]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/page_decrypt.h
xnu-3789.1.32.tar.gz
[apple/xnu.git] / osfmk / kern / page_decrypt.h
index 2f896f313d31590135833f699f7432ede894bcf7..3860f9b39b64681ffc9d0b35298095ac12974153 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2005-2008 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
+#ifdef KERNEL_PRIVATE
+
 #ifndef _KERN_PAGE_DECRYPT_H
 #define _KERN_PAGE_DECRYPT_H
 
-typedef        int       (*dsmos_page_transform_hook_t) (const void*,void*);
-extern void    dsmos_page_transform_hook(dsmos_page_transform_hook_t hook,
-                                         void (*commpage_setup_dsmos_blob)(void**, int));      /* exported */
+#include <mach/machine.h>
+
+/* 
+ * Interface for DSMOS 
+ */
+typedef        int     (*dsmos_page_transform_hook_t) (const void *,void*, unsigned long long, void *);
+extern void    dsmos_page_transform_hook(dsmos_page_transform_hook_t hook);    /* exported */
+
+extern int     dsmos_page_transform(const void *,void*, unsigned long long, void*);
+
 
-extern int             dsmos_page_transform(const void*,void*);
+/*
+ *Interface for text decryption family
+ */
+struct pager_crypt_info {
+        /* Decrypt one page */
+        int     (*page_decrypt)(const void *src_vaddr, void *dst_vaddr, 
+                               unsigned long long src_offset, void *crypt_ops);
+        /* Pager using this crypter terminates - crypt module not needed anymore */
+        void    (*crypt_end)(void *crypt_ops);
+        /* Private data for the crypter */
+        void    *crypt_ops;
+       volatile int    crypt_refcnt;
+};
+typedef struct pager_crypt_info pager_crypt_info_t;
+
+struct crypt_file_data {
+       char          *filename;
+       cpu_type_t     cputype;
+       cpu_subtype_t  cpusubtype;
+};
+typedef struct crypt_file_data crypt_file_data_t;
+
+typedef int (*text_crypter_create_hook_t)(struct pager_crypt_info *crypt_info, 
+                                               const char *id, void *crypt_data);
+extern void text_crypter_create_hook_set(text_crypter_create_hook_t hook);
+extern text_crypter_create_hook_t text_crypter_create;
 
 #endif /* _KERN_PAGE_DECRYPT_H */
+
+#endif /* KERNEL_PRIVATE */