Annotation of qemu/roms/openbios/include/arch/x86/io.h, revision 1.1.1.1

1.1       root        1: #ifndef _ASM_IO_H
                      2: #define _ASM_IO_H
                      3: 
                      4: #include "asm/types.h"
                      5: 
                      6: extern char _start, _end;
                      7: extern unsigned long virt_offset;
                      8: 
                      9: #define phys_to_virt(phys) ((void *) ((unsigned long) (phys) - virt_offset))
                     10: #define virt_to_phys(virt) ((unsigned long) (virt) + virt_offset)
                     11: 
                     12: #ifndef BOOTSTRAP
                     13: #define __SLOW_DOWN_IO "outb %%al,$0x80;"
                     14: static inline void slow_down_io(void)
                     15: {
                     16:        __asm__ __volatile__(
                     17:                __SLOW_DOWN_IO
                     18: #ifdef REALLY_SLOW_IO
                     19:                __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO
                     20: #endif
                     21:                : : );
                     22: }
                     23: 
                     24: #define BUILDIO(bwl,bw,type) \
                     25: static inline void out##bwl(unsigned type value, int port) { \
                     26:        __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
                     27: } \
                     28: static inline unsigned type in##bwl(int port) { \
                     29:        unsigned type value; \
                     30:        __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port)); \
                     31:        return value; \
                     32: } \
                     33: static inline void out##bwl##_p(unsigned type value, int port) { \
                     34:        out##bwl(value, port); \
                     35:        slow_down_io(); \
                     36: } \
                     37: static inline unsigned type in##bwl##_p(int port) { \
                     38:        unsigned type value = in##bwl(port); \
                     39:        slow_down_io(); \
                     40:        return value; \
                     41: } \
                     42: static inline void outs##bwl(int port, const void *addr, unsigned long count) { \
                     43:        __asm__ __volatile__("rep; outs" #bwl : "+S"(addr), "+c"(count) : "d"(port)); \
                     44: } \
                     45: static inline void ins##bwl(int port, void *addr, unsigned long count) { \
                     46:        __asm__ __volatile__("rep; ins" #bwl : "+D"(addr), "+c"(count) : "d"(port)); \
                     47: }
                     48: 
                     49: #ifndef BOOTSTRAP
                     50: BUILDIO(b,b,char)
                     51: BUILDIO(w,w,short)
                     52: BUILDIO(l,,int)
                     53: #endif
                     54: 
                     55: #else /* BOOTSTRAP */
                     56: #ifdef FCOMPILER
                     57: #define inb(reg) ((u8)0xff)
                     58: #define inw(reg) ((u16)0xffff)
                     59: #define inl(reg) ((u32)0xffffffff)
                     60: #define outb(reg, val) do{} while(0)
                     61: #define outw(reg, val) do{} while(0)
                     62: #define outl(reg, val) do{} while(0)
                     63: #else
                     64: extern u8 inb(u32 reg);
                     65: extern u16 inw(u32 reg);
                     66: extern u32 inl(u32 reg);
                     67: extern void insw(u32 reg, void *addr, unsigned long count);
                     68: extern void outb(u32 reg, u8 val);
                     69: extern void outw(u32 reg, u16 val);
                     70: extern void outl(u32 reg, u32 val);
                     71: extern void outsw(u32 reg, const void *addr, unsigned long count);
                     72: #endif
                     73: #endif
                     74: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.