struct ivec_dsp for interrupt vector allocation added.

This commit is contained in:
ragge 1995-11-12 14:33:11 +00:00
parent dacabc2dd9
commit 2a23f39e82
2 changed files with 34 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.h,v 1.8 1995/06/16 15:17:40 ragge Exp $ */
/* $NetBSD: trap.h,v 1.9 1995/11/12 14:33:11 ragge Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -104,6 +104,27 @@ struct trapframe {
u_int pc; /* User pc */
u_int psl; /* User psl */
};
/*
* This struct is used when setting up interrupt vectors dynamically.
* It pushes a longword between 0-63 on the stack; this number is
* normally used as the ctlr number on devices. This use effectively
* limits the number of interruptable ctlrs on the unibus to 64.
*/
struct ivec_dsp {
char pushr; /* pushr */
char pushrarg; /* $3f */
char pushl; /* pushl */
char pushlarg; /* $? */
char nop; /* nop, for foolish gcc */
char calls[3]; /* calls $1,? */
u_int hoppaddr; /* jump for calls */
char popr; /* popr $0x3f */
char poprarg;
char rei; /* rei */
char pad; /* sizeof(struct ivec_dsp) == 16 */
};
#endif /* ASSEMBLER */
#endif _VAX_TRAP_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.13 1995/07/05 08:39:48 ragge Exp $ */
/* $NetBSD: trap.c,v 1.14 1995/11/12 14:33:13 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -140,6 +140,10 @@ faulter:
if (kdb_trap(frame))
return;
#endif
printf("Trap: type %x, code %x, pc %x, psl %x\n",
frame->trap, frame->code, frame->pc, frame->psl);
showregs(frame);
asm("halt");
panic("trap: adr %x",frame->code);
case T_KSPNOTVAL:
goto faulter;
@ -154,8 +158,8 @@ faulter:
else
ptep=(u_int *)p->p_addr->u_pcb.P1BR;
pte1=(u_int *)trunc_page(&ptep[(frame->code
&0x3fffffff)>>PG_SHIFT]);
pte=(u_int*)&Sysmap[((u_int)pte1&0x3fffffff)>>PG_SHIFT];
&0x3fffffff)>>PGSHIFT]);
pte=(u_int*)&Sysmap[((u_int)pte1&0x3fffffff)>>PGSHIFT];
if(*pte&PG_SREF){ /* Yes, simulated */
s=splhigh();
@ -171,13 +175,13 @@ faulter:
frame->code=trunc_page(frame->code);
if(frame->code<0x40000000){
ptep=(u_int *)p->p_addr->u_pcb.P0BR;
pte=&ptep[(frame->code>>PG_SHIFT)];
pte=&ptep[(frame->code>>PGSHIFT)];
} else if(frame->code>0x7fffffff){
pte=(u_int *)&Sysmap[((u_int)frame->code&
0x3fffffff)>>PG_SHIFT];
0x3fffffff)>>PGSHIFT];
} else {
ptep=(u_int *)p->p_addr->u_pcb.P1BR;
pte=&ptep[(frame->code&0x3fffffff)>>PG_SHIFT];
pte=&ptep[(frame->code&0x3fffffff)>>PGSHIFT];
}
if(*pte&PG_SREF){
s=splhigh();
@ -208,10 +212,10 @@ if(faultdebug)printf("trap accflt type %x, code %x, pc %x, psl %x\n",
if(P0){
faultaddr=(u_int)pm->pm_pcb->P0BR+
((testaddr>>PG_SHIFT)<<2);
((testaddr>>PGSHIFT)<<2);
} else if(P1){
faultaddr=(u_int)pm->pm_pcb->P1BR+
((testaddr>>PG_SHIFT)<<2);
((testaddr>>PGSHIFT)<<2);
} else panic("pageflt: PTE fault in SPT\n");
faultaddr&=~PAGE_MASK;
@ -413,31 +417,6 @@ stray(scb, vec){
printf("stray interrupt scb %d, vec 0x%x\n", scb, vec);
}
struct inta {
char pushr[2]; /* pushr $3f */
char pushl[2]; /* pushl $? */
char nop; /* nop, for foolish gcc */
char calls[3]; /* $1,? */
u_int hoppaddr; /* jump for calls */
char popr[2]; /* popr $0x3f */
char rei; /* rei */
} intasm = {0xbb, 0x3f, 0xdd, 0, 1, 0xfb, 1, 0xef, 0, 0xba, 0x3f, 2};
u_int
settrap(plats, nyrut,arg)
u_int plats; /* Pointer to place to copy interrupt routine */
u_int nyrut; /* Pointer to new routine to jump to */
u_int arg; /* arg number to pass to routine. */
{
struct inta *introut;
introut=(void *)((plats&0xfffffffc)+4);
bcopy(&intasm, introut, sizeof(struct inta));
introut->pushl[1]=arg;
introut->hoppaddr=nyrut-(u_int)&introut->popr[0];
return (u_int)introut;
}
printstack(loaddr, highaddr)
u_int *loaddr, *highaddr;
{