From: Michael Brown Date: Sat, 14 Jun 2008 19:01:14 +0000 (+0100) Subject: [legacy] Align legacy drivers' __shared data to the maximum possible X-Git-Tag: v0.9.4~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d91c37ce56497f6aba1ecb07f25c6d71b355e09;p=thirdparty%2Fipxe.git [legacy] Align legacy drivers' __shared data to the maximum possible Some drivers that still use the legacy-driver wrapper (tg3 in particular) apparently do not specify their alignment constraints properly. This hack forces any __shared data to be maximally aligned. Note that this provides only 16-byte alignment; it is not possible to request alignment to any greater than 16 bytes using __attribute__((aligned)), since the relocation code will preserve only 16 byte alignment (and operation under -DKEEP_IT_REAL cannot preserve more that 16 byte alignment). Idea proposed by Tim Hockin --- diff --git a/src/include/compiler.h b/src/include/compiler.h index 1d4312a61..8ab7b8ae3 100644 --- a/src/include/compiler.h +++ b/src/include/compiler.h @@ -345,7 +345,7 @@ extern void dbg_hex_dump_da ( unsigned long dispaddr, * @endcode * */ -#define __shared __asm__ ( "_shared_bss" ) +#define __shared __asm__ ( "_shared_bss" ) __aligned /** * Optimisation barrier