|
root / base / usr / src / stand / sys
sys Plain Text 699 lines 19.9 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 (c) 1995-1996, Sun Microsystems, Inc.  All Rights Reserved.
 */

#ifndef	_SYS_BOOTCMN_H
#define	_SYS_BOOTCMN_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef __cplusplus
extern "C" {
#endif

/*	dummy device names for boot and floppy devices			*/
#define	BOOT_DEV_NAME	"<bootdev>"
#define	FLOPPY0_NAME	"/dev/diskette0"
#define	FLOPPY1_NAME	"/dev/diskette1"

/*	Maximum size (in characters) allotted to DOS volume labels	*/
#define	VOLLABELSIZE	11

#ifdef __cplusplus
}
#endif

#endif /* _SYS_BOOTCMN_H */
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 1996, 2001, 2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_BOOTDEBUG_H
#define	_SYS_BOOTDEBUG_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * a collection of usefule debug defines and macros
 */

/* #define	COMPFS_OPS_DEBUG */
/* #define	PCFS_OPS_DEBUG */
/* #define	HSFS_OPS_DEBUG */
/* #define	UFS_OPS_DEBUG */
/* #define	NFS_OPS_DEBUG */
/* #define	CFS_OPS_DEBUG */
/* #define	VERIFY_HASH_REALLOC */

#include <sys/reboot.h>

extern int boothowto;			/* What boot options are set */
extern int verbosemode;

#define	dprintf		if (boothowto & RB_DEBUG) printf
#define	DBFLAGS		(RB_DEBUG | RB_VERBOSE)

/*
 * Debug Message Macros - will print message if CFS_OPS_DEBUG
 * is defined.
 */
#ifdef CFS_OPS_DEBUG

#define	OPS_DEBUG(args)	{ printf args; }
#define	OPS_DEBUG_CK(args)\
	{ if ((boothowto & DBFLAGS) == DBFLAGS) printf args; }

#else /* CFS_OPS_DEBUG */

#define	OPS_DEBUG(args)	/* nothing */
#define	OPS_DEBUG_CK(args)	/* nothing */

#endif /* CFS_OPS_DEBUG */

#ifdef __cplusplus
}
#endif

#endif	/* _SYS_BOOTDEBUG_H */
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_BOOTHSFS_H
#define	_SYS_BOOTHSFS_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/types.h>
#include <sys/bootvfs.h>

extern struct boot_fs_ops boot_hsfs_ops;

#ifdef __cplusplus
}
#endif

#endif /* _SYS_BOOTHSFS_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2008 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_BOOTSYMS_H
#define	_SYS_BOOTSYMS_H

/*
 * This header file should not exist.
 *
 * Whether it be due to laziness, machismo, or just plain cluelessness, most
 * of the symbols over in psm/stand are not properly prototyped anywhere.
 *
 * To workaround this, developers have adopted the horrendous practice of
 * "externing" the symbols they need, leading to dozens of declarations of
 * the same symbol which have to be kept in sync.  Unfortunately, no similar
 * workaround exists for lint's pass2, which requires definitions for all
 * symbols in order to properly perform cross-checks.
 *
 * Thus, this header file was created to address the problems:
 *
 *	- The "extern" problem.  All files beneath stand/lib should #include
 *	  this file rather than "extern" the symbol. Additionally, existing
 *	  externs should be removed as convenient.
 *
 *	  Of course, eventually some brave soul needs to venture over to the
 *	  slums of psm/stand and add all the proper header files, at which
 *	  point this file can be disposed of.
 *
 * Note that the set of symbols shared between stand/lib and psm/stand is
 * itself a moving target.  As such, this file should be updated as needed
 * so that it always contains the *minimum* set of shared symbols needed to
 * avoid externs and placate lint.
 */

#include <sys/saio.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * From psm/stand/boot/$(MACH)/common/fsconf.c:
 */
extern int nfs_readsize;
extern int boot_nfsw;
extern struct boot_fs_ops *boot_fsw[];
extern struct boot_fs_ops *extendfs_ops;
extern struct boot_fs_ops *origfs_ops;

/*
 * From psm/stand/boot/common/boot.c:
 */
extern int boothowto;
extern int verbosemode;
extern char *systype;
extern struct memlist *pfreelistp;
extern struct memlist *vfreelistp;
extern void set_default_filename(char *);

