Rev 3675 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3675 | Rev 4377 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | #include <arch/register.h> |
42 | #include <arch/register.h> |
43 | #include <config.h> |
43 | #include <config.h> |
44 | #include <arch/stack.h> |
44 | #include <arch/stack.h> |
45 | #include <arch/barrier.h> |
45 | #include <arch/barrier.h> |
46 | 46 | ||
47 | static inline void outb(ioport_t port, uint8_t v) |
47 | static inline void pio_write_8(ioport8_t *port, uint8_t v) |
48 | { |
48 | { |
49 | *((volatile uint8_t *)(port)) = v; |
49 | *port = v; |
50 | memory_barrier(); |
50 | memory_barrier(); |
51 | } |
51 | } |
52 | 52 | ||
53 | static inline void outw(ioport_t port, uint16_t v) |
53 | static inline void pio_write_16(ioport16_t *port, uint16_t v) |
54 | { |
54 | { |
55 | *((volatile uint16_t *)(port)) = v; |
55 | *port = v; |
56 | memory_barrier(); |
56 | memory_barrier(); |
57 | } |
57 | } |
58 | 58 | ||
59 | static inline void outl(ioport_t port, uint32_t v) |
59 | static inline void pio_write_32(ioport32_t *port, uint32_t v) |
60 | { |
60 | { |
61 | *((volatile uint32_t *)(port)) = v; |
61 | *port = v; |
62 | memory_barrier(); |
62 | memory_barrier(); |
63 | } |
63 | } |
64 | 64 | ||
65 | static inline uint8_t inb(ioport_t port) |
65 | static inline uint8_t pio_read_8(ioport8_t *port) |
66 | { |
66 | { |
67 | uint8_t rv; |
67 | uint8_t rv; |
68 | 68 | ||
69 | rv = *((volatile uint8_t *)(port)); |
69 | rv = *port; |
70 | memory_barrier(); |
70 | memory_barrier(); |
71 | 71 | ||
72 | return rv; |
72 | return rv; |
73 | } |
73 | } |
74 | 74 | ||
75 | static inline uint16_t inw(ioport_t port) |
75 | static inline uint16_t pio_read_16(ioport16_t *port) |
76 | { |
76 | { |
77 | uint16_t rv; |
77 | uint16_t rv; |
78 | 78 | ||
79 | rv = *((volatile uint16_t *)(port)); |
79 | rv = *port; |
80 | memory_barrier(); |
80 | memory_barrier(); |
81 | 81 | ||
82 | return rv; |
82 | return rv; |
83 | } |
83 | } |
84 | 84 | ||
85 | static inline uint32_t inl(ioport_t port) |
85 | static inline uint32_t pio_read_32(ioport32_t *port) |
86 | { |
86 | { |
87 | uint32_t rv; |
87 | uint32_t rv; |
88 | 88 | ||
89 | rv = *((volatile uint32_t *)(port)); |
89 | rv = *port; |
90 | memory_barrier(); |
90 | memory_barrier(); |
91 | 91 | ||
92 | return rv; |
92 | return rv; |
93 | } |
93 | } |
94 | 94 |