xref: /titanic_50/usr/src/stand/sys/salib.h (revision e07d9cb85217949d497b02d7211de8a197d2f2eb)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_SALIB_H
28 #define	_SYS_SALIB_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <sys/memlist.h>
34 
35 /*
36  * This header file contains most of the libc-like interfaces exported by
37  * standalone's "libsa" library, and a few other odds and ends (witness the
38  * externs below).  This file should *only* be included from code that is
39  * built *exclusively* for use in the standalone environment.  Even then, it's
40  * perfectly acceptable to instead just use the traditional libc names for
41  * #include files (as we do below), since all standalone code is built against
42  * an alternate set of C headers (located under $SRC/stand/lib/sa).
43  */
44 
45 #include <assert.h>
46 #include <ctype.h>
47 #include <errno.h>
48 #include <libintl.h>
49 #include <netdb.h>
50 #include <stdio.h>
51 #include <stdlib.h>
52 #include <strings.h>
53 #include <time.h>
54 #include <unistd.h>
55 
56 #ifdef	__cplusplus
57 extern "C" {
58 #endif
59 
60 extern void init_boot_time(void);
61 extern void *bkmem_alloc(size_t);
62 extern void *bkmem_zalloc(size_t);
63 extern void bkmem_free(void *, size_t);
64 
65 /* memlist.c */
66 extern caddr_t tablep;
67 extern void print_memlist(struct memlist *);
68 extern void *getlink(uint_t);
69 extern struct memlist *get_memlist_struct(void);
70 extern void add_to_freelist(struct memlist *);
71 
72 /* standalloc.c */
73 extern caddr_t kern_resalloc(caddr_t, size_t, int);
74 extern void kern_resfree(caddr_t, size_t);
75 extern int get_progmemory(caddr_t, size_t, int);
76 
77 #ifdef	__i386
78 /* console.c */
79 extern int cons_gets(char *, int);
80 #endif
81 
82 #ifdef __sparc
83 /* prom_misc.c */
84 enum encode_how	{ ENCODE_BYTES, ENCODE_STRING };
85 extern void	prom_create_encoded_prop(char *, void *, int, enum encode_how);
86 #endif
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif	/* _SYS_SALIB_H */
93