Have separate data and text segments, make text read-only.
This commit is contained in:
parent
27ddcb91ce
commit
245619bad4
@ -1,8 +1,8 @@
|
||||
# $NetBSD: GENERIC,v 1.34 2000/06/14 22:02:37 veego Exp $
|
||||
# $NetBSD: GENERIC,v 1.35 2000/06/19 23:30:32 eeh Exp $
|
||||
|
||||
include "arch/sparc64/conf/std.sparc64"
|
||||
|
||||
#ident "GENERIC-$Revision: 1.34 $"
|
||||
#ident "GENERIC-$Revision: 1.35 $"
|
||||
|
||||
maxusers 32
|
||||
|
||||
@ -83,7 +83,7 @@ options DDB_HISTORY_SIZE=100 # enable history editing in DDB
|
||||
## Compile the kernel with debugging symbols (`netbsd.gdb' is the debug file),
|
||||
## such that gdb(1) can be used on a kernel coredump.
|
||||
|
||||
#makeoptions DEBUG="-g"
|
||||
makeoptions DEBUG="-g"
|
||||
|
||||
|
||||
## Adds code to the kernel that does internal consistency checks, and will
|
||||
@ -93,7 +93,7 @@ options DDB_HISTORY_SIZE=100 # enable history editing in DDB
|
||||
|
||||
## Enable (possibly expensive) debugging code that may also display messages
|
||||
## on the system console
|
||||
#options DEBUG
|
||||
options DEBUG
|
||||
|
||||
## Make SCSI error messages more verbose when explaining their meanings.
|
||||
options SCSIVERBOSE
|
||||
@ -273,8 +273,8 @@ scsibus* at isp?
|
||||
#scsibus* at fas?
|
||||
|
||||
## GLM support missing
|
||||
#sym* at pci? # 53C875 "glm" compatible
|
||||
#scsibus* at sym?
|
||||
siop* at pci? # 53C875 "glm" compatible
|
||||
scsibus* at siop?
|
||||
|
||||
## These entries find devices on all SCSI busses and assign
|
||||
## unit numbers dynamically.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.sparc64,v 1.25 2000/06/09 15:28:21 eeh Exp $
|
||||
# $NetBSD: Makefile.sparc64,v 1.26 2000/06/19 23:30:32 eeh Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -69,7 +69,8 @@ CWARNFLAGS= -Wimplicit -Wunused -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts
|
||||
#CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
|
||||
CFLAGS= ${DEBUG} ${CWARNFLAGS} -Wa,-Av9a -mno-fpu
|
||||
AFLAGS= -x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -p -Ttext f1000000 -e start >lderr
|
||||
LINKFLAGS= -p -Ttext f1000000 -Tdata f1400000 -e start >lderr
|
||||
#LINKFLAGS= -N -p -Ttext f1000000 -e start >lderr
|
||||
STRIPFLAGS= -g
|
||||
|
||||
%INCLUDES
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: NONPLUS64,v 1.12 1999/11/20 18:09:52 eeh Exp $
|
||||
# $NetBSD: NONPLUS64,v 1.13 2000/06/19 23:30:32 eeh Exp $
|
||||
|
||||
include "arch/sparc64/conf/std.sparc64"
|
||||
|
||||
@ -10,9 +10,9 @@ maxusers 64
|
||||
# Options for variants of the Sun SPARC architecure.
|
||||
# We currently support three architecture types; at least one is required.
|
||||
options SUN4U # sun4u - Ultra 140 and 170
|
||||
options TRAPWIN # use a new window for traps
|
||||
options __ELF__ # we use elf
|
||||
options _LP64 # we're using a 64-bit compiler
|
||||
makeoptions SPARC64_BINARIES=1
|
||||
|
||||
## System options specific to the sparc machine type
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
# $NetBSD: std.sparc64,v 1.6 1999/11/15 19:00:30 fvdl Exp $
|
||||
# $NetBSD: std.sparc64,v 1.7 2000/06/19 23:30:32 eeh Exp $
|
||||
|
||||
#
|
||||
# Mandatory NetBSD/sparc kernel options.
|
||||
#
|
||||
|
||||
machine sparc64 # Machine architecture; required by config(8)
|
||||
makeoptions MACHINE=sparc64
|
||||
|
||||
prefix ../gnu/sys
|
||||
cinclude "conf/files.softdep"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: iommu.c,v 1.14 2000/06/18 07:17:40 mrg Exp $ */
|
||||
/* $NetBSD: iommu.c,v 1.15 2000/06/19 23:30:33 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Matthew R. Green
|
||||
@ -181,11 +181,8 @@ iommu_init(name, is, tsbsize)
|
||||
is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize) + NBPG;
|
||||
|
||||
/*
|
||||
* Allocate memory for I/O pagetables.
|
||||
* This takes 64K of contiguous physical memory to map 64M of
|
||||
* DVMA space (starting at IOMMU_DVMA_BASE).
|
||||
* The table must be aligned on a (-IOMMU_DVMA_BASE/pagesize)
|
||||
* boundary (i.e. 64K for 64M of DVMA space).
|
||||
* Allocate memory for I/O pagetables. They need to be physically
|
||||
* contiguous.
|
||||
*/
|
||||
|
||||
size = NBPG<<(is->is_tsbsize);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.h,v 1.19 2000/06/12 23:32:46 eeh Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.20 2000/06/19 23:30:34 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -91,21 +91,34 @@
|
||||
*/
|
||||
|
||||
struct cpu_info {
|
||||
/* Most important fields first */
|
||||
struct proc *ci_curproc;
|
||||
struct pcb *ci_cpcb;
|
||||
struct pcb *ci_cpcb; /* also initial stack */
|
||||
struct cpu_info *ci_next;
|
||||
|
||||
struct proc *ci_fpproc;
|
||||
int ci_number;
|
||||
int ci_upaid;
|
||||
struct schedstate_percpu ci_schedstate; /* scheduler state */
|
||||
#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
|
||||
|
||||
/* DEBUG/DIAGNOSTIC stuff */
|
||||
u_long ci_spin_locks; /* # of spin locks held */
|
||||
u_long ci_simple_locks;/* # of simple locks held */
|
||||
#endif
|
||||
|
||||
/* Spinning up the CPU */
|
||||
void (*ci_spinup) __P((void)); /* spinup routine */
|
||||
void *ci_initstack;
|
||||
paddr_t ci_paddr; /* Phys addr of this structure. */
|
||||
};
|
||||
|
||||
extern struct cpu_info *cpus;
|
||||
extern struct cpu_info cpu_info_store;
|
||||
|
||||
#if 1
|
||||
#define curcpu() (&cpu_info_store)
|
||||
#else
|
||||
#define curcpu() ((struct cpu_info *)CPUINFO_VA)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* definitions of cpu-dependent requirements
|
||||
@ -114,7 +127,11 @@ extern struct cpu_info cpu_info_store;
|
||||
#define cpu_swapin(p) /* nothing */
|
||||
#define cpu_swapout(p) /* nothing */
|
||||
#define cpu_wait(p) /* nothing */
|
||||
#if 1
|
||||
#define cpu_number() 0
|
||||
#else
|
||||
#define cpu_number() (curcpu()->ci_number)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Arguments to hardclock, softclock and gatherstats encapsulate the
|
||||
@ -132,12 +149,13 @@ struct clockframe {
|
||||
#define CLKF_BASEPRI(framep) (((framep)->t.tf_oldpil) == 0)
|
||||
#define CLKF_PC(framep) ((framep)->t.tf_pc)
|
||||
#define CLKF_INTR(framep) ((!CLKF_USERMODE(framep))&&\
|
||||
(((framep)->t.tf_kstack < (u_int)eintstack)&&\
|
||||
((framep)->t.tf_kstack > (u_int)intstack)))
|
||||
(((framep)->t.tf_kstack < (vaddr_t)EINTSTACK)&&\
|
||||
((framep)->t.tf_kstack > (vaddr_t)INTSTACK)))
|
||||
|
||||
/*
|
||||
* Software interrupt request `register'.
|
||||
*/
|
||||
#ifdef DEPRECATED
|
||||
union sir {
|
||||
int sir_any;
|
||||
char sir_which[4];
|
||||
@ -145,6 +163,7 @@ union sir {
|
||||
|
||||
#define SIR_NET 0
|
||||
#define SIR_CLOCK 1
|
||||
#endif
|
||||
|
||||
extern struct intrhand soft01intr, soft01net, soft01clock;
|
||||
|
||||
@ -210,7 +229,8 @@ extern struct intrhand *intrlev[MAXINTNUM];
|
||||
void intr_establish __P((int level, struct intrhand *));
|
||||
|
||||
/* cpu.c */
|
||||
u_int64_t cpu_start __P((int));
|
||||
paddr_t cpu_alloc __P((void));
|
||||
u_int64_t cpu_init __P((paddr_t, int));
|
||||
/* disksubr.c */
|
||||
struct dkbad;
|
||||
int isbad __P((struct dkbad *bt, int, int, int));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ctlreg.h,v 1.17 2000/06/10 20:51:43 eeh Exp $ */
|
||||
/* $NetBSD: ctlreg.h,v 1.18 2000/06/19 23:30:34 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996-1999 Eduardo Horvath
|
||||
@ -171,6 +171,11 @@
|
||||
* The following are 4u control registers
|
||||
*/
|
||||
|
||||
|
||||
/* Get the CPU's UPAID */
|
||||
#define UPA_CR_MID(x) (((x)>>17)&0x1f)
|
||||
#define CPU_UPAID UPA_CR_MID(ldxa(0, ASI_MID_REG))
|
||||
|
||||
/*
|
||||
* [4u] MMU and Cache Control Register (MCCR)
|
||||
* use ASI = 0x45
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: param.h,v 1.19 2000/06/13 05:04:05 eeh Exp $ */
|
||||
/* $NetBSD: param.h,v 1.20 2000/06/19 23:30:34 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -120,10 +120,6 @@
|
||||
extern int nbpg, pgofset, pgshift;
|
||||
#endif
|
||||
|
||||
#define KERNBASE 0x0f1000000 /* start of kernel virtual space */
|
||||
#define KERNEND 0x0fe000000 /* end of kernel virtual space */
|
||||
#define VM_MAX_KERNEL_BUF ((KERNEND-KERNBASE)/4)
|
||||
|
||||
#define DEV_BSIZE 512
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
#define BLKDEV_IOSIZE 2048
|
||||
@ -137,11 +133,67 @@ extern int nbpg, pgofset, pgshift;
|
||||
#endif
|
||||
#define USPACE (SSIZE*8192)
|
||||
|
||||
|
||||
/*
|
||||
* Here are all the magic kernel virtual addresses and how they're allocated.
|
||||
*
|
||||
* First, the PROM is usually a fixed-sized block from 0x00000000f0000000 to
|
||||
* 0x00000000f0100000. It also uses some space around 0x00000000fff00000 to
|
||||
* map in device registers. The rest is pretty much ours to play with.
|
||||
*
|
||||
* The kernel starts at KERNBASE. Here's they layout. We use macros to set
|
||||
* the addresses so we can relocate everything easily. We use 4MB locked TTEs
|
||||
* to map in the kernel text and data segments. Any extra pages are recycled,
|
||||
* so they can potentially be double-mapped. This shouldn't really be a
|
||||
* problem since they're unused, but wild pointers can cause silent data
|
||||
* corruption if they are in those segments.
|
||||
*
|
||||
* 0x0000000000000000: 64K NFO page zero
|
||||
* 0x0000000000010000: Userland or PROM
|
||||
* KERNBASE: 4MB kernel text and read only data
|
||||
* This is mapped in the ITLB and
|
||||
* Read-Only in the DTLB
|
||||
* KERNBASE+0x400000: 4MB kernel data and BSS -- not in ITLB
|
||||
* Contains context table, kernel pmap,
|
||||
* and other important structures.
|
||||
* KERNBASE+0x800000: Unmapped page -- redzone
|
||||
* KERNBASE+0x802000: Process 0 stack and u-area
|
||||
* KERNBASE+0x806000: 2 pages for pmap_copy_page and /dev/mem
|
||||
* KERNBASE+0x80a000: Start of kernel VA segment
|
||||
* KERNEND: End of kernel VA segment
|
||||
* KERNEND+0x02000: Auxreg_va (unused?)
|
||||
* KERNEND+0x04000: TMPMAP_VA (unused?)
|
||||
* KERNEND+0x06000: message buffer.
|
||||
* KERNEND+0x010000: 64K locked TTE -- different for each CPU
|
||||
* Contains interrupt stack, cpu_info structure,
|
||||
* and 32KB kernel TSB.
|
||||
* KERNEND+0x020000: IODEV_BASE -- begin mapping IO devices here.
|
||||
* 0x00000000fe000000: IODEV_END -- end of device mapping space.
|
||||
*
|
||||
*/
|
||||
#define KERNBASE 0x0f1000000 /* start of kernel virtual space */
|
||||
#define KERNEND 0x0fe000000 /* end of kernel virtual space */
|
||||
#define VM_MAX_KERNEL_BUF ((KERNEND-KERNBASE)/4)
|
||||
|
||||
#if 0
|
||||
#define AUXREG_VA ( KERNEND + _MAXNBPG) /* 1 page REDZONE */
|
||||
#define TMPMAP_VA ( AUXREG_VA + _MAXNBPG)
|
||||
#define MSGBUF_VA ( TMPMAP_VA + _MAXNBPG)
|
||||
#define CPUINFO_VA ( KERNEND + 8*_MAXBPG) /* 64K after kernel end */
|
||||
#define IODEV_BASE ( CPUINFO_VA + 8*_MAXNBPG)/* 64K long */
|
||||
#define IODEV_END 0x0ff000000UL /* 16 MB of iospace */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Here's the location of the interrupt stack and CPU structure.
|
||||
*/
|
||||
#define INTSTACK (KERNEND)
|
||||
#define EINTSTACK (INTSTACK+USPACE)
|
||||
#if 1
|
||||
#define INTSTACK (KERNEND+(64*1024))
|
||||
#define EINTSTACK (INTSTACK+2*USPACE)
|
||||
#else
|
||||
#define INTSTACK intstack
|
||||
#define EINTSTACK eintstack
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constants related to network buffer management.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: autoconf.c,v 1.30 2000/05/19 05:26:18 eeh Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.31 2000/06/19 23:30:34 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -220,7 +220,7 @@ bootstrap(nctx)
|
||||
#ifdef DDB
|
||||
db_machine_init();
|
||||
#ifdef DB_ELF_SYMBOLS
|
||||
ddb_init((int)((caddr_t)esym - (caddr_t)ssym), ssym, esym); /* No symbols as yet */
|
||||
ddb_init((int)((caddr_t)esym - (caddr_t)ssym), ssym, esym);
|
||||
#else
|
||||
ddb_init();
|
||||
#endif
|
||||
@ -230,18 +230,6 @@ bootstrap(nctx)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These are the best approximations for the spitfire:
|
||||
*
|
||||
* Contexts are 13 bits.
|
||||
*
|
||||
* Other values are not relevant, but used to simulate a sun4
|
||||
* 3-level MMU so we can address a full 32-bit virtual address
|
||||
* space.
|
||||
*
|
||||
* Eventually we should drop all of this in favor of traversing
|
||||
* process address spaces during MMU faults.
|
||||
*/
|
||||
pmap_bootstrap(KERNBASE, (u_long)&end, nctx);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.c,v 1.6 2000/06/12 23:32:47 eeh Exp $ */
|
||||
/* $NetBSD: cpu.c,v 1.7 2000/06/19 23:30:34 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -133,7 +133,8 @@ static char *iu_vendor[16] = {
|
||||
* Return the TLB entry for the cpuinfo.
|
||||
*/
|
||||
u_int64_t
|
||||
cpu_start(cpu_num)
|
||||
cpu_init(pa, cpu_num)
|
||||
paddr_t pa;
|
||||
int cpu_num;
|
||||
{
|
||||
struct cpu_info *ci;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_disasm.c,v 1.6 2000/05/25 19:57:35 jhawk Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.7 2000/06/19 23:30:35 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 David S. Miller, davem@nadzieja.rutgers.edu
|
||||
@ -40,7 +40,9 @@
|
||||
#include <ddb/db_output.h>
|
||||
#include <ddb/db_access.h>
|
||||
|
||||
#ifndef V9
|
||||
#define V9
|
||||
#endif
|
||||
/*
|
||||
* All Sparc instructions are 32-bits, with the one exception being
|
||||
* the set instruction which is actually a macro which expands into
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: db_interface.c,v 1.33 2000/06/08 17:45:29 eeh Exp $ */
|
||||
/* $NetBSD: db_interface.c,v 1.34 2000/06/19 23:30:35 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -186,6 +186,7 @@ kdb_trap(type, tf)
|
||||
default:
|
||||
printf("kernel trap %x: %s\n", type, trap_type[type & 0x1ff]);
|
||||
if (db_recover != 0) {
|
||||
OF_enter();
|
||||
db_error("Faulted in DDB; continuing...\n");
|
||||
OF_enter();
|
||||
/*NOTREACHED*/
|
||||
@ -278,11 +279,17 @@ db_write_bytes(addr, size, data)
|
||||
register char *data;
|
||||
{
|
||||
register char *dst;
|
||||
extern vaddr_t ktext;
|
||||
extern paddr_t ktextp;
|
||||
|
||||
dst = (char *)addr;
|
||||
while (size-- > 0) {
|
||||
if ((dst >= (char *)VM_MIN_KERNEL_ADDRESS))
|
||||
if ((dst >= (char *)VM_MIN_KERNEL_ADDRESS+0x400000))
|
||||
*dst = *data;
|
||||
else if ((dst >= (char *)VM_MIN_KERNEL_ADDRESS) &&
|
||||
(dst < (char *)VM_MIN_KERNEL_ADDRESS+0x400000))
|
||||
/* Read Only mapping -- need to do a bypass access */
|
||||
stba(dst - ktext + ktextp, ASI_PHYS_CACHED, *data);
|
||||
else
|
||||
subyte(dst, *data);
|
||||
dst++, data++;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: genassym.c,v 1.12 1999/12/30 16:35:25 eeh Exp $ */
|
||||
/* $NetBSD: genassym.c,v 1.13 2000/06/19 23:30:35 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -125,6 +125,7 @@ main()
|
||||
off("P_PID", struct proc, p_pid);
|
||||
off("P_FPSTATE", struct proc, p_md.md_fpstate);
|
||||
def("SRUN", SRUN);
|
||||
def("SONPROC", SONPROC);
|
||||
|
||||
/* user struct stuff */
|
||||
siz("USIZ", struct user); /* Needed for redzone calculations */
|
||||
@ -142,6 +143,20 @@ main()
|
||||
off("V_INTR", struct uvmexp, intrs);
|
||||
off("V_FAULTS", struct uvmexp, faults);
|
||||
|
||||
/* CPU info structure */
|
||||
off("CI_CURPROC", struct cpu_info, ci_curproc);
|
||||
off("CI_CPCB", struct cpu_info, ci_cpcb);
|
||||
off("CI_NEXT", struct cpu_info, ci_next);
|
||||
off("CI_FPPROC", struct cpu_info, ci_fpproc);
|
||||
off("CI_NUMBER", struct cpu_info, ci_number);
|
||||
off("CI_UPAID", struct cpu_info, ci_upaid);
|
||||
off("CI_SPINUP", struct cpu_info, ci_spinup);
|
||||
off("CI_INITSTACK", struct cpu_info, ci_initstack);
|
||||
off("CI_PADDR", struct cpu_info, ci_paddr);
|
||||
def("CURPROC", (CPUINFO_VA+CI_CURPROC));
|
||||
def("CPCB", (CPUINFO_VA+CI_CPCB));
|
||||
def("FPPROC", (CPUINFO_VA+CI_FPPROC));
|
||||
|
||||
/* FPU state */
|
||||
off("FS_REGS", struct fpstate64, fs_regs);
|
||||
off("FS_FSR", struct fpstate64, fs_fsr);
|
||||
@ -150,9 +165,9 @@ main()
|
||||
off("FS_QUEUE", struct fpstate64, fs_queue);
|
||||
siz("FS_SIZE", struct fpstate64);
|
||||
def("FSR_QNE", FSR_QNE);
|
||||
def("FPRS_FEF",FPRS_FEF);
|
||||
def("FPRS_DU",FPRS_DU);
|
||||
def("FPRS_DL",FPRS_DL);
|
||||
def("FPRS_FEF", FPRS_FEF);
|
||||
def("FPRS_DU", FPRS_DU);
|
||||
def("FPRS_DL", FPRS_DL);
|
||||
|
||||
/* system calls */
|
||||
def("SYS___sigreturn14", SYS___sigreturn14);
|
||||
@ -215,45 +230,6 @@ main()
|
||||
off("IH_MAP", struct intrhand, ih_map);
|
||||
off("IH_CLR", struct intrhand, ih_clr);
|
||||
siz("IH_SIZE", struct intrhand);
|
||||
|
||||
#ifdef notyet
|
||||
/* ZSCC interrupt fields */
|
||||
off("ZSC_A", struct zs_softc, sc_a);
|
||||
off("ZSC_B", struct zs_softc, sc_b);
|
||||
/* off("ZL_WREG", struct zs_line, zl_wreg); */
|
||||
off("ZL_TBC", struct zs_line, zl_tbc);
|
||||
off("ZL_TBA", struct zs_line, zl_tba);
|
||||
off("ZL_RBPUT", struct zs_line, zl_rbput);
|
||||
off("ZL_RBUF", struct zs_line, zl_rbuf);
|
||||
def("ZSRR1_DO_bit", ffs(ZSRR1_DO) - 1);
|
||||
#endif
|
||||
#ifdef notyet
|
||||
/* audio trap handler fields */
|
||||
off("AU_AMD", struct auio, au_amd);
|
||||
off("AU_RDATA", struct auio, au_rdata);
|
||||
off("AU_REND", struct auio, au_rend);
|
||||
off("AU_PDATA", struct auio, au_pdata);
|
||||
off("AU_PEND", struct auio, au_pend);
|
||||
off("AU_EVCNT", struct auio, au_intrcnt.ev_count);
|
||||
|
||||
off("AMD_IR", struct amd7930, ir);
|
||||
off("AMD_BBRB", struct amd7930, bbrb);
|
||||
off("AMD_BBTB", struct amd7930, bbtb);
|
||||
#endif
|
||||
/* def("PROM_BASE", PROM_BASE); */
|
||||
|
||||
off("PV_NODEOPS", struct promvec, pv_nodeops);
|
||||
off("PV_HALT", struct promvec, pv_halt);
|
||||
off("PV_EVAL", struct promvec, pv_fortheval.v0_eval);
|
||||
off("PV_ROMVEC_VERS", struct promvec, pv_romvec_vers);
|
||||
|
||||
off("NO_NEXTNODE", struct nodeops, no_nextnode);
|
||||
off("NO_GETPROP", struct nodeops, no_getprop);
|
||||
|
||||
#if 0
|
||||
off("OLDMON_PRINTF", struct om_vector, printf);
|
||||
off("OLDMON_HALT", struct om_vector, exitToMon);
|
||||
#endif
|
||||
|
||||
/* floppy trap handler fields */
|
||||
off("FDC_REG_MSR", struct fdcio, fdcio_reg_msr);
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: genassym.cf,v 1.14 2000/05/26 00:36:50 thorpej Exp $
|
||||
# $NetBSD: genassym.cf,v 1.15 2000/06/19 23:30:35 eeh Exp $
|
||||
|
||||
#
|
||||
# Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -133,7 +133,6 @@ define USIZ sizeof(struct user)
|
||||
|
||||
# VM structure fields
|
||||
define VM_PMAP offsetof(struct vmspace, vm_map.pmap)
|
||||
#define VM_PMAP_CTX offsetof(struct vmspace, vm_map.pmap.pm_ctx)
|
||||
|
||||
# pmap structure fields
|
||||
define PM_CTX offsetof(struct pmap, pm_ctx)
|
||||
@ -147,7 +146,18 @@ define V_INTR offsetof(struct uvmexp, intrs)
|
||||
define V_FAULTS offsetof(struct uvmexp, faults)
|
||||
|
||||
# CPU info structure
|
||||
#define CPUINFO_FAULTSTATUS offsetof(struct cpu_softc, get_faultstatus)
|
||||
define CI_CURPROC offsetof(struct cpu_info, ci_curproc)
|
||||
define CI_CPCB offsetof(struct cpu_info, ci_cpcb)
|
||||
define CI_NEXT offsetof(struct cpu_info, ci_next)
|
||||
define CI_FPPROC offsetof(struct cpu_info, ci_fpproc)
|
||||
define CI_NUMBER offsetof(struct cpu_info, ci_number)
|
||||
define CI_UPAID offsetof(struct cpu_info, ci_upaid)
|
||||
define CI_SPINUP offsetof(struct cpu_info, ci_spinup)
|
||||
define CI_INITSTACK offsetof(struct cpu_info, ci_initstack)
|
||||
define CI_PADDR offsetof(struct cpu_info, ci_paddr)
|
||||
define CURPROC (CPUINFO_VA+CI_CURPROC)
|
||||
define CPCB (CPUINFO_VA+CI_CPCB)
|
||||
define FPPROC (CPUINFO_VA+CI_FPPROC)
|
||||
|
||||
# FPU state
|
||||
define FS_REGS offsetof(struct fpstate64, fs_regs)
|
||||
@ -158,8 +168,8 @@ define FS_QUEUE offsetof(struct fpstate64, fs_queue)
|
||||
define FS_SIZE sizeof(struct fpstate64)
|
||||
define FSR_QNE FSR_QNE
|
||||
define FPRS_FEF FPRS_FEF
|
||||
define FPRS_DL FPRS_DL
|
||||
define FPRS_DU FPRS_DU
|
||||
define FPRS_DL FPRS_DL
|
||||
|
||||
# system calls
|
||||
define SYS___sigreturn14 SYS___sigreturn14
|
||||
@ -223,48 +233,6 @@ define IH_NEXT offsetof(struct intrhand, ih_next)
|
||||
define IH_MAP offsetof(struct intrhand, ih_map)
|
||||
define IH_CLR offsetof(struct intrhand, ih_clr)
|
||||
|
||||
|
||||
ifdef notyet
|
||||
# ZSCC interrupt fields
|
||||
define ZSC_A offsetof(struct zs_softc, sc_a)
|
||||
define ZSC_B offsetof(struct zs_softc, sc_b)
|
||||
#define ZL_WREG offsetof(struct zs_line, zl_wreg)
|
||||
define ZL_TBC offsetof(struct zs_line, zl_tbc)
|
||||
define ZL_TBA offsetof(struct zs_line, zl_tba)
|
||||
define ZL_RBPUT offsetof(struct zs_line, zl_rbput)
|
||||
define ZL_RBUF offsetof(struct zs_line, zl_rbuf)
|
||||
define ZSRR1_DO_bit ffs(ZSRR1_DO) - 1
|
||||
endif
|
||||
|
||||
ifdef notyet
|
||||
# audio trap handler fields
|
||||
define AU_AMD offsetof(struct auio, au_amd)
|
||||
define AU_RDATA offsetof(struct auio, au_rdata)
|
||||
define AU_REND offsetof(struct auio, au_rend)
|
||||
define AU_PDATA offsetof(struct auio, au_pdata)
|
||||
define AU_PEND offsetof(struct auio, au_pend)
|
||||
define AU_EVCNT offsetof(struct auio, au_intrcnt.ev_count)
|
||||
|
||||
define AMD_IR offsetof(struct amd7930, ir)
|
||||
define AMD_BBRB offsetof(struct amd7930, bbrb)
|
||||
define AMD_BBTB offsetof(struct amd7930, bbtb)
|
||||
endif
|
||||
|
||||
#define PROM_BASE PROM_BASE
|
||||
|
||||
define PV_NODEOPS offsetof(struct promvec, pv_nodeops)
|
||||
define PV_HALT offsetof(struct promvec, pv_halt)
|
||||
define PV_EVAL offsetof(struct promvec, pv_fortheval.v0_eval)
|
||||
define PV_ROMVEC_VERS offsetof(struct promvec, pv_romvec_vers)
|
||||
|
||||
define NO_NEXTNODE offsetof(struct nodeops, no_nextnode)
|
||||
define NO_GETPROP offsetof(struct nodeops, no_getprop)
|
||||
|
||||
ifdef notyet
|
||||
define OLDMON_PRINTF offsetof(struct om_vector, printf)
|
||||
define OLDMON_HALT offsetof(struct om_vector, exitToMon)
|
||||
endif
|
||||
|
||||
# floppy trap handler fields
|
||||
define FDC_REG_MSR offsetof(struct fdcio, fdcio_reg_msr)
|
||||
define FDC_REG_FIFO offsetof(struct fdcio, fdcio_reg_fifo)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mem.c,v 1.10 1999/12/04 21:21:36 ragge Exp $ */
|
||||
/* $NetBSD: mem.c,v 1.11 2000/06/19 23:30:36 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -59,8 +59,8 @@
|
||||
|
||||
#include <vm/vm.h>
|
||||
|
||||
extern vaddr_t prom_vstart;
|
||||
extern vaddr_t prom_vend;
|
||||
vaddr_t prom_vstart = 0xf000000;
|
||||
vaddr_t prom_vend = 0xf0100000;
|
||||
caddr_t zeropage;
|
||||
|
||||
/*ARGSUSED*/
|
||||
@ -210,7 +210,7 @@ mmrw(dev, uio, flags)
|
||||
v = uio->uio_offset;
|
||||
if (v >= MSGBUF_VA && v < MSGBUF_VA+NBPG) {
|
||||
c = min(iov->iov_len, 4096);
|
||||
#if 0 /* Don't know where PROMs are on Ultras. Think it's at f000000 */
|
||||
#if 1 /* Don't know where PROMs are on Ultras. Think it's at f000000 */
|
||||
} else if (v >= prom_vstart && v < prom_vend &&
|
||||
uio->uio_rw == UIO_READ) {
|
||||
/* Allow read-only access to the PROM */
|
||||
@ -233,20 +233,6 @@ mmrw(dev, uio, flags)
|
||||
|
||||
/* XXX should add sbus, etc */
|
||||
|
||||
#if defined(SUN4)
|
||||
/*
|
||||
* minor device 11 (/dev/eeprom) is the old-style
|
||||
* (a'la Sun 3) EEPROM.
|
||||
*/
|
||||
case 11:
|
||||
if (cputyp == CPU_SUN4)
|
||||
error = eeprom_uio(uio);
|
||||
else
|
||||
error = ENXIO;
|
||||
|
||||
break;
|
||||
#endif /* SUN4 */
|
||||
|
||||
/*
|
||||
* minor device 12 (/dev/zero) is source of nulls on read,
|
||||
* rathole on write.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: trap.c,v 1.43 2000/06/18 08:13:45 mrg Exp $ */
|
||||
/* $NetBSD: trap.c,v 1.44 2000/06/19 23:30:36 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -49,6 +49,7 @@
|
||||
*/
|
||||
|
||||
#define NEW_FPSTATE
|
||||
#define TRAPWIN
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_syscall_debug.h"
|
||||
@ -501,7 +502,7 @@ trap(type, tstate, pc, tf)
|
||||
int* sp;
|
||||
|
||||
__asm("mov %%sp, %0" : "=r" (sp) :);
|
||||
if (sp < eintstack) {
|
||||
if (sp < EINTSTACK) {
|
||||
printf("trap: We're on the interrupt stack!\ntype=0x%x tf=%p %s\n",
|
||||
type, tf, type < N_TRAP_TYPES ? trap_type[type] :
|
||||
((type == T_AST) ? "ast" :
|
||||
@ -1457,7 +1458,7 @@ out:
|
||||
void
|
||||
text_access_fault(type, pc, tf)
|
||||
register unsigned type;
|
||||
register u_long pc;
|
||||
register vaddr_t pc;
|
||||
register struct trapframe64 *tf;
|
||||
{
|
||||
register u_int64_t tstate;
|
||||
@ -1515,7 +1516,7 @@ text_access_fault(type, pc, tf)
|
||||
extern int trap_trace_dis;
|
||||
trap_trace_dis = 1; /* Disable traptrace for printf */
|
||||
(void) splhigh();
|
||||
printf("text_access_fault: pc=%x\n", pc);
|
||||
printf("text_access_fault: pc=%lx\n", pc);
|
||||
DEBUGGER(type, tf);
|
||||
panic("kernel fault");
|
||||
/* NOTREACHED */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vaddrs.h,v 1.4 2000/06/12 23:32:48 eeh Exp $ */
|
||||
/* $NetBSD: vaddrs.h,v 1.5 2000/06/19 23:30:37 eeh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -56,16 +56,6 @@
|
||||
* a 24-bit address space out to 32 bits. This is a legacy of the
|
||||
* IBM PC AT bus, actually, just so you know who to blame.)
|
||||
*
|
||||
* We reserve several pages at the base of our IO virtual space
|
||||
* for `oft-used' devices which must be present anyway in order to
|
||||
* configure. In particular, we want the counter-timer register and
|
||||
* the Zilog ZSCC serial port chips to be mapped at fixed VAs to make
|
||||
* microtime() and the zs hardware interrupt handlers faster.
|
||||
*
|
||||
* [sun4/sun4c:]
|
||||
* Ideally, we should map the interrupt enable register here as well,
|
||||
* but that would require allocating pmegs in locore.s, so instead we
|
||||
* use one of the two `wasted' pages at KERNBASE+_MAXNBPG (see locore.s).
|
||||
*/
|
||||
|
||||
#ifndef IODEV_0
|
||||
@ -76,11 +66,11 @@
|
||||
|
||||
/* [4m:] interrupt and counter registers take (1 + NCPU) pages. */
|
||||
|
||||
#define CPUINFO_VA ( INTSTACK)
|
||||
#define AUXREG_VA ( EINTSTACK)
|
||||
#define AUXREG_VA ( KERNEND + _MAXNBPG) /* 1 page REDZONE */
|
||||
#define TMPMAP_VA ( AUXREG_VA + _MAXNBPG)
|
||||
#define MSGBUF_VA ( TMPMAP_VA + _MAXNBPG)
|
||||
#define IODEV_BASE ( MSGBUF_VA + _MAXNBPG)
|
||||
#define CPUINFO_VA ( KERNEND + 8*_MAXNBPG) /* 64K after kernel end */
|
||||
#define IODEV_BASE ( CPUINFO_VA + 8*_MAXNBPG)/* 64K long */
|
||||
#define IODEV_END 0x0ff000000UL /* 16 MB of iospace */
|
||||
|
||||
#endif /* IODEV_0 */
|
||||
|
Loading…
Reference in New Issue
Block a user