Skip to content

Commit

Permalink
mem: PDE/PTEの構造体宣言をヘッダーファイルへ移動
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuma Arakawa committed Dec 21, 2015
1 parent 3e8b196 commit a2b3585
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
21 changes: 21 additions & 0 deletions kernel/include/memory.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
#ifndef __MEMORY_H__
#define __MEMORY_H__

struct page_directory_entry {
union {
struct {
unsigned int all;
};
struct {
unsigned int p: 1, r_w: 1, u_s: 1, pwt: 1, pcd: 1, a: 1, reserved: 1, ps: 1, g: 1, usable: 3, pt_base: 20;
};
};
};
struct page_table_entry {
union {
struct {
unsigned int all;
};
struct {
unsigned int p: 1, r_w: 1, u_s: 1, pwt: 1, pcd: 1, a: 1, d: 1, pat: 1, g: 1, usable: 3, page_base: 20;
};
};
};

void mem_init(void);
void mem_page_start(void);

Expand Down
22 changes: 2 additions & 20 deletions kernel/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,8 @@

void mem_init(void)
{
struct page_directory_entry {
union {
struct {
unsigned int all;
};
struct {
unsigned int p: 1, r_w: 1, u_s: 1, pwt: 1, pcd: 1, a: 1, reserved: 1, ps: 1, g: 1, usable: 3, pt_base: 20;
};
};
} *pde;
struct page_table_entry {
union {
struct {
unsigned int all;
};
struct {
unsigned int p: 1, r_w: 1, u_s: 1, pwt: 1, pcd: 1, a: 1, d: 1, pat: 1, g: 1, usable: 3, page_base: 20;
};
};
} *pte;
struct page_directory_entry *pde;
struct page_table_entry *pte;
unsigned int paging_base_addr;
unsigned int i;
unsigned int cr4;
Expand Down

0 comments on commit a2b3585

Please sign in to comment.