31 #ifndef __DEV_NET_SINICREG_HH__
32 #define __DEV_NET_SINICREG_HH__
34 #define __SINIC_REG32(NAME, VAL) static const uint32_t NAME = (VAL);
35 #define __SINIC_REG64(NAME, VAL) static const uint64_t NAME = (VAL);
37 #define __SINIC_VAL32(NAME, OFFSET, WIDTH) \
38 static const uint32_t NAME##_width = WIDTH; \
39 static const uint32_t NAME##_offset = OFFSET; \
40 static const uint32_t NAME##_mask = (1 << WIDTH) - 1; \
41 static const uint32_t NAME = ((1 << WIDTH) - 1) << OFFSET; \
42 static inline uint32_t get_##NAME(uint32_t reg) \
43 { return (reg & NAME) >> OFFSET; } \
44 static inline uint32_t set_##NAME(uint32_t reg, uint32_t val) \
45 { return (reg & ~NAME) | ((val << OFFSET) & NAME); }
47 #define __SINIC_VAL64(NAME, OFFSET, WIDTH) \
48 static const uint64_t NAME##_width = WIDTH; \
49 static const uint64_t NAME##_offset = OFFSET; \
50 static const uint64_t NAME##_mask = (ULL(1) << WIDTH) - 1; \
51 static const uint64_t NAME = ((ULL(1) << WIDTH) - 1) << OFFSET; \
52 static inline uint64_t get_##NAME(uint64_t reg) \
53 { return (reg & NAME) >> OFFSET; } \
54 static inline uint64_t set_##NAME(uint64_t reg, uint64_t val) \
55 { return (reg & ~NAME) | ((val << OFFSET) & NAME); }
186 static Regs::Info invalid = { 0,
false,
false,
"invalid" };
188 { 4,
true,
true,
"Config" },
189 { 4,
false,
true,
"Command" },
190 { 4,
true,
true,
"IntrStatus" },
191 { 4,
true,
true,
"IntrMask" },
192 { 4,
true,
false,
"RxMaxCopy" },
193 { 4,
true,
false,
"TxMaxCopy" },
194 { 4,
true,
false,
"ZeroCopySize" },
195 { 4,
true,
false,
"ZeroCopyMark" },
196 { 4,
true,
false,
"VirtualCount" },
197 { 4,
true,
false,
"RxMaxIntr" },
198 { 4,
true,
false,
"RxFifoSize" },
199 { 4,
true,
false,
"TxFifoSize" },
200 { 4,
true,
false,
"RxFifoLow" },
201 { 4,
true,
false,
"TxFifoLow" },
202 { 4,
true,
false,
"RxFifoHigh" },
203 { 4,
true,
false,
"TxFifoHigh" },
204 { 8,
true,
true,
"RxData" },
206 { 8,
true,
false,
"RxDone" },
208 { 8,
true,
false,
"RxWait" },
210 { 8,
true,
true,
"TxData" },
212 { 8,
true,
false,
"TxDone" },
214 { 8,
true,
false,
"TxWait" },
216 { 8,
true,
false,
"HwAddr" },
218 { 8,
true,
false,
"RxStatus" },
222 return info[daddr / 4];
228 if (daddr > Regs::Size)
239 #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