31,6 → 31,11 |
* @{ |
*/ |
/** @file |
* @brief Memory management used while booting the kernel. |
* |
* So called "section" paging is used while booting the kernel. The term "section" |
* comes from the ARM architecture specification and stands for the following: |
* one-level paging, 1MB sized pages, 4096 entries in the page table. |
*/ |
|
|
44,17 → 49,19 |
|
|
/** Frame width. */ |
#define FRAME_WIDTH 20 /* 4KB frames */ |
#define FRAME_WIDTH 20 |
|
/** Frame size. */ |
#define FRAME_SIZE (1 << FRAME_WIDTH) |
|
/** Page size in 2-level paging which is switched on later in the kernel initialization. */ |
#define PAGE_SIZE (1 << 12) |
/** Page size in 2-level paging which is switched on later after the kernel initialization. */ |
#define KERNEL_PAGE_SIZE (1 << 12) |
|
|
#ifndef __ASM__ |
/** Converts kernel address to physical address. */ |
# define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) |
/** Converts physical address to kernel address. */ |
# define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) |
#else |
# define KA2PA(x) ((x) - 0x80000000) |
82,7 → 89,8 |
|
|
/** Page table level 0 entry - "section" format is used (one-level paging, 1MB sized |
* pages). Used only while booting the kernel. */ |
* pages). Used only while booting the kernel. |
*/ |
typedef struct { |
unsigned descriptor_type : 2; |
unsigned bufferable : 1; |