promif.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PROMIF_H
#define _SYS_PROMIF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* These are for V0 ops only. We sometimes have to specify
* to promif which type of operation we need to perform
* and since we can't get such a property from a V0 prom, we
* sometimes just assume it. V2 and later proms do the right thing.
*/
#define BLOCK 0
#define NETWORK 1
#define BYTE 2
/*
* resource allocation group: OBP and IEEE 1275-1994.
* prom_alloc is platform dependent on SPARC.
*/
/*
* Device tree and property group: OBP and IEEE 1275-1994.
*/
extern dnode_t prom_optionsnode(void);
extern dnode_t prom_alias_node(void);
extern dnode_t prom_rootnode(void);
extern char *prom_decode_composite_string(void *buf,
/*
* Device tree and property group: IEEE 1275-1994 Only.
*/
/*
* Device pathnames and pathname conversion: OBP and IEEE 1275-1994.
*/
/*
* Device pathnames and pathname conversion: IEEE 1275-1994 only.
*/
/*
* Special device nodes: OBP and IEEE 1275-1994.
*/
extern int prom_stdin_is_keyboard(void);
extern int prom_stdout_is_framebuffer(void);
extern char *prom_stdinpath(void);
extern char *prom_stdoutpath(void);
extern void prom_pathname(char *);
/*
* Special device nodes: IEEE 1275-1994 only.
*/
/*
* Administrative group: OBP and IEEE 1275-1994.
*/
extern void prom_enter_mon(void);
extern void prom_exit_to_mon(void)
extern void prom_reboot(char *bootstr)
extern void prom_panic(char *string)
extern int prom_is_openprom(void);
extern int prom_is_p1275(void);
extern int prom_version_boot_syscalls(void);
extern uint_t prom_gettime(void);
extern char *prom_bootpath(void);
extern char *prom_bootargs(void);
/*
* Administrative group: OBP only.
*/
/*
* Administrative group: IEEE 1275-1994 only.
*/
/*
* Administrative group: IEEE 1275 only.
*/
/*
* Promif support group: Generic.
*/
typedef uint_t prom_generation_cookie_t;
/*
* I/O Group: OBP and IEEE 1275.
*/
extern uchar_t prom_getchar(void);
extern void prom_putchar(char c);
extern int prom_mayget(void);
extern int prom_mayput(char c);
extern int prom_close(int fd);
/*PRINTFLIKE1*/
extern void prom_printf(const char *fmt, ...)
__PRINTFLIKE(1);
#pragma rarely_called(prom_printf)
__VPRINTFLIKE(1);
#pragma rarely_called(prom_vprintf)
/*PRINTFLIKE2*/
extern char *prom_sprintf(char *s, const char *fmt, ...)
__PRINTFLIKE(2);
__VPRINTFLIKE(2);
/*
* promif tree searching routines ... OBP and IEEE 1275-1994.
*/
extern char *prom_get_extend_name(void);
extern int prom_devreset(int);
extern int OpenCount;
extern struct ihandle *open_devices[];
#define PROM_STOP { \
prom_enter_mon(); \
}
#endif /* _KERNEL || _KMDB */
#ifdef _KERNEL
/*
* Used by wrappers which bring up console frame buffer before prom_printf()
* and other prom calls that may output to the console. Struct is filled in
* in prom_env.c and in sunpm.c
*/
typedef struct promif_owrap {
void (*preout)(void);
void (*postout)(void);
/*
* WAN boot key storage interface
*/
int *status);
int *status);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PROMIF_H */