Chinaunix首页 | 论坛 | 博客
  • 博客访问: 569041
  • 博文数量: 137
  • 博客积分: 4040
  • 博客等级: 上校
  • 技术积分: 1584
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-08 13:05
文章分类

全部博文(137)

文章存档

2011年(10)

2010年(23)

2009年(104)

分类: LINUX

2009-08-21 23:42:31

/*
 * linux/mm/page.s
 *
 * (C) 1991 Linus Torvalds
 */

/*
 * page.s contains the low-level page-exception code.
 * the real work is done in mm.c
 */

.globl _page_fault

_page_fault:
    xchgl %eax,(%esp)
    pushl %ecx
    pushl %edx
    push %ds
    push %es
    push %fs
    movl $0x10,%edx
    mov %dx,%ds
    mov %dx,%es
    mov %dx,%fs
    movl %cr2,%edx
    pushl %edx
    pushl %eax
    testl $1,%eax
    jne 1f
    call _do_no_page//调用缺页中断处理函数,error_code是有CPU自动产生的,mm/memory.c line 365
    jmp 2f
1:    call _do_wp_page//调用写保护处理函数,error_code是有CPU自动产生的,mm/memory.c line 247
2:    addl $8,%esp
    pop %fs
    pop %es
    pop %ds
    popl %edx
    popl %ecx
    popl %eax
    iret

阅读(744) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~