diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-12-04 06:11:35 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-12-04 06:11:35 +0100 |
commit | 31578e285a21a749a49e3ac146feb8b02fcc7b52 (patch) | |
tree | e67f619360352a87fb6e0f410f5246468fbc1073 /code/fe310/include/sifive/devices/plic.h | |
parent | 2c981aec5e5c10f9fd036dfb48105b16f16e4233 (diff) |
added new metal sdk
Diffstat (limited to 'code/fe310/include/sifive/devices/plic.h')
-rw-r--r-- | code/fe310/include/sifive/devices/plic.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/code/fe310/include/sifive/devices/plic.h b/code/fe310/include/sifive/devices/plic.h new file mode 100644 index 0000000..e1ca5d6 --- /dev/null +++ b/code/fe310/include/sifive/devices/plic.h @@ -0,0 +1,31 @@ +// See LICENSE for license details. + +#ifndef PLIC_H +#define PLIC_H + +#include <sifive/const.h> + +// 32 bits per source +#define PLIC_PRIORITY_OFFSET _AC(0x0000,UL) +#define PLIC_PRIORITY_SHIFT_PER_SOURCE 2 +// 1 bit per source (1 address) +#define PLIC_PENDING_OFFSET _AC(0x1000,UL) +#define PLIC_PENDING_SHIFT_PER_SOURCE 0 + +//0x80 per target +#define PLIC_ENABLE_OFFSET _AC(0x2000,UL) +#define PLIC_ENABLE_SHIFT_PER_TARGET 7 + + +#define PLIC_THRESHOLD_OFFSET _AC(0x200000,UL) +#define PLIC_CLAIM_OFFSET _AC(0x200004,UL) +#define PLIC_THRESHOLD_SHIFT_PER_TARGET 12 +#define PLIC_CLAIM_SHIFT_PER_TARGET 12 + +#define PLIC_MAX_SOURCE 1023 +#define PLIC_SOURCE_MASK 0x3FF + +#define PLIC_MAX_TARGET 15871 +#define PLIC_TARGET_MASK 0x3FFF + +#endif /* PLIC_H */ |