diff options
author | jb <jb@FreeBSD.org> | 1998-03-09 05:43:16 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-03-09 05:43:16 +0000 |
commit | 61880eb7f0e6e9e4ffb7f70fff37162bf10c5df0 (patch) | |
tree | e37d9c68291de35fefd582080cf0b47d6fdd9a04 /sys | |
parent | 971d61ef3e282284bb792d2d8a167910fa71e027 (diff) | |
parent | 5936ee903a7ddea3af0822c836a585177d5108b8 (diff) | |
download | FreeBSD-src-61880eb7f0e6e9e4ffb7f70fff37162bf10c5df0.zip FreeBSD-src-61880eb7f0e6e9e4ffb7f70fff37162bf10c5df0.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r34368,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/include/elf.h | 112 | ||||
-rw-r--r-- | sys/alpha/include/elf_machdep.h | 45 | ||||
-rw-r--r-- | sys/alpha/include/exec.h | 34 | ||||
-rw-r--r-- | sys/alpha/include/ieee.h | 124 | ||||
-rw-r--r-- | sys/alpha/include/ieeefp.h | 27 | ||||
-rw-r--r-- | sys/alpha/include/lock.h | 42 | ||||
-rw-r--r-- | sys/alpha/include/pcb.h | 65 | ||||
-rw-r--r-- | sys/alpha/include/pmap.h | 140 | ||||
-rw-r--r-- | sys/alpha/include/proc.h | 41 | ||||
-rw-r--r-- | sys/alpha/include/profile.h | 217 | ||||
-rw-r--r-- | sys/alpha/include/pte.h | 110 | ||||
-rw-r--r-- | sys/alpha/include/reg.h | 99 | ||||
-rw-r--r-- | sys/alpha/include/reloc.h | 32 | ||||
-rw-r--r-- | sys/alpha/include/vmparam.h | 153 |
14 files changed, 1241 insertions, 0 deletions
diff --git a/sys/alpha/include/elf.h b/sys/alpha/include/elf.h new file mode 100644 index 0000000..ce2da56 --- /dev/null +++ b/sys/alpha/include/elf.h @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 1996-1997 John D. Polstra. + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * $Id: elf.h,v 1.2 1997/08/30 18:59:48 peter Exp $ + */ + +#ifndef _MACHINE_ELF_H_ +#define _MACHINE_ELF_H_ 1 + +/* + * ELF definitions for the i386 architecture. + */ + +#include <sys/elf32.h> /* Definitions common to all 32 bit architectures. */ + +/* + * Auxiliary vector entries for passing information to the interpreter. + * + * The i386 supplement to the SVR4 ABI specification names this "auxv_t", + * but POSIX lays claim to all symbols ending with "_t". + */ + +typedef struct { /* Auxiliary vector entry on initial stack */ + int a_type; /* Entry type. */ + union { + long a_val; /* Integer value. */ + void *a_ptr; /* Address. */ + void (*a_fcn)(void); /* Function pointer (not used). */ + } a_un; +} Elf32_Auxinfo; + +/* Values for a_type. */ +#define AT_NULL 0 /* Terminates the vector. */ +#define AT_IGNORE 1 /* Ignored entry. */ +#define AT_EXECFD 2 /* File descriptor of program to load. */ +#define AT_PHDR 3 /* Program header of program already loaded. */ +#define AT_PHENT 4 /* Size of each program header entry. */ +#define AT_PHNUM 5 /* Number of program header entries. */ +#define AT_PAGESZ 6 /* Page size in bytes. */ +#define AT_BASE 7 /* Interpreter's base address. */ +#define AT_FLAGS 8 /* Flags (unused for i386). */ +#define AT_ENTRY 9 /* Where interpreter should transfer control. */ + +/* + * The following non-standard values are used for passing information + * from John Polstra's testbed program to the dynamic linker. These + * are expected to go away soon. + * + * Unfortunately, these overlap the Linux non-standard values, so they + * must not be used in the same context. + */ +#define AT_BRK 10 /* Starting point for sbrk and brk. */ +#define AT_DEBUG 11 /* Debugging level. */ + +/* + * The following non-standard values are used in Linux ELF binaries. + */ +#define AT_NOTELF 10 /* Program is not ELF ?? */ +#define AT_UID 11 /* Real uid. */ +#define AT_EUID 12 /* Effective uid. */ +#define AT_GID 13 /* Real gid. */ +#define AT_EGID 14 /* Effective gid. */ + +#define AT_COUNT 15 /* Count of defined aux entry types. */ + +/* + * Relocation types. + */ + +#define R_386_NONE 0 /* No relocation. */ +#define R_386_32 1 /* Add symbol value. */ +#define R_386_PC32 2 /* Add PC-relative symbol value. */ +#define R_386_GOT32 3 /* Add PC-relative GOT offset. */ +#define R_386_PLT32 4 /* Add PC-relative PLT offset. */ +#define R_386_COPY 5 /* Copy data from shared object. */ +#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_386_RELATIVE 8 /* Add load address of shared object. */ +#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ +#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ + +#define R_386_COUNT 11 /* Count of defined relocation types. */ + +/* Define "machine" characteristics */ +#define ELF_TARG_CLASS ELFCLASS32 +#define ELF_TARG_DATA ELFDATA2LSB +#define ELF_TARG_MACH EM_386 +#define ELF_TARG_VER 1 + +#endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/alpha/include/elf_machdep.h b/sys/alpha/include/elf_machdep.h new file mode 100644 index 0000000..f14c0fa --- /dev/null +++ b/sys/alpha/include/elf_machdep.h @@ -0,0 +1,45 @@ +/* $Id$ +/* From: NetBSD: elf_machdep.h,v 1.3 1997/04/06 08:47:24 cgd Exp */ + +#define ELF32_MACHDEP_ENDIANNESS XXX /* break compilation */ +#define ELF32_MACHDEP_ID_CASES \ + /* no 32-bit ELF machine types supported */ + +#define ELF64_MACHDEP_ENDIANNESS Elf_ed_2lsb +#define ELF64_MACHDEP_ID_CASES \ + case Elf_em_alpha: \ + break; + +/* + * Alpha Relocation Types + */ +#define R_ALPHA_NONE 0 /* No reloc */ +#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ +#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ +#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ +#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ +#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ +#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ +#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ +#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ +#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ +#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ +#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ +#define R_ALPHA_OP_PUSH 12 /* OP stack push */ +#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */ +#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */ +#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */ +#define R_ALPHA_GPVALUE 16 +#define R_ALPHA_GPRELHIGH 17 +#define R_ALPHA_GPRELLOW 18 +#define R_ALPHA_IMMED_GP_16 19 +#define R_ALPHA_IMMED_GP_HI32 20 +#define R_ALPHA_IMMED_SCN_HI32 21 +#define R_ALPHA_IMMED_BR_HI32 22 +#define R_ALPHA_IMMED_LO32 23 +#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ +#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ +#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ +#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ + +#define R_TYPE(name) __CONCAT(R_ALPHA_,name) diff --git a/sys/alpha/include/exec.h b/sys/alpha/include/exec.h new file mode 100644 index 0000000..f0e3418 --- /dev/null +++ b/sys/alpha/include/exec.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>. + * 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 John Birrell. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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. + * + */ + +#define __LDPGSZ 8192 diff --git a/sys/alpha/include/ieee.h b/sys/alpha/include/ieee.h new file mode 100644 index 0000000..701f22c --- /dev/null +++ b/sys/alpha/include/ieee.h @@ -0,0 +1,124 @@ +/* $Id$ */ +/* From: NetBSD: ieee.h,v 1.2 1997/04/06 08:47:27 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. + * + * 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. + * + * 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. + * + * @(#)ieee.h 8.1 (Berkeley) 6/11/93 + * + * from: Header: ieee.h,v 1.7 92/11/26 02:04:37 torek Exp + */ + +/* + * ieee.h defines the machine-dependent layout of the machine's IEEE + * floating point. It does *not* define (yet?) any of the rounding + * mode bits, exceptions, and so forth. + */ + +/* + * Define the number of bits in each fraction and exponent. + * + * k k+1 + * Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented + * + * (-exp_bias+1) + * as fractions that look like 0.fffff x 2 . This means that + * + * -126 + * the number 0.10000 x 2 , for instance, is the same as the normalized + * + * -127 -128 + * float 1.0 x 2 . Thus, to represent 2 , we need one leading zero + * + * -129 + * in the fraction; to represent 2 , we need two, and so on. This + * + * (-exp_bias-fracbits+1) + * implies that the smallest denormalized number is 2 + * + * for whichever format we are talking about: for single precision, for + * + * -126 -149 + * instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and + * + * -149 == -127 - 23 + 1. + */ +#define SNG_EXPBITS 8 +#define SNG_FRACBITS 23 + +#define DBL_EXPBITS 11 +#define DBL_FRACBITS 52 + +struct ieee_single { + u_int sng_frac:23; + u_int sng_exp:8; + u_int sng_sign:1; +}; + +struct ieee_double { + u_int dbl_fracl; + u_int dbl_frach:20; + u_int dbl_exp:11; + u_int dbl_sign:1; +}; + +/* + * Floats whose exponent is in [1..INFNAN) (of whatever type) are + * `normal'. Floats whose exponent is INFNAN are either Inf or NaN. + * Floats whose exponent is zero are either zero (iff all fraction + * bits are zero) or subnormal values. + * + * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its + * high fraction; if the bit is set, it is a `quiet NaN'. + */ +#define SNG_EXP_INFNAN 255 +#define DBL_EXP_INFNAN 2047 + +#if 0 +#define SNG_QUIETNAN (1 << 22) +#define DBL_QUIETNAN (1 << 19) +#endif + +/* + * Exponent biases. + */ +#define SNG_EXP_BIAS 127 +#define DBL_EXP_BIAS 1023 diff --git a/sys/alpha/include/ieeefp.h b/sys/alpha/include/ieeefp.h new file mode 100644 index 0000000..c0f4c2f --- /dev/null +++ b/sys/alpha/include/ieeefp.h @@ -0,0 +1,27 @@ +/* $Id$ */ +/* From: NetBSD: ieeefp.h,v 1.2 1997/04/06 08:47:28 cgd Exp */ + +/* + * Written by J.T. Conklin, Apr 28, 1995 + * Public domain. + */ + +#ifndef _ALPHA_IEEEFP_H_ +#define _ALPHA_IEEEFP_H_ + +typedef int fp_except; +#define FP_X_INV 0x01 /* invalid operation exception */ +#define FP_X_DZ 0x02 /* divide-by-zero exception */ +#define FP_X_OFL 0x04 /* overflow exception */ +#define FP_X_UFL 0x08 /* underflow exception */ +#define FP_X_IMP 0x10 /* imprecise (loss of precision; "inexact") */ +#define FP_X_IOV 0x20 /* integer overflow XXX? */ + +typedef enum { + FP_RZ=0, /* round to zero (truncate) */ + FP_RM=1, /* round toward negative infinity */ + FP_RN=2, /* round to nearest representable number */ + FP_RP=3 /* round toward positive infinity */ +} fp_rnd; + +#endif /* _ALPHA_IEEEFP_H_ */ diff --git a/sys/alpha/include/lock.h b/sys/alpha/include/lock.h new file mode 100644 index 0000000..b5604e8 --- /dev/null +++ b/sys/alpha/include/lock.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1997, by Steve Passe + * 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. The name of the developer 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 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 AUTHOR 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. + * + * $Id: lock.h,v 1.5 1997/12/15 02:18:27 tegge Exp $ + */ + + +#ifndef _MACHINE_LOCK_H_ +#define _MACHINE_LOCK_H_ + + +/* + * Simple spin lock. + * It is an error to hold one of these locks while a process is sleeping. + */ +struct simplelock { + volatile int lock_data; +}; + + +#endif /* !_MACHINE_LOCK_H_ */ diff --git a/sys/alpha/include/pcb.h b/sys/alpha/include/pcb.h new file mode 100644 index 0000000..445617ea --- /dev/null +++ b/sys/alpha/include/pcb.h @@ -0,0 +1,65 @@ +/* $Id$ */ +/* From: NetBSD: pcb.h,v 1.6 1997/04/06 08:47:33 cgd Exp */ + +/* + * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#include <machine/frame.h> +#include <machine/reg.h> + +#include <machine/alpha_cpu.h> + +/* + * PCB: process control block + * + * In this case, the hardware structure that is the defining element + * for a process, and the additional state that must be saved by software + * on a context switch. Fields marked [HW] are mandated by hardware; fields + * marked [SW] are for the software. + * + * It's said in the VMS PALcode section of the AARM that the pcb address + * passed to the swpctx PALcode call has to be a physical address. Not + * knowing this (and trying a virtual) address proved this correct. + * So we cache the physical address of the pcb in the md_proc struct. + */ +struct pcb { + struct alpha_pcb pcb_hw; /* PALcode defined */ + unsigned long pcb_context[9]; /* s[0-6], ra, ps [SW] */ + struct fpreg pcb_fp; /* FP registers [SW] */ + unsigned long pcb_onfault; /* for copy faults [SW] */ + unsigned long pcb_accessaddr; /* for [fs]uswintr [SW] */ +}; + +/* + * The pcb is augmented with machine-dependent additional data for + * core dumps. For the Alpha, that's a trap frame and the floating + * point registers. + */ +struct md_coredump { + struct trapframe md_tf; + struct fpreg md_fpstate; +}; diff --git a/sys/alpha/include/pmap.h b/sys/alpha/include/pmap.h new file mode 100644 index 0000000..9f013ac --- /dev/null +++ b/sys/alpha/include/pmap.h @@ -0,0 +1,140 @@ +/* $Id$ */ +/* From: NetBSD: pmap.old.h,v 1.16 1998/01/09 19:13:09 thorpej Exp */ + +/* + * Copyright (c) 1987 Carnegie-Mellon University + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * 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. + * + * @(#)pmap.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _PMAP_MACHINE_ +#define _PMAP_MACHINE_ + +#include <machine/pte.h> +#include <machine/lock.h> + +extern vm_offset_t vtophys(vm_offset_t); + +#define ALPHA_PAGE_SIZE NBPG +#define ALPHA_SEG_SIZE NBSEG + +#define alpha_trunc_seg(x) (((u_long)(x)) & ~(ALPHA_SEG_SIZE-1)) +#define alpha_round_seg(x) alpha_trunc_seg((u_long)(x) + ALPHA_SEG_SIZE-1) + +typedef struct simplelock simple_lock_data_t; + +/* + * Pmap stuff + */ +struct pmap { + pt_entry_t *pm_ptab; /* KVA of page table */ + pt_entry_t *pm_stab; /* KVA of segment table */ + pt_entry_t pm_stpte; /* PTE mapping STE */ + short pm_sref; /* segment table ref count */ + short pm_count; /* pmap reference count */ + simple_lock_data_t pm_lock; /* lock on pmap */ + struct pmap_statistics pm_stats; /* pmap statistics */ + long pm_ptpages; /* more stats: PT pages */ +}; + +typedef struct pmap *pmap_t; + +extern struct pmap kernel_pmap_store; + +#define pmap_kernel() (&kernel_pmap_store) +#define active_pmap(pm) \ + ((pm) == pmap_kernel() \ + || curproc == NULL \ + || (pm) == curproc->p_vmspace->vm_map.pmap) +#define active_user_pmap(pm) \ + (curproc && \ + (pm) != pmap_kernel() && (pm) == curproc->p_vmspace->vm_map.pmap) + +/* + * For each vm_page_t, there is a list of all currently valid virtual + * mappings of that page. An entry is a pv_entry_t, the list is pv_table. + */ +typedef struct pv_entry { + struct pv_entry *pv_next; /* next pv_entry */ + struct pmap *pv_pmap; /* pmap where mapping lies */ + vm_offset_t pv_va; /* virtual address for mapping */ + pt_entry_t *pv_ptpte; /* non-zero if VA maps a PT page */ + struct pmap *pv_ptpmap; /* if pv_ptpte, pmap for PT page */ + int pv_flags; /* flags */ +} *pv_entry_t; + +#define PV_PTPAGE 0x01 /* header: entry maps a page table page */ + +struct pv_page_info { + TAILQ_ENTRY(pv_page) pgi_list; + struct pv_entry *pgi_freelist; + int pgi_nfree; +}; + +#define NPVPPG ((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) + +struct pv_page { + struct pv_page_info pvp_pgi; + struct pv_entry pvp_pv[NPVPPG]; +}; + +/* + * Physical page attributes. + */ +typedef int pmap_attr_t; +#define PMAP_ATTR_MOD 0x01 /* modified */ +#define PMAP_ATTR_REF 0x02 /* referenced */ + +#ifdef _KERNEL +#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) +#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count) + +extern pt_entry_t *Sysmap; +extern char *vmmap; /* map for mem, dumps, etc. */ + +#if defined(MACHINE_NEW_NONCONTIG) +#define PMAP_STEAL_MEMORY /* enable pmap_steal_memory() */ +#endif + +/* Machine-specific functions. */ +void pmap_bootstrap __P((vm_offset_t firstaddr, vm_offset_t ptaddr)); +void pmap_emulate_reference __P((struct proc *p, vm_offset_t v, + int user, int write)); +void pmap_unmap_prom __P((void)); +#endif /* _KERNEL */ + +#endif /* _PMAP_MACHINE_ */ diff --git a/sys/alpha/include/proc.h b/sys/alpha/include/proc.h new file mode 100644 index 0000000..1f433c5 --- /dev/null +++ b/sys/alpha/include/proc.h @@ -0,0 +1,41 @@ +/* $Id$ +/* From: NetBSD: proc.h,v 1.3 1997/04/06 08:47:36 cgd Exp */ + +/* + * Copyright (c) 1994, 1995 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +/* + * Machine-dependent part of the proc struct for the Alpha. + */ + +struct mdproc { + u_long md_flags; + struct trapframe *md_tf; /* trap/syscall registers */ + struct pcb *md_pcbpaddr; /* phys addr of the pcb */ +}; + +#define MDP_FPUSED 0x0001 /* Process used the FPU */ diff --git a/sys/alpha/include/profile.h b/sys/alpha/include/profile.h new file mode 100644 index 0000000..e0eb101 --- /dev/null +++ b/sys/alpha/include/profile.h @@ -0,0 +1,217 @@ +/* $Id$ */ +/* From: NetBSD: profile.h,v 1.9 1997/04/06 08:47:37 cgd Exp */ + +/* + * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#define _MCOUNT_DECL void mcount + +#if 0 +/* + * XXX The definition of MCOUNT below is really the following code, run + * XXX through cpp, since the inline assembly isn't preprocessed. + */ +#define OFFSET_AT 0 +#define OFFSET_V0 8 +#define OFFSET_T0 16 +#define OFFSET_T1 24 +#define OFFSET_T2 32 +#define OFFSET_T3 40 +#define OFFSET_T4 48 +#define OFFSET_T5 56 +#define OFFSET_T6 64 +#define OFFSET_T7 72 +#define OFFSET_S6 80 +#define OFFSET_A0 88 +#define OFFSET_A1 96 +#define OFFSET_A2 104 +#define OFFSET_A3 112 +#define OFFSET_A4 120 +#define OFFSET_A5 128 +#define OFFSET_T8 136 +#define OFFSET_T9 144 +#define OFFSET_T10 152 +#define OFFSET_T11 160 +#define OFFSET_RA 168 +#define OFFSET_T12 176 +#define OFFSET_GP 184 +#define FRAME_SIZE 192 + +LEAF(_mcount,0) /* XXX */ + .set noat + .set noreorder + + lda sp, -FRAME_SIZE(sp) + + stq at_reg, OFFSET_AT(sp) + stq v0, OFFSET_V0(sp) + stq t0, OFFSET_T0(sp) + stq t1, OFFSET_T1(sp) + stq t2, OFFSET_T2(sp) + stq t3, OFFSET_T3(sp) + stq t4, OFFSET_T4(sp) + stq t5, OFFSET_T5(sp) + stq t6, OFFSET_T6(sp) + stq t7, OFFSET_T7(sp) + stq s6, OFFSET_S6(sp) /* XXX because run _after_ prologue. */ + stq a0, OFFSET_A0(sp) + stq a1, OFFSET_A1(sp) + stq a2, OFFSET_A2(sp) + stq a3, OFFSET_A3(sp) + stq a4, OFFSET_A4(sp) + stq a5, OFFSET_A5(sp) + stq t8, OFFSET_T8(sp) + stq t9, OFFSET_T9(sp) + stq t10, OFFSET_T10(sp) + stq t11, OFFSET_T11(sp) + stq ra, OFFSET_RA(sp) + stq t12, OFFSET_T12(sp) + stq gp, OFFSET_GP(sp) + + br pv, LX99 +LX99: SETGP(pv) + mov ra, a0 + mov at_reg, a1 + CALL(mcount) + + ldq v0, OFFSET_V0(sp) + ldq t0, OFFSET_T0(sp) + ldq t1, OFFSET_T1(sp) + ldq t2, OFFSET_T2(sp) + ldq t3, OFFSET_T3(sp) + ldq t4, OFFSET_T4(sp) + ldq t5, OFFSET_T5(sp) + ldq t6, OFFSET_T6(sp) + ldq t7, OFFSET_T7(sp) + ldq s6, OFFSET_S6(sp) /* XXX because run _after_ prologue. */ + ldq a0, OFFSET_A0(sp) + ldq a1, OFFSET_A1(sp) + ldq a2, OFFSET_A2(sp) + ldq a3, OFFSET_A3(sp) + ldq a4, OFFSET_A4(sp) + ldq a5, OFFSET_A5(sp) + ldq t8, OFFSET_T8(sp) + ldq t9, OFFSET_T9(sp) + ldq t10, OFFSET_T10(sp) + ldq t11, OFFSET_T11(sp) + ldq ra, OFFSET_RA(sp) + stq t12, OFFSET_T12(sp) + ldq gp, OFFSET_GP(sp) + + ldq at_reg, OFFSET_AT(sp) + + lda sp, FRAME_SIZE(sp) + ret zero, (at_reg), 1 + + END(_mcount) +#endif /* 0 */ + +#define MCOUNT __asm (" \ + .globl _mcount; \ + .ent _mcount 0; \ +_mcount:; \ + .frame $30,0,$26; \ + .set noat; \ + .set noreorder; \ + \ + lda $30, -192($30); \ + \ + stq $28, 0($30); \ + stq $0, 8($30); \ + stq $1, 16($30); \ + stq $2, 24($30); \ + stq $3, 32($30); \ + stq $4, 40($30); \ + stq $5, 48($30); \ + stq $6, 56($30); \ + stq $7, 64($30); \ + stq $8, 72($30); \ + stq $15, 80($30); \ + stq $16, 88($30); \ + stq $17, 96($30); \ + stq $18, 104($30); \ + stq $19, 112($30); \ + stq $20, 120($30); \ + stq $21, 128($30); \ + stq $22, 136($30); \ + stq $23, 144($30); \ + stq $24, 152($30); \ + stq $25, 160($30); \ + stq $26, 168($30); \ + stq $27, 176($30); \ + stq $29, 184($30); \ + \ + br $27, LX98; \ +LX98: ldgp $29,0($27); \ + mov $26, $16; \ + mov $28, $17; \ + jsr $26,mcount; \ + ldgp $29,0($26); \ + \ + ldq $0, 8($30); \ + ldq $1, 16($30); \ + ldq $2, 24($30); \ + ldq $3, 32($30); \ + ldq $4, 40($30); \ + ldq $5, 48($30); \ + ldq $6, 56($30); \ + ldq $7, 64($30); \ + ldq $8, 72($30); \ + ldq $15, 80($30); \ + ldq $16, 88($30); \ + ldq $17, 96($30); \ + ldq $18, 104($30); \ + ldq $19, 112($30); \ + ldq $20, 120($30); \ + ldq $21, 128($30); \ + ldq $22, 136($30); \ + ldq $23, 144($30); \ + ldq $24, 152($30); \ + ldq $25, 160($30); \ + ldq $25, 160($30); \ + ldq $26, 168($30); \ + ldq $27, 176($30); \ + ldq $29, 184($30); \ + \ + lda $30, 192($30); \ + ret $31, ($28), 1; \ + \ + .end _mcount"); + +#ifdef _KERNEL +/* + * The following two macros do splhigh and splx respectively. + * _alpha_pal_swpipl is a special version of alpha_pal_swpipl which + * doesn't include profiling support. + * + * XXX These macros should probably use inline assembly. + */ +#define MCOUNT_ENTER \ + s = _alpha_pal_swpipl(ALPHA_PSL_IPL_HIGH) +#define MCOUNT_EXIT \ + (void)_alpha_pal_swpipl(s); +#endif diff --git a/sys/alpha/include/pte.h b/sys/alpha/include/pte.h new file mode 100644 index 0000000..da211ca --- /dev/null +++ b/sys/alpha/include/pte.h @@ -0,0 +1,110 @@ +/* $Id$ */ +/* From: NetBSD: pte.h,v 1.10 1997/09/02 19:07:22 thorpej Exp */ + +/* + * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +/* + * Alpha page table entry. + * Things which are in the VMS PALcode but not in the OSF PALcode + * are marked with "(VMS)". + * + * This information derived from pp. (II) 3-3 - (II) 3-6 and + * (III) 3-3 - (III) 3-5 of the "Alpha Architecture Reference Manual" by + * Richard L. Sites. + */ + +/* + * Alpha Page Table Entry + */ + +#include <machine/alpha_cpu.h> + +typedef alpha_pt_entry_t pt_entry_t; + +#define PT_ENTRY_NULL ((pt_entry_t *) 0) +#define PTESHIFT 3 /* pte size == 1 << PTESHIFT */ + +#define PG_V ALPHA_PTE_VALID +#define PG_NV 0 +#define PG_FOR ALPHA_PTE_FAULT_ON_READ +#define PG_FOW ALPHA_PTE_FAULT_ON_WRITE +#define PG_FOE ALPHA_PTE_FAULT_ON_EXECUTE +#define PG_ASM ALPHA_PTE_ASM +#define PG_GH ALPHA_PTE_GRANULARITY +#define PG_KRE ALPHA_PTE_KR +#define PG_URE ALPHA_PTE_UR +#define PG_KWE ALPHA_PTE_KW +#define PG_UWE ALPHA_PTE_UW +#define PG_PROT ALPHA_PTE_PROT +#define PG_RSVD 0x000000000000cc80 /* Reserved fpr hardware */ +#define PG_WIRED 0x0000000000010000 /* Wired. [SOFTWARE] */ +#define PG_FRAME ALPHA_PTE_RAME +#define PG_SHIFT 32 +#define PG_PFNUM(x) ALPHA_PTE_TO_PFN(x) + +#if 0 /* XXX NOT HERE */ +#define K0SEG_BEGIN 0xfffffc0000000000 /* unmapped, cached */ +#define K0SEG_END 0xfffffe0000000000 +#define PHYS_UNCACHED 0x0000000040000000 +#endif + +#ifndef _LOCORE +#if 0 /* XXX NOT HERE */ +#define k0segtophys(x) ((vm_offset_t)(x) & 0x00000003ffffffff) +#define phystok0seg(x) ((vm_offset_t)(x) | K0SEG_BEGIN) + +#define phystouncached(x) ((vm_offset_t)(x) | PHYS_UNCACHED) +#define uncachedtophys(x) ((vm_offset_t)(x) & ~PHYS_UNCACHED) +#endif + +#define PTEMASK (NPTEPG - 1) +#define vatopte(va) (((va) >> PGSHIFT) & PTEMASK) +#define vatoste(va) (((va) >> SEGSHIFT) & PTEMASK) +#define kvtol1pte(va) \ + (((vm_offset_t)(va) >> (PGSHIFT + 2*(PGSHIFT-PTESHIFT))) & PTEMASK) + +#define vatopa(va) \ + ((PG_PFNUM(*kvtopte(va)) << PGSHIFT) | ((vm_offset_t)(va) & PGOFSET)) + +#define ALPHA_STSIZE ((u_long)NBPG) /* 8k */ +#define ALPHA_MAX_PTSIZE ((u_long)(NPTEPG * NBPG)) /* 8M */ + +#ifdef _KERNEL +/* + * Kernel virtual address to Sysmap entry and visa versa. + */ +#define kvtopte(va) \ + (Sysmap + (((vm_offset_t)(va) - VM_MIN_KERNEL_ADDRESS) >> PGSHIFT)) +#define ptetokv(pte) \ + ((((pt_entry_t *)(pte) - Sysmap) << PGSHIFT) + VM_MIN_KERNEL_ADDRESS) + +extern pt_entry_t *Lev1map; /* Alpha Level One page table */ +extern pt_entry_t *Sysmap; /* kernel pte table */ +extern vm_size_t Sysmapsize; /* number of pte's in Sysmap */ +#endif +#endif diff --git a/sys/alpha/include/reg.h b/sys/alpha/include/reg.h new file mode 100644 index 0000000..d2d5ab9 --- /dev/null +++ b/sys/alpha/include/reg.h @@ -0,0 +1,99 @@ +/* $Id$ */ +/* From: NetBSD: reg.h,v 1.3 1997/04/06 08:47:40 cgd Exp */ + +/* + * Copyright (c) 1994, 1995 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#ifndef _ALPHA_REG_H_ +#define _ALPHA_REG_H_ + +/* + * XXX where did this info come from? + */ + +/* + * Struct reg, used for procfs and in signal contexts + * Note that in signal contexts, it's represented as an array. + * That array has to look exactly like 'struct reg' though. + */ +#define R_V0 0 +#define R_T0 1 +#define R_T1 2 +#define R_T2 3 +#define R_T3 4 +#define R_T4 5 +#define R_T5 6 +#define R_T6 7 +#define R_T7 8 +#define R_S0 9 +#define R_S1 10 +#define R_S2 11 +#define R_S3 12 +#define R_S4 13 +#define R_S5 14 +#define R_S6 15 +#define R_A0 16 +#define R_A1 17 +#define R_A2 18 +#define R_A3 19 +#define R_A4 20 +#define R_A5 21 +#define R_T8 22 +#define R_T9 23 +#define R_T10 24 +#define R_T11 25 +#define R_RA 26 +#define R_T12 27 +#define R_AT 28 +#define R_GP 29 +#define R_SP 30 +#define R_ZERO 31 + +struct reg { + u_int64_t r_regs[32]; +}; + +/* + * Floating point unit state. (also, register set used for ptrace.) + * + * The floating point registers for a process, saved only when + * necessary. + * + * Note that in signal contexts, it's represented as an array. + * That array has to look exactly like 'struct reg' though. + */ +struct fpreg { + u_int64_t fpr_regs[32]; + u_int64_t fpr_cr; +}; + +#ifdef _KERNEL +void restorefpstate __P((struct fpreg *)); +void savefpstate __P((struct fpreg *)); +#endif + +#endif /* _ALPHA_REG_H_ */ diff --git a/sys/alpha/include/reloc.h b/sys/alpha/include/reloc.h new file mode 100644 index 0000000..2d74a73 --- /dev/null +++ b/sys/alpha/include/reloc.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>. + * 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 John Birrell. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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. + * + */ diff --git a/sys/alpha/include/vmparam.h b/sys/alpha/include/vmparam.h new file mode 100644 index 0000000..bc543fd --- /dev/null +++ b/sys/alpha/include/vmparam.h @@ -0,0 +1,153 @@ +/* $Id$ */ +/* From: NetBSD: vmparam.h,v 1.6 1997/09/23 23:23:23 mjacob Exp */ +#ifndef _ALPHA_VMPARAM_H +#define _ALPHA_VMPARAM_H +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and Ralph Campbell. + * + * 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. + * + * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ + * + * @(#)vmparam.h 8.2 (Berkeley) 4/22/94 + */ + +/* + * Machine dependent constants for Alpha. + */ +/* + * USRTEXT is the start of the user text/data space, while USRSTACK + * is the top (end) of the user stack. Immediately above the user stack + * resides the user structure, which is UPAGES long and contains the + * kernel stack. + */ +#define USRTEXT CLBYTES +#define USRSTACK VM_MAXUSER_ADDRESS + +/* + * Virtual memory related constants, all in bytes + */ +#ifndef MAXTSIZ +#define MAXTSIZ (1<<30) /* max text size (1G) */ +#endif +#ifndef DFLDSIZ +#define DFLDSIZ (1<<27) /* initial data size (128M) */ +#endif +#ifndef MAXDSIZ +#define MAXDSIZ (1<<30) /* max data size (1G) */ +#endif +#ifndef DFLSSIZ +#define DFLSSIZ (1<<21) /* initial stack size (2M) */ +#endif +#ifndef MAXSSIZ +#define MAXSSIZ (1<<25) /* max stack size (32M) */ +#endif + +/* + * PTEs for mapping user space into the kernel for phyio operations. + * 64 pte's are enough to cover 8 disks * MAXBSIZE. + */ +#ifndef USRIOSIZE +#define USRIOSIZE 64 +#endif + +/* + * PTEs for system V style shared memory. + * This is basically slop for kmempt which we actually allocate (malloc) from. + */ +#ifndef SHMMAXPGS +#define SHMMAXPGS 1024 /* 8mb */ +#endif + +/* + * Boundary at which to place first MAPMEM segment if not explicitly + * specified. Should be a power of two. This allows some slop for + * the data segment to grow underneath the first mapped segment. + */ +#define MMSEG 0x200000 + +/* + * The size of the clock loop. + */ +#define LOOPPAGES (maxfree - firstfree) + +/* + * The time for a process to be blocked before being very swappable. + * This is a number of seconds which the system takes as being a non-trivial + * amount of real time. You probably shouldn't change this; + * it is used in subtle ways (fractions and multiples of it are, that is, like + * half of a ``long time'', almost a long time, etc.) + * It is related to human patience and other factors which don't really + * change over time. + */ +#define MAXSLP 20 + +/* + * A swapped in process is given a small amount of core without being bothered + * by the page replacement algorithm. Basically this says that if you are + * swapped in you deserve some resources. We protect the last SAFERSS + * pages against paging and will just swap you out rather than paging you. + * Note that each process has at least UPAGES+CLSIZE pages which are not + * paged anyways, in addition to SAFERSS. + */ +#define SAFERSS 10 /* nominal ``small'' resident set size + protected against replacement */ + +/* + * Mach derived constants + */ + +/* user/kernel map constants */ +#define VM_MIN_ADDRESS ((vm_offset_t)ALPHA_USEG_BASE) /* 0 */ +#define VM_MAXUSER_ADDRESS ((vm_offset_t)0x0000000200000000) /* 8G XXX */ +#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS +#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)ALPHA_K1SEG_BASE) +#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)ALPHA_K1SEG_END) + +/* virtual sizes (bytes) for various kernel submaps */ +#ifndef _KERNEL +#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) +#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES) +#define VM_PHYS_SIZE (USRIOSIZE*CLBYTES) +#else +extern u_int32_t vm_mbuf_size, vm_kmem_size, vm_phys_size; +#define VM_MBUF_SIZE vm_mbuf_size +#define VM_KMEM_SIZE vm_kmem_size +#define VM_PHYS_SIZE vm_phys_size +#endif + +/* some Alpha-specific constants */ +#define VPTBASE ((vm_offset_t)0xfffffffc00000000) /* Virt. pg table */ +#endif /* !_ALPHA_VMPARAM_H */ |