Skip to content

Commit

Permalink
Kernel/EFI: Add header for the RISC-V EFI boot protocol
Browse files Browse the repository at this point in the history
These definitions are adapted from the UEFI spec to match our code
style.
  • Loading branch information
spholz committed Nov 12, 2024
1 parent 577056d commit 54ace82
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Kernel/Firmware/EFI/Protocols/RISCVBootProtocol.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024, Sönke Holz <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/

#pragma once

#include <Kernel/Firmware/EFI/EFI.h>

namespace Kernel::EFI {

// RISCV_EFI_BOOT_PROTOCOL: https://github.com/riscv-non-isa/riscv-uefi/releases/download/1.0.0/RISCV_UEFI_PROTOCOL-spec.pdf
struct RISCVBootProtocol {
static constexpr GUID guid = { 0xccd15fec, 0x6f73, 0x4eec, { 0x83, 0x95, 0x3e, 0x69, 0xe4, 0xb9, 0x40, 0xbf } };

using GetBootHartIDFn = EFIAPI Status (*)(RISCVBootProtocol*, FlatPtr* boot_hart_id);

u64 revision;
GetBootHartIDFn get_boot_hart_id;
};
static_assert(AssertSize<RISCVBootProtocol, 16>());

}

0 comments on commit 54ace82

Please sign in to comment.