Messages in this thread Patch in this message | | | Date | Wed, 26 Jan 2000 16:15:31 -0800 | From | Chris Sears <> | Subject | [PATCH] 2.3.40: <linux/linkage.h> doesn't generate correct cache alignments for 486 and above |
| |
On inspection <linux/linkage.h> handles the i686 incorrectly. Cache line alignments are being set to 4 bytes as per the i386. This is a bad bad thing for the i686.
However, it is much worse than this. __i386__ is always defined. BTW, I am running gcc 2.95.1 and I don't have the stomach to track down where, but __i386__ is always defined for x86.
The patch strips out dependancies on __i*86__ and uses a combination of CONFIG_X86 and and CONFIG_M386.
I would *strongly* advocate cleansing the kernel of all uses of:
__WorksWithMyCompilerTodayDoesItWorkWithYours__
And I don't want to hear about Linux being written in gcc. It is one thing to use gcc as a compiler/code-generator, and quite another to use it as a configuration management system.
Chris Sears cbsears@ix.netcom.com
Here is the patch against 2.3.40:
--- linkage.h.orig Wed Jan 26 14:31:54 2000 +++ linkage.h Wed Jan 26 15:32:25 2000 @@ -1,6 +1,8 @@ #ifndef _LINUX_LINKAGE_H #define _LINUX_LINKAGE_H
+#include <linux/autoconf.h> + #ifdef __cplusplus #define CPP_ASMLINKAGE extern "C" #else @@ -45,13 +47,13 @@ #define __ALIGN .balign 4 #define __ALIGN_STR ".balign 4" #else -#if !defined(__i486__) && !defined(__i586__) -#define __ALIGN .align 4,0x90 -#define __ALIGN_STR ".align 4,0x90" -#else /* __i486__/__i586__ */ +#if defined(CONFIG_X86) && !defined(CONFIG_M386) #define __ALIGN .align 16,0x90 #define __ALIGN_STR ".align 16,0x90" -#endif /* __i486__/__i586__ */ +#else +#define __ALIGN .align 4,0x90 +#define __ALIGN_STR ".align 4,0x90" +#endif #endif /* __sh__ */ #endif /* __mc68000__ */ #endif /* __arm__ */
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |