1 /* $NetBSD: promlib.h,v 1.8 2005/12/11 12:19:16 christos Exp $ */
4 * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Paul Kranenburg and Matthew Fredette.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 * Macros and functions to hide the Sun2 PROM interface from the
34 * common Sun parts of the kernel.
37 #ifndef _MACHINE_PROMLIB_H_
38 #define _MACHINE_PROMLIB_H_
40 #include <machine/mon.h>
42 #ifdef _SUN2_PROMLIB_PRIVATE
43 #define romVectorPtr ((struct sunromvec *) SUN2_PROM_BASE)
44 #endif /* _SUN2_PROMLIB_PRIVATE */
47 * We define both of these, since there are places where their
48 * functionality is the same, and some common code knows that
49 * (e.g. dev/sun/zs.c).
54 void prom_init(void); /* To setup promops */
56 #define prom_version() (PROM_OLDMON)
57 int prom_memsize(void);
59 int prom_stdout(void);
61 int prom_getchar(void);
62 int prom_peekchar(void);
63 void prom_putchar(int);
64 void prom_putstr(char *, int);
65 void prom_printf(const char *, ...);
66 void prom_abort(void);
67 void prom_halt(void) __attribute__((__noreturn__
));
68 void prom_boot(const char *) __attribute__((__noreturn__
));
69 char *prom_getbootpath(void);
70 char *prom_getbootfile(void);
71 char *prom_getbootargs(void);
72 int prom_sd_target(int);
73 #define callrom prom_abort
76 * We also provide these, to keep #ifdef'ing down in common
77 * code. These should be revisited. The worst offender is
78 * our definition of CPU_ISSUN4, for the benefit of
83 #define PROM_OPENFIRM 4
84 #define prom_getpropint(a, b, c) (0)
85 #define CPU_ISSUN4 (1)
87 #endif /* _MACHINE_PROMLIB_H_ */