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 typedef unsigned long ihandle; 14 typedef unsigned long phandle; 15 typedef int size_t; 16 17 /* globals */ 18 extern void _prom_entry(void); /* OF CI entry point (i.e. this firmware) */ 19 20 void do_boot(unsigned long addr, unsigned long r3, unsigned long r4); 21 22 /* libc */ 23 int strlen(const char *s); 24 int strcmp(const char *s1, const char *s2); 25 void *memcpy(void *dest, const void *src, size_t n); 26 int memcmp(const void *ptr1, const void *ptr2, size_t n); 27 void *memmove(void *dest, const void *src, size_t n); 28 void *memset(void *dest, int c, size_t size); 29 30 /* CI wrappers */ 31 void ci_panic(const char *str); 32 phandle ci_finddevice(const char *path); 33 uint32_t ci_getprop(phandle ph, const char *propname, void *prop, int len); 34 35 /* booting from -kernel */ 36 void boot_from_memory(uint64_t initrd, uint64_t initrdsize); 37 38 /* Entry points for CI and RTAS */ 39 extern uint32_t ci_entry(uint32_t params); 40 extern unsigned long hv_rtas(unsigned long params); 41 extern unsigned int hv_rtas_size; 42