]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ppc/trap.c
xnu-792.22.5.tar.gz
[apple/xnu.git] / osfmk / ppc / trap.c
index 1182e0e0e42cf0d6106e971deb536d4a29f7d00a..1b992c852e562db0fb14a354ca46d8359e665d7b 100644 (file)
@@ -88,6 +88,7 @@ extern int not_in_kdp;
 #define PROT_RO                (VM_PROT_READ)
 #define PROT_RW                (VM_PROT_READ|VM_PROT_WRITE)
 
 #define PROT_RO                (VM_PROT_READ)
 #define PROT_RW                (VM_PROT_READ|VM_PROT_WRITE)
 
+
 /* A useful macro to update the ppc_exception_state in the PCB
  * before calling doexception
  */
 /* A useful macro to update the ppc_exception_state in the PCB
  * before calling doexception
  */
@@ -134,11 +135,11 @@ struct savearea *trap(int trapno,
 
        myast = ast_pending();
        if(perfASTHook) {
 
        myast = ast_pending();
        if(perfASTHook) {
-               if(*myast & AST_PPC_CHUD_ALL) {
+               if(*myast & AST_CHUD_ALL) {
                        perfASTHook(trapno, ssp, dsisr, (unsigned int)dar);
                }
        } else {
                        perfASTHook(trapno, ssp, dsisr, (unsigned int)dar);
                }
        } else {
-               *myast &= ~AST_PPC_CHUD_ALL;
+               *myast &= ~AST_CHUD_ALL;
        }
 
        if(perfTrapHook) {                                                      /* Is there a hook? */
        }
 
        if(perfTrapHook) {                                                      /* Is there a hook? */
@@ -375,7 +376,7 @@ struct savearea *trap(int trapno,
                        map = kernel_map;
                        
                        code = vm_fault(map, vm_map_trunc_page(ssp->save_srr0),
                        map = kernel_map;
                        
                        code = vm_fault(map, vm_map_trunc_page(ssp->save_srr0),
-                                       PROT_EXEC, FALSE, THREAD_UNINT, NULL, vm_map_trunc_page(0));
+                                       (PROT_EXEC | PROT_RO), FALSE, THREAD_UNINT, NULL, vm_map_trunc_page(0));
 
                        if (code != KERN_SUCCESS) {
                                unresolved_kernel_trap(trapno, ssp, dsisr, dar, NULL);
 
                        if (code != KERN_SUCCESS) {
                                unresolved_kernel_trap(trapno, ssp, dsisr, dar, NULL);
@@ -604,7 +605,7 @@ struct savearea *trap(int trapno,
                        map = thread->map;
                        
                        code = vm_fault(map, vm_map_trunc_page(ssp->save_srr0),
                        map = thread->map;
                        
                        code = vm_fault(map, vm_map_trunc_page(ssp->save_srr0),
-                               PROT_EXEC, FALSE, THREAD_ABORTSAFE, NULL, vm_map_trunc_page(0));
+                                       (PROT_EXEC | PROT_RO), FALSE, THREAD_ABORTSAFE, NULL, vm_map_trunc_page(0));
 
                        if ((code != KERN_SUCCESS) && (code != KERN_ABORTED)) {
                                UPDATE_PPC_EXCEPTION_STATE;
 
                        if ((code != KERN_SUCCESS) && (code != KERN_ABORTED)) {
                                UPDATE_PPC_EXCEPTION_STATE;