xref: /qemu/include/hw/arm/linux-boot-if.h (revision 67cc32eb)
1 /*
2  * hw/arm/linux-boot-if.h : interface for devices which need to behave
3  * specially for direct boot of an ARM Linux kernel
4  */
5 
6 #ifndef HW_ARM_LINUX_BOOT_IF_H
7 #define HW_ARM_LINUX_BOOT_IF_H
8 
9 #include "qom/object.h"
10 
11 #define TYPE_ARM_LINUX_BOOT_IF "arm-linux-boot-if"
12 #define ARM_LINUX_BOOT_IF_CLASS(klass) \
13     OBJECT_CLASS_CHECK(ARMLinuxBootIfClass, (klass), TYPE_ARM_LINUX_BOOT_IF)
14 #define ARM_LINUX_BOOT_IF_GET_CLASS(obj) \
15     OBJECT_GET_CLASS(ARMLinuxBootIfClass, (obj), TYPE_ARM_LINUX_BOOT_IF)
16 #define ARM_LINUX_BOOT_IF(obj) \
17     INTERFACE_CHECK(ARMLinuxBootIf, (obj), TYPE_ARM_LINUX_BOOT_IF)
18 
19 typedef struct ARMLinuxBootIf {
20     /*< private >*/
21     Object parent_obj;
22 } ARMLinuxBootIf;
23 
24 typedef struct ARMLinuxBootIfClass {
25     /*< private >*/
26     InterfaceClass parent_class;
27 
28     /*< public >*/
29     /** arm_linux_init: configure the device for a direct boot
30      * of an ARM Linux kernel (so that device reset puts it into
31      * the state the kernel expects after firmware initialization,
32      * rather than the true hardware reset state). This callback is
33      * called once after machine construction is complete (before the
34      * first system reset).
35      *
36      * @obj: the object implementing this interface
37      * @secure_boot: true if we are booting Secure, false for NonSecure
38      * (or for a CPU which doesn't support TrustZone)
39      */
40     void (*arm_linux_init)(ARMLinuxBootIf *obj, bool secure_boot);
41 } ARMLinuxBootIfClass;
42 
43 #endif
44