xref: /xnu-11215.61.5/EXTERNAL_HEADERS/image4/coprocessor/ap.h (revision 4f1223e81cd707a65cc109d0b8ad6653699da3c4)
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  * Application Processor and associated handles.
31  */
32 #ifndef __IMAGE4_API_COPROCESSOR_AP_H
33 #define __IMAGE4_API_COPROCESSOR_AP_H
34 
35 #include <image4/image4.h>
36 #include <image4/types.h>
37 
38 __BEGIN_DECLS
39 OS_ASSUME_NONNULL_BEGIN
40 OS_ASSUME_PTR_ABI_SINGLE_BEGIN
41 
42 /*!
43  * @const IMAGE4_COPROCESSOR_AP
44  * The Application Processor executing payloads signed by the Secure Boot CA.
45  *
46  * Handles for this environment are enumerated in the
47  * {@link image4_coprocessor_ap_handle_t} type.
48  */
49 IMAGE4_API_AVAILABLE_SPRING_2024
50 OS_EXPORT
51 const image4_coprocessor_t _image4_coprocessor_ap;
52 #define IMAGE4_COPROCESSOR_AP (&_image4_coprocessor_ap)
53 IMAGE4_XNU_AVAILABLE_INDIRECT(_image4_coprocessor_ap);
54 
55 /*!
56  * @typedef image4_coprocessor_handle_ap_t
57  * Handles describing supported AP execution environments.
58  *
59  * @const IMAGE4_COPROCESSOR_HANDLE_AP
60  * The host's Application Processor environment.
61  *
62  * @const IMAGE4_COPROCESSOR_HANDLE_AP_FF00
63  * The software AP environment used for loading globally-signed OTA update brain
64  * trust caches.
65  *
66  * @const IMAGE4_COPROCESSOR_HANDLE_AP_FF01
67  * The software AP environment used for loading globally-signed Install
68  * Assistant brain trust caches.
69  *
70  * @const IMAGE4_COPROCESSOR_HANDLE_AP_FF06
71  * The software AP environment used for loading globally-signed Bootability
72  * brain trust caches.
73  *
74  * @const IMAGE4_COPROCESSOR_HANDLE_AP_PDI
75  * The sideloading AP environment used to load a personalized disk image.
76  *
77  * @const IMAGE4_COPROCESSOR_HANDLE_AP_SRDP
78  * The sideloading AP environment used to load firmware which has been
79  * authorized as part of the Security Research Device Program.
80  *
81  * @const IMAGE4_COPROCESSOR_HANDLE_AP_DDI
82  * The sideloading AP environment used to load a personalized disk image which
83  * is automatically mounted at boot.
84  *
85  * This handle is available starting in API version 20231027.
86  *
87  * @const IMAGE4_COPROCESSOR_HANDLE_AP_BOOTPC
88  * The AP environment for use in calculating boot policy closures. While relying
89  * parties can simply do an unauthenticated calculation to verify that a
90  * manifest is consistent with an authorized closure measurement, the initial
91  * generation of that authorized measurement must still verify that the boot
92  * ticket was issued by the Secure Boot CA. This environment facilitates that
93  * procedure.
94  *
95  * This handle is available starting in API version 20240318.
96  */
97 OS_CLOSED_ENUM(image4_coprocessor_handle_ap, image4_coprocessor_handle_t,
98 	IMAGE4_COPROCESSOR_HANDLE_AP = 0,
99 	IMAGE4_COPROCESSOR_HANDLE_AP_FF00,
100 	IMAGE4_COPROCESSOR_HANDLE_AP_FF01,
101 	IMAGE4_COPROCESSOR_HANDLE_AP_FF06,
102 	IMAGE4_COPROCESSOR_HANDLE_AP_PDI,
103 	IMAGE4_COPROCESSOR_HANDLE_AP_SRDP,
104 	IMAGE4_COPROCESSOR_HANDLE_AP_RESERVED_0,
105 	IMAGE4_COPROCESSOR_HANDLE_AP_RESERVED_1,
106 	IMAGE4_COPROCESSOR_HANDLE_AP_RESERVED_2,
107 	IMAGE4_COPROCESSOR_HANDLE_AP_DDI,
108 	IMAGE4_COPROCESSOR_HANDLE_AP_BOOTPC,
109 	_IMAGE4_COPROCESSOR_HANDLE_AP_CNT,
110 );
111 
112 /*!
113  * @const IMAGE4_COPROCESSOR_HANDLE_AP_DEFAULT
114  * The default handle for {@link IMAGE4_COPROCESSOR_AP}. This constant enables
115  * `DEFAULT` to be used as the second and third arguments to
116  * {@link image4_environment_init_coproc} and
117  * {@link image4_environment_new_coproc} respectively.
118  */
119 #define IMAGE4_COPROCESSOR_HANDLE_AP_DEFAULT IMAGE4_COPROCESSOR_HANDLE_AP
120 
121 OS_ASSUME_PTR_ABI_SINGLE_END
122 OS_ASSUME_NONNULL_END
123 __END_DECLS
124 
125 #endif // __IMAGE4_API_COPROCESSOR_AP_H
126