SPARC: Remove ancient BSD arch headers.
None of these were used; they were all imported with the original root Haiku commit, and they are totally unrelated to PulkoMandy's new SPARC work. Plus, they were also under a BSD Advertising Clause license.
This commit is contained in:
parent
657f041aee
commit
4a230cfc6c
@ -1,44 +0,0 @@
|
|||||||
/* $OpenBSD: DEFS.h,v 1.2 1997/11/07 15:57:30 niklas Exp $ */
|
|
||||||
/* $NetBSD: DEFS.h,v 1.2 1994/10/26 06:39:51 cgd Exp $ */
|
|
||||||
|
|
||||||
/*-
|
|
||||||
* Copyright (c) 1992, 1993
|
|
||||||
* The Regents of the University of California. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software was developed by the Computer Systems Engineering group
|
|
||||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
|
||||||
* contributed to Berkeley.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
|
||||||
* must display the following acknowledgement:
|
|
||||||
* This product includes software developed by the University of
|
|
||||||
* California, Berkeley and its contributors.
|
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* @(#)DEFS.h 8.1 (Berkeley) 6/4/93
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <machine/asm.h>
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
|||||||
/* $OpenBSD: promdev.h,v 1.1 1997/09/17 10:46:19 downsj Exp $ */
|
|
||||||
/* $NetBSD: promdev.h,v 1.3 1995/09/18 21:31:50 pk Exp $ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1993 Paul Kranenburg
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
|
||||||
* must display the following acknowledgement:
|
|
||||||
* This product includes software developed by Paul Kranenburg.
|
|
||||||
* 4. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <machine/bsd_openprom.h>
|
|
||||||
|
|
||||||
struct promdata {
|
|
||||||
int fd; /* Openboot descriptor */
|
|
||||||
struct saioreq *si; /* Oldmon IO request */
|
|
||||||
int devtype; /* Kind of device we're booting from */
|
|
||||||
#define DT_BLOCK 1
|
|
||||||
#define DT_NET 2
|
|
||||||
#define DT_BYTE 3
|
|
||||||
/* Hooks for netif.c */
|
|
||||||
int (*xmit) __P((struct promdata *, void *, size_t));
|
|
||||||
int (*recv) __P((struct promdata *, void *, size_t));
|
|
||||||
};
|
|
||||||
|
|
||||||
#define LOADADDR ((caddr_t)0x4000)
|
|
||||||
#define DDB_MAGIC0 ( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('0') )
|
|
||||||
#define DDB_MAGIC1 ( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('1') )
|
|
||||||
#define DDB_MAGIC DDB_MAGIC0
|
|
||||||
|
|
||||||
extern struct promvec *promvec;
|
|
||||||
extern char *prom_bootdevice;
|
|
||||||
extern char *prom_bootfile;
|
|
||||||
extern int prom_boothow;
|
|
||||||
extern int hz;
|
|
||||||
extern int cputyp, nbpg, pgofset, pgshift;
|
|
||||||
extern int debug;
|
|
||||||
|
|
||||||
extern void prom_init __P((void));
|
|
||||||
|
|
||||||
/* Note: dvma_*() routines are for "oldmon" machines only */
|
|
||||||
extern char *dvma_mapin __P((char *, size_t));
|
|
||||||
extern char *dvma_mapout __P((char *, size_t));
|
|
||||||
extern char *dvma_alloc __P((int));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* duplicates from pmap.c for mapping device on "oldmon" machines.
|
|
||||||
*/
|
|
||||||
#include <sparc/asm.h>
|
|
||||||
|
|
||||||
#define getcontext() lduba(AC_CONTEXT, ASI_CONTROL)
|
|
||||||
#define setcontext(c) stba(AC_CONTEXT, ASI_CONTROL, c)
|
|
||||||
#define getsegmap(va) (cputyp == CPU_SUN4C \
|
|
||||||
? lduba(va, ASI_SEGMAP) \
|
|
||||||
: lduha(va, ASI_SEGMAP))
|
|
||||||
#define setsegmap(va, pmeg) (cputyp == CPU_SUN4C \
|
|
||||||
? stba(va, ASI_SEGMAP, pmeg) \
|
|
||||||
: stha(va, ASI_SEGMAP, pmeg))
|
|
||||||
#define getregmap(va) ((unsigned)lduha(va+2, ASI_REGMAP) >> 8)
|
|
||||||
#define setregmap(va, smeg) stha(va+2, ASI_REGMAP, (smeg << 8))
|
|
||||||
|
|
||||||
#define getpte(va) lda(va, ASI_PTE)
|
|
||||||
#define setpte(va, pte) sta(va, ASI_PTE, pte)
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
|||||||
/* $OpenBSD: saerrno.h,v 1.4 1996/10/29 08:00:58 mickey Exp $ */
|
|
||||||
/* $NetBSD: saerrno.h,v 1.6 1995/09/18 21:19:45 pk Exp $ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1988, 1993
|
|
||||||
* The Regents of the University of California. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
|
||||||
* must display the following acknowledgement:
|
|
||||||
* This product includes software developed by the University of
|
|
||||||
* California, Berkeley and its contributors.
|
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* @(#)saerrno.h 8.1 (Berkeley) 6/11/93
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/errno.h>
|
|
||||||
|
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
/* special stand error codes */
|
|
||||||
#define EADAPT (ELAST+1) /* bad adaptor */
|
|
||||||
#define ECTLR (ELAST+2) /* bad controller */
|
|
||||||
#define EUNIT (ELAST+3) /* bad drive */
|
|
||||||
#define EPART (ELAST+4) /* bad partition */
|
|
||||||
#define ERDLAB (ELAST+5) /* can't read disk label */
|
|
||||||
#define EUNLAB (ELAST+6) /* unlabeled disk */
|
|
||||||
#define EOFFSET (ELAST+7) /* relative seek not supported */
|
|
||||||
#define ECMD (ELAST+8) /* undefined driver command */
|
|
||||||
#define EBSE (ELAST+9) /* bad sector error */
|
|
||||||
#define EWCK (ELAST+10) /* write check error */
|
|
||||||
#define EECC (ELAST+11) /* uncorrectable ecc error */
|
|
||||||
#define EHER (ELAST+12) /* hard error */
|
|
||||||
#define ESALAST (ELAST+12) /* */
|
|
||||||
|
|
||||||
char *strerror __P((int err));
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
|||||||
/* $OpenBSD: saioctl.h,v 1.2 1996/09/23 14:19:04 mickey Exp $ */
|
|
||||||
/* $NetBSD: saioctl.h,v 1.2 1994/10/26 05:45:04 cgd Exp $ */
|
|
||||||
|
|
||||||
/*-
|
|
||||||
* Copyright (c) 1993
|
|
||||||
* The Regents of the University of California. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
|
||||||
* must display the following acknowledgement:
|
|
||||||
* This product includes software developed by the University of
|
|
||||||
* California, Berkeley and its contributors.
|
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* @(#)saioctl.h 8.1 (Berkeley) 6/11/93
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* ioctl's -- for disks just now */
|
|
||||||
#define SAIOHDR (('d'<<8)|1) /* next i/o includes header */
|
|
||||||
#define SAIOCHECK (('d'<<8)|2) /* next i/o checks data */
|
|
||||||
#define SAIOHCHECK (('d'<<8)|3) /* next i/o checks header & data */
|
|
||||||
#define SAIONOBAD (('d'<<8)|4) /* inhibit bad sector forwarding */
|
|
||||||
#define SAIODOBAD (('d'<<8)|5) /* enable bad sector forwarding */
|
|
||||||
#define SAIOECCLIM (('d'<<8)|6) /* set limit to ecc correction, bits */
|
|
||||||
#define SAIOECCUNL (('d'<<8)|7) /* use standard ecc procedures */
|
|
||||||
#define SAIORETRIES (('d'<<8)|8) /* set retry count for unit */
|
|
||||||
#define SAIODEVDATA (('d'<<8)|9) /* get pointer to pack label */
|
|
||||||
#define SAIOSSI (('d'<<8)|10) /* set skip sector inhibit */
|
|
||||||
#define SAIONOSSI (('d'<<8)|11) /* inhibit skip sector handling */
|
|
||||||
#define SAIOSSDEV (('d'<<8)|12) /* is device skip sector type? */
|
|
||||||
#define SAIODEBUG (('d'<<8)|13) /* enable/disable debugging */
|
|
||||||
#define SAIOGBADINFO (('d'<<8)|14) /* get bad-sector table */
|
|
||||||
|
|
@ -1,214 +0,0 @@
|
|||||||
/* $OpenBSD: stand.h,v 1.35 1998/07/29 00:38:36 mickey Exp $ */
|
|
||||||
/* $NetBSD: stand.h,v 1.18 1996/11/30 04:35:51 gwr Exp $ */
|
|
||||||
|
|
||||||
/*-
|
|
||||||
* Copyright (c) 1993
|
|
||||||
* The Regents of the University of California. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
|
||||||
* must display the following acknowledgement:
|
|
||||||
* This product includes software developed by the University of
|
|
||||||
* California, Berkeley and its contributors.
|
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
* @(#)stand.h 8.1 (Berkeley) 6/11/93
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#ifdef __STDC__
|
|
||||||
#include <machine/stdarg.h>
|
|
||||||
#else
|
|
||||||
#include <machine/varargs.h>
|
|
||||||
#endif
|
|
||||||
#include "saioctl.h"
|
|
||||||
#include "saerrno.h"
|
|
||||||
|
|
||||||
#ifndef NULL
|
|
||||||
#define NULL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct open_file;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Useful macros
|
|
||||||
*/
|
|
||||||
#define NENTS(x) sizeof(x)/sizeof(x[0])
|
|
||||||
/* don't define if libkern included */
|
|
||||||
#ifndef LIBKERN_INLINE
|
|
||||||
#define max(a,b) (((a)>(b))? (a) : (b))
|
|
||||||
#define min(a,b) (((a)>(b))? (b) : (a))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This structure is used to define file system operations in a file system
|
|
||||||
* independent way.
|
|
||||||
*/
|
|
||||||
struct fs_ops {
|
|
||||||
int (*open) __P((char *path, struct open_file *f));
|
|
||||||
int (*close) __P((struct open_file *f));
|
|
||||||
int (*read) __P((struct open_file *f, void *buf,
|
|
||||||
size_t size, size_t *resid));
|
|
||||||
int (*write) __P((struct open_file *f, void *buf,
|
|
||||||
size_t size, size_t *resid));
|
|
||||||
off_t (*seek) __P((struct open_file *f, off_t offset, int where));
|
|
||||||
int (*stat) __P((struct open_file *f, struct stat *sb));
|
|
||||||
int (*readdir) __P((struct open_file *f, char *));
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct fs_ops file_system[];
|
|
||||||
extern int nfsys;
|
|
||||||
|
|
||||||
/* where values for lseek(2) */
|
|
||||||
#define SEEK_SET 0 /* set file offset to offset */
|
|
||||||
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
|
||||||
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
|
||||||
|
|
||||||
/* Device switch */
|
|
||||||
struct devsw {
|
|
||||||
char *dv_name;
|
|
||||||
int (*dv_strategy) __P((void *devdata, int rw,
|
|
||||||
daddr_t blk, size_t size,
|
|
||||||
void *buf, size_t *rsize));
|
|
||||||
int (*dv_open) __P((struct open_file *f, ...));
|
|
||||||
int (*dv_close) __P((struct open_file *f));
|
|
||||||
int (*dv_ioctl) __P((struct open_file *f, u_long cmd, void *data));
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct devsw devsw[]; /* device array */
|
|
||||||
extern int ndevs; /* number of elements in devsw[] */
|
|
||||||
|
|
||||||
extern struct consdev constab[];
|
|
||||||
extern struct consdev *cn_tab;
|
|
||||||
|
|
||||||
struct open_file {
|
|
||||||
int f_flags; /* see F_* below */
|
|
||||||
struct devsw *f_dev; /* pointer to device operations */
|
|
||||||
void *f_devdata; /* device specific data */
|
|
||||||
struct fs_ops *f_ops; /* pointer to file system operations */
|
|
||||||
void *f_fsdata; /* file system specific data */
|
|
||||||
off_t f_offset; /* current file offset (F_RAW) */
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SOPEN_MAX 4
|
|
||||||
extern struct open_file files[];
|
|
||||||
|
|
||||||
/* f_flags values */
|
|
||||||
#define F_READ 0x0001 /* file opened for reading */
|
|
||||||
#define F_WRITE 0x0002 /* file opened for writing */
|
|
||||||
#define F_RAW 0x0004 /* raw device open - no file system */
|
|
||||||
#define F_NODEV 0x0008 /* network open - no device */
|
|
||||||
|
|
||||||
#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
|
|
||||||
#define islower(c) ((c) >= 'a' && (c) <= 'z')
|
|
||||||
#define isalpha(c) (isupper(c)||islower(c))
|
|
||||||
#define tolower(c) (isupper(c)?((c) - 'A' + 'a'):(c))
|
|
||||||
#define toupper(c) (islower(c)?((c) - 'a' + 'A'):(c))
|
|
||||||
#define isspace(c) ((c) == ' ' || (c) == '\t')
|
|
||||||
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
|
||||||
|
|
||||||
#define btochs(b,c,h,s,nh,ns) \
|
|
||||||
c = (b) / ((nh) * (ns)); \
|
|
||||||
h = ((b) % ((nh) * (ns))) / (ns); \
|
|
||||||
s = ((b) % ((nh) * (ns))) % (ns);
|
|
||||||
|
|
||||||
void *alloc __P((u_int));
|
|
||||||
void *alloca __P((size_t));
|
|
||||||
void free __P((void *, u_int));
|
|
||||||
struct disklabel;
|
|
||||||
char *getdisklabel __P((const char *, struct disklabel *));
|
|
||||||
u_int dkcksum __P((struct disklabel *));
|
|
||||||
|
|
||||||
void printf __P((const char *, ...));
|
|
||||||
void sprintf __P((char *, const char *, ...));
|
|
||||||
void vprintf __P((const char *, _BSD_VA_LIST_));
|
|
||||||
void twiddle __P((void));
|
|
||||||
void gets __P((char *));
|
|
||||||
__dead void panic __P((const char *, ...)) __attribute__((noreturn));
|
|
||||||
__dead void _rtt __P((void)) __attribute__((noreturn));
|
|
||||||
#define bzero(s,n) ((void)memset((s),0,(n)))
|
|
||||||
#define bcmp(s1,s2,n) (memcmp((s2),(s1),(n)))
|
|
||||||
#define bcopy(s1,s2,n) ((void)memcpy((s2),(s1),(n)))
|
|
||||||
void *memcpy __P((void *, const void *, size_t));
|
|
||||||
int memcmp __P((const void *, const void*, size_t));
|
|
||||||
char *strncpy __P((char *, const char *, size_t));
|
|
||||||
char *strcpy __P((char *, const char *));
|
|
||||||
int strncmp __P((const char *, const char *, size_t));
|
|
||||||
size_t strlen __P((const char *));
|
|
||||||
long strtol __P((const char *, char **, int));
|
|
||||||
char *strchr __P((const char *, int));
|
|
||||||
void *memset __P((void *, int, size_t));
|
|
||||||
void exec __P((char *, void *, int));
|
|
||||||
void exit __P((void));
|
|
||||||
int open __P((const char *, int));
|
|
||||||
int close __P((int));
|
|
||||||
void closeall __P((void));
|
|
||||||
ssize_t read __P((int, void *, size_t));
|
|
||||||
ssize_t write __P((int, void *, size_t));
|
|
||||||
int stat __P((const char *path, struct stat *sb));
|
|
||||||
int fstat __P((int fd, struct stat *sb));
|
|
||||||
int opendir __P((char *));
|
|
||||||
int readdir __P((int, char *));
|
|
||||||
void closedir __P((int));
|
|
||||||
int nodev __P((void));
|
|
||||||
int noioctl __P((struct open_file *, u_long, void *));
|
|
||||||
void nullsys __P((void));
|
|
||||||
|
|
||||||
int null_open __P((char *path, struct open_file *f));
|
|
||||||
int null_close __P((struct open_file *f));
|
|
||||||
ssize_t null_read __P((struct open_file *f, void *buf,
|
|
||||||
size_t size, size_t *resid));
|
|
||||||
ssize_t null_write __P((struct open_file *f, void *buf,
|
|
||||||
size_t size, size_t *resid));
|
|
||||||
off_t null_seek __P((struct open_file *f, off_t offset, int where));
|
|
||||||
int null_stat __P((struct open_file *f, struct stat *sb));
|
|
||||||
int null_readdir __P((struct open_file *f, char *name));
|
|
||||||
char *ttyname __P((int)); /* match userland decl, but ignore !0 */
|
|
||||||
dev_t ttydev __P((char *));
|
|
||||||
void cninit __P((void));
|
|
||||||
int cnset __P((dev_t));
|
|
||||||
void cnputc __P((int));
|
|
||||||
int cngetc __P((void));
|
|
||||||
int cnischar __P((void));
|
|
||||||
int cnspeed __P((dev_t, int));
|
|
||||||
u_int sleep __P((u_int));
|
|
||||||
void usleep __P((u_int));
|
|
||||||
char *ctime __P((const time_t *));
|
|
||||||
|
|
||||||
void putchar __P((int));
|
|
||||||
int getchar __P((void));
|
|
||||||
|
|
||||||
#ifdef __INTERNAL_LIBSA_CREAD
|
|
||||||
int oopen __P((const char *, int));
|
|
||||||
int oclose __P((int));
|
|
||||||
ssize_t oread __P((int, void *, size_t));
|
|
||||||
off_t olseek __P((int, off_t, int));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Machine dependent functions */
|
|
||||||
int devopen __P((struct open_file *, const char *, char **));
|
|
||||||
void machdep_start __P((char *, int, char *, char *, char *));
|
|
||||||
time_t getsecs __P((void));
|
|
||||||
|
|
@ -1,166 +0,0 @@
|
|||||||
/* This is just like the default gvarargs.h
|
|
||||||
except for differences described below. */
|
|
||||||
|
|
||||||
/* Define __gnuc_va_list. */
|
|
||||||
|
|
||||||
#ifndef __GNUC_VA_LIST
|
|
||||||
#define __GNUC_VA_LIST
|
|
||||||
#if ! defined (__svr4__) && ! defined (__linux__) && ! defined (__arch64__)
|
|
||||||
/* This has to be a char * to be compatible with Sun.
|
|
||||||
i.e., we have to pass a `va_list' to vsprintf. */
|
|
||||||
typedef char * __gnuc_va_list;
|
|
||||||
#else
|
|
||||||
/* This has to be a void * to be compatible with Sun svr4.
|
|
||||||
i.e., we have to pass a `va_list' to vsprintf. */
|
|
||||||
typedef void * __gnuc_va_list;
|
|
||||||
#endif
|
|
||||||
#endif /* not __GNUC_VA_LIST */
|
|
||||||
|
|
||||||
/* If this is for internal libc use, don't define anything but
|
|
||||||
__gnuc_va_list. */
|
|
||||||
#if defined (_STDARG_H) || defined (_VARARGS_H)
|
|
||||||
|
|
||||||
#ifdef _STDARG_H
|
|
||||||
|
|
||||||
/* Call __builtin_next_arg even though we aren't using its value, so that
|
|
||||||
we can verify that LASTARG is correct. */
|
|
||||||
#if defined (__GCC_NEW_VARARGS__) || defined (__arch64__)
|
|
||||||
#define va_start(AP, LASTARG) \
|
|
||||||
(__builtin_next_arg (LASTARG), AP = (char *) __builtin_saveregs ())
|
|
||||||
#else
|
|
||||||
#define va_start(AP, LASTARG) \
|
|
||||||
(__builtin_saveregs (), AP = ((char *) __builtin_next_arg (LASTARG)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define va_alist __builtin_va_alist
|
|
||||||
#define va_dcl int __builtin_va_alist;...
|
|
||||||
|
|
||||||
#if defined (__GCC_NEW_VARARGS__) || defined (__arch64__)
|
|
||||||
#define va_start(AP) ((AP) = (char *) __builtin_saveregs ())
|
|
||||||
#else
|
|
||||||
#define va_start(AP) \
|
|
||||||
(__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef va_end
|
|
||||||
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
|
||||||
|
|
||||||
/* Values returned by __builtin_classify_type. */
|
|
||||||
|
|
||||||
enum __va_type_classes {
|
|
||||||
__no_type_class = -1,
|
|
||||||
__void_type_class,
|
|
||||||
__integer_type_class,
|
|
||||||
__char_type_class,
|
|
||||||
__enumeral_type_class,
|
|
||||||
__boolean_type_class,
|
|
||||||
__pointer_type_class,
|
|
||||||
__reference_type_class,
|
|
||||||
__offset_type_class,
|
|
||||||
__real_type_class,
|
|
||||||
__complex_type_class,
|
|
||||||
__function_type_class,
|
|
||||||
__method_type_class,
|
|
||||||
__record_type_class,
|
|
||||||
__union_type_class,
|
|
||||||
__array_type_class,
|
|
||||||
__string_type_class,
|
|
||||||
__set_type_class,
|
|
||||||
__file_type_class,
|
|
||||||
__lang_type_class
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#define va_end(pvar) ((void)0)
|
|
||||||
|
|
||||||
/* Avoid errors if compiling GCC v2 with GCC v1. */
|
|
||||||
#if __GNUC__ == 1
|
|
||||||
#define __extension__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* RECORD_TYPE args passed using the C calling convention are
|
|
||||||
passed by invisible reference. ??? RECORD_TYPE args passed
|
|
||||||
in the stack are made to be word-aligned; for an aggregate that is
|
|
||||||
not word-aligned, we advance the pointer to the first non-reg slot. */
|
|
||||||
|
|
||||||
#ifdef __arch64__
|
|
||||||
|
|
||||||
typedef unsigned int __ptrint __attribute__ ((__mode__ (__DI__)));
|
|
||||||
|
|
||||||
/* ??? TODO: little endian support */
|
|
||||||
|
|
||||||
#define va_arg(pvar, TYPE) \
|
|
||||||
__extension__ \
|
|
||||||
(*({int __type = __builtin_classify_type (* (TYPE *) 0); \
|
|
||||||
char * __result; \
|
|
||||||
if (__type == __real_type_class) /* float? */ \
|
|
||||||
{ \
|
|
||||||
if (__alignof__ (TYPE) == 16) \
|
|
||||||
(pvar) = (void *) (((__ptrint) (pvar) + 15) & -16); \
|
|
||||||
__result = (pvar); \
|
|
||||||
(pvar) = (char *) (pvar) + sizeof (TYPE); \
|
|
||||||
} \
|
|
||||||
else if (__type < __record_type_class) /* integer? */ \
|
|
||||||
{ \
|
|
||||||
(pvar) = (char *) (pvar) + 8; \
|
|
||||||
__result = (char *) (pvar) - sizeof (TYPE); \
|
|
||||||
} \
|
|
||||||
else /* aggregate object */ \
|
|
||||||
{ \
|
|
||||||
if (sizeof (TYPE) <= 8) \
|
|
||||||
{ \
|
|
||||||
__result = (pvar); \
|
|
||||||
(pvar) = (char *) (pvar) + 8; \
|
|
||||||
} \
|
|
||||||
else if (sizeof (TYPE) <= 16) \
|
|
||||||
{ \
|
|
||||||
if (__alignof__ (TYPE) == 16) \
|
|
||||||
(pvar) = (void *) (((__ptrint) (pvar) + 15) & -16); \
|
|
||||||
__result = (pvar); \
|
|
||||||
(pvar) = (char *) (pvar) + 16; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
__result = * (void **) (pvar); \
|
|
||||||
(pvar) = (char *) (pvar) + 8; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
(TYPE *) __result;}))
|
|
||||||
|
|
||||||
#else /* not __arch64__ */
|
|
||||||
|
|
||||||
#define __va_rounded_size(TYPE) \
|
|
||||||
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
|
|
||||||
|
|
||||||
/* We don't declare the union member `d' to have type TYPE
|
|
||||||
because that would lose in C++ if TYPE has a constructor. */
|
|
||||||
/* We cast to void * and then to TYPE * because this avoids
|
|
||||||
a warning about increasing the alignment requirement.
|
|
||||||
The casts to char * avoid warnings about invalid pointer arithmetic. */
|
|
||||||
#define va_arg(pvar,TYPE) \
|
|
||||||
__extension__ \
|
|
||||||
(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
|
|
||||||
|| (__builtin_classify_type (*(TYPE*) 0) == __real_type_class \
|
|
||||||
&& sizeof (TYPE) == 16)) \
|
|
||||||
? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \
|
|
||||||
*(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \
|
|
||||||
: __va_rounded_size (TYPE) == 8 \
|
|
||||||
? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \
|
|
||||||
__u.__i[0] = ((int *) (void *) (pvar))[0]; \
|
|
||||||
__u.__i[1] = ((int *) (void *) (pvar))[1]; \
|
|
||||||
(pvar) = (char *)(pvar) + 8; \
|
|
||||||
(TYPE *) (void *) __u.__d; }) \
|
|
||||||
: ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE), \
|
|
||||||
((TYPE *) (void *) ((char *)(pvar) - __va_rounded_size (TYPE)))));}))
|
|
||||||
|
|
||||||
#endif /* not __arch64__ */
|
|
||||||
|
|
||||||
/* Copy __gnuc_va_list into another variable of this type. */
|
|
||||||
#define __va_copy(dest, src) (dest) = (src)
|
|
||||||
|
|
||||||
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user