summaryrefslogtreecommitdiff
path: root/src/arch/i386
diff options
context:
space:
mode:
authorarch import user (historical) <svn@openbios.org>2005-07-06 16:48:02 +0000
committerarch import user (historical) <svn@openbios.org>2005-07-06 16:48:02 +0000
commit4966de81c341aca7e2ae8f971a112acfaeba89b1 (patch)
tree61e70d0dd9b143ee0e07b99c8a15cdec4e6fc22a /src/arch/i386
parent3f8eb7a072f10a5ecea9e879830dce4002ff86bd (diff)
Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-3
Creator: Eric Biederman <ebiederman@lnxi.com> Add read[bwl] write[bwl] to arch/io.h for i386 A pending patch requires needs this and ppc already has them so it is a good idea to implement them :) I don't know why this was not implemented earlier. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1922 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/i386')
-rw-r--r--src/arch/i386/include/arch/io.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/arch/i386/include/arch/io.h b/src/arch/i386/include/arch/io.h
index 411098128f..4bd2f4a4c3 100644
--- a/src/arch/i386/include/arch/io.h
+++ b/src/arch/i386/include/arch/io.h
@@ -138,5 +138,35 @@ static inline void insl(uint16_t port, void *addr, unsigned long count)
);
}
+static inline void writeb(uint8_t b, volatile void *addr)
+{
+ *(volatile uint8_t *) addr = b;
+}
+
+static inline void writew(uint16_t b, volatile void *addr)
+{
+ *(volatile uint16_t *) addr = b;
+}
+
+static inline void writel(uint32_t b, volatile void *addr)
+{
+ *(volatile uint32_t *) addr = b;
+}
+
+static inline uint8_t readb(const volatile void *addr)
+{
+ return *(volatile uint8_t *) addr;
+}
+
+static inline uint16_t readw(const volatile void *addr)
+{
+ return *(volatile uint16_t *) addr;
+}
+
+static inline uint32_t readl(const volatile void *addr)
+{
+ return *(volatile uint32_t *) addr;
+}
+
#endif