-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27fe7b4
commit d74411b
Showing
5 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "configuration_table.h" | ||
#include "boot_service_provider.h" | ||
#include "system_table.h" | ||
#include <string.h> | ||
|
||
void setup_configuration_table(EfiSystemTable *table) { | ||
auto &rng = table->configuration_table[0]; | ||
rng.vendor_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID; | ||
rng.vendor_table = alloc_page(PAGE_SIZE); | ||
auto rng_seed = reinterpret_cast<linux_efi_random_seed *>(rng.vendor_table); | ||
rng_seed->size = 512; | ||
memset(&rng_seed->bits, 0, rng_seed->size); | ||
table->number_of_table_entries = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef __CONFIGURATION_TABLE_ | ||
#define __CONFIGURATION_TABLE_ | ||
|
||
#include "system_table.h" | ||
#include "types.h" | ||
|
||
struct linux_efi_random_seed { | ||
uint32_t size; | ||
uint8_t bits[]; | ||
}; | ||
|
||
static constexpr auto LINUX_EFI_RANDOM_SEED_TABLE_GUID = | ||
EfiGuid{0x1ce1e5bc, | ||
0x7ceb, | ||
0x42f2, | ||
{0x81, 0xe5, 0x8a, 0xad, 0xf1, 0x80, 0xf5, 0x7b}}; | ||
|
||
void setup_configuration_table(EfiSystemTable *table); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters