2 Definitions for talking to the Open Firmware PROM on
3 Power Macintosh computers.
5 Copyright (C) 1999 Marius Vollmer
6 Copyright (C) 1996 Paul Mackerras.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 typedef void *prom_handle;
29 typedef void *ihandle;
30 typedef void *phandle;
32 #define PROM_INVALID_HANDLE ((prom_handle)-1UL)
35 typedef int (*prom_entry)(struct prom_args *);
37 extern void prom_init (prom_entry pe);
39 extern prom_entry prom;
43 extern prom_handle prom_stdin;
44 extern prom_handle prom_stdout;
46 prom_handle prom_open (char *spec);
47 int prom_read (prom_handle file, void *buf, int len);
48 int prom_write (prom_handle file, void *buf, int len);
49 int prom_seek (prom_handle file, int pos);
50 int prom_lseek (prom_handle file, unsigned long long pos);
51 int prom_readblocks (prom_handle file, int blockNum, int blockCount, void *buffer);
52 void prom_close (prom_handle file);
53 int prom_getblksize (prom_handle file);
54 int prom_loadmethod (prom_handle device, void* addr);
62 void prom_putchar (char);
65 void prom_vprintf (char *fmt, va_list ap);
66 void prom_fprintf (prom_handle dev, char *fmt, ...);
67 void prom_printf (char *fmt, ...);
68 void prom_readline (char *prompt, char *line, int len);
69 int prom_set_color(prom_handle device, int color, int r, int g, int b);
73 void *prom_claim (void *virt, unsigned int size, unsigned int align);
74 void prom_release(void *virt, unsigned int size);
75 void prom_map (void *phys, void *virt, int size);
77 /* packages and device nodes */
79 prom_handle prom_finddevice (char *name);
80 prom_handle prom_findpackage (char *path);
81 int prom_getprop (prom_handle dev, char *name, void *buf, int len);
85 char *prom_getargs ();
86 void prom_setargs (char *args);
89 void prom_abort (char *fmt, ...);
91 int prom_interpret (char *forth);
93 int prom_get_chosen (char *name, void *mem, int len);
94 int prom_get_options (char *name, void *mem, int len);
96 extern int prom_getms(void);
97 extern void prom_pause(void);
99 extern void *call_prom (const char *service, int nargs, int nret, ...);
100 extern void *call_prom_return (const char *service, int nargs, int nret, ...);