aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/include/arch/memory/multiboot.hpp41
1 files changed, 3 insertions, 38 deletions
diff --git a/arch/x86_64/include/arch/memory/multiboot.hpp b/arch/x86_64/include/arch/memory/multiboot.hpp
index baad25b..a2d6e9d 100644
--- a/arch/x86_64/include/arch/memory/multiboot.hpp
+++ b/arch/x86_64/include/arch/memory/multiboot.hpp
@@ -53,13 +53,12 @@ namespace teachos::arch::memory
struct multi_boot_info
{
uint32_t total_size;
- uint32_t reserved;
/*
* field "tags" is an array of multi_boot_tag, however the array is never
* being accessed by index we don't know the real size at compile-time,
* and using an array definition with size 0 produces a compiler error.
*/
- struct multi_boot_tag tags;
+ alignas(8) struct multi_boot_tag tags;
};
enum class memory_area_type : uint32_t
@@ -75,8 +74,7 @@ namespace teachos::arch::memory
{
uint64_t base_addr;
uint64_t length;
- memory_area_type type;
- uint32_t reserved;
+ alignas(8) memory_area_type type;
};
struct memory_map
@@ -92,8 +90,6 @@ namespace teachos::arch::memory
struct memory_area entries;
};
-#define EI_NIDENT 16
-
/* ELF standard typedefs (yet more proof that <stdint.h> was way overdue) */
typedef uint16_t Elf64_Half;
typedef int16_t Elf64_SHalf;
@@ -106,36 +102,6 @@ namespace teachos::arch::memory
typedef uint64_t Elf64_Addr;
typedef uint16_t Elf64_Section;
- struct executable_header
- {
- unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
- Elf64_Half e_type; /* Object file type */
- Elf64_Half e_machine; /* Architecture */
- Elf64_Word e_version; /* Object file version */
- Elf64_Addr e_entry; /* Entry point virtual address */
- Elf64_Off e_phoff; /* Program header table file offset */
- Elf64_Off e_shoff; /* Section header table file offset */
- Elf64_Word e_flags; /* Processor-specific flags */
- Elf64_Half e_ehsize; /* ELF header size in bytes */
- Elf64_Half e_phentsize; /* Program header table entry size */
- Elf64_Half e_phnum; /* Program header table entry count */
- Elf64_Half e_shentsize; /* Section header table entry size */
- Elf64_Half e_shnum; /* Section header table entry count */
- Elf64_Half e_shstrndx; /* Section header string table index */
- };
-
- struct program_header
- {
- Elf64_Word p_type; /* Segment type */
- Elf64_Word p_flags; /* Segment flags */
- Elf64_Off p_offset; /* Segment file offset */
- Elf64_Addr p_vaddr; /* Segment virtual address */
- Elf64_Addr p_paddr; /* Segment physical address */
- Elf64_Xword p_filesz; /* Segment size in file */
- Elf64_Xword p_memsz; /* Segment size in memory */
- Elf64_Xword p_align; /* Segment alignment */
- };
-
struct elf_section_header
{
Elf64_Word sh_name; /* Section name (string tbl index) */
@@ -166,8 +132,7 @@ namespace teachos::arch::memory
uint16_t num;
uint16_t entsize;
uint16_t shndx;
- uint16_t reserved;
- struct elf_section_header sections;
+ alignas(8) struct elf_section_header sections;
};
} // namespace teachos::arch::memory