haiku/headers/private/kernel/arch/riscv64/arch_kernel_args.h
X512 b87ec78210 kernel: update arch headers for riscv64
Change-Id: Iaf1c253745412614f7e4a30019d96483cb0d3a12
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4310
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-08-06 17:26:04 +00:00

77 lines
1.4 KiB
C

/*
** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_ARCH_RISCV64_KERNEL_ARGS_H
#define KERNEL_ARCH_RISCV64_KERNEL_ARGS_H
#ifndef KERNEL_BOOT_KERNEL_ARGS_H
# error This file is included from <boot/kernel_args.h> only
#endif
#include <util/FixedWidthPointer.h>
#define _PACKED __attribute__((packed))
#define MAX_VIRTUAL_RANGES_TO_KEEP 32
enum {
kPlatform1None,
kPlatform1Riscv,
kPlatform1Sbi,
};
enum {
kPlatform2None,
kPlatform2Riscv,
kPlatform2Efi,
kPlatform2UBoot,
};
enum {
kUartKindNone,
kUartKind8250,
kUartKindSifive,
kUartKindPl011,
};
typedef struct {
uint32 kind;
addr_range regs;
uint32 irq;
int64 clock;
} _PACKED ArchUart;
// kernel args
typedef struct {
// Virtual address range of RAM physical memory mapping region
addr_range physMap;
// The virtual ranges we want to keep in the kernel.
uint32 num_virtual_ranges_to_keep;
addr_range virtual_ranges_to_keep[MAX_VIRTUAL_RANGES_TO_KEEP];
uint32 platform1;
uint32 platform2;
uint bootHart;
uint64 timerFrequrency; // in Hz
// All following address are virtual
FixedWidthPointer<void> acpi_root;
FixedWidthPointer<void> fdt;
addr_range htif;
addr_range plic;
addr_range clint;
ArchUart uart;
} _PACKED arch_kernel_args;
#endif /* KERNEL_ARCH_RISCV64_KERNEL_ARGS_H */