1 /* 2 * Copyright © 2017-2024 Apple Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. The rights granted to you under the License 10 * may not be used to create, or enable the creation or redistribution of, 11 * unlawful or unlicensed copies of an Apple operating system, or to 12 * circumvent, violate, or enable the circumvention or violation of, any 13 * terms of an Apple operating system software license agreement. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 18 * The Original Code and all software distributed under the License are 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 * Please see the License for the specific language governing rights and 24 * limitations under the License. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28 /*! 29 * @header 30 * Interface structure for the upward-exported AppleImage4 API. 31 * 32 * This header relies entirely on transitive inclusion from dlxk.h to satisfy 33 * its dependencies. 34 */ 35 #ifndef __IMAGE4_DLXK_INTERFACE_H 36 #define __IMAGE4_DLXK_INTERFACE_H 37 38 #if !defined(__IMAGE4_XNU_INDIRECT) 39 #error "Please include <libkern/image4/dlxk.h> instead of this file" 40 #endif 41 42 __BEGIN_DECLS 43 OS_ASSUME_NONNULL_BEGIN 44 OS_ASSUME_PTR_ABI_SINGLE_BEGIN 45 46 #pragma mark Macros 47 #define image4_xnu_dlxk_type(_s) _image4_ ## _s ## _dlxk_t 48 #define image4_xnu_dlxk_fld(_s) dlxk_ ## _s 49 #define image4_xnu_dlxk_fld_decl(_s) \ 50 image4_xnu_dlxk_type(_s) image4_xnu_dlxk_fld(_s) 51 52 #pragma mark Types 53 typedef struct _image4_dlxk_interface { 54 image4_struct_version_t dlxk_version; 55 image4_xnu_dlxk_fld_decl(coprocessor_host); 56 image4_xnu_dlxk_fld_decl(coprocessor_ap); 57 image4_xnu_dlxk_fld_decl(coprocessor_ap_local); 58 image4_xnu_dlxk_fld_decl(coprocessor_cryptex1); 59 image4_xnu_dlxk_fld_decl(coprocessor_sep); 60 image4_xnu_dlxk_fld_decl(coprocessor_x86); 61 image4_xnu_dlxk_fld_decl(environment_init); 62 image4_xnu_dlxk_fld_decl(environment_new); 63 image4_xnu_dlxk_fld_decl(environment_set_secure_boot); 64 image4_xnu_dlxk_fld_decl(environment_set_callbacks); 65 image4_xnu_dlxk_fld_decl(environment_copy_nonce_digest); 66 image4_xnu_dlxk_fld_decl(environment_roll_nonce); 67 image4_xnu_dlxk_fld_decl(environment_generate_nonce_proposal); 68 image4_xnu_dlxk_fld_decl(environment_commit_nonce_proposal); 69 image4_xnu_dlxk_fld_decl(environment_get_nonce_handle); 70 image4_xnu_dlxk_fld_decl(environment_destroy); 71 image4_xnu_dlxk_fld_decl(trust_init); 72 image4_xnu_dlxk_fld_decl(trust_new); 73 image4_xnu_dlxk_fld_decl(trust_set_payload); 74 image4_xnu_dlxk_fld_decl(trust_set_booter); 75 image4_xnu_dlxk_fld_decl(trust_record_property_bool); 76 image4_xnu_dlxk_fld_decl(trust_record_property_integer); 77 image4_xnu_dlxk_fld_decl(trust_record_property_data); 78 image4_xnu_dlxk_fld_decl(trust_evaluate); 79 image4_xnu_dlxk_fld_decl(trust_destroy); 80 image4_xnu_dlxk_fld_decl(trust_evaluation_exec); 81 image4_xnu_dlxk_fld_decl(trust_evaluation_preflight); 82 image4_xnu_dlxk_fld_decl(trust_evaluation_sign); 83 image4_xnu_dlxk_fld_decl(trust_evaluation_boot); 84 image4_xnu_dlxk_fld_decl(cs_trap_resolve_handler); 85 image4_xnu_dlxk_fld_decl(cs_trap_vector_size); 86 image4_xnu_dlxk_fld_decl(trust_evaluation_normalize); 87 image4_xnu_dlxk_fld_decl(environment_identify); 88 image4_xnu_dlxk_fld_decl(environment_get_digest_info); 89 image4_xnu_dlxk_fld_decl(environment_flash); 90 image4_xnu_dlxk_fld_decl(coprocessor_resolve_from_manifest); 91 image4_xnu_dlxk_fld_decl(coprocessor_bootpc); 92 image4_xnu_dlxk_fld_decl(coprocessor_vma2); 93 image4_xnu_dlxk_fld_decl(coprocessor_vma3); 94 #if IMAGE4_API_VERSION >= 20240503 95 image4_xnu_dlxk_fld_decl(trust_set_result_buffer); 96 #endif 97 } image4_dlxk_interface_t; 98 99 OS_ASSUME_PTR_ABI_SINGLE_END 100 OS_ASSUME_NONNULL_END 101 __END_DECLS 102 103 #endif // __IMAGE4_DLXK_INTERFACE_H 104