From 66a45dd3620ee5f913ba1af3d2dca8b9bdfa2b96 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sat, 14 Jan 2006 15:04:06 +1100 Subject: powerpc: Make COFF zImages for old 32-bit powermacs This adds code to build zImage.coff and/or zImage.initrd.coff when CONFIG_PPC32 and CONFIG_PPC_PMAC are defined. It also restructures the OF client code and adds some workarounds for OF quirks on the older machines. Signed-off-by: Paul Mackerras --- arch/powerpc/boot/prom.h | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'arch/powerpc/boot/prom.h') diff --git a/arch/powerpc/boot/prom.h b/arch/powerpc/boot/prom.h index 96ab5aec740c..3e2ddd4a5a81 100644 --- a/arch/powerpc/boot/prom.h +++ b/arch/powerpc/boot/prom.h @@ -1,18 +1,34 @@ #ifndef _PPC_BOOT_PROM_H_ #define _PPC_BOOT_PROM_H_ +typedef void *phandle; +typedef void *ihandle; + extern int (*prom) (void *); -extern void *chosen_handle; +extern phandle chosen_handle; +extern ihandle stdout; -extern void *stdin; -extern void *stdout; -extern void *stderr; +int call_prom(const char *service, int nargs, int nret, ...); +int call_prom_ret(const char *service, int nargs, int nret, + unsigned int *rets, ...); extern int write(void *handle, void *ptr, int nb); -extern int read(void *handle, void *ptr, int nb); -extern void exit(void); -extern void pause(void); -extern void *finddevice(const char *); -extern void *claim(unsigned long virt, unsigned long size, unsigned long align); -extern int getprop(void *phandle, const char *name, void *buf, int buflen); +extern void *claim(unsigned long virt, unsigned long size, unsigned long aln); + +static inline void exit(void) +{ + call_prom("exit", 0, 0); +} + +static inline phandle finddevice(const char *name) +{ + return (phandle) call_prom("finddevice", 1, 1, name); +} + +static inline int getprop(void *phandle, const char *name, + void *buf, int buflen) +{ + return call_prom("getprop", 4, 1, phandle, name, buf, buflen); +} + #endif /* _PPC_BOOT_PROM_H_ */ -- cgit v1.2.2