29 #ifndef __DEV_NET_SINICREG_HH__ 30 #define __DEV_NET_SINICREG_HH__ 32 #define __SINIC_REG32(NAME, VAL) static const uint32_t NAME = (VAL); 33 #define __SINIC_REG64(NAME, VAL) static const uint64_t NAME = (VAL); 35 #define __SINIC_VAL32(NAME, OFFSET, WIDTH) \ 36 static const uint32_t NAME##_width = WIDTH; \ 37 static const uint32_t NAME##_offset = OFFSET; \ 38 static const uint32_t NAME##_mask = (1 << WIDTH) - 1; \ 39 static const uint32_t NAME = ((1 << WIDTH) - 1) << OFFSET; \ 40 static inline uint32_t get_##NAME(uint32_t reg) \ 41 { return (reg & NAME) >> OFFSET; } \ 42 static inline uint32_t set_##NAME(uint32_t reg, uint32_t val) \ 43 { return (reg & ~NAME) | ((val << OFFSET) & NAME); } 45 #define __SINIC_VAL64(NAME, OFFSET, WIDTH) \ 46 static const uint64_t NAME##_width = WIDTH; \ 47 static const uint64_t NAME##_offset = OFFSET; \ 48 static const uint64_t NAME##_mask = (ULL(1) << WIDTH) - 1; \ 49 static const uint64_t NAME = ((ULL(1) << WIDTH) - 1) << OFFSET; \ 50 static inline uint64_t get_##NAME(uint64_t reg) \ 51 { return (reg & NAME) >> OFFSET; } \ 52 static inline uint64_t set_##NAME(uint64_t reg, uint64_t val) \ 53 { return (reg & ~NAME) | ((val << OFFSET) & NAME); } 184 static Regs::Info invalid = { 0,
false,
false,
"invalid" };
186 { 4,
true,
true,
"Config" },
187 { 4,
false,
true,
"Command" },
188 { 4,
true,
true,
"IntrStatus" },
189 { 4,
true,
true,
"IntrMask" },
190 { 4,
true,
false,
"RxMaxCopy" },
191 { 4,
true,
false,
"TxMaxCopy" },
192 { 4,
true,
false,
"ZeroCopySize" },
193 { 4,
true,
false,
"ZeroCopyMark" },
194 { 4,
true,
false,
"VirtualCount" },
195 { 4,
true,
false,
"RxMaxIntr" },
196 { 4,
true,
false,
"RxFifoSize" },
197 { 4,
true,
false,
"TxFifoSize" },
198 { 4,
true,
false,
"RxFifoLow" },
199 { 4,
true,
false,
"TxFifoLow" },
200 { 4,
true,
false,
"RxFifoHigh" },
201 { 4,
true,
false,
"TxFifoHigh" },
202 { 8,
true,
true,
"RxData" },
204 { 8,
true,
false,
"RxDone" },
206 { 8,
true,
false,
"RxWait" },
208 { 8,
true,
true,
"TxData" },
210 { 8,
true,
false,
"TxDone" },
212 { 8,
true,
false,
"TxWait" },
214 { 8,
true,
false,
"HwAddr" },
216 { 8,
true,
false,
"RxStatus" },
220 return info[daddr / 4];
226 if (daddr > Regs::Size)
237 #endif // __DEV_NET_SINICREG_HH__ __SINIC_REG32(Config, 0x00) __SINIC_REG32(Command
const Regs::Info & regInfo(Addr daddr)
static const int VirtualShift
bool regValid(Addr daddr)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
__SINIC_VAL64(RxData_Vaddr, 60, 1) __SINIC_VAL64(RxData_Len
__SINIC_VAL32(Config_ZeroCopy, 12, 1) __SINIC_VAL32(Config_DelayCopy
static const int VirtualMask