xref: /xnu-10002.61.3/EXTERNAL_HEADERS/img4/object.h (revision 0f4c859e951fba394238ab619495c4e1d54d0f34)
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 OS_ASSUME_NONNULL_BEGIN
13 
14 /*!
15  * @typedef img4_object_spec_t
16  * An opaque type which describes information about Image4 objects for use by
17  * the runtime.
18  */
19 IMG4_API_AVAILABLE_20200508
20 typedef struct _img4_object_spec img4_object_spec_t;
21 
22 /*!
23  * @const IMG4_FIRMWARE_SPEC
24  * The object specification for an {@link img4_firmware_t} object.
25  */
26 #if !XNU_KERNEL_PRIVATE
27 IMG4_API_AVAILABLE_20200508
28 OS_EXPORT
29 const img4_object_spec_t _img4_firmware_spec;
30 #define IMG4_FIRMWARE_SPEC (&_img4_firmware_spec)
31 #else
32 #define IMG4_FIRMWARE_SPEC (img4if->i4if_v7.firmware_spec)
33 #endif
34 
35 /*!
36  * @const IMG4_FIRMWARE_SIZE_RECOMMENDED
37  * A constant describing the recommended stack allocation required for a
38  * {@link img4_firmware_t} object.
39  */
40 #define IMG4_FIRMWARE_SIZE_RECOMMENDED (1280u)
41 
42 /*!
43  * @const IMG4_CHIP_SPEC
44  * The object specification for an {@link img4_chip_t} object.
45  */
46 #if !XNU_KERNEL_PRIVATE
47 IMG4_API_AVAILABLE_20200508
48 OS_EXPORT
49 const img4_object_spec_t _img4_chip_spec;
50 #define IMG4_CHIP_SPEC (&_img4_chip_spec)
51 #else
52 #define IMG4_CHIP_SPEC (img4if->i4if_v7.chip_spec)
53 #endif
54 
55 /*!
56  * @const IMG4_CHIP_SIZE_RECOMMENDED
57  * A constant describing the recommended stack allocation required for a
58  * {@link img4_chip_t} object.
59  */
60 #define IMG4_CHIP_SIZE_RECOMMENDED (384u)
61 
62 /*!
63  * @const IMG4_PMAP_DATA_SPEC
64  * The object specification for an {@link img4_pmap_data_t} object.
65  */
66 #if !XNU_KERNEL_PRIVATE
67 IMG4_API_AVAILABLE_20210521
68 OS_EXPORT
69 const img4_object_spec_t _img4_pmap_data_spec;
70 #define IMG4_PMAP_DATA_SPEC (&_img4_pmap_data_spec)
71 #else
72 #define IMG4_PMAP_DATA_SPEC (img4if->i4if_v13.pmap_data_spec)
73 #endif
74 
75 /*!
76  * @const IMG4_CHIP_SIZE_RECOMMENDED
77  * A constant describing the recommended stack allocation required for a
78  * {@link img4_pmap_data_t} object.
79  */
80 #define IMG4_PMAP_DATA_SIZE_RECOMMENDED (2048u)
81 
82 OS_ASSUME_NONNULL_END
83 
84 #endif // __IMG4_OBJECT_H
85