mirror of
https://github.com/tailix/libkernaux.git
synced 2024-11-13 11:04:27 -05:00
Add enum KernAux_Multiboot2_HTag_RelocatableHeader_Preference
This commit is contained in:
parent
df4f518f77
commit
5a7a745c22
2 changed files with 24 additions and 6 deletions
|
@ -35,6 +35,12 @@ extern "C" {
|
|||
#define KERNAUX_MULTIBOOT2_HTAG_FLAGS_REQUIRE_CONSOLE (1 << 0)
|
||||
#define KERNAUX_MULTIBOOT2_HTAG_FLAGS_EGA_SUPPORT (1 << 1)
|
||||
|
||||
enum KernAux_Multiboot2_HTag_RelocatableHeader_Preference {
|
||||
KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER_PREFERENCE_NONE = 0,
|
||||
KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER_PREFERENCE_LOWEST = 1,
|
||||
KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER_PREFERENCE_HIGHEST = 2,
|
||||
};
|
||||
|
||||
/****************
|
||||
* Common types *
|
||||
****************/
|
||||
|
@ -214,10 +220,10 @@ struct KernAux_Multiboot2_HTag_RelocatableHeader {
|
|||
// size = 24
|
||||
struct KernAux_Multiboot2_HTagBase base;
|
||||
|
||||
unsigned min_addr : 32;
|
||||
unsigned max_addr : 32;
|
||||
unsigned align : 32;
|
||||
unsigned preferences : 32;
|
||||
unsigned min_addr : 32;
|
||||
unsigned max_addr : 32;
|
||||
unsigned align : 32;
|
||||
enum KernAux_Multiboot2_HTag_RelocatableHeader_Preference preferences : 32;
|
||||
}
|
||||
__attribute__((packed));
|
||||
|
||||
|
|
|
@ -238,10 +238,22 @@ bool KernAux_Multiboot2_HTag_EFIAmd64EntryAddr_is_valid(
|
|||
bool KernAux_Multiboot2_HTag_RelocatableHeader_is_valid(
|
||||
const struct KernAux_Multiboot2_HTag_RelocatableHeader *tag
|
||||
) {
|
||||
return (
|
||||
if (!(
|
||||
tag->base.type == KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER &&
|
||||
tag->base.size == 24 &&
|
||||
// TODO: write this
|
||||
true
|
||||
);
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (tag->preferences) {
|
||||
case KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER_PREFERENCE_NONE: break;
|
||||
case KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER_PREFERENCE_LOWEST: break;
|
||||
case KERNAUX_MULTIBOOT2_HTAG_RELOCATABLE_HEADER_PREFERENCE_HIGHEST: break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue