]> git.saurik.com Git - apple/xnu.git/blame - EXTERNAL_HEADERS/img4/api.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / img4 / api.h
CommitLineData
d9a64523
A
1/*!
2 * @header
3 * API definitions.
4 */
5#ifndef __IMG4_API_H
6#define __IMG4_API_H
7
8#ifndef __IMG4_INDIRECT
f427ee49 9#error "Please #include <img4/firmware.h> instead of this file directly"
d9a64523
A
10#endif // __IMG4_INDIRECT
11
0a7de745 12#include <stdint.h>
f427ee49
A
13#include <stdbool.h>
14#include <os/base.h>
0a7de745 15
d9a64523
A
16#ifndef KERNEL
17#include <os/availability.h>
f427ee49 18#include <unistd.h>
d9a64523
A
19#endif
20
21#if !XNU_KERNEL_PRIVATE
22#include <TargetConditionals.h>
23#endif
24
25/*!
26 * @const IMG4_API_VERSION
27 * The API version of the library. This version will be changed in accordance
28 * with new API introductions so that callers may submit code to the build that
29 * adopts those new APIs before the APIs land by using the following pattern:
30 *
31 * #if IMG4_API_VERSION >= 20180424
32 * img4_new_api();
33 * #endif
34 *
35 * In this example, the library maintainer and API adopter agree on an API
36 * version of 20180424 ahead of time for the introduction of
37 * img4_new_api(). When a libdarwin with that API version is submitted, the
38 * project is rebuilt, and the new API becomes active.
39 *
40 * Breaking API changes will be both covered under this mechanism as well as
41 * individual preprocessor macros in this header that declare new behavior as
42 * required.
43 */
f427ee49 44#define IMG4_API_VERSION (20200724u)
d9a64523 45
f427ee49 46#if IMG4_TAPI || (!defined(KERNEL) && !IMG4_PROJECT_BUILD)
d9a64523 47#define IMG4_API_AVAILABLE_20180112 \
f427ee49
A
48 API_AVAILABLE( \
49 macos(10.15), \
50 ios(12.0), \
51 tvos(12.0), \
52 watchos(5.0))
53
54#define IMG4_API_AVAILABLE_20180112_DEPRECATED \
55 API_DEPRECATED_WITH_REPLACEMENT( \
56 "img4_firmware_t", \
57 macos(10.15, 11.0), \
58 ios(12.0, 14.0), \
59 tvos(12.0, 14.0), \
60 watchos(5.0, 7.0))
0a7de745 61#define IMG4_API_AVAILABLE_20181004 \
f427ee49
A
62 API_DEPRECATED_WITH_REPLACEMENT( \
63 "img4_firmware_t", \
64 macos(10.15, 11.0), \
65 ios(12.2, 14.0), \
66 tvos(12.2, 14.0), \
67 watchos(5.2, 7.0))
68
69// This API version introduced the nonce manager which was not deprecated when
70// the new API was introduced.
0a7de745 71#define IMG4_API_AVAILABLE_20181106 \
f427ee49
A
72 API_AVAILABLE( \
73 macos(10.15), \
74 ios(12.2), \
75 tvos(12.2), \
76 watchos(5.2))
77#define IMG4_API_AVAILABLE_20181106_DEPRECATED \
78 API_DEPRECATED_WITH_REPLACEMENT( \
79 "img4_firmware_t", \
80 macos(10.15, 11.0), \
81 ios(12.2, 14.0), \
82 tvos(12.2, 14.0), \
83 watchos(5.2, 7.0))
cb323159 84#define IMG4_API_AVAILABLE_20190125 \
f427ee49
A
85 API_DEPRECATED_WITH_REPLACEMENT( \
86 "img4_firmware_t", \
87 macos(10.15, 11.0), \
88 ios(13.0, 14.0), \
89 tvos(13.0, 14.0), \
90 watchos(6.0, 7.0))
4ba76501 91#define IMG4_API_AVAILABLE_20191001 \
f427ee49
A
92 API_DEPRECATED_WITH_REPLACEMENT( \
93 "img4_firmware_t", \
94 macos(10.15.2, 11.0), \
95 ios(13.3, 14.0), \
96 tvos(13.3, 14.0), \
97 watchos(6.1.1, 7.0))
98#define IMG4_API_AVAILABLE_20191108 \
99 API_DEPRECATED_WITH_REPLACEMENT( \
100 "img4_firmware_t", \
101 macos(11.0, 11.0), \
102 ios(14.0, 14.0), \
103 tvos(14.0, 14.0), \
104 watchos(7.0, 7.0))
105#define IMG4_API_AVAILABLE_20200221 \
106 API_DEPRECATED_WITH_REPLACEMENT( \
107 "img4_firmware_t", \
108 macos(11.0, 11.0), \
109 ios(14.0, 14.0), \
110 tvos(14.0, 14.0), \
111 watchos(7.0, 7.0))
112#define IMG4_API_AVAILABLE_20200310 \
113 API_DEPRECATED_WITH_REPLACEMENT( \
114 "img4_firmware_t", \
115 macos(11.0, 11.0), \
116 ios(14.0, 14.0), \
117 tvos(14.0, 14.0), \
118 watchos(7.0, 7.0))
119#define IMG4_API_AVAILABLE_20200508 \
120 API_AVAILABLE( \
121 macos(11.0), \
122 ios(14.0), \
123 tvos(14.0), \
124 watchos(7.0), \
125 bridgeos(5.0))
126#define IMG4_API_AVAILABLE_20200608 \
127 API_AVAILABLE( \
128 macos(11.0), \
129 ios(14.0), \
130 tvos(14.0), \
131 watchos(7.0), \
132 bridgeos(5.0))
133#define IMG4_API_AVAILABLE_20200724 \
134 API_AVAILABLE( \
135 macos(11.0), \
136 ios(14.0), \
137 tvos(14.0), \
138 watchos(7.0), \
139 bridgeos(5.0))
d9a64523
A
140#else
141#define IMG4_API_AVAILABLE_20180112
f427ee49 142#define IMG4_API_AVAILABLE_20180112_DEPRECATED
0a7de745
A
143#define IMG4_API_AVAILABLE_20181004
144#define IMG4_API_AVAILABLE_20181106
f427ee49 145#define IMG4_API_AVAILABLE_20181106_DEPRECATED
cb323159 146#define IMG4_API_AVAILABLE_20190125
4ba76501 147#define IMG4_API_AVAILABLE_20191001
f427ee49
A
148#define IMG4_API_AVAILABLE_20191108
149#define IMG4_API_AVAILABLE_20200221
150#define IMG4_API_AVAILABLE_20200310
151#define IMG4_API_AVAILABLE_20200508
152#define IMG4_API_AVAILABLE_20200608
153#define IMG4_API_AVAILABLE_20200724
d9a64523
A
154#endif
155
156/*!
157 * @typedef img4_struct_version_t
158 * A type describing the version of a structure in the library.
159 */
160IMG4_API_AVAILABLE_20180112
161typedef uint16_t img4_struct_version_t;
162
163#endif // __IMG4_API_H