����13-2 linux/mm/page.s


  1 /*

  2  *  linux/mm/page.s

  3  *

  4  *  (C) 1991  Linus Torvalds

  5  */

  6

  7 /*

  8  * page.s contains the low-level page-exception code.

  9  * the real work is done in mm.c

 10  */

    /*

     * page.s��������ײ�ҳ�쳣�������롣ʵ�ʹ�����memory.c����ɡ�

     */

 11

 12 .globl _page_fault           # ����Ϊȫ�ֱ���������traps.c����������ҳ�쳣��������

 13

 14 _page_fault:

 15         xchgl %eax,(%esp)    # ȡ�����뵽eax��

 16         pushl %ecx

 17         pushl %edx

 18         push %ds

 19         push %es

 20         push %fs

 21         movl $0x10,%edx      # ���ں����ݶ�ѡ�����

 22         mov %dx,%ds

 23         mov %dx,%es

 24         mov %dx,%fs

 25         movl %cr2,%edx       # ȡ����ҳ���쳣�����Ե�ַ��

 26         pushl %edx           # �������Ե�ַ�ͳ�����ѹ��ջ�У���Ϊ�����ú����IJ�����

 27         pushl %eax

 28         testl $1,%eax        # ����ҳ���ڱ�־P��λ0�����������ȱҳ������쳣����ת��

 29         jne 1f

 30         call _do_no_page     # ����ȱҳ����������mm/memory.c,365�У���

 31         jmp 2f

 32 1:      call _do_wp_page     # ����д��������������mm/memory.c,247�У���

 33 2:      addl $8,%esp         # ����ѹ��ջ����������������ջ�мĴ������˳��жϡ�

 34         pop %fs

 35         pop %es

 36         pop %ds

 37         popl %edx

 38         popl %ecx

 39         popl %eax

 40         iret