summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graichen <graichen@cvs.openbsd.org>1997-02-05 23:48:48 +0000
committerThomas Graichen <graichen@cvs.openbsd.org>1997-02-05 23:48:48 +0000
commit7f337d13736b38766d1d244cc44b6f4d8910760e (patch)
tree551e33bd4c0ca64778dcf0e53592c1bbc8ae79de
parent277e50c3a76cd048a29168e71b2c5e7450378029 (diff)
bring siginfo stuff for the pmax in sync with the arc and add
BUFCACHEPERCENT for the pmax
-rw-r--r--sys/arch/pmax/pmax/machdep.c30
-rw-r--r--sys/arch/pmax/pmax/trap.c6
2 files changed, 32 insertions, 4 deletions
diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c
index 932b07f0fba..715a4d82685 100644
--- a/sys/arch/pmax/pmax/machdep.c
+++ b/sys/arch/pmax/pmax/machdep.c
@@ -723,6 +723,10 @@ mach_init(argc, argv, code, cv)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
+#ifndef BUFCACHEPERCENT
+#define BUFCACHEPERCENT 5
+#endif
+
/*
* Determine how many buffers to allocate.
* We allocate more buffer space than the BSD standard of
@@ -730,13 +734,29 @@ mach_init(argc, argv, code, cv)
* We just allocate a flat 10%. Ensure a minimum of 16 buffers.
* We allocate 1/2 as many swap buffer headers as file i/o buffers.
*/
- if (bufpages == 0)
- bufpages = physmem / 10 / CLSIZE;
+ if (bufpages == 0) {
+ if (physmem < btoc(2 * 1024 * 1024))
+ bufpages = physmem / (10 * CLSIZE);
+ else
+ bufpages = (btoc(2 * 1024 * 1024) + physmem) /
+ ((100/BUFCACHEPERCENT) * CLSIZE);
+ }
if (nbuf == 0) {
nbuf = bufpages;
if (nbuf < 16)
nbuf = 16;
}
+
+ /* Restrict to at most 70% filled kvm */
+ if (nbuf * MAXBSIZE >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 7 / 10)
+ nbuf = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ MAXBSIZE * 7 / 10;
+
+ /* More buffer pages than fits into the buffers is senseless. */
+ if (bufpages > nbuf * MAXBSIZE / CLBYTES)
+ bufpages = nbuf * MAXBSIZE / CLBYTES;
+
if (nswbuf == 0) {
nswbuf = (nbuf / 2) &~ 1; /* force even */
if (nswbuf > 256)
@@ -798,6 +818,12 @@ cpu_startup()
panic("startup: cannot allocate buffers");
base = bufpages / nbuf;
residual = bufpages % nbuf;
+ if (base >= MAXBSIZE / CLBYTES) {
+ /* don't want to alloc more physical mem than needed */
+ base = MAXBSIZE / CLBYTES;
+ residual = 0;
+ }
+
for (i = 0; i < nbuf; i++) {
vm_size_t curbufsize;
vm_offset_t curbuf;
diff --git a/sys/arch/pmax/pmax/trap.c b/sys/arch/pmax/pmax/trap.c
index 9552a662475..88ba03e83dc 100644
--- a/sys/arch/pmax/pmax/trap.c
+++ b/sys/arch/pmax/pmax/trap.c
@@ -411,7 +411,7 @@ trap(statusReg, causeReg, vadr, pc, args)
u_quad_t sticks;
vm_prot_t ftype;
extern unsigned onfault_table[];
- int typ;
+ int typ = 0;
#ifdef DEBUG
trp->status = statusReg;
@@ -596,7 +596,7 @@ trap(statusReg, causeReg, vadr, pc, args)
}
goto err;
}
- ucode = vadr;
+ ucode = ftype;
i = SIGSEGV;
typ = SEGV_MAPERR;
break;
@@ -604,11 +604,13 @@ trap(statusReg, causeReg, vadr, pc, args)
case T_ADDR_ERR_LD+T_USER: /* misaligned or kseg access */
case T_ADDR_ERR_ST+T_USER: /* misaligned or kseg access */
+ ucode = 0; /* XXX should be VM_PROT_something */
i = SIGBUS;
typ = BUS_ADRALN;
break;
case T_BUS_ERR_IFETCH+T_USER: /* BERR asserted to cpu */
case T_BUS_ERR_LD_ST+T_USER: /* BERR asserted to cpu */
+ ucode = 0; /* XXX should be VM_PROT_something */
i = SIGBUS;
typ = BUS_OBJERR;
break;