/*
 * From psm/stand/boot/common/heap_kmem.c:
 */
extern void *bkmem_alloc(size_t);
extern void *bkmem_zalloc(size_t);
extern void bkmem_free(void *, size_t);

/*
 * From psm/stand/boot/$(MACH)/common/$(MACH)_standalloc.c:
 */
extern caddr_t resalloc(enum RESOURCES, size_t, caddr_t, int);
extern void resfree(enum RESOURCES, caddr_t, size_t);
extern void reset_alloc(void);

/*
 * From psm/stand/lib/names/$(MACH)/common/mfgname.c: (libnames)
 */
extern char *get_mfg_name(void);

/*
 * From psm/stand/boot/i386/common/boot_plat.c or
 *      psm/stand/boot/sparcv9/sun4u/machdep.c:
 */
extern int pagesize;
extern int global_pages;

#ifdef __sparc
/*
 * From psm/stand/boot/sparc/common/fsconf.c:
 */
extern char *bootp_response;
#endif /* __sparc */

#ifdef __cplusplus
}
#endif

#endif /* _SYS_BOOTSYMS_H */
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_BOOTUFS_H
#define	_SYS_BOOTUFS_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/types.h>
#include <sys/bootvfs.h>

extern struct boot_fs_ops boot_ufs_ops;

#ifdef __cplusplus
}
#endif

#endif /* _SYS_BOOTUFS_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2008 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_BOOTVFS_H
#define	_SYS_BOOTVFS_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/filep.h>
#include <sys/dirent.h>
#include <sys/bootstat.h>

/* same as those in /usr/include/unistd.h */
#define	SEEK_SET	0	/* Offset */
#define	SEEK_CUR	1	/* Current + Offset */
#define	SEEK_END	2	/* EOF + Offset */

/* mountroot/unmountroot return values */
#define	VFS_SUCCESS	0
#define	VFS_FAILURE	-1

/*
 * unified (vfs-like) file system operations for booters
 */

struct boot_fs_ops {
    char	*fsw_name;
    int		(*fsw_mountroot)(char *str);
    int		(*fsw_unmountroot)(void);
    int		(*fsw_open)(char *filename, int flags);
    int		(*fsw_close)(int fd);
    ssize_t	(*fsw_read)(int fd, caddr_t buf, size_t size);
    off_t	(*fsw_lseek)(int filefd, off_t addr, int whence);
    int		(*fsw_fstat)(int filefd, struct bootstat *buf);
    void	(*fsw_closeall)(int flag);
    int		(*fsw_getdents)(int fd, struct dirent *buf, unsigned size);
};

/*
 *  Function prototypes
 *
 *	fstat() (if exists) supports size and mode right now.
 */

extern	int	mountroot(char *str);
extern	int	unmountroot(void);
extern	int	open(const char *filename, int flags);
extern	int	close(int fd);
extern	ssize_t	read(int fd, void *buf, size_t size);
extern	off_t	lseek(int filefd, off_t addr, int whence);
extern	int	fstat(int fd, struct stat *buf);
extern	int	stat(const char *filename, struct stat *buf);

/*
 * The compfs filesystem provides additional fsswitch-like entry points,
 * though these are not yet hooked properly into the fsswitch.
 */

extern	void	closeall(int flag);

extern	ssize_t	kern_read(int fd, caddr_t buf, size_t size);
extern	int	kern_open(char *filename, int flags);
extern	off_t	kern_seek(int fd, off_t hi, off_t lo);
extern	off_t	kern_lseek(int fd, off_t hi, off_t lo);
extern	int	kern_close(int fd);
extern	int	kern_fstat(int fd, struct bootstat *buf);
extern	int	kern_getdents(int fd, struct dirent *buf, size_t size);
extern	int	kern_mountroot(char *path);
extern	int	kern_unmountroot(void);

/*
 * these are for common fs switch interface routines
 */
extern	int	boot_no_ops(void);	/* no ops entry */
extern	void	boot_no_ops_void(void);	/* no ops entry */

extern	struct boot_fs_ops *get_default_fs(void);
extern	struct boot_fs_ops *get_fs_ops_pointer(char *fsw_name);
extern	void	set_default_fs(char *fsw_name);
extern	void	clr_default_fs(void);
extern	char 	*set_fstype(char *v2path, char *bpath);

#ifdef __cplusplus
}
#endif

#endif /* _SYS_BOOTVFS_H */
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 _SA_CMN_ERR_H
#define	_SA_CMN_ERR_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

/*
 * Exported interfaces for standalone's subset of kernel's <sys/cmn_err.h>.
 * Really all that is needed are the printf functions defined in stdio.h.
 */
#include <stdio.h>

#endif /* _SA_CMN_ERR_H */
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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_SACACHE_H
#define	_SYS_SACACHE_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/filep.h>
#include <sys/dirent.h>

/*
 * there are common cache interface routines
 */

extern	void	*get_icache(int dev, int inum);
extern	void	set_icache(int dev, int inum, void *buf, int len);
extern	int	set_ricache(int dev, int inum, void *buf, int len);
extern	int	get_dcache(int dev, char *name, int pnum);
extern	void	set_dcache(int dev, char *name, int pnum, int inum);
extern	int	set_rdcache(int dev, char *name, int pnum, int inum);
extern  caddr_t	get_bcache(fileid_t *fp);
extern  int	set_bcache(fileid_t *fp);
extern	void	release_cache(int dev);
extern	void	print_cache_data(void);

extern	int	read_opt;

#ifdef __cplusplus
}
#endif

#endif /* _SYS_SACACHE_H */
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2005 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_SAIO_H
#define	_SYS_SAIO_H

#pragma ident	"%Z%%M%	%I%	%E% SMI" /* from SunOS 4.1 */

/*
 * NOTE: This header file is a vestige from a previous era.  The RESOURCES
 *	 enum should be move somewhere more appropriate (with an accompanying
 *	 proper prototype for resalloc()) and this should be removed.
 */

#include <sys/types.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Types of resources that can be allocated by resalloc().
 */
enum RESOURCES {
	RES_MAINMEM,		/* Main memory, accessible to CPU */
	RES_RAWVIRT,		/* Raw addr space that can be mapped */
	RES_DMAMEM,		/* Memory acc. by CPU and by all DMA I/O */
	RES_DMAVIRT,		/* Raw addr space accessible by DMA I/O */
	RES_PHYSICAL,		/* Physical address */
	RES_VIRTALLOC,		/* Virtual addresses used */
	RES_BOOTSCRATCH,	/* Memory <4MB used only by boot. */
#ifdef	__sparc
	RES_CHILDVIRT,		/* Virt anywhere, phys > 4MB */
	RES_BOOTSCRATCH_NOFAIL
#else
	RES_CHILDVIRT		/* Virt anywhere, phys > 4MB */
#endif
};

#ifdef __cplusplus
}
#endif

#endif /* _SYS_SAIO_H */
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2008 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_SALIB_H
#define	_SYS_SALIB_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <sys/types.h>
#include <sys/memlist.h>

/*
 * This header file contains most of the libc-like interfaces exported by
 * standalone's "libsa" library, and a few other odds and ends (witness the
 * externs below).  This file should *only* be included from code that is
 * built *exclusively* for use in the standalone environment.  Even then, it's
 * perfectly acceptable to instead just use the traditional libc names for
 * #include files (as we do below), since all standalone code is built against
 * an alternate set of C headers (located under $SRC/stand/lib/sa).
 */

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <libintl.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <time.h>
#include <unistd.h>

#ifdef	__cplusplus
extern "C" {
#endif

extern void init_boot_time(void);
extern void *bkmem_alloc(size_t);
extern void *bkmem_zalloc(size_t);
extern void bkmem_free(void *, size_t);

/* memlist.c */
extern caddr_t tablep;
extern void print_memlist(struct memlist *);
extern void *getlink(uint_t);
extern struct memlist *get_memlist_struct(void);
extern void add_to_freelist(struct memlist *);

/* standalloc.c */
extern caddr_t kern_resalloc(caddr_t, size_t, int);
extern void kern_resfree(caddr_t, size_t);
extern int get_progmemory(caddr_t, size_t, int);

#ifdef __sparc
/* prom_misc.c */
enum encode_how	{ ENCODE_BYTES, ENCODE_STRING };
extern void	prom_create_encoded_prop(char *, void *, int, enum encode_how);
#endif

#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_SALIB_H */