diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-10-12 09:49:27 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-10-12 09:49:27 -0400 |
commit | 91031edcb2a6adf2510478bc81a4df68c5e3daf2 (patch) | |
tree | 04e7127058b975c1ab0ba9fa30838c786595f186 | |
parent | 43562769f9736375f20ebde00601e479fdde9872 (diff) | |
download | seabios-91031edcb2a6adf2510478bc81a4df68c5e3daf2.tar.gz |
Move read/write[bwl] from smp.c to util.h.
Move them to the header so other code can use them.
-rw-r--r-- | src/smp.c | 30 | ||||
-rw-r--r-- | src/util.h | 19 |
2 files changed, 19 insertions, 30 deletions
@@ -16,36 +16,6 @@ #define APIC_ENABLED 0x0100 -static inline void writel(void *addr, u32 val) -{ - *(volatile u32 *)addr = val; -} - -static inline void writew(void *addr, u16 val) -{ - *(volatile u16 *)addr = val; -} - -static inline void writeb(void *addr, u8 val) -{ - *(volatile u8 *)addr = val; -} - -static inline u32 readl(const void *addr) -{ - return *(volatile const u32 *)addr; -} - -static inline u16 readw(const void *addr) -{ - return *(volatile const u16 *)addr; -} - -static inline u8 readb(const void *addr) -{ - return *(volatile const u8 *)addr; -} - struct { u32 ecx, eax, edx; } smp_mtrr[16] VAR16VISIBLE; u32 smp_mtrr_count VAR16VISIBLE; @@ -94,6 +94,25 @@ static inline u32 __ffs(u32 word) return word; } +static inline void writel(void *addr, u32 val) { + *(volatile u32 *)addr = val; +} +static inline void writew(void *addr, u16 val) { + *(volatile u16 *)addr = val; +} +static inline void writeb(void *addr, u8 val) { + *(volatile u8 *)addr = val; +} +static inline u32 readl(const void *addr) { + return *(volatile const u32 *)addr; +} +static inline u16 readw(const void *addr) { + return *(volatile const u16 *)addr; +} +static inline u8 readb(const void *addr) { + return *(volatile const u8 *)addr; +} + // GDT bit manipulation #define GDT_BASE(v) ((((u64)(v) & 0xff000000) << 32) \ | (((u64)(v) & 0x00ffffff) << 16)) |