stdarg.h, varargs.h, psl.h, autoconf.h: posted patches from torek

cpu.h: cpu_adjstack() won't work well in the NetBSD execve - need a
	different model, stub enablertclock() for now..
exec.h: a netbsd-type exec.h file (ie. empty)
param.h: add MID_MACHINE
pmap.h: delete kernel_pmap hack - it doesn't work for us, + two proto's
vmparam.h: VM_MIN_ADDRESS = 0!
This commit is contained in:
deraadt 1993-10-11 02:28:23 +00:00
parent ed575390ee
commit 7ee2311b78
10 changed files with 60 additions and 241 deletions

View File

@ -1,15 +1,6 @@
/*
* 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.
*
* 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, Lawrence Berkeley Laboratory.
* Copyright (c) 1993 Christopher G. Demetriou
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -19,110 +10,24 @@
* 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.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software withough 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.
* 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.
*
* @(#)exec.h 8.1 (Berkeley) 6/11/93
*
* from: Header: exec.h,v 1.9 93/04/20 11:14:45 torek Exp
* $Id: aout_machdep.h,v 1.1 1993/10/02 10:23:08 deraadt Exp $
* $Id: aout_machdep.h,v 1.2 1993/10/11 02:28:26 deraadt Exp $
*/
/*
* __LDPGSZ is the page size used by the linker and by exec().
* It may be some multiple of the ``normal'' page size, so that, e.g.,
* the same binaries can be run on hardware with different page sizes
* that otherwise use the same instruction set. It must be no larger
* than CLBYTES (in param.h).
*/
#define __LDPGSZ 8192
#ifndef _SPARC_EXEC_H_
#define _SPARC_EXEC_H_
/* Valid magic number check. */
#define N_BADMAG(ex) \
((ex).a_magic != ZMAGIC && (ex).a_magic != NMAGIC && \
(ex).a_magic != OMAGIC)
/*
* N_TXTADDR is the address of the first executable instruction: that is,
* the place the pc could begin after an a.out is loaded, in order to run
* the instructions in that a.out. The pc will actually be set to ex.a_entry
* but this is the first place it could possibly reference.
*
* On the SPARC, binaries begin at __LDPGSZ, i.e., page 1.
*/
#define N_TXTADDR(ex) 8192
/* Address of the bottom of the data segment. */
#define N_DATADDR(ex) \
(N_TXTADDR(ex) + ((ex).a_magic == OMAGIC ? (ex).a_text : \
(((ex).a_text + __LDPGSZ - 1) & ~(__LDPGSZ - 1))))
/*
* N_TXTOFF is the offset within an a.out file of the first executable
* instruction: that is, the offset in the a.out of the byte that winds
* up at N_TXTADDR.
*
* On the SPARC, the a.out header is included in the executable when running
* a ZMAGIC file (but not for OMAGIC and NMAGIC).
*/
#define N_TXTOFF(ex) ((ex).a_magic == ZMAGIC ? 0 : sizeof(struct exec))
/* Data segment offset. */
#define N_DATOFF(ex) \
(N_TXTOFF(ex) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \
(((ex).a_text + __LDPGSZ - 1) & ~(__LDPGSZ - 1))))
/* Symbol table offset. */
#define N_SYMOFF(ex) \
(N_TXTOFF(ex) + (ex).a_text + (ex).a_data + (ex).a_trsize + \
(ex).a_drsize)
/* String table offset. */
#define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms)
/* Description of the object file header (a.out format). */
struct exec {
u_char a_dynamic:1; /* dynamically linked */
u_char a_toolversion:7;/* Sun toolset version XXX */
#define MID_ZERO 0 /* unknown - implementation dependent */
#define MID_SUN010 1 /* sun 68010/68020 binary */
#define MID_SUN020 2 /* sun 68020-only binary */
#define MID_SUN_SPARC 3 /* sparc binary */
#define MID_HP200 200 /* hp200 (68010) BSD binary */
#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */
#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */
#define MID_HPUX800 0x20B /* hp800 HP-UX binary */
u_char a_mid; /* machine ID */
#define OMAGIC 0407 /* old impure format */
#define NMAGIC 0410 /* read-only text */
#define ZMAGIC 0413 /* demand load format */
u_short a_magic; /* magic number */
u_long a_text; /* text segment size */
u_long a_data; /* initialized data size */
u_long a_bss; /* uninitialized data size */
u_long a_syms; /* symbol table size */
u_long a_entry; /* entry point */
u_long a_trsize; /* text relocation size */
u_long a_drsize; /* data relocation size */
};
#define a_machtype a_mid /* SUN compatibility */
#endif /* _SPARC_EXEC_H_ */

View File

@ -42,7 +42,7 @@
* @(#)autoconf.h 8.1 (Berkeley) 6/11/93
*
* from: Header: autoconf.h,v 1.10 92/11/26 02:04:32 torek Exp (LBL)
* $Id: autoconf.h,v 1.1 1993/10/02 10:23:03 deraadt Exp $
* $Id: autoconf.h,v 1.2 1993/10/11 02:28:23 deraadt Exp $
*/
/*
@ -138,3 +138,6 @@ struct bootpath {
};
struct device *bootdv; /* found during autoconfiguration */
/* Parse a disk string into a dev_t, return device struct pointer */
struct device *parsedisk __P((char *, int, int, dev_t *));

View File

@ -42,7 +42,7 @@
* @(#)cpu.h 8.1 (Berkeley) 6/11/93
*
* from: Header: cpu.h,v 1.12 93/05/25 10:36:34 torek Exp (LBL)
* $Id: cpu.h,v 1.1 1993/10/02 10:23:07 deraadt Exp $
* $Id: cpu.h,v 1.2 1993/10/11 02:28:25 deraadt Exp $
*/
#ifndef _CPU_H_
@ -73,7 +73,6 @@
#define cpu_exec(p) /* nothing */
#define cpu_wait(p) /* nothing */
#define cpu_setstack(p, ap) ((p)->p_md.md_tf->tf_out[6] = (ap) - 64)
/*
* Arguments to hardclock, softclock and gatherstats encapsulate the
@ -90,6 +89,7 @@ struct clockframe {
};
extern int eintstack[];
#define enablertclock() /* TDR: delete this soon */
#define CLKF_USERMODE(framep) (((framep)->psr & PSR_PS) == 0)
#define CLKF_BASEPRI(framep) (((framep)->psr & PSR_PIL) == 0)

View File

@ -1,15 +1,6 @@
/*
* 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.
*
* 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, Lawrence Berkeley Laboratory.
* Copyright (c) 1993 Christopher G. Demetriou
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -19,110 +10,24 @@
* 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.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software withough 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.
* 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.
*
* @(#)exec.h 8.1 (Berkeley) 6/11/93
*
* from: Header: exec.h,v 1.9 93/04/20 11:14:45 torek Exp
* $Id: exec.h,v 1.1 1993/10/02 10:23:08 deraadt Exp $
* $Id: exec.h,v 1.2 1993/10/11 02:28:26 deraadt Exp $
*/
/*
* __LDPGSZ is the page size used by the linker and by exec().
* It may be some multiple of the ``normal'' page size, so that, e.g.,
* the same binaries can be run on hardware with different page sizes
* that otherwise use the same instruction set. It must be no larger
* than CLBYTES (in param.h).
*/
#define __LDPGSZ 8192
#ifndef _SPARC_EXEC_H_
#define _SPARC_EXEC_H_
/* Valid magic number check. */
#define N_BADMAG(ex) \
((ex).a_magic != ZMAGIC && (ex).a_magic != NMAGIC && \
(ex).a_magic != OMAGIC)
/*
* N_TXTADDR is the address of the first executable instruction: that is,
* the place the pc could begin after an a.out is loaded, in order to run
* the instructions in that a.out. The pc will actually be set to ex.a_entry
* but this is the first place it could possibly reference.
*
* On the SPARC, binaries begin at __LDPGSZ, i.e., page 1.
*/
#define N_TXTADDR(ex) 8192
/* Address of the bottom of the data segment. */
#define N_DATADDR(ex) \
(N_TXTADDR(ex) + ((ex).a_magic == OMAGIC ? (ex).a_text : \
(((ex).a_text + __LDPGSZ - 1) & ~(__LDPGSZ - 1))))
/*
* N_TXTOFF is the offset within an a.out file of the first executable
* instruction: that is, the offset in the a.out of the byte that winds
* up at N_TXTADDR.
*
* On the SPARC, the a.out header is included in the executable when running
* a ZMAGIC file (but not for OMAGIC and NMAGIC).
*/
#define N_TXTOFF(ex) ((ex).a_magic == ZMAGIC ? 0 : sizeof(struct exec))
/* Data segment offset. */
#define N_DATOFF(ex) \
(N_TXTOFF(ex) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \
(((ex).a_text + __LDPGSZ - 1) & ~(__LDPGSZ - 1))))
/* Symbol table offset. */
#define N_SYMOFF(ex) \
(N_TXTOFF(ex) + (ex).a_text + (ex).a_data + (ex).a_trsize + \
(ex).a_drsize)
/* String table offset. */
#define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms)
/* Description of the object file header (a.out format). */
struct exec {
u_char a_dynamic:1; /* dynamically linked */
u_char a_toolversion:7;/* Sun toolset version XXX */
#define MID_ZERO 0 /* unknown - implementation dependent */
#define MID_SUN010 1 /* sun 68010/68020 binary */
#define MID_SUN020 2 /* sun 68020-only binary */
#define MID_SUN_SPARC 3 /* sparc binary */
#define MID_HP200 200 /* hp200 (68010) BSD binary */
#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */
#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */
#define MID_HPUX800 0x20B /* hp800 HP-UX binary */
u_char a_mid; /* machine ID */
#define OMAGIC 0407 /* old impure format */
#define NMAGIC 0410 /* read-only text */
#define ZMAGIC 0413 /* demand load format */
u_short a_magic; /* magic number */
u_long a_text; /* text segment size */
u_long a_data; /* initialized data size */
u_long a_bss; /* uninitialized data size */
u_long a_syms; /* symbol table size */
u_long a_entry; /* entry point */
u_long a_trsize; /* text relocation size */
u_long a_drsize; /* data relocation size */
};
#define a_machtype a_mid /* SUN compatibility */
#endif /* _SPARC_EXEC_H_ */

View File

@ -42,13 +42,14 @@
* @(#)param.h 8.1 (Berkeley) 6/11/93
*
* from: Header: param.h,v 1.13 92/11/26 02:04:38 torek Exp (LBL)
* $Id: param.h,v 1.1 1993/10/02 10:23:16 deraadt Exp $
* $Id: param.h,v 1.2 1993/10/11 02:28:27 deraadt Exp $
*/
/*
* Machine dependent constants for Sun-4c (SPARCstation)
*/
#define MACHINE "sparc"
#define MACHINE "sparc"
#define MID_MACHINE MID_SPARC
#ifdef KERNEL /* XXX */
#include <machine/cpu.h> /* XXX */

View File

@ -42,7 +42,7 @@
* @(#)pmap.h 8.1 (Berkeley) 6/11/93
*
* from: Header: pmap.h,v 1.11 93/05/25 10:36:09 torek Exp
* $Id: pmap.h,v 1.1 1993/10/02 10:23:18 deraadt Exp $
* $Id: pmap.h,v 1.2 1993/10/11 02:28:28 deraadt Exp $
*/
#ifndef _SPARC_PMAP_H_
@ -154,7 +154,6 @@ typedef struct pmap *pmap_t;
#define PMAP_NULL ((pmap_t)0)
extern struct kpmap kernel_pmap_store;
#define kernel_pmap ((struct pmap *)(&kernel_pmap_store))
#define PMAP_ACTIVATE(pmap, pcb, iscurproc)
#define PMAP_DEACTIVATE(pmap, pcb)
@ -174,6 +173,8 @@ extern struct kpmap kernel_pmap_store;
#define PMAP_NC 4 /* tells pmap_enter to set PG_NC */
#define PMAP_TNC 7 /* mask to get PG_TYPE & PG_NC */
void pmap_bootstrap __P((int nmmu, int nctx));
void pmap_init __P((vm_offset_t phys_start, vm_offset_t phys_end));
#endif /* KERNEL */
#endif /* _SPARC_PMAP_H_ */

View File

@ -42,7 +42,7 @@
* @(#)psl.h 8.1 (Berkeley) 6/11/93
*
* from: Header: psl.h,v 1.12 92/11/26 02:04:42 torek Exp
* $Id: psl.h,v 1.1 1993/10/02 10:23:21 deraadt Exp $
* $Id: psl.h,v 1.2 1993/10/11 02:28:29 deraadt Exp $
*/
#ifndef PSR_IMPL
@ -78,7 +78,7 @@
#define PIL_CLOCK 10
#ifndef LOCORE
#if defined(KERNEL) && !defined(LOCORE)
/*
* GCC pseudo-functions for manipulating PSR (primarily PIL field).
*/
@ -180,6 +180,6 @@ static __inline void splx(int newipl) {
"r" (psr & ~PSR_PIL), "rn" (newipl));
__asm __volatile("nop; nop; nop");
}
#endif /* LOCORE */
#endif /* KERNEL && !LOCORE */
#endif /* PSR_IMPL */

View File

@ -42,7 +42,7 @@
* @(#)stdarg.h 8.1 (Berkeley) 6/11/93
*
* from: Header: stdarg.h,v 1.8 93/05/07 18:10:14 torek Exp
* $Id: stdarg.h,v 1.1 1993/10/02 10:23:29 deraadt Exp $
* $Id: stdarg.h,v 1.2 1993/10/11 02:28:30 deraadt Exp $
*/
/*
@ -61,8 +61,12 @@ typedef char *va_list;
*
* va_end cleans up after va_start. There is nothing to do there.
*/
#ifdef __GCC_NEW_VARARGS__ /* gcc 2.4.5 */
#define va_start(ap, l) ((ap) = (char *)__builtin_saveregs())
#else /* gcc 2.3.3 */
#define va_start(ap, l) (__builtin_saveregs(), \
ap = (char *)__builtin_next_arg())
(ap) = (char *)__builtin_next_arg())
#endif
#define va_end(ap) /* empty */
#if __GNUC__ == 1

View File

@ -1 +1 @@
revision 1.1 intentionally removed
revision 1.2 intentionally removed

View File

@ -42,7 +42,7 @@
* @(#)vmparam.h 8.1 (Berkeley) 6/11/93
*
* from: Header: vmparam.h,v 1.8 93/05/25 09:52:16 torek Exp
* $Id: vmparam.h,v 1.1 1993/10/02 10:23:33 deraadt Exp $
* $Id: vmparam.h,v 1.2 1993/10/11 02:28:31 deraadt Exp $
*/
/*
@ -122,7 +122,7 @@
* IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS:
* tread with care.
*/
#define VM_MIN_ADDRESS ((vm_offset_t)0x2000) /* texts start at 8K */
#define VM_MIN_ADDRESS ((vm_offset_t)0)
#define VM_MAX_ADDRESS ((vm_offset_t)KERNBASE)
#define VM_MAXUSER_ADDRESS ((vm_offset_t)KERNBASE)
#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNBASE)