1
2
3
4
5
6#ifndef HW_VOF_H
7#define HW_VOF_H
8
9#include "qom/object.h"
10#include "exec/address-spaces.h"
11#include "exec/memory.h"
12#include "cpu.h"
13
14typedef struct Vof {
15 uint64_t top_addr;
16 GArray *claimed;
17 uint64_t claimed_base;
18 GHashTable *of_instances;
19 uint32_t of_instance_last;
20 char *bootargs;
21 long fw_size;
22} Vof;
23
24int vof_client_call(MachineState *ms, Vof *vof, void *fdt,
25 target_ulong args_real);
26uint64_t vof_claim(Vof *vof, uint64_t virt, uint64_t size, uint64_t align);
27void vof_init(Vof *vof, uint64_t top_addr, Error **errp);
28void vof_cleanup(Vof *vof);
29void vof_build_dt(void *fdt, Vof *vof);
30uint32_t vof_client_open_store(void *fdt, Vof *vof, const char *nodename,
31 const char *prop, const char *path);
32
33#define TYPE_VOF_MACHINE_IF "vof-machine-if"
34
35typedef struct VofMachineIfClass VofMachineIfClass;
36DECLARE_CLASS_CHECKERS(VofMachineIfClass, VOF_MACHINE, TYPE_VOF_MACHINE_IF)
37
38struct VofMachineIfClass {
39 InterfaceClass parent;
40 target_ulong (*client_architecture_support)(MachineState *ms, CPUState *cs,
41 target_ulong vec);
42 void (*quiesce)(MachineState *ms);
43 bool (*setprop)(MachineState *ms, const char *path, const char *propname,
44 void *val, int vallen);
45};
46
47
48
49
50
51
52
53
54#define VOF_STACK_SIZE 0x8000
55
56#define VOF_MEM_READ(pa, buf, size) \
57 address_space_read(&address_space_memory, \
58 (pa), MEMTXATTRS_UNSPECIFIED, (buf), (size))
59#define VOF_MEM_WRITE(pa, buf, size) \
60 address_space_write(&address_space_memory, \
61 (pa), MEMTXATTRS_UNSPECIFIED, (buf), (size))
62
63#define PROM_ERROR (~0U)
64
65#endif
66