diff options
| author | Matt Wilson <msw@redhat.com> | 2000-04-18 00:33:20 +0000 |
|---|---|---|
| committer | Matt Wilson <msw@redhat.com> | 2000-04-18 00:33:20 +0000 |
| commit | 76de05be197968f874fdffd035ec577a7d0918d6 (patch) | |
| tree | 2cd3a606ea116e2cd4310cd4194718ca99b458bd /loader/kon2/include | |
| parent | 92035702beb8056b4f5b745de2d724c4169f9149 (diff) | |
partial merge to latest
Diffstat (limited to 'loader/kon2/include')
| -rw-r--r-- | loader/kon2/include/mem.h | 66 |
1 files changed, 13 insertions, 53 deletions
diff --git a/loader/kon2/include/mem.h b/loader/kon2/include/mem.h index 4294c1656..1efc44021 100644 --- a/loader/kon2/include/mem.h +++ b/loader/kon2/include/mem.h @@ -30,68 +30,28 @@ #ifndef MEM_H #define MEM_H -static inline +static __inline__ void PortOutw(u_short value, u_short port) { - __asm__ ("outw %0,%1" - ::"a" ((u_short) value), - "d" ((u_short) port)); + __asm__ volatile ("outw %0,%1" + ::"a" ((unsigned short) value), "d"((unsigned short) port)); } -static inline +static __inline__ void PortOutb(char value, u_short port) { - __asm__ ("outb %0,%1" - ::"a" ((char) value), - "d" ((u_short) port)); + __asm__ volatile ("outb %0,%1" + ::"a" ((unsigned char) value), "d"((unsigned short) port)); } -static inline - void lzero(void *head, int n) +static __inline__ + unsigned char PortInb(unsigned short port) { - __asm__ ("cld\n\t" - "rep\n\t" - "stosl" - ::"a" (0), - "c" (n>>2), - "D" ((long)head) - :"cx","di"); -} - -static inline - void bmove(void *dst, void *src, int n) -{ - __asm__ ("cld\n\t" - "rep\n\t" - "movsb\n\t" - ::"c" (n), - "D" ((long)dst), - "S" ((long)src) - :"cx","di","si"); -} - -static inline - void brmove(void *dst, void *src, int n) -{ - __asm__ ("std\n\t" - "rep\n\t" - "movsb\n\t" - ::"c" (n), - "D" ((long)dst), - "S" ((long)src) - :"cx","di","si"); -} - -static inline - void bzero2(void *head, int n) -{ - __asm__ ("cld\n\t" - "rep\n\t" - "stosb" - ::"a" (0), - "c" (n), - "D" ((long)head) - :"cx","di"); + unsigned char value; + __asm__ volatile ("inb %1,%0" + :"=a" (value) + :"d"((unsigned short) port)); + return value; } extern u_char PortInb(u_short); |
