Changes in uspace/lib/c/arch/ia32/include/ddi.h [c22531fc:d161715] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/include/ddi.h
rc22531fc rd161715 41 41 static inline uint8_t pio_read_8(ioport8_t *port) 42 42 { 43 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 44 uint8_t val; 45 46 asm volatile ( 47 "inb %w[port], %b[val]\n" 48 : [val] "=a" (val) 49 : [port] "d" (port) 50 ); 51 52 return val; 53 } else 54 return (uint8_t) *port; 43 uint8_t val; 44 45 asm volatile ( 46 "inb %w[port], %b[val]\n" 47 : [val] "=a" (val) 48 : [port] "d" (port) 49 ); 50 51 return val; 55 52 } 56 53 57 54 static inline uint16_t pio_read_16(ioport16_t *port) 58 55 { 59 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 60 uint16_t val; 61 62 asm volatile ( 63 "inw %w[port], %w[val]\n" 64 : [val] "=a" (val) 65 : [port] "d" (port) 66 ); 67 68 return val; 69 } else 70 return (uint16_t) *port; 56 uint16_t val; 57 58 asm volatile ( 59 "inw %w[port], %w[val]\n" 60 : [val] "=a" (val) 61 : [port] "d" (port) 62 ); 63 64 return val; 71 65 } 72 66 73 67 static inline uint32_t pio_read_32(ioport32_t *port) 74 68 { 75 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 76 uint32_t val; 77 78 asm volatile ( 79 "inl %w[port], %[val]\n" 80 : [val] "=a" (val) 81 : [port] "d" (port) 82 ); 83 84 return val; 85 } else 86 return (uint32_t) *port; 69 uint32_t val; 70 71 asm volatile ( 72 "inl %w[port], %[val]\n" 73 : [val] "=a" (val) 74 : [port] "d" (port) 75 ); 76 77 return val; 87 78 } 88 79 89 80 static inline void pio_write_8(ioport8_t *port, uint8_t val) 90 81 { 91 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 92 asm volatile ( 93 "outb %b[val], %w[port]\n" 94 :: [val] "a" (val), [port] "d" (port) 95 ); 96 } else 97 *port = val; 82 asm volatile ( 83 "outb %b[val], %w[port]\n" 84 :: [val] "a" (val), [port] "d" (port) 85 ); 98 86 } 99 87 100 88 static inline void pio_write_16(ioport16_t *port, uint16_t val) 101 89 { 102 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 103 asm volatile ( 104 "outw %w[val], %w[port]\n" 105 :: [val] "a" (val), [port] "d" (port) 106 ); 107 } else 108 *port = val; 90 asm volatile ( 91 "outw %w[val], %w[port]\n" 92 :: [val] "a" (val), [port] "d" (port) 93 ); 109 94 } 110 95 111 96 static inline void pio_write_32(ioport32_t *port, uint32_t val) 112 97 { 113 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 114 asm volatile ( 115 "outl %[val], %w[port]\n" 116 :: [val] "a" (val), [port] "d" (port) 117 ); 118 } else 119 *port = val; 98 asm volatile ( 99 "outl %[val], %w[port]\n" 100 :: [val] "a" (val), [port] "d" (port) 101 ); 120 102 } 121 103
Note:
See TracChangeset
for help on using the changeset viewer.