toaruos/base/usr/include/kernel/task.h

26 lines
627 B
C
Raw Normal View History

2018-03-16 15:56:19 +03:00
#pragma once
2018-03-19 05:38:11 +03:00
#include <kernel/types.h>
2018-03-16 15:56:19 +03:00
typedef struct page {
unsigned int present:1;
unsigned int rw:1;
unsigned int user:1;
unsigned int writethrough:1;
unsigned int cachedisable:1;
unsigned int unused:7;
unsigned int frame:20;
} __attribute__((packed)) page_t;
typedef struct page_table {
page_t pages[1024];
} page_table_t;
typedef struct page_directory {
uintptr_t physical_tables[1024]; /* Physical addresses of the tables */
page_table_t *tables[1024]; /* 1024 pointers to page tables... */
uintptr_t physical_address; /* The physical address of physical_tables */
int32_t ref_count;
} page_directory_t;