kern

annotate src/vm-asm.S @ 20:369adbbd4bdd

added a few comments in mem.c
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 30 Mar 2011 23:14:29 +0300
parents
children 5454cee245a3
rev   line source
nuclear@17 1 .text
nuclear@17 2 /* enable_paging(void)
nuclear@17 3 * sets the cr0 bit 31 which enables page translation */
nuclear@17 4 .globl enable_paging
nuclear@17 5 enable_paging:
nuclear@17 6 movl %cr0, %eax
nuclear@17 7 orl $0x80000000, %eax
nuclear@17 8 movl %eax, %cr0
nuclear@17 9 ret
nuclear@17 10
nuclear@17 11 /* set_pgdir_addr(uint32_t addr)
nuclear@17 12 * sets the address of the page directory by writing to cr3, which
nuclear@17 13 * also results in a TLB flush. */
nuclear@17 14 .globl set_pgdir_addr
nuclear@17 15 set_pgdir_addr:
nuclear@17 16 movl 4(%esp), %eax
nuclear@17 17 movl %eax, %cr3
nuclear@17 18 ret
nuclear@17 19
nuclear@17 20 /* get_fault_addr(void)
nuclear@17 21 * returns the contents of control register 2, which provides
nuclear@17 22 * the faulting address during a page fault exception
nuclear@17 23 */
nuclear@17 24 .globl get_fault_addr
nuclear@17 25 get_fault_addr:
nuclear@17 26 movl %cr2, %eax
nuclear@17 27 ret