xref: /haiku/headers/private/kernel/arch/riscv64/arch_kernel_args.h (revision 4c8e85b316c35a9161f5a1c50ad70bc91c83a76f)
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef KERNEL_ARCH_RISCV64_KERNEL_ARGS_H
6 #define KERNEL_ARCH_RISCV64_KERNEL_ARGS_H
7 
8 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
9 #	error This file is included from <boot/kernel_args.h> only
10 #endif
11 
12 
13 #include <util/FixedWidthPointer.h>
14 #include <boot/uart.h>
15 
16 
17 #define _PACKED __attribute__((packed))
18 
19 #define MAX_VIRTUAL_RANGES_TO_KEEP      32
20 
21 
22 enum {
23 	kPlatformNone,
24 	kPlatformMNative,
25 	kPlatformSbi,
26 };
27 
28 
29 // kernel args
30 typedef struct {
31 	// Virtual address range of RAM physical memory mapping region
32 	addr_range physMap;
33 
34 	// The virtual ranges we want to keep in the kernel.
35 	uint32		num_virtual_ranges_to_keep;
36 	addr_range	virtual_ranges_to_keep[MAX_VIRTUAL_RANGES_TO_KEEP];
37 
38 	// MNative hooks, or SBI
39 	uint32 machine_platform;
40 
41 	uint64 timerFrequency; // in Hz
42 
43 	// All following address are virtual
44 	FixedWidthPointer<void> acpi_root;
45 	FixedWidthPointer<void> fdt;
46 
47 	addr_range	htif;
48 	addr_range	plic;
49 	addr_range	clint;
50 
51 	uart_info	uart;
52 
53 	uint32 hartIds[SMP_MAX_CPUS];
54 	uint32 plicContexts[SMP_MAX_CPUS];
55 } _PACKED arch_kernel_args;
56 
57 #endif	/* KERNEL_ARCH_RISCV64_KERNEL_ARGS_H */
58