Use a direct address for P4 rather than a pointer

This commit is contained in:
2018-02-20 14:02:47 +01:00
parent 8711fee390
commit 36c517dd82
6 changed files with 97 additions and 87 deletions

View File

@@ -26,20 +26,24 @@
#ifndef __ASSEMBLER__
#include <stddef.h>
extern uint64_t kernel_P4;
void *memcpy(void *dst, const void *src, size_t n);
void *memset(void *s, int c, size_t n);
void *memmove(void *dest, const void *src, size_t n);
int memcmp(const void *s1, const void *s2, size_t n);
size_t strlen(const char *s);
void pmm_free(uintptr_t page);
uintptr_t pmm_alloc();
uintptr_t pmm_calloc();
void pmm_free(uint64_t page);
uint64_t pmm_alloc();
uint64_t pmm_calloc();
uintptr_t vmm_get_page(void *P4, uintptr_t addr);
int vmm_set_page(void *P4, uintptr_t addr, uintptr_t page, uint16_t flags);
int touch_page(void *P4, uintptr_t addr, uint16_t flags);
void free_page(void *P4, uintptr_t addr, int free);
uint64_t vmm_get_page(uint64_t P4, uint64_t addr);
#define PAGE_EXIST(p) ((p) != (uint64_t)-1)
int vmm_set_page(uint64_t P4, uint64_t addr, uint64_t page, uint16_t flags);
int touch_page(uint64_t P4, uint64_t addr, uint16_t flags);
void free_page(uint64_t P4, uint64_t addr, int free);
extern union PTE BootP4;
extern int kernel_start, kernel_end;