29#ifndef __DEV_NET_SINICREG_HH__
30#define __DEV_NET_SINICREG_HH__
36#define __SINIC_REG32(NAME, VAL) static const uint32_t NAME = (VAL);
37#define __SINIC_REG64(NAME, VAL) static const uint64_t NAME = (VAL);
39#define __SINIC_VAL32(NAME, OFFSET, WIDTH) \
40 static const uint32_t NAME##_width = WIDTH; \
41 static const uint32_t NAME##_offset = OFFSET; \
42 static const uint32_t NAME##_mask = (1 << WIDTH) - 1; \
43 static const uint32_t NAME = ((1 << WIDTH) - 1) << OFFSET; \
44 static inline uint32_t get_##NAME(uint32_t reg) \
45 { return (reg & NAME) >> OFFSET; } \
46 static inline uint32_t set_##NAME(uint32_t reg, uint32_t val) \
47 { return (reg & ~NAME) | ((val << OFFSET) & NAME); }
49#define __SINIC_VAL64(NAME, OFFSET, WIDTH) \
50 static const uint64_t NAME##_width = WIDTH; \
51 static const uint64_t NAME##_offset = OFFSET; \
52 static const uint64_t NAME##_mask = (1ULL << WIDTH) - 1; \
53 static const uint64_t NAME = ((1ULL << WIDTH) - 1) << OFFSET; \
54 static inline uint64_t get_##NAME(uint64_t reg) \
55 { return (reg & NAME) >> OFFSET; } \
56 static inline uint64_t set_##NAME(uint64_t reg, uint64_t val) \
57 { return (reg & ~NAME) | ((val << OFFSET) & NAME); }
196 { 4,
true,
true,
"Config" },
197 { 4,
false,
true,
"Command" },
198 { 4,
true,
true,
"IntrStatus" },
199 { 4,
true,
true,
"IntrMask" },
200 { 4,
true,
false,
"RxMaxCopy" },
201 { 4,
true,
false,
"TxMaxCopy" },
202 { 4,
true,
false,
"ZeroCopySize" },
203 { 4,
true,
false,
"ZeroCopyMark" },
204 { 4,
true,
false,
"VirtualCount" },
205 { 4,
true,
false,
"RxMaxIntr" },
206 { 4,
true,
false,
"RxFifoSize" },
207 { 4,
true,
false,
"TxFifoSize" },
208 { 4,
true,
false,
"RxFifoLow" },
209 { 4,
true,
false,
"TxFifoLow" },
210 { 4,
true,
false,
"RxFifoHigh" },
211 { 4,
true,
false,
"TxFifoHigh" },
212 { 8,
true,
true,
"RxData" },
214 { 8,
true,
false,
"RxDone" },
216 { 8,
true,
false,
"RxWait" },
218 { 8,
true,
true,
"TxData" },
220 { 8,
true,
false,
"TxDone" },
222 { 8,
true,
false,
"TxWait" },
224 { 8,
true,
false,
"HwAddr" },
226 { 8,
true,
false,
"RxStatus" },
230 return info[daddr / 4];
236 if (daddr > registers::Size)
static const int VirtualMask
static const int VirtualShift
const registers::Info & regInfo(Addr daddr)
bool regValid(Addr daddr)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define __SINIC_VAL32(NAME, OFFSET, WIDTH)
#define __SINIC_REG32(NAME, VAL)
#define __SINIC_VAL64(NAME, OFFSET, WIDTH)