1/*!
2 * @header
3 * Image4 object specifications.
4 */
5#ifndef __IMG4_OBJECT_H
6#define __IMG4_OBJECT_H
7
8#ifndef __IMG4_INDIRECT
9#error "Please #include <img4/firmware.h> instead of this file directly"
10#endif // __IMG4_INDIRECT
11
12__BEGIN_DECLS
13OS_ASSUME_NONNULL_BEGIN
14OS_ASSUME_PTR_ABI_SINGLE_BEGIN
15
16/*!
17 * @typedef img4_object_spec_t
18 * An opaque type which describes information about Image4 objects for use by
19 * the runtime.
20 */
21IMG4_API_AVAILABLE_20200508
22typedef struct _img4_object_spec img4_object_spec_t;
23
24/*!
25 * @const IMG4_FIRMWARE_SPEC
26 * The object specification for an {@link img4_firmware_t} object.
27 */
28#if !XNU_KERNEL_PRIVATE
29IMG4_API_AVAILABLE_20200508
30OS_EXPORT
31const img4_object_spec_t _img4_firmware_spec;
32#define IMG4_FIRMWARE_SPEC (&_img4_firmware_spec)
33#else
34#define IMG4_FIRMWARE_SPEC (img4if->i4if_v7.firmware_spec)
35#endif
36
37/*!
38 * @const IMG4_FIRMWARE_SIZE_RECOMMENDED
39 * A constant describing the recommended stack allocation required for a
40 * {@link img4_firmware_t} object.
41 */
42#define IMG4_FIRMWARE_SIZE_RECOMMENDED (1536u)
43
44/*!
45 * @const IMG4_CHIP_SPEC
46 * The object specification for an {@link img4_chip_t} object.
47 */
48#if !XNU_KERNEL_PRIVATE
49IMG4_API_AVAILABLE_20200508
50OS_EXPORT
51const img4_object_spec_t _img4_chip_spec;
52#define IMG4_CHIP_SPEC (&_img4_chip_spec)
53#else
54#define IMG4_CHIP_SPEC (img4if->i4if_v7.chip_spec)
55#endif
56
57/*!
58 * @const IMG4_CHIP_SIZE_RECOMMENDED
59 * A constant describing the recommended stack allocation required for a
60 * {@link img4_chip_t} object.
61 */
62#define IMG4_CHIP_SIZE_RECOMMENDED (960u)
63
64/*!
65 * @const IMG4_PMAP_DATA_SPEC
66 * The object specification for an {@link img4_pmap_data_t} object.
67 */
68#if !XNU_KERNEL_PRIVATE
69IMG4_API_AVAILABLE_20210521
70OS_EXPORT
71const img4_object_spec_t _img4_pmap_data_spec;
72#define IMG4_PMAP_DATA_SPEC (&_img4_pmap_data_spec)
73#else
74#define IMG4_PMAP_DATA_SPEC (img4if->i4if_v13.pmap_data_spec)
75#endif
76
77/*!
78 * @const IMG4_PMAP_DATA_SIZE_RECOMMENDED
79 * A constant describing the recommended stack allocation required for a
80 * {@link img4_pmap_data_t} object.
81 */
82#define IMG4_PMAP_DATA_SIZE_RECOMMENDED (5120u)
83
84OS_ASSUME_PTR_ABI_SINGLE_END
85OS_ASSUME_NONNULL_END
86__END_DECLS
87
88#endif // __IMG4_OBJECT_H
89