| 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 |
| 13 | OS_ASSUME_NONNULL_BEGIN |
| 14 | OS_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 | */ |
| 21 | IMG4_API_AVAILABLE_20200508 |
| 22 | typedef 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 |
| 29 | IMG4_API_AVAILABLE_20200508 |
| 30 | OS_EXPORT |
| 31 | const 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 |
| 49 | IMG4_API_AVAILABLE_20200508 |
| 50 | OS_EXPORT |
| 51 | const 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 |
| 69 | IMG4_API_AVAILABLE_20210521 |
| 70 | OS_EXPORT |
| 71 | const 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 | |
| 84 | OS_ASSUME_PTR_ABI_SINGLE_END |
| 85 | OS_ASSUME_NONNULL_END |
| 86 | __END_DECLS |
| 87 | |
| 88 | #endif // __IMG4_OBJECT_H |
| 89 | |