]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/kern_core.c
xnu-201.5.tar.gz
[apple/xnu.git] / bsd / kern / kern_core.c
index 7776eb45df2371354ac3b9a062b8273d320efb8b..144331f7d14b30e1ee2b19a2b3f974449408ad2f 100644 (file)
@@ -51,6 +51,7 @@
 
 #include <mach-o/loader.h>
 #include <mach/vm_region.h>
+#include <mach/vm_statistics.h>
 
 #include <vm/vm_kern.h>
 
@@ -185,7 +186,8 @@ coredump(p)
         *      into core file.
         */
 #if defined (__ppc__)
-       fpu_save();
+       fpu_save(current_act());
+       vec_save(current_act());
 #endif
        sprintf(core_name, "/cores/core.%d", p->p_pid);
        NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, core_name, p);
@@ -316,7 +318,7 @@ coredump(p)
                 *      Note: if we can't read, then we end up with
                 *      a hole in the file.
                 */
-               if ((maxprot & VM_PROT_READ) == VM_PROT_READ) {
+               if ((maxprot & VM_PROT_READ) == VM_PROT_READ && vbr.user_tag != VM_MEMORY_IOKIT) {
                        error = vn_rdwr(UIO_WRITE, vp, (caddr_t)vmoffset, size, foffset,
                                UIO_USERSPACE, IO_NODELOCKED|IO_UNIT, cred, (int *) 0, p);
                }