[all] Add stub for new Endpoint kernel object

This commit is contained in:
Drew Galbraith 2023-06-21 21:26:24 -07:00
parent 1f7a15eed4
commit 69501bfe01
15 changed files with 144 additions and 38 deletions

View file

@ -49,8 +49,9 @@ struct PartitionEntry {
GptReader::GptReader(const DenaliClient& client) : denali_(client) {}
z_err_t GptReader::ParsePartitionTables() {
MappedMemoryRegion lba_1_and_2 = denali_.ReadSectors(0, 0, 2);
glcr::ErrorCode GptReader::ParsePartitionTables() {
ASSIGN_OR_RETURN(MappedMemoryRegion lba_1_and_2,
denali_.ReadSectors(0, 0, 2));
uint16_t* mbr_sig = reinterpret_cast<uint16_t*>(lba_1_and_2.vaddr() + 0x1FE);
if (*mbr_sig != 0xAA55) {
return glcr::FAILED_PRECONDITION;
@ -83,8 +84,9 @@ z_err_t GptReader::ParsePartitionTables() {
dbgln("partition_entry_size: %x", entry_size);
dbgln("Num blocks: %x", num_blocks);
MappedMemoryRegion part_table =
denali_.ReadSectors(0, header->lba_partition_entries, num_blocks);
ASSIGN_OR_RETURN(
MappedMemoryRegion part_table,
denali_.ReadSectors(0, header->lba_partition_entries, num_blocks));
dbgln("Entries");
for (uint64_t i = 0; i < num_partitions; i++) {
PartitionEntry* entry = reinterpret_cast<PartitionEntry*>(