1384740dcSRalf Baechle /* 2384740dcSRalf Baechle * This file is subject to the terms and conditions of the GNU General Public 3384740dcSRalf Baechle * License. See the file "COPYING" in the main directory of this archive 4384740dcSRalf Baechle * for more details. 5384740dcSRalf Baechle * 6384740dcSRalf Baechle * SGI ARCS firmware interface library for the Linux kernel. 7384740dcSRalf Baechle * 879add627SJustin P. Mattock * Copyright (C) 1996 David S. Miller (davem@davemloft.net) 9384740dcSRalf Baechle * Copyright (C) 2001, 2002 Ralf Baechle (ralf@gnu.org) 10384740dcSRalf Baechle */ 11384740dcSRalf Baechle #ifndef _ASM_SGIALIB_H 12384740dcSRalf Baechle #define _ASM_SGIALIB_H 13384740dcSRalf Baechle 14384740dcSRalf Baechle #include <asm/sgiarcs.h> 15384740dcSRalf Baechle 16384740dcSRalf Baechle extern struct linux_romvec *romvec; 17384740dcSRalf Baechle extern int prom_argc; 18384740dcSRalf Baechle 19384740dcSRalf Baechle extern LONG *_prom_argv, *_prom_envp; 20384740dcSRalf Baechle 21384740dcSRalf Baechle /* A 32-bit ARC PROM pass arguments and environment as 32-bit pointer. 22384740dcSRalf Baechle These macros take care of sign extension. */ 23384740dcSRalf Baechle #define prom_argv(index) ((char *) (long) _prom_argv[(index)]) 24384740dcSRalf Baechle #define prom_argc(index) ((char *) (long) _prom_argc[(index)]) 25384740dcSRalf Baechle 26384740dcSRalf Baechle extern int prom_flags; 27384740dcSRalf Baechle 28384740dcSRalf Baechle #define PROM_FLAG_ARCS 1 29384740dcSRalf Baechle #define PROM_FLAG_USE_AS_CONSOLE 2 30384740dcSRalf Baechle #define PROM_FLAG_DONT_FREE_TEMP 4 31384740dcSRalf Baechle 32384740dcSRalf Baechle /* Simple char-by-char console I/O. */ 33384740dcSRalf Baechle extern void prom_putchar(char c); 34384740dcSRalf Baechle extern char prom_getchar(void); 35384740dcSRalf Baechle 36384740dcSRalf Baechle /* Get next memory descriptor after CURR, returns first descriptor 37384740dcSRalf Baechle * in chain is CURR is NULL. 38384740dcSRalf Baechle */ 39384740dcSRalf Baechle extern struct linux_mdesc *prom_getmdesc(struct linux_mdesc *curr); 40384740dcSRalf Baechle #define PROM_NULL_MDESC ((struct linux_mdesc *) 0) 41384740dcSRalf Baechle 42384740dcSRalf Baechle /* Called by prom_init to setup the physical memory pmemblock 43384740dcSRalf Baechle * array. 44384740dcSRalf Baechle */ 45384740dcSRalf Baechle extern void prom_meminit(void); 46384740dcSRalf Baechle 47384740dcSRalf Baechle /* PROM device tree library routines. */ 48384740dcSRalf Baechle #define PROM_NULL_COMPONENT ((pcomponent *) 0) 49384740dcSRalf Baechle 50384740dcSRalf Baechle /* Get sibling component of THIS. */ 51384740dcSRalf Baechle extern pcomponent *ArcGetPeer(pcomponent *this); 52384740dcSRalf Baechle 53384740dcSRalf Baechle /* Get child component of THIS. */ 54384740dcSRalf Baechle extern pcomponent *ArcGetChild(pcomponent *this); 55384740dcSRalf Baechle 56384740dcSRalf Baechle /* This is called at prom_init time to identify the 57384740dcSRalf Baechle * ARC architecture we are running on 58384740dcSRalf Baechle */ 59384740dcSRalf Baechle extern void prom_identify_arch(void); 60384740dcSRalf Baechle 61384740dcSRalf Baechle /* Environment variable routines. */ 62384740dcSRalf Baechle extern PCHAR ArcGetEnvironmentVariable(PCHAR name); 63384740dcSRalf Baechle extern LONG ArcSetEnvironmentVariable(PCHAR name, PCHAR value); 64384740dcSRalf Baechle 65cb6edd45SDmitri Vorobiev /* ARCS command line parsing. */ 66384740dcSRalf Baechle extern void prom_init_cmdline(void); 67384740dcSRalf Baechle 68384740dcSRalf Baechle /* File operations. */ 69384740dcSRalf Baechle extern LONG ArcRead(ULONG fd, PVOID buf, ULONG num, PULONG cnt); 70384740dcSRalf Baechle extern LONG ArcWrite(ULONG fd, PVOID buf, ULONG num, PULONG cnt); 71384740dcSRalf Baechle 72384740dcSRalf Baechle /* Misc. routines. */ 73384740dcSRalf Baechle extern VOID ArcReboot(VOID) __attribute__((noreturn)); 74384740dcSRalf Baechle extern VOID ArcEnterInteractiveMode(VOID) __attribute__((noreturn)); 75384740dcSRalf Baechle extern VOID ArcFlushAllCaches(VOID); 76384740dcSRalf Baechle extern DISPLAY_STATUS *ArcGetDisplayStatus(ULONG FileID); 77384740dcSRalf Baechle 78384740dcSRalf Baechle #endif /* _ASM_SGIALIB_H */ 79