summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-01-04 18:24:50 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-01-04 18:24:50 +0200
commit93b6cf19212891267fd61d825ddde42ac75fdc52 (patch)
tree90ae3fa7848d1898d77c954a815a152863e12170
parent46e90216028779ae1f890af8989874f60a9b3d2e (diff)
lrmi: use IO functions of the library instead the server's ones
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r--src/lrmi/backend-x86emu.c14
-rw-r--r--src/lrmi/common_helper.h14
-rw-r--r--src/lrmi/common_io.c12
3 files changed, 19 insertions, 21 deletions
diff --git a/src/lrmi/backend-x86emu.c b/src/lrmi/backend-x86emu.c
index 24cdd2a..9c0e058 100644
--- a/src/lrmi/backend-x86emu.c
+++ b/src/lrmi/backend-x86emu.c
@@ -18,20 +18,6 @@ extern Int10Current;
#define SHMERRORPTR (pointer)(-1)
-#define __BUILDIO(bwl,bw,type) \
-static inline void out##bwl##_local(unsigned long port, unsigned type value) { __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
-}\
-static inline unsigned type in##bwl##_local(unsigned long port) { \
- unsigned type value; \
- __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)); \
- return value; \
-}\
-
-__BUILDIO(b,b,char)
-__BUILDIO(w,w,short)
-__BUILDIO(l,,int)
-
-
char *mmap_addr = SHMERRORPTR;
static void *stack;
diff --git a/src/lrmi/common_helper.h b/src/lrmi/common_helper.h
index 9f72694..3f1c7c2 100644
--- a/src/lrmi/common_helper.h
+++ b/src/lrmi/common_helper.h
@@ -1,9 +1,21 @@
-//#include "libx86.h"
+#define __BUILDIO(bwl,bw,type) \
+static inline void out##bwl##_local(unsigned long port, unsigned type value) { __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
+}\
+static inline unsigned type in##bwl##_local(unsigned long port) { \
+ unsigned type value; \
+ __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)); \
+ return value; \
+}\
+
+__BUILDIO(b,b,char)
+__BUILDIO(w,w,short)
+__BUILDIO(l,,int)
#ifdef _VM86
#include <asm/vm86.h>
+
#define CPU_R(type,name,num) \
(((type *)&(((struct vm86_struct *)pInt->cpuRegs)->regs.name))[num])
#define CPU_RD(name,num) CPU_R(uint32_t,name,num)
diff --git a/src/lrmi/common_io.c b/src/lrmi/common_io.c
index 372d504..3c61ef1 100644
--- a/src/lrmi/common_io.c
+++ b/src/lrmi/common_io.c
@@ -9,7 +9,7 @@
extern xf86Int10InfoPtr Int10Current;
-static uint8_t
+uint8_t
x_inb(uint16_t port)
{
uint8_t val;
@@ -18,7 +18,7 @@ x_inb(uint16_t port)
return val;
}
-static uint16_t
+uint16_t
x_inw(uint16_t port)
{
uint16_t val;
@@ -28,7 +28,7 @@ x_inw(uint16_t port)
return val;
}
-static uint32_t
+uint32_t
x_inl(uint16_t port)
{
uint32_t val;
@@ -37,19 +37,19 @@ x_inl(uint16_t port)
return val;
}
-static void
+void
x_outl(uint16_t port, uint32_t val)
{
outl_local(Int10Current->ioBase + port, val);
}
-static void
+void
x_outb(uint16_t port, uint8_t val)
{
outb_local(Int10Current->ioBase + port, val);
}
-static void
+void
x_outw(uint16_t port, uint16_t val)
{
outw_local(Int10Current->ioBase + port, val);