27 |
#include "vm-kmem.h" |
#include "vm-kmem.h" |
28 |
#include "trace.h" |
#include "trace.h" |
29 |
#include "bootstrap.h" |
#include "bootstrap.h" |
30 |
|
#include "host.h" |
31 |
|
|
32 |
#include "i386-pmap.h" |
#include "i386-pmap.h" |
33 |
#include "i386-regs.h" |
#include "i386-regs.h" |
86 |
static inline int convert_real_prot (vm_prot_t prot) |
static inline int convert_real_prot (vm_prot_t prot) |
87 |
{ |
{ |
88 |
#define VM_PROT_RW (VM_PROT_READ | VM_PROT_WRITE) |
#define VM_PROT_RW (VM_PROT_READ | VM_PROT_WRITE) |
89 |
|
#define VM_PROT_RE (VM_PROT_READ | VM_PROT_EXEC) |
90 |
|
#define VM_PROT_WE (VM_PROT_WRITE | VM_PROT_EXEC) |
91 |
|
|
92 |
return |
return |
93 |
prot == VM_PROT_ALL ? (PTE_VALID|PTE_WRITE|PTE_USER) |
prot == VM_PROT_ALL ? (PTE_VALID|PTE_WRITE|PTE_USER) |
94 |
: prot == VM_PROT_RW ? (PTE_VALID|PTE_WRITE|PTE_USER) |
: prot == VM_PROT_RW ? (PTE_VALID|PTE_WRITE|PTE_USER) |
95 |
: prot == VM_PROT_READ ? (PTE_VALID|PTE_USER) |
: prot == VM_PROT_READ ? (PTE_VALID|PTE_USER) |
96 |
: prot == VM_PROT_WRITE ? (PTE_VALID|PTE_WRITE|PTE_USER) |
: prot == VM_PROT_WRITE ? (PTE_VALID|PTE_WRITE|PTE_USER) |
97 |
: prot == VM_PROT_EXEC ? (PTE_VALID|PTE_USER) : 0; |
: prot == VM_PROT_EXEC ? (PTE_VALID|PTE_USER) |
98 |
|
: prot == VM_PROT_RE ? (PTE_VALID|PTE_USER) |
99 |
|
: prot == VM_PROT_WE ? (PTE_VALID|PTE_WRITE|PTE_USER) : 0; |
100 |
} |
} |
101 |
|
|
102 |
/* Flush local TLB cache. */ |
/* Flush local TLB cache. */ |
176 |
vm_page_load (0x1000, vm_trunc_page (((vm_size_t) cpu_multiboot_ptr->mem_lower * 1024)), |
vm_page_load (0x1000, vm_trunc_page (((vm_size_t) cpu_multiboot_ptr->mem_lower * 1024)), |
177 |
0x1000, vm_trunc_page (((vm_size_t) cpu_multiboot_ptr->mem_lower * 1024))); |
0x1000, vm_trunc_page (((vm_size_t) cpu_multiboot_ptr->mem_lower * 1024))); |
178 |
|
|
179 |
|
/* Store info for host basic info. */ |
180 |
|
host_info_basic.physical_memory |
181 |
|
= (vm_size_t) cpu_multiboot_ptr->mem_upper * 1024; |
182 |
|
|
183 |
/* Add upper physical memory (excluding modules) */ |
/* Add upper physical memory (excluding modules) */ |
184 |
memory_top = ((vm_size_t) cpu_multiboot_ptr->mem_upper) * 1024; |
memory_top = ((vm_size_t) cpu_multiboot_ptr->mem_upper) * 1024; |
185 |
for (i = 0, memory_start = vm_round_page (kernel_end); i < bootstrap_count; i++) |
for (i = 0, memory_start = vm_round_page (kernel_end); i < bootstrap_count; i++) |