From 543938a49ac8b56df52d4e233d8254debcedcd7c Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 2 Dec 2020 00:11:28 +0500 Subject: [PATCH] Move code --- kernelmq/page_dir.h | 27 --------------------------- kernelmq/paging.c | 1 - kernelmq/paging.h | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 kernelmq/page_dir.h diff --git a/kernelmq/page_dir.h b/kernelmq/page_dir.h deleted file mode 100644 index 2268835..0000000 --- a/kernelmq/page_dir.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef KERNELMQ_INCLUDED_PAGE_DIR -#define KERNELMQ_INCLUDED_PAGE_DIR 1 - -#include "config.h" - -#define PAGE_DIR_ALIGN 4096 - -#define PAGE_DIR_ADDR(base) ((base) >> 12) - -struct PageDir_Entry { - unsigned int present : 1; - unsigned int writable : 1; - unsigned int user : 1; - unsigned int write_through : 1; - unsigned int cache_disabled : 1; - unsigned int accessed : 1; - unsigned int always_0 : 1; - unsigned int page_size : 1; - unsigned int ignored : 1; - unsigned int unused : 3; - unsigned int addr : 20; -} -__attribute__((packed)); - -typedef struct PageDir_Entry PageDir[PAGE_DIR_LENGTH] __attribute__((aligned((PAGE_DIR_ALIGN)))); - -#endif diff --git a/kernelmq/paging.c b/kernelmq/paging.c index b573cdd..d00b481 100644 --- a/kernelmq/paging.c +++ b/kernelmq/paging.c @@ -1,6 +1,5 @@ #include "paging.h" -#include "page_dir.h" #include "panic.h" #include diff --git a/kernelmq/paging.h b/kernelmq/paging.h index e06fb64..1d2e23f 100644 --- a/kernelmq/paging.h +++ b/kernelmq/paging.h @@ -1,8 +1,30 @@ #ifndef KERNELMQ_INCLUDED_PAGING #define KERNELMQ_INCLUDED_PAGING 1 +#include "config.h" #include "info.h" +#define PAGE_DIR_ALIGN 4096 + +#define PAGE_DIR_ADDR(base) ((base) >> 12) + +struct PageDir_Entry { + unsigned int present : 1; + unsigned int writable : 1; + unsigned int user : 1; + unsigned int write_through : 1; + unsigned int cache_disabled : 1; + unsigned int accessed : 1; + unsigned int always_0 : 1; + unsigned int page_size : 1; + unsigned int ignored : 1; + unsigned int unused : 3; + unsigned int addr : 20; +} +__attribute__((packed)); + +typedef struct PageDir_Entry PageDir[PAGE_DIR_LENGTH] __attribute__((aligned((PAGE_DIR_ALIGN)))); + void paging_enable(); void paging_clear();