]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/hibernate_i386.c
xnu-7195.60.75.tar.gz
[apple/xnu.git] / osfmk / i386 / hibernate_i386.c
index d88bb1897312998551dbac9b9ade126787a7444a..abfe74a22437eb62f8862b7c7898ccc60a3ce8cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2012 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2020 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
+/*!
+ * i386/x86_64-specific functions required to support hibernation entry, and also to
+ * support hibernation exit after wired pages have already been restored.
+ */
 
 #include <kern/machine.h>
 #include <kern/misc_protos.h>
@@ -41,6 +45,7 @@
 #include <pexpert/i386/efi.h>
 
 #include <IOKit/IOHibernatePrivate.h>
+#include <machine/pal_hibernate.h>
 #include <vm/vm_page.h>
 #include <i386/i386_lowmem.h>
 #include <san/kasan.h>
@@ -113,6 +118,7 @@ hibernate_page_list_allocate(boolean_t log)
                case kEfiACPIMemoryNVS:
                case kEfiPalCode:
                        non_os_pagecount += num;
+                       OS_FALLTHROUGH;
 
                // OS used dram
                case kEfiLoaderCode:
@@ -166,6 +172,7 @@ hibernate_page_list_allocate(boolean_t log)
        }
 
        if (num_banks >= MAX_BANKS) {
+               HIBLOG("%s error, num_banks exceed MAX_BANKS(0x%x)\n", __FUNCTION__, MAX_BANKS);
                return NULL;
        }
 
@@ -291,3 +298,8 @@ hibernate_vm_locks_are_safe(void)
        assert(FALSE == ml_get_interrupts_enabled());
        return hibernate_vm_locks_safe;
 }
+
+void
+pal_hib_write_hook(void)
+{
+}