Files
haiku-beta6/src/system/kernel/arch/x86/arch_platform.cpp
T
Jérôme Duval 6ce67a5336 smbios: support getting address from EFI
* prefer v3 over v2
* adding efi attributes in gBootVolume KMessage is a bit of a hack, but
shouldn't hurt older kernels.

Change-Id: If5ea19dafa5a845872eb8d577e77a6935539ce20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9685
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-15 06:52:57 +00:00

64 lines
1.4 KiB
C++

/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold <[email protected]>
* Axel Dörfler, [email protected]
*/
#include <arch/platform.h>
#include <apm.h>
#include <boot_item.h>
#include <boot/stage2.h>
static phys_addr_t sACPIRootPointer = 0;
static phys_addr_t sSMBIOSv2RootPointer = 0;
static phys_addr_t sSMBIOSv3RootPointer = 0;
status_t
arch_platform_init(struct kernel_args *args)
{
return B_OK;
}
status_t
arch_platform_init_post_vm(struct kernel_args *args)
{
// Now we can add boot items; pass on the ACPI root pointer
sACPIRootPointer = args->arch_args.acpi_root.Get();
add_boot_item("ACPI_ROOT_POINTER",
&sACPIRootPointer, sizeof(sACPIRootPointer));
KMessage bootVolume;
bootVolume.SetTo(args->boot_volume, args->boot_volume_size);
sSMBIOSv2RootPointer = bootVolume.GetInt64(BOOT_EFI_SMBIOS_V2_ROOT, 0);
if (sSMBIOSv2RootPointer != 0) {
add_boot_item("SMBIOSv2_ROOT_POINTER",
&sSMBIOSv2RootPointer, sizeof(sSMBIOSv2RootPointer));
}
sSMBIOSv3RootPointer = bootVolume.GetInt64(BOOT_EFI_SMBIOS_V3_ROOT, 0);
if (sSMBIOSv3RootPointer != 0) {
add_boot_item("SMBIOSv3_ROOT_POINTER",
&sSMBIOSv3RootPointer, sizeof(sSMBIOSv3RootPointer));
}
return B_OK;
}
status_t
arch_platform_init_post_thread(struct kernel_args *args)
{
// APM is not supported on x86_64.
#ifndef __x86_64__
apm_init(args);
#endif
return B_OK;
}