1/*
2 * Copyright 2018, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
8 * See "LICENSE_GPLv2.txt" for details.
9 *
10 * @TAG(DATA61_GPL)
11 */
12
13/*
14 *
15 * Copyright 2016, 2017 Hesham Almatary, Data61/CSIRO <hesham.almatary@data61.csiro.au>
16 * Copyright 2015, 2016 Hesham Almatary <heshamelmatary@gmail.com>
17 */
18
19#ifndef __LIBSEL4_SEL4_ARCH_CONSTANTS_H
20#define __LIBSEL4_SEL4_ARCH_CONSTANTS_H
21
22#ifdef HAVE_AUTOCONF
23#include <autoconf.h>
24#endif
25
26#define seL4_WordBits           32
27/* log 2 bits in a word */
28#define seL4_WordSizeBits       2
29
30#define seL4_SlotBits           4
31#define seL4_NotificationBits   4
32#define seL4_EndpointBits       4
33#define seL4_IPCBufferSizeBits  9
34#define seL4_TCBBits            9
35
36/* Untyped size limits */
37#define seL4_MinUntypedBits     4
38#define seL4_MaxUntypedBits     29
39
40/* RISC-V Sv32 pages/ptes sizes */
41#define seL4_PageTableEntryBits 2
42#define seL4_PageTableIndexBits 10
43
44#define seL4_PageBits           12
45#define seL4_LargePageBits      22
46#define seL4_HugePageBits       29
47#define seL4_PageTableBits      12
48
49#define seL4_ASIDPoolIndexBits  4
50#define seL4_ASIDPoolBits       12
51
52enum {
53    seL4_VMFault_IP,
54    seL4_VMFault_Addr,
55    seL4_VMFault_PrefetchFault,
56    seL4_VMFault_FSR,
57    seL4_VMFault_Length,
58} seL4_VMFault_Msg;
59
60enum {
61    seL4_UnknownSyscall_FaultIP,
62    seL4_UnknownSyscall_SP,
63    seL4_UnknownSyscall_RA,
64    seL4_UnknownSyscall_A0,
65    seL4_UnknownSyscall_A1,
66    seL4_UnknownSyscall_A2,
67    seL4_UnknownSyscall_A3,
68    seL4_UnknownSyscall_A4,
69    seL4_UnknownSyscall_A5,
70    seL4_UnknownSyscall_A6,
71    seL4_UnknownSyscall_Syscall,
72    seL4_UnknownSyscall_Length,
73} seL4_UnknownSyscall_Msg;
74
75enum {
76    seL4_UserException_FaultIP,
77    seL4_UserException_SP,
78    seL4_UserException_FLAGS,
79    seL4_UserException_Number,
80    seL4_UserException_Code,
81    seL4_UserException_Length,
82} seL4_UserException_Msg;
83
84#endif
85