Rev 4028 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4028 | Rev 4272 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | 44 | ||
45 | static inline void pio_write_8(ioport8_t *port, uint8_t v) |
45 | static inline void pio_write_8(ioport8_t *port, uint8_t v) |
46 | { |
46 | { |
47 | uintptr_t prt = (uintptr_t) port; |
47 | uintptr_t prt = (uintptr_t) port; |
48 | 48 | ||
49 | *((uint8_t *)(IA64_IOSPACE_ADDRESS + |
49 | *((ioport8_t *)(IA64_IOSPACE_ADDRESS + |
50 | ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
50 | ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
51 | 51 | ||
52 | asm volatile ("mf\n" ::: "memory"); |
52 | asm volatile ("mf\n" ::: "memory"); |
53 | } |
53 | } |
54 | 54 | ||
55 | static inline void pio_write_16(ioport16_t *port, uint16_t v) |
55 | static inline void pio_write_16(ioport16_t *port, uint16_t v) |
56 | { |
56 | { |
57 | uintptr_t prt = (uintptr_t) port; |
57 | uintptr_t prt = (uintptr_t) port; |
58 | 58 | ||
59 | *((uint16_t *)(IA64_IOSPACE_ADDRESS + |
59 | *((ioport16_t *)(IA64_IOSPACE_ADDRESS + |
60 | ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
60 | ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
61 | 61 | ||
62 | asm volatile ("mf\n" ::: "memory"); |
62 | asm volatile ("mf\n" ::: "memory"); |
63 | } |
63 | } |
64 | 64 | ||
65 | static inline void pio_write_32(ioport32_t *port, uint32_t v) |
65 | static inline void pio_write_32(ioport32_t *port, uint32_t v) |
66 | { |
66 | { |
67 | uintptr_t prt = (uintptr_t) port; |
67 | uintptr_t prt = (uintptr_t) port; |
68 | 68 | ||
69 | *((uint32_t *)(IA64_IOSPACE_ADDRESS + |
69 | *((ioport32_t *)(IA64_IOSPACE_ADDRESS + |
70 | ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
70 | ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
71 | 71 | ||
72 | asm volatile ("mf\n" ::: "memory"); |
72 | asm volatile ("mf\n" ::: "memory"); |
73 | } |
73 | } |
74 | 74 | ||
Line 76... | Line 76... | ||
76 | { |
76 | { |
77 | uintptr_t prt = (uintptr_t) port; |
77 | uintptr_t prt = (uintptr_t) port; |
78 | 78 | ||
79 | asm volatile ("mf\n" ::: "memory"); |
79 | asm volatile ("mf\n" ::: "memory"); |
80 | 80 | ||
81 | return *((uint8_t *)(IA64_IOSPACE_ADDRESS + |
81 | return *((ioport8_t *)(IA64_IOSPACE_ADDRESS + |
82 | ((prt & 0xfff) | ((prt >> 2) << 12)))); |
82 | ((prt & 0xfff) | ((prt >> 2) << 12)))); |
83 | } |
83 | } |
84 | 84 | ||
85 | static inline uint16_t pio_read_16(ioport16_t *port) |
85 | static inline uint16_t pio_read_16(ioport16_t *port) |
86 | { |
86 | { |
87 | uintptr_t prt = (uintptr_t) port; |
87 | uintptr_t prt = (uintptr_t) port; |
88 | 88 | ||
89 | asm volatile ("mf\n" ::: "memory"); |
89 | asm volatile ("mf\n" ::: "memory"); |
90 | 90 | ||
91 | return *((uint16_t *)(IA64_IOSPACE_ADDRESS + |
91 | return *((ioport16_t *)(IA64_IOSPACE_ADDRESS + |
92 | ((prt & 0xfff) | ((prt >> 2) << 12)))); |
92 | ((prt & 0xfff) | ((prt >> 2) << 12)))); |
93 | } |
93 | } |
94 | 94 | ||
95 | static inline uint32_t pio_read_32(ioport32_t *port) |
95 | static inline uint32_t pio_read_32(ioport32_t *port) |
96 | { |
96 | { |
97 | uintptr_t prt = (uintptr_t) port; |
97 | uintptr_t prt = (uintptr_t) port; |
98 | 98 | ||
99 | asm volatile ("mf\n" ::: "memory"); |
99 | asm volatile ("mf\n" ::: "memory"); |
100 | 100 | ||
101 | return *((uint32_t *)(IA64_IOSPACE_ADDRESS + |
101 | return *((ioport32_t *)(IA64_IOSPACE_ADDRESS + |
102 | ((prt & 0xfff) | ((prt >> 2) << 12)))); |
102 | ((prt & 0xfff) | ((prt >> 2) << 12)))); |
103 | } |
103 | } |
104 | 104 | ||
105 | /** Return base address of current stack |
105 | /** Return base address of current stack |
106 | * |
106 | * |