Changeset 5b082ba9 in mainline
- Timestamp:
- 2012-10-14T14:58:09Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- acc0efb
- Parents:
- 1ae74c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ddi.h
r1ae74c6 r5b082ba9 37 37 38 38 #include <sys/types.h> 39 #include <sys/time.h> 39 40 #include <abi/ddi/irq.h> 40 41 #include <task.h> … … 51 52 52 53 extern int pio_enable(void *, size_t, void **); 54 53 55 extern void pio_write_8(ioport8_t *, uint8_t); 54 56 extern void pio_write_16(ioport16_t *, uint16_t); … … 59 61 extern uint32_t pio_read_32(ioport32_t *); 60 62 63 static inline uint8_t pio_change_8( 64 ioport8_t *reg, uint8_t val, uint8_t mask, useconds_t delay) 65 { 66 uint8_t v = pio_read_8(reg); 67 udelay(delay); 68 pio_write_8(reg, (v & ~mask) | val); 69 return v; 70 } 71 72 static inline uint16_t pio_change_16( 73 ioport16_t *reg, uint16_t val, uint16_t mask, useconds_t delay) 74 { 75 uint16_t v = pio_read_16(reg); 76 udelay(delay); 77 pio_write_16(reg, (v & ~mask) | val); 78 return v; 79 } 80 81 static inline uint32_t pio_change_32( 82 ioport32_t *reg, uint32_t val, uint32_t mask, useconds_t delay) 83 { 84 uint32_t v = pio_read_32(reg); 85 udelay(delay); 86 pio_write_32(reg, (v & ~mask) | val); 87 return v; 88 } 89 90 static inline uint8_t pio_set_8(ioport8_t *r, uint8_t v, useconds_t d) 91 { 92 return pio_change_8(r, v, 0, d); 93 } 94 static inline uint16_t pio_set_16(ioport16_t *r, uint16_t v, useconds_t d) 95 { 96 return pio_change_16(r, v, 0, d); 97 } 98 static inline uint32_t pio_set_32(ioport32_t *r, uint32_t v, useconds_t d) 99 { 100 return pio_change_32(r, v, 0, d); 101 } 102 103 static inline uint8_t pio_clear_8(ioport8_t *r, uint8_t v, useconds_t d) 104 { 105 return pio_change_8(r, 0, v, d); 106 } 107 static inline uint16_t pio_clear_16(ioport16_t *r, uint16_t v, useconds_t d) 108 { 109 return pio_change_16(r, 0, v, d); 110 } 111 static inline uint32_t pio_clear_32(ioport32_t *r, uint32_t v, useconds_t d) 112 { 113 return pio_change_32(r, 0, v, d); 114 } 115 61 116 extern int irq_register(int, int, int, irq_code_t *); 62 117 extern int irq_unregister(int, int);
Note:
See TracChangeset
for help on using the changeset viewer.