haiku/headers/private/kernel/arch/riscv64/arch_kernel_args.h
X512 8ca0f03d0c riscv64/smp: Implement multi-processor support
* Working under qemu smp 1,2+
* Working on SiFive Unmatched
* x86_64 efi not broken by smp_boot_other_cpus change

Change-Id: I32ebc17913e46ed082be9ade8f56448bbf12f16e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4705
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-12-12 15:35:24 +00:00

58 lines
1.2 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>
#include <boot/uart.h>
#define _PACKED __attribute__((packed))
#define MAX_VIRTUAL_RANGES_TO_KEEP 32
enum {
kPlatformNone,
kPlatformMNative,
kPlatformSbi,
};
// 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];
// MNative hooks, or SBI
uint32 machine_platform;
uint64 timerFrequency; // in Hz
// All following address are virtual
FixedWidthPointer<void> acpi_root;
FixedWidthPointer<void> fdt;
addr_range htif;
addr_range plic;
addr_range clint;
uart_info uart;
uint32 hartIds[SMP_MAX_CPUS];
uint32 plicContexts[SMP_MAX_CPUS];
} _PACKED arch_kernel_args;
#endif /* KERNEL_ARCH_RISCV64_KERNEL_ARGS_H */