Changeset aa537a5a in mainline
- Timestamp:
- 2017-11-01T20:33:08Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d0cbfd3
- Parents:
- 315130c
- Location:
- uspace
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/amdm37x/amdm37x.c
r315130c raa537a5a 44 44 #include <stdio.h> 45 45 46 static void log(const volatile void *place, uint32_t val, volatile void* base, size_t size, void *data, bool write) 46 static void 47 log(const volatile void *place, uint64_t val, volatile void *base, size_t size, 48 void *data, bool write) 47 49 { 48 printf("PIO %s: %p(%p) %#"PRIx 32"\n", write ? "WRITE" : "READ",50 printf("PIO %s: %p(%p) %#"PRIx64"\n", write ? "WRITE" : "READ", 49 51 (place - base) + data, place, val); 50 52 } -
uspace/lib/c/arch/abs32le/include/libarch/ddi.h
r315130c raa537a5a 50 50 } 51 51 52 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 53 { 54 *port = v; 55 } 56 52 57 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 53 58 { … … 65 70 } 66 71 72 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 73 { 74 return *port; 75 } 76 67 77 #endif -
uspace/lib/c/arch/arm32/include/libarch/ddi.h
r315130c raa537a5a 51 51 } 52 52 53 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 54 { 55 *port = v; 56 } 57 53 58 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 54 59 { … … 66 71 } 67 72 73 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 74 { 75 return *port; 76 } 77 68 78 #endif -
uspace/lib/c/arch/ia32/include/libarch/ddi.h
r315130c raa537a5a 86 86 } 87 87 88 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 89 { 90 return (uint64_t) *port; 91 } 92 88 93 static inline void arch_pio_write_8(ioport8_t *port, uint8_t val) 89 94 { … … 119 124 } 120 125 126 static inline void arch_pio_write_64(ioport64_t *port, uint64_t val) 127 { 128 *port = val; 129 } 130 121 131 #endif -
uspace/lib/c/arch/ia64/include/libarch/ddi.h
r315130c raa537a5a 94 94 } 95 95 96 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 97 { 98 *port = v; 99 100 asm volatile ("mf\n" ::: "memory"); 101 asm volatile ("mf.a\n" ::: "memory"); 102 } 103 96 104 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 97 105 { … … 154 162 } 155 163 164 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 165 { 166 uint64_t v; 167 168 asm volatile ("mf\n" ::: "memory"); 169 170 v = *port; 171 172 asm volatile ("mf.a\n" ::: "memory"); 173 174 return v; 175 } 176 156 177 #endif 157 178 -
uspace/lib/c/arch/mips32/include/libarch/ddi.h
r315130c raa537a5a 51 51 } 52 52 53 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 54 { 55 *port = v; 56 } 57 53 58 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 54 59 { … … 66 71 } 67 72 73 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 74 { 75 return *port; 76 } 77 68 78 #endif -
uspace/lib/c/arch/ppc32/include/libarch/ddi.h
r315130c raa537a5a 51 51 } 52 52 53 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 54 { 55 *port = v; 56 } 57 53 58 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 54 59 { … … 66 71 } 67 72 73 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 74 { 75 return *port; 76 } 77 68 78 #endif -
uspace/lib/c/arch/riscv64/include/libarch/ddi.h
r315130c raa537a5a 50 50 } 51 51 52 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 53 { 54 *port = v; 55 } 56 52 57 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 53 58 { … … 65 70 } 66 71 72 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 73 { 74 return *port; 75 } 76 67 77 #endif -
uspace/lib/c/arch/sparc64/include/libarch/ddi.h
r315130c raa537a5a 62 62 } 63 63 64 static inline void arch_pio_write_64(ioport64_t *port, uint64_t v) 65 { 66 *port = v; 67 memory_barrier(); 68 } 69 70 64 71 static inline uint8_t arch_pio_read_8(const ioport8_t *port) 65 72 { … … 92 99 } 93 100 101 static inline uint64_t arch_pio_read_64(const ioport64_t *port) 102 { 103 uint64_t rv; 104 105 rv = *port; 106 memory_barrier(); 107 108 return rv; 109 } 110 94 111 #endif -
uspace/lib/c/generic/ddi.c
r315130c raa537a5a 338 338 } 339 339 340 void pio_write_64(ioport64_t *reg, uint64_t val) 341 { 342 pio_trace_log(reg, val, true); 343 arch_pio_write_64(reg, val); 344 } 345 340 346 uint8_t pio_read_8(const ioport8_t *reg) 341 347 { … … 359 365 } 360 366 367 uint64_t pio_read_64(const ioport64_t *reg) 368 { 369 const uint64_t val = arch_pio_read_64(reg); 370 pio_trace_log(reg, val, false); 371 return val; 372 } 373 361 374 /** @} 362 375 */ -
uspace/lib/c/generic/pio_trace.c
r315130c raa537a5a 91 91 92 92 93 void pio_trace_log(const volatile void *r, uint 32_t val, bool write)93 void pio_trace_log(const volatile void *r, uint64_t val, bool write) 94 94 { 95 95 pio_regions_t *regions = get_regions(); -
uspace/lib/c/include/ddi.h
r315130c raa537a5a 52 52 typedef volatile uint16_t ioport16_t; 53 53 typedef volatile uint32_t ioport32_t; 54 typedef volatile uint64_t ioport64_t; 54 55 55 56 extern int device_assign_devno(void); … … 69 70 extern int pio_disable(void *, size_t); 70 71 71 typedef void (*trace_fnc)(const volatile void *place, uint 32_t val,72 typedef void (*trace_fnc)(const volatile void *place, uint64_t val, 72 73 volatile void* base, size_t size, void *data, bool write); 73 74 74 75 extern int pio_trace_enable(void *, size_t, trace_fnc, void *); 75 extern void pio_trace_log(const volatile void *, uint 32_t val, bool write);76 extern void pio_trace_log(const volatile void *, uint64_t val, bool write); 76 77 extern void pio_trace_disable(void *); 77 78 … … 79 80 extern void pio_write_16(ioport16_t *, uint16_t); 80 81 extern void pio_write_32(ioport32_t *, uint32_t); 82 extern void pio_write_64(ioport64_t *, uint64_t); 81 83 82 84 extern uint8_t pio_read_8(const ioport8_t *); 83 85 extern uint16_t pio_read_16(const ioport16_t *); 84 86 extern uint32_t pio_read_32(const ioport32_t *); 87 extern uint64_t pio_read_64(const ioport64_t *); 85 88 86 89 static inline uint8_t pio_change_8(ioport8_t *reg, uint8_t val, uint8_t mask, … … 111 114 } 112 115 116 static inline uint64_t pio_change_64(ioport64_t *reg, uint64_t val, 117 uint64_t mask, useconds_t delay) 118 { 119 uint64_t v = pio_read_64(reg); 120 udelay(delay); 121 pio_write_64(reg, (v & ~mask) | val); 122 return v; 123 } 124 113 125 static inline uint8_t pio_set_8(ioport8_t *r, uint8_t v, useconds_t d) 114 126 { … … 122 134 { 123 135 return pio_change_32(r, v, 0, d); 136 } 137 static inline uint64_t pio_set_64(ioport64_t *r, uint64_t v, useconds_t d) 138 { 139 return pio_change_64(r, v, 0, d); 124 140 } 125 141 … … 136 152 return pio_change_32(r, 0, v, d); 137 153 } 154 static inline uint64_t pio_clear_64(ioport64_t *r, uint64_t v, useconds_t d) 155 { 156 return pio_change_64(r, 0, v, d); 157 } 138 158 139 159 #endif
Note:
See TracChangeset
for help on using the changeset viewer.