kern
view src/vm-asm.S @ 17:098b1cb5eeaa
forgot to add a shitload of files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 26 Mar 2011 21:39:14 +0200 |
parents | |
children | 5454cee245a3 |
line source
1 .text
2 /* enable_paging(void)
3 * sets the cr0 bit 31 which enables page translation */
4 .globl enable_paging
5 enable_paging:
6 movl %cr0, %eax
7 orl $0x80000000, %eax
8 movl %eax, %cr0
9 ret
11 /* set_pgdir_addr(uint32_t addr)
12 * sets the address of the page directory by writing to cr3, which
13 * also results in a TLB flush. */
14 .globl set_pgdir_addr
15 set_pgdir_addr:
16 movl 4(%esp), %eax
17 movl %eax, %cr3
18 ret
20 /* get_fault_addr(void)
21 * returns the contents of control register 2, which provides
22 * the faulting address during a page fault exception
23 */
24 .globl get_fault_addr
25 get_fault_addr:
26 movl %cr2, %eax
27 ret