summaryrefslogtreecommitdiff
path: root/kernel/include/arch/i686/paging.h
blob: 3c0c335addcad5ebaa86ea52c7fa70f9f7f1b25f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include <stddef.h>

struct page_directory_t { // 32 bits
    unsigned int present       : 1;
    unsigned int rw_flag       : 1;
    unsigned int access_lvl    : 1; //0 is for only ring0. 1 is for anybody.
    unsigned int write_through : 1;
    unsigned int cache_off     : 1;
    unsigned int accessed      : 1;
    unsigned int zero          : 1;
    unsigned int page_size     : 1;
    unsigned int unused        : 4;
    unsigned int tbl_addr      : 20;
};

struct page_table_t {  // 32 bits
    unsigned int present       : 1;
    unsigned int rw_flag       : 1;
    unsigned int access_lvl    : 1; //0 is for only ring0. 1 is for anybody.
    unsigned int write_through : 1;
    unsigned int cache_off     : 1;
    unsigned int accessed      : 1;
    unsigned int dirty         : 1;
    unsigned int zero          : 1;
    unsigned int global        : 1;
    unsigned int reserved      : 3;
    unsigned int phys_addr     : 20;
};

extern void ident_map_addr(void *addr, size_t len);
extern void ident_unmap_addr(void *addr, size_t len);