Changeset 7d60cf5 in mainline
- Timestamp:
- 2009-02-19T21:58:37Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5cb223f
- Parents:
- 4b44099d
- Location:
- kernel/arch
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/asm.h
r4b44099d r7d60cf5 74 74 * @return Value read 75 75 */ 76 static inline uint8_t pio_read_8( uint16_tport)76 static inline uint8_t pio_read_8(ioport8_t *port) 77 77 { 78 78 uint8_t val; … … 89 89 * @param val Value to write 90 90 */ 91 static inline void pio_write_8( uint16_tport, uint8_t val)91 static inline void pio_write_8(ioport8_t *port, uint8_t val) 92 92 { 93 93 asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port)); -
kernel/arch/amd64/include/types.h
r4b44099d r7d60cf5 58 58 typedef int64_t native_t; 59 59 60 typedef uintptr_t ioport_t; 60 typedef volatile uint8_t ioport8_t; 61 typedef volatile uint16_t ioport16_t; 62 typedef volatile uint32_t ioport32_t; 61 63 62 64 typedef struct { -
kernel/arch/arm32/include/asm.h
r4b44099d r7d60cf5 47 47 } 48 48 49 static inline void pio_write_8(ioport _tport, uint8_t v)49 static inline void pio_write_8(ioport8_t *port, uint8_t v) 50 50 { 51 51 /* XXX */ 52 52 } 53 53 54 static inline uint8_t pio_read_8(ioport _tport)54 static inline uint8_t pio_read_8(ioport8_t *port) 55 55 { 56 56 return 0; /* XXX */ -
kernel/arch/arm32/include/types.h
r4b44099d r7d60cf5 65 65 typedef int32_t native_t; 66 66 67 typedef uintptr_t ioport_t; 67 typedef volatile uint8_t ioport8_t; 68 typedef volatile uint16_t ioport16_t; 69 typedef volatile uint32_t ioport32_t; 68 70 69 71 typedef struct { -
kernel/arch/ia32/include/asm.h
r4b44099d r7d60cf5 106 106 * @param val Value to write 107 107 */ 108 static inline void pio_write_8( uint16_tport, uint8_t val)109 { 110 asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) 108 static inline void pio_write_8(ioport8_t *port, uint8_t val) 109 { 110 asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port)); 111 111 } 112 112 … … 118 118 * @param val Value to write 119 119 */ 120 static inline void pio_write_16( uint16_tport, uint16_t val)121 { 122 asm volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) 120 static inline void pio_write_16(ioport16_t *port, uint16_t val) 121 { 122 asm volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port)); 123 123 } 124 124 … … 130 130 * @param val Value to write 131 131 */ 132 static inline void pio_write_32( uint16_tport, uint32_t val)133 { 134 asm volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) 132 static inline void pio_write_32(ioport32_t *port, uint32_t val) 133 { 134 asm volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port)); 135 135 } 136 136 … … 142 142 * @return Value read 143 143 */ 144 static inline uint8_t pio_read_8( uint16_tport)144 static inline uint8_t pio_read_8(ioport8_t *port) 145 145 { 146 146 uint8_t val; 147 147 148 asm volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) 148 asm volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port)); 149 149 return val; 150 150 } … … 157 157 * @return Value read 158 158 */ 159 static inline uint16_t pio_read_16( uint16_tport)159 static inline uint16_t pio_read_16(ioport16_t *port) 160 160 { 161 161 uint16_t val; 162 162 163 asm volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) 163 asm volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port)); 164 164 return val; 165 165 } … … 172 172 * @return Value read 173 173 */ 174 static inline uint32_t pio_read_32( uint16_tport)174 static inline uint32_t pio_read_32(ioport32_t *port) 175 175 { 176 176 uint32_t val; 177 177 178 asm volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) 178 asm volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port)); 179 179 return val; 180 180 } -
kernel/arch/ia32/include/types.h
r4b44099d r7d60cf5 58 58 typedef int32_t native_t; 59 59 60 typedef uintptr_t ioport_t; 60 typedef volatile uint8_t ioport8_t; 61 typedef volatile uint16_t ioport16_t; 62 typedef volatile uint32_t ioport32_t; 61 63 62 64 typedef struct { -
kernel/arch/ia64/include/asm.h
r4b44099d r7d60cf5 42 42 #define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL 43 43 44 static inline void pio_write_8(ioport_t port, uint8_t v) 45 { 44 static inline void pio_write_8(ioport8_t *port, uint8_t v) 45 { 46 uintptr_t prt = (uintptr_t) port; 47 46 48 *((uint8_t *)(IA64_IOSPACE_ADDRESS + 47 ((port & 0xfff) | ((port >> 2) << 12)))) = v; 48 49 asm volatile ("mf\n" ::: "memory"); 50 } 51 52 static inline void pio_write_16(ioport_t port, uint16_t v) 53 { 49 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 50 51 asm volatile ("mf\n" ::: "memory"); 52 } 53 54 static inline void pio_write_16(ioport16_t *port, uint16_t v) 55 { 56 uintptr_t prt = (uintptr_t) port; 57 54 58 *((uint16_t *)(IA64_IOSPACE_ADDRESS + 55 ((port & 0xfff) | ((port >> 2) << 12)))) = v; 56 57 asm volatile ("mf\n" ::: "memory"); 58 } 59 60 static inline void pio_write_32(ioport_t port, uint32_t v) 61 { 59 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 60 61 asm volatile ("mf\n" ::: "memory"); 62 } 63 64 static inline void pio_write_32(ioport32_t *port, uint32_t v) 65 { 66 uintptr_t prt = (uintptr_t) port; 67 62 68 *((uint32_t *)(IA64_IOSPACE_ADDRESS + 63 ((port & 0xfff) | ((port >> 2) << 12)))) = v; 64 65 asm volatile ("mf\n" ::: "memory"); 66 } 67 68 static inline uint8_t pio_read_8(ioport_t port) 69 { 69 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 70 71 asm volatile ("mf\n" ::: "memory"); 72 } 73 74 static inline uint8_t pio_read_8(ioport8_t *port) 75 { 76 uintptr_t prt = (uintptr_t) port; 77 70 78 asm volatile ("mf\n" ::: "memory"); 71 79 72 80 return *((uint8_t *)(IA64_IOSPACE_ADDRESS + 73 ((port & 0xfff) | ((port >> 2) << 12)))); 74 } 75 76 static inline uint16_t pio_read_16(ioport_t port) 77 { 81 ((prt & 0xfff) | ((prt >> 2) << 12)))); 82 } 83 84 static inline uint16_t pio_read_16(ioport16_t *port) 85 { 86 uintptr_t prt = (uintptr_t) port; 87 78 88 asm volatile ("mf\n" ::: "memory"); 79 89 80 90 return *((uint16_t *)(IA64_IOSPACE_ADDRESS + 81 ((port & 0xffE) | ((port >> 2) << 12)))); 82 } 83 84 static inline uint32_t pio_read_32(ioport_t port) 85 { 91 ((prt & 0xffE) | ((prt >> 2) << 12)))); 92 } 93 94 static inline uint32_t pio_read_32(ioport32_t *port) 95 { 96 uintptr_t prt = (uintptr_t) port; 97 86 98 asm volatile ("mf\n" ::: "memory"); 87 99 88 100 return *((uint32_t *)(IA64_IOSPACE_ADDRESS + 89 ((p ort & 0xfff) | ((port >> 2) << 12))));101 ((prt & 0xfff) | ((prt >> 2) << 12)))); 90 102 } 91 103 -
kernel/arch/ia64/include/types.h
r4b44099d r7d60cf5 66 66 typedef int64_t native_t; 67 67 68 typedef uintptr_t ioport_t; 68 typedef volatile uint8_t ioport8_t; 69 typedef volatile uint16_t ioport16_t; 70 typedef volatile uint32_t ioport32_t; 69 71 70 72 typedef struct { -
kernel/arch/mips32/include/asm.h
r4b44099d r7d60cf5 76 76 extern void asm_delay_loop(uint32_t t); 77 77 78 static inline void pio_write_8(ioport _tport, uint8_t v)78 static inline void pio_write_8(ioport8_t *port, uint8_t v) 79 79 { 80 80 /* XXX */ 81 81 } 82 82 83 static inline uint8_t pio_read_8(ioport _tport)83 static inline uint8_t pio_read_8(ioport8_t *port) 84 84 { 85 85 return 0; /* XXX */ -
kernel/arch/mips32/include/types.h
r4b44099d r7d60cf5 58 58 typedef int32_t native_t; 59 59 60 typedef uintptr_t ioport_t; 60 typedef volatile uint8_t ioport8_t; 61 typedef volatile uint16_t ioport16_t; 62 typedef volatile uint32_t ioport32_t; 61 63 62 64 typedef struct { -
kernel/arch/ppc32/include/asm.h
r4b44099d r7d60cf5 150 150 extern void userspace_asm(uintptr_t uspace_uarg, uintptr_t stack, uintptr_t entry); 151 151 152 static inline void pio_write_8(ioport _tport, uint8_t v)152 static inline void pio_write_8(ioport8_t *port, uint8_t v) 153 153 { 154 154 /* XXX */ 155 155 } 156 156 157 static inline uint8_t pio_read_8(ioport _tport)157 static inline uint8_t pio_read_8(ioport8_t *port) 158 158 { 159 159 return 0; /* XXX */ -
kernel/arch/ppc32/include/types.h
r4b44099d r7d60cf5 58 58 typedef int32_t native_t; 59 59 60 typedef uintptr_t ioport_t; 60 typedef volatile uint8_t ioport8_t; 61 typedef volatile uint16_t ioport16_t; 62 typedef volatile uint32_t ioport32_t; 61 63 62 64 typedef struct { -
kernel/arch/sparc64/include/asm.h
r4b44099d r7d60cf5 45 45 #include <arch/barrier.h> 46 46 47 static inline void pio_write_8(ioport _tport, uint8_t v)48 { 49 * ((volatile uint8_t *)(port))= v;50 memory_barrier(); 51 } 52 53 static inline void pio_write_16(ioport _tport, uint16_t v)54 { 55 * ((volatile uint16_t *)(port))= v;56 memory_barrier(); 57 } 58 59 static inline void pio_write_32(ioport _tport, uint32_t v)60 { 61 * ((volatile uint32_t *)(port))= v;62 memory_barrier(); 63 } 64 65 static inline uint8_t pio_read_8(ioport _tport)47 static inline void pio_write_8(ioport8_t *port, uint8_t v) 48 { 49 *port = v; 50 memory_barrier(); 51 } 52 53 static inline void pio_write_16(ioport16_t *port, uint16_t v) 54 { 55 *port = v; 56 memory_barrier(); 57 } 58 59 static inline void pio_write_32(ioport32_t *port, uint32_t v) 60 { 61 *port = v; 62 memory_barrier(); 63 } 64 65 static inline uint8_t pio_read_8(ioport8_t *port) 66 66 { 67 67 uint8_t rv; 68 68 69 rv = * ((volatile uint8_t *)(port));69 rv = *port; 70 70 memory_barrier(); 71 71 … … 73 73 } 74 74 75 static inline uint16_t pio_read_16(ioport _tport)75 static inline uint16_t pio_read_16(ioport16_t *port) 76 76 { 77 77 uint16_t rv; 78 78 79 rv = * ((volatile uint16_t *)(port));79 rv = *port; 80 80 memory_barrier(); 81 81 … … 83 83 } 84 84 85 static inline uint32_t pio_read_32(ioport _tport)85 static inline uint32_t pio_read_32(ioport32_t *port) 86 86 { 87 87 uint32_t rv; 88 88 89 rv = * ((volatile uint32_t *)(port));89 rv = *port; 90 90 memory_barrier(); 91 91 -
kernel/arch/sparc64/include/types.h
r4b44099d r7d60cf5 58 58 typedef int64_t native_t; 59 59 60 typedef uintptr_t ioport_t; 60 typedef volatile uint8_t ioport8_t; 61 typedef volatile uint16_t ioport16_t; 62 typedef volatile uint32_t ioport32_t; 61 63 62 64 typedef struct {
Note:
See TracChangeset
for help on using the changeset viewer.