feat: small code optimisations

This commit is contained in:
2022-05-14 16:59:04 +02:00
parent 6d898c07e8
commit e850dabc8b
6 changed files with 13 additions and 17 deletions

View File

@@ -2,7 +2,6 @@
// Created by rick on 22-04-20.
//
#include <attributes.h>
#include <stdio.h>
#include <sys/types.h>
@@ -22,10 +21,10 @@
#define MMAP_TYPE_PAGING 7
typedef struct {
uint32_t address;
uintptr_t address;
uint32_t length;
uint32_t type;
} att_packed mmap_entry;
} mmap_entry;
int last_memmap_entry = 0;
mmap_entry memmap[MEMMAP_ENTRIES] = {
@@ -49,7 +48,7 @@ mmap_entry memmap[MEMMAP_ENTRIES] = {
void use_mmap_entry(struct multiboot_mmap_entry *entry) {
mmap_entry *mm_entry = &memmap[last_memmap_entry++];
mm_entry->address = (void *) entry->addr;
mm_entry->address = (uintptr_t) entry->addr;
mm_entry->length = entry->len;
mm_entry->type = entry->type;
// check if the entry overlaps with the kernel address space