diff options
author | Rudolf Marek <r.marek@assembler.cz> | 2010-05-16 22:26:25 +0000 |
---|---|---|
committer | Rudolf Marek <r.marek@assembler.cz> | 2010-05-16 22:26:25 +0000 |
commit | fdddce3b926b5ad1d27f807feaeb318471a543ab (patch) | |
tree | 1312f13cf74d5d89bb2d53c101d0b0efda685eb8 /src/include/cpu/x86 | |
parent | beba99045c7e7af21481d359384d06c77e636d53 (diff) |
Sorry for this. I fixed that reverting the change for ROMCC.
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Rudolf Marek <r.marek@assembler.cz>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5563 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include/cpu/x86')
-rw-r--r-- | src/include/cpu/x86/cache.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/cpu/x86/cache.h b/src/include/cpu/x86/cache.h index 14538592e9..858637cf2b 100644 --- a/src/include/cpu/x86/cache.h +++ b/src/include/cpu/x86/cache.h @@ -23,6 +23,17 @@ /* the memory clobber prevents the GCC from reordering the read/write order of CR0 */ + */ + +#if defined(__GNUC__) + +/* +Need this because ROMCC fails here with: + +cache.h:29.71: cache.h:60.24: earlymtrr.c:117.23: romstage.c:144.33: +0x1559920 asm Internal compiler error: lhs 1 regcm == 0 +*/ + static inline unsigned long read_cr0(void) { unsigned long cr0; @@ -35,6 +46,23 @@ static inline void write_cr0(unsigned long cr0) asm volatile ("movl %0, %%cr0" : : "r" (cr0) : "memory"); } +#else + +static inline unsigned long read_cr0(void) +{ + unsigned long cr0; + asm volatile ("movl %%cr0, %0" : "=r" (cr0)); + return cr0; +} + +static inline void write_cr0(unsigned long cr0) +{ + asm volatile ("movl %0, %%cr0" : : "r" (cr0)); +} + +#endif + + static inline void invd(void) { asm volatile("invd" ::: "memory"); |