xref: /openbmc/qemu/pc-bios/vof/vof.h (revision fc8c745d)
1 /*
2  * Virtual Open Firmware
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  */
6 #include <stdarg.h>
7 
8 typedef unsigned char uint8_t;
9 typedef unsigned short uint16_t;
10 typedef unsigned long uint32_t;
11 typedef unsigned long long uint64_t;
12 #define NULL (0)
13 #define PROM_ERROR (-1u)
14 typedef unsigned long ihandle;
15 typedef unsigned long phandle;
16 typedef int size_t;
17 typedef void client(void);
18 
19 /* globals */
20 extern void _prom_entry(void); /* OF CI entry point (i.e. this firmware) */
21 
22 void do_boot(unsigned long addr, unsigned long r3, unsigned long r4);
23 
24 /* libc */
25 int strlen(const char *s);
26 int strcmp(const char *s1, const char *s2);
27 void *memcpy(void *dest, const void *src, size_t n);
28 int memcmp(const void *ptr1, const void *ptr2, size_t n);
29 void *memmove(void *dest, const void *src, size_t n);
30 void *memset(void *dest, int c, size_t size);
31 
32 /* CI wrappers */
33 void ci_panic(const char *str);
34 phandle ci_finddevice(const char *path);
35 uint32_t ci_getprop(phandle ph, const char *propname, void *prop, int len);
36 
37 /* booting from -kernel */
38 void boot_from_memory(uint64_t initrd, uint64_t initrdsize);
39 
40 /* Entry points for CI and RTAS */
41 extern uint32_t ci_entry(uint32_t params);
42 extern unsigned long hv_rtas(unsigned long params);
43 extern unsigned int hv_rtas_size;
44