Move PF_* from exception.c to exception.h, because some students may
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 4 Jan 2006 18:56:16 +0000 (18:56 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 4 Jan 2006 18:56:16 +0000 (18:56 +0000)
wish to pass them around.
Suggested by Godmar Back.

src/userprog/exception.c
src/userprog/exception.h

index 47bfbc278878595b1cf0fa15d73d374057a994d7..985cd175a1b9b9267b78c4f787219a7843acea2f 100644 (file)
@@ -114,7 +114,7 @@ kill (struct intr_frame *f)
 
    At entry, the address that faulted is in CR2 (Control Register
    2) and information about the fault, formatted as described in
 
    At entry, the address that faulted is in CR2 (Control Register
    2) and information about the fault, formatted as described in
-   the PF_* macros above, is in F's error_code member.  The
+   the PF_* macros in exception.h, is in F's error_code member.  The
    example code here shows how to parse that information.  You
    can find more information about both of these in the
    description of "Interrupt 14--Page Fault Exception (#PF)" in
    example code here shows how to parse that information.  You
    can find more information about both of these in the
    description of "Interrupt 14--Page Fault Exception (#PF)" in
index f1a1537b99edbfa05b93d21afb3ba2d5f3623dc8..f83e615bb1e010c8723510a99abb01d714c0f275 100644 (file)
@@ -1,6 +1,11 @@
 #ifndef USERPROG_EXCEPTION_H
 #define USERPROG_EXCEPTION_H
 
 #ifndef USERPROG_EXCEPTION_H
 #define USERPROG_EXCEPTION_H
 
+/* Page fault error code bits that describe the cause of the exception.  */
+#define PF_P 0x1    /* 0: not-present page. 1: access rights violation. */
+#define PF_W 0x2    /* 0: read, 1: write. */
+#define PF_U 0x4    /* 0: kernel, 1: user process. */
+
 void exception_init (void);
 void exception_print_stats (void);
 
 void exception_init (void);
 void exception_print_stats (void);