xref: /haiku/headers/private/kernel/arch/riscv64/arch_kernel_args.h (revision 3d4afef9cba2f328e238089d4609d00d4b1524f3)
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 	uint bootHart;
42 	uint64 timerFrequency; // in Hz
43 
44 	// All following address are virtual
45 	FixedWidthPointer<void> acpi_root;
46 	FixedWidthPointer<void> fdt;
47 
48 	addr_range	htif;
49 	addr_range	plic;
50 	addr_range	clint;
51 
52 	uart_info	uart;
53 } _PACKED arch_kernel_args;
54 
55 #endif	/* KERNEL_ARCH_RISCV64_KERNEL_ARGS_H */
56