<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21601">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Makefile.inc: Add left shift macro<br><br>Add a macro to shift a value to the left by a specified number of bits.<br><br>Change-Id: Ib3fb43b620f31fee2a41f00ddf7294edc81a60f6<br>Signed-off-by: Martin Roth <martinroth@google.com><br>---<br>M Makefile.inc<br>1 file changed, 15 insertions(+), 13 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/21601/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/Makefile.inc b/Makefile.inc<br>index 88a9a63..cdebd1b 100644<br>--- a/Makefile.inc<br>+++ b/Makefile.inc<br>@@ -113,19 +113,20 @@<br> # macros work on all formats understood by printf(1)<br> # values are space separated if using more than one value<br> #<br>-# int-add:       adds an arbitrary length list of integers<br>-# int-subtract:  subtracts the the second of two integers from the first<br>-# int-multiply:  multiplies an arbitrary length list of integers<br>-# int-divide:    divides the first integer by the second<br>-# int-remainder: arithmetic remainder of the first number divided by the second<br>-# int-lt:        1 if the first value is less than the second.  0 otherwise<br>-# int-gt:        1 if the first values is greater than the second.  0 otherwise<br>-# int-eq:        1 if the two values are equal.  0 otherwise<br>-# int-align:     align $1 to $2 units<br>-# file-size:     returns the filesize of the given file<br>-# tolower:       returns the value in all lowercase<br>-# toupper:       returns the value in all uppercase<br>-# ws_to_under:   returns the value with any whitespace changed to underscores<br>+# int-add:        adds an arbitrary length list of integers<br>+# int-subtract:   subtracts the the second of two integers from the first<br>+# int-multiply:   multiplies an arbitrary length list of integers<br>+# int-divide:     divides the first integer by the second<br>+# int-remainder:  arithmetic remainder of the first number divided by the second<br>+# int-shift-left: Shift $1 left by $2 bits<br>+# int-lt:         1 if the first value is less than the second.  0 otherwise<br>+# int-gt:         1 if the first values is greater than the second.  0 otherwise<br>+# int-eq:         1 if the two values are equal.  0 otherwise<br>+# int-align:      align $1 to $2 units<br>+# file-size:      returns the filesize of the given file<br>+# tolower:        returns the value in all lowercase<br>+# toupper:        returns the value in all uppercase<br>+# ws_to_under:    returns the value with any whitespace changed to underscores<br> _toint=$(shell printf "%d" $1)<br> _int-add2=$(shell expr $(call _toint,$1) + $(call _toint,$2))<br> int-add=$(if $(filter 1,$(words $1)),$(strip $1),$(call int-add,$(call _int-add2,$(word 1,$1),$(word 2,$1)) $(wordlist 3,$(words $1),$1)))<br>@@ -134,6 +135,7 @@<br> int-multiply=$(if $(filter 1,$(words $1)),$(strip $1),$(call int-multiply,$(call _int-multiply2,$(word 1,$1),$(word 2,$1)) $(wordlist 3,$(words $1),$1)))<br> int-divide=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) / $(call _toint,$(word 2,$1))))<br> int-remainder=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) % $(call _toint,$(word 2,$1))))<br>+int-shift-left=$(shell echo "$(call _toint,$(word 1, $1)) * (2 ^ $(call _toint,$(word 2, $1)))" | bc)<br> int-lt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) \< $(call _toint,$(word 2,$1))))<br> int-gt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) \> $(call _toint,$(word 2,$1))))<br> int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))<br></pre><p>To view, visit <a href="https://review.coreboot.org/21601">change 21601</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21601"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib3fb43b620f31fee2a41f00ddf7294edc81a60f6 </div>
<div style="display:none"> Gerrit-Change-Number: 21601 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>