2 * Virtual Open Firmware
4 * SPDX-License-Identifier: GPL-2.0-or-later
10 uint64_t top_addr
; /* copied from rma_size */
11 GArray
*claimed
; /* array of SpaprOfClaimed */
12 uint64_t claimed_base
;
13 GHashTable
*of_instances
; /* ihandle -> SpaprOfInstance */
14 uint32_t of_instance_last
;
19 int vof_client_call(MachineState
*ms
, Vof
*vof
, void *fdt
,
20 target_ulong args_real
);
21 uint64_t vof_claim(Vof
*vof
, uint64_t virt
, uint64_t size
, uint64_t align
);
22 void vof_init(Vof
*vof
, uint64_t top_addr
, Error
**errp
);
23 void vof_cleanup(Vof
*vof
);
24 void vof_build_dt(void *fdt
, Vof
*vof
);
25 uint32_t vof_client_open_store(void *fdt
, Vof
*vof
, const char *nodename
,
26 const char *prop
, const char *path
);
28 #define TYPE_VOF_MACHINE_IF "vof-machine-if"
30 typedef struct VofMachineIfClass VofMachineIfClass
;
31 DECLARE_CLASS_CHECKERS(VofMachineIfClass
, VOF_MACHINE
, TYPE_VOF_MACHINE_IF
)
33 struct VofMachineIfClass
{
34 InterfaceClass parent
;
35 target_ulong (*client_architecture_support
)(MachineState
*ms
, CPUState
*cs
,
37 void (*quiesce
)(MachineState
*ms
);
38 bool (*setprop
)(MachineState
*ms
, const char *path
, const char *propname
,
39 void *val
, int vallen
);
43 * Initial stack size is from
44 * https://www.devicetree.org/open-firmware/bindings/ppc/release/ppc-2_1.html#REF27292
46 * "Client programs shall be invoked with a valid stack pointer (r1) with
47 * at least 32K bytes of memory available for stack growth".
49 #define VOF_STACK_SIZE 0x8000
51 #define VOF_MEM_READ(pa, buf, size) \
52 address_space_read(&address_space_memory, \
53 (pa), MEMTXATTRS_UNSPECIFIED, (buf), (size))
54 #define VOF_MEM_WRITE(pa, buf, size) \
55 address_space_write(&address_space_memory, \
56 (pa), MEMTXATTRS_UNSPECIFIED, (buf), (size))