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