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);
66 void prom_vprintf (char *fmt, va_list ap) __attribute__ ((format (printf, 1, 0)));
67 void prom_fprintf (prom_handle dev, char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
68 void prom_printf (char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
70 void prom_vprintf (char *fmt, va_list ap);
71 void prom_fprintf (prom_handle dev, char *fmt, ...);
72 void prom_printf (char *fmt, ...);
75 void prom_perror (int error, char *filename);
76 void prom_readline (char *prompt, char *line, int len);
77 int prom_set_color(prom_handle device, int color, int r, int g, int b);
81 void *prom_claim (void *virt, unsigned int size, unsigned int align);
82 void prom_release(void *virt, unsigned int size);
83 void prom_map (void *phys, void *virt, int size);
85 /* packages and device nodes */
87 prom_handle prom_finddevice (char *name);
88 prom_handle prom_findpackage (char *path);
89 int prom_getprop (prom_handle dev, char *name, void *buf, int len);
90 int prom_get_devtype (char *device);
94 char *prom_getargs ();
95 void prom_setargs (char *args);
98 void prom_abort (char *fmt, ...);
99 void prom_sleep (int seconds);
101 int prom_interpret (char *forth);
103 int prom_get_chosen (char *name, void *mem, int len);
104 int prom_get_options (char *name, void *mem, int len);
106 extern int prom_getms(void);
107 extern void prom_pause(void);
109 extern void *call_prom (const char *service, int nargs, int nret, ...);
110 extern void *call_prom_return (const char *service, int nargs, int nret, ...);