diff options
author | Eric Biederman <ebiederm@xmission.com> | 2003-05-09 02:39:00 +0000 |
---|---|---|
committer | Eric Biederman <ebiederm@xmission.com> | 2003-05-09 02:39:00 +0000 |
commit | 0babc1c1164dd7ec51fde8141c8687a71997c81b (patch) | |
tree | 964a87fc9af3411df0dab4dda46253871f9a76b4 /util/romcc/tests/simple_test19.c | |
parent | ba8c25affb3178006435fd54c2ddef51587cc1bf (diff) | |
download | coreboot-0babc1c1164dd7ec51fde8141c8687a71997c81b.tar.xz |
- Implement support for structures, typedefs, and __builtin_rdmsr, __builtin_wrmsr in romcc
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@819 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/romcc/tests/simple_test19.c')
-rw-r--r-- | util/romcc/tests/simple_test19.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/util/romcc/tests/simple_test19.c b/util/romcc/tests/simple_test19.c new file mode 100644 index 0000000000..0bdcf422ef --- /dev/null +++ b/util/romcc/tests/simple_test19.c @@ -0,0 +1,24 @@ +static void hlt(void) +{ + __builtin_hlt(); +} + +typedef __builtin_msr_t msr_t; + +static msr_t rdmsr(unsigned long index) +{ + return __builtin_rdmsr(index); +} + +static void wrmsr(unsigned long index, msr_t msr) +{ + __builtin_wrmsr(index, msr.lo, msr.hi); +} + +static void main(void) +{ + msr_t msr; + msr = rdmsr(0x1234); + msr.lo &= ~(1<<5); + wrmsr(0x1234, msr); +} |