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