MOS Source Code
Loading...
Searching...
No Matches
platform_defs.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
3
#pragma once
4
5
#include <
mos/types.h
>
6
7
#define MOS_PLATFORM_PAGING_LEVELS 4
8
9
#define MOS_PLATFORM_HAS_FDT 1
10
11
#define PML2_HUGE_CAPABLE 1
12
#define PML3_HUGE_CAPABLE 1
13
#define PML4_HUGE_CAPABLE 1
14
15
#define PML1_SHIFT 12
16
#define PML2_SHIFT 21
17
#define PML3_SHIFT 30
18
#define PML4_SHIFT 39
19
20
#define PML1_MASK 0x1FFULL
21
#define PML2_MASK 0x1FFULL
22
#define PML3_MASK 0x1FFULL
23
#define PML4_MASK 0x1FFULL
24
25
#define PML1_ENTRIES 512
26
#define PML2_ENTRIES 512
27
#define PML3_ENTRIES 512
28
#define PML4_ENTRIES 512
29
30
#define MOS_USER_END_VADDR 0x00007FFFFFFFFFFF
31
#define MOS_KERNEL_START_VADDR 0xFFFF800000000000
32
33
#define MOS_ELF_PLATFORM EM_RISCV
34
35
#define MOS_PLATFORM_PANIC_INSTR "unimp"
36
37
// clang-format off
38
#define MOS_PLATFORM_PANIC_POINT_ASM \
39
".quad 1b\n\t" \
40
".quad %0\n\t" \
41
".quad %1\n\t" \
42
".quad %2\n\t"
43
// clang-format on
44
45
#define MOS_PLATFORM_DEBUG_MODULES(X) \
46
X(riscv64_startup) \
47
48
49
#define MOS_PLATFORM_MEMORY_BARRIER() __asm__ __volatile__("fence.i" ::: "memory")
50
51
typedef
struct
_platform_process_options
52
{
53
int
__unused
;
54
}
platform_process_options_t
;
55
56
typedef
struct
_platform_thread_options
57
{
58
reg64_t
f[32];
// f0-f31
59
reg32_t
fcsr
;
// fcsr
60
}
platform_thread_options_t
;
61
62
typedef
struct
_platform_cpuinfo
63
{
64
int
__unused
;
65
}
platform_cpuinfo_t
;
66
67
typedef
struct
_platform_arch_info
68
{
69
void
*
fdt
;
70
ptr_t
rsdp_addr
;
71
u32
rsdp_revision
;
72
}
platform_arch_info_t
;
platform_thread_options_t
struct _platform_thread_options platform_thread_options_t
Definition
platform.h:142
platform_process_options_t
struct _platform_process_options platform_process_options_t
Definition
platform.h:141
platform_arch_info_t
Definition
platform_defs.h:68
platform_arch_info_t::rsdp_revision
u32 rsdp_revision
Definition
platform_defs.h:71
platform_arch_info_t::rsdp_addr
ptr_t rsdp_addr
Definition
platform_defs.h:70
platform_arch_info_t::fdt
void * fdt
pointer to the device tree
Definition
platform_defs.h:69
platform_cpuinfo_t
Definition
platform_defs.h:63
platform_cpuinfo_t::__unused
int __unused
Definition
platform_defs.h:64
platform_process_options_t::__unused
int __unused
Definition
platform_defs.h:53
platform_thread_options_t::fcsr
reg32_t fcsr
Definition
platform_defs.h:59
types.h
u32
unsigned int u32
Definition
types.h:21
reg32_t
u32 reg32_t
Definition
types.h:53
reg64_t
u64 reg64_t
Definition
types.h:54
ptr_t
unsigned long ptr_t
Definition
types.h:25
kernel
arch
riscv64
include
private
mos
platform
platform_defs.h
Generated on Sun Sep 1 2024 18:22:52 for MOS Source Code by
1.12.0