[coreboot] [PATCH] v3: change the GAS bug workaround in CAR code

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sat Aug 9 18:07:56 CEST 2008


Hi,

v3 is not legacy and I'd like to keep the code readable. AFAICS my new
variant of the code will work with older GNU as and it is also more
readable. Basically, the problem was that gas treated whitespace as
argument delimiter. Removing the whitespace in crtitical places is the
most obvious fix.

This is a much-needed simplification and will help me in merging K8 and
Phenom CAR code.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: corebootv3-car_gas_bug_workaround/arch/x86/stage0_i586.S
===================================================================
--- corebootv3-car_gas_bug_workaround/arch/x86/stage0_i586.S	(revision 725)
+++ corebootv3-car_gas_bug_workaround/arch/x86/stage0_i586.S	(working copy)
@@ -319,15 +319,10 @@
  * windowoffset is the 32k-aligned window into CAR size
  */
 .macro simplemask carsize, windowoffset
-	.set gas_bug_workaround,(((\carsize - \windowoffset) / 0x1000) - 4)
-	extractmask gas_bug_workaround, %eax
-	.set gas_bug_workaround,(((\carsize - \windowoffset) / 0x1000))
-	extractmask gas_bug_workaround, %edx
-/* Without the gas bug workaround, the entire macro would consist only of the
- * two lines below.
-	extractmask (((\carsize - \windowoffset) / 0x1000) - 4), %eax
-	extractmask (((\carsize - \windowoffset) / 0x1000)), %edx
- */
+/* DO NOT CHANGE THE FORMATTING of the two lines below! Whitespace is
+ * interpreted as an argument delimiter by some versions of GNU as. */
+	extractmask (((\carsize-\windowoffset)/0x1000)-4), %eax
+	extractmask (((\carsize-\windowoffset)/0x1000)), %edx
 .endm
 
 #if CacheSize > 0x10000
Index: corebootv3-car_gas_bug_workaround/arch/x86/amd/stage0.S
===================================================================
--- corebootv3-car_gas_bug_workaround/arch/x86/amd/stage0.S	(revision 725)
+++ corebootv3-car_gas_bug_workaround/arch/x86/amd/stage0.S	(working copy)
@@ -275,15 +275,10 @@
  * windowoffset is the 32k-aligned window into CAR size
  */
 .macro simplemask carsize, windowoffset
-	.set gas_bug_workaround,(((\carsize - \windowoffset) / 0x1000) - 4)
-	extractmask gas_bug_workaround, %eax
-	.set gas_bug_workaround,(((\carsize - \windowoffset) / 0x1000))
-	extractmask gas_bug_workaround, %edx
-/* Without the gas bug workaround, the entire macro would consist only of the
- * two lines below.
-	extractmask (((\carsize - \windowoffset) / 0x1000) - 4), %eax
-	extractmask (((\carsize - \windowoffset) / 0x1000)), %edx
- */
+/* DO NOT CHANGE THE FORMATTING of the two lines below! Whitespace is
+ * interpreted as an argument delimiter by some versions of GNU as. */
+	extractmask (((\carsize-\windowoffset)/0x1000)-4), %eax
+	extractmask (((\carsize-\windowoffset)/0x1000)), %edx
 .endm
 
 #if CacheSize > 0x10000


-- 
http://www.hailfinger.org/





More information about the coreboot mailing list