fixed problem that caused two consecutive segments to be using the same

pmeg unknowingly.  still too many printfs, not sure how many are actualy
in the machine dependent code.  reaches cpu_startup() where it stops
deliberately. next project: autoconfig(), maybe kgdb
This commit is contained in:
glass 1993-08-10 08:42:34 +00:00
parent 4ed4b0d387
commit a1d3be118e
12 changed files with 124 additions and 33 deletions

View File

@ -26,9 +26,15 @@
/*
* HISTORY
* $Log: db_machdep.h,v $
* Revision 1.1 1993/08/08 12:18:27 glass
* various changes
* Revision 1.2 1993/08/10 08:42:37 glass
* fixed problem that caused two consecutive segments to be using the same
* pmeg unknowingly. still too many printfs, not sure how many are actualy
* in the machine dependent code. reaches cpu_startup() where it stops
* deliberately. next project: autoconfig(), maybe kgdb
*
* Revision 1.1 93/08/08 12:18:27 glass
* various changes
*
* Revision 2.5 91/07/31 18:12:56 dbg
* Changed register save area name.
* [91/07/12 dbg]
@ -101,6 +107,7 @@ db_regs_t ddb_regs; /* register state */
#define FIXUP_PC_AFTER_BREAK ddb_regs.pc -= 2;
#define SR_T1 0x8000
#define db_clear_single_step(regs) ((regs)->sr &= ~SR_T1)
#define db_set_single_step(regs) ((regs)->sr |= SR_T1)

View File

@ -26,9 +26,15 @@
/*
* HISTORY
* $Log: db_interface.c,v $
* Revision 1.1 1993/08/08 12:22:06 glass
* lots of changes, too many printfs
* Revision 1.2 1993/08/10 08:42:52 glass
* fixed problem that caused two consecutive segments to be using the same
* pmeg unknowingly. still too many printfs, not sure how many are actualy
* in the machine dependent code. reaches cpu_startup() where it stops
* deliberately. next project: autoconfig(), maybe kgdb
*
* Revision 1.1 93/08/08 12:22:06 glass
* lots of changes, too many printfs
*
* Revision 2.6 92/01/03 20:31:01 dbg
* Ignore RB_KDB - always enter DDB.
* [91/11/06 dbg]
@ -153,7 +159,8 @@ kdb_trap(type, regs)
}
extern char * trap_type[];
extern int TRAP_TYPES;
#define TRAP_TYPES 15
/*extern int TRAP_TYPES;*/
/*
* Print trap reason.
@ -237,3 +244,8 @@ db_write_bytes(addr, size, data)
#endif
}
int
Debugger()
{
asm ("trap #15");
}

View File

@ -26,9 +26,15 @@
/*
* HISTORY
* $Log: db_trace.c,v $
* Revision 1.1 1993/08/08 12:22:09 glass
* lots of changes, too many printfs
* Revision 1.2 1993/08/10 08:42:55 glass
* fixed problem that caused two consecutive segments to be using the same
* pmeg unknowingly. still too many printfs, not sure how many are actualy
* in the machine dependent code. reaches cpu_startup() where it stops
* deliberately. next project: autoconfig(), maybe kgdb
*
* Revision 1.1 93/08/08 12:22:09 glass
* lots of changes, too many printfs
*
* Revision 2.5 91/10/09 16:17:23 af
* Added parens in initializers for db_regs.
* [91/10/07 af]
@ -76,7 +82,7 @@
#include <machine/setjmp.h>
#define jmp_buf_t jmp_buf
extern jmp_buf_t *db_recover;
jmp_buf_t *db_recover;
/*
* Register list
@ -284,7 +290,7 @@ findentry( sp )
jmp_buf_t db_jmpbuf;
jmp_buf_t *savejmp = db_recover;
if (_setjmp(db_recover = &db_jmpbuf)) {
if (setjmp(db_recover = &db_jmpbuf)) {
/* oops -- we touched something we ought not to have */
/* cannot trace caller of "start" */
sp->k_entry = MAXINT;

View File

@ -55,6 +55,7 @@
#endif
#define _ASM_FUNC(x) x
#define ALIGN_TEXT .align 2
#ifdef GPROF
# define _BEGIN_ENTRY
# define _END_ENTRY link a6,#0; jbsr mcount; unlk a6 ;
@ -65,7 +66,7 @@
# define _ENTER_FUNC(x) ;
#endif
#define _ENTRY(x) .globl x; x:
#define _ENTRY(x) .globl x; ALIGN_TEXT; x:
#define ENTRY(y) _BEGIN_ENTRY; _ENTRY(_C_FUNC(y)); _END_ENTRY
#define TWOENTRY(y,z) _BEGIN_ENTRY; _ENTRY(_C_FUNC(z)); _END_ENTRY \

View File

@ -26,9 +26,15 @@
/*
* HISTORY
* $Log: db_machdep.h,v $
* Revision 1.1 1993/08/08 12:18:27 glass
* various changes
* Revision 1.2 1993/08/10 08:42:37 glass
* fixed problem that caused two consecutive segments to be using the same
* pmeg unknowingly. still too many printfs, not sure how many are actualy
* in the machine dependent code. reaches cpu_startup() where it stops
* deliberately. next project: autoconfig(), maybe kgdb
*
* Revision 1.1 93/08/08 12:18:27 glass
* various changes
*
* Revision 2.5 91/07/31 18:12:56 dbg
* Changed register save area name.
* [91/07/12 dbg]
@ -101,6 +107,7 @@ db_regs_t ddb_regs; /* register state */
#define FIXUP_PC_AFTER_BREAK ddb_regs.pc -= 2;
#define SR_T1 0x8000
#define db_clear_single_step(regs) ((regs)->sr &= ~SR_T1)
#define db_set_single_step(regs) ((regs)->sr |= SR_T1)

View File

@ -60,6 +60,8 @@
#define T_COPERR 12
#define T_ASTFLT 13
#define T_TRAP15 15
#define T_BRKPT T_TRAP15
#define T_WATCHPOINT 16
#define T_USER 0x80 /* user-mode flag or'ed with type */

View File

@ -26,9 +26,15 @@
/*
* HISTORY
* $Log: db_interface.c,v $
* Revision 1.1 1993/08/08 12:22:06 glass
* lots of changes, too many printfs
* Revision 1.2 1993/08/10 08:42:52 glass
* fixed problem that caused two consecutive segments to be using the same
* pmeg unknowingly. still too many printfs, not sure how many are actualy
* in the machine dependent code. reaches cpu_startup() where it stops
* deliberately. next project: autoconfig(), maybe kgdb
*
* Revision 1.1 93/08/08 12:22:06 glass
* lots of changes, too many printfs
*
* Revision 2.6 92/01/03 20:31:01 dbg
* Ignore RB_KDB - always enter DDB.
* [91/11/06 dbg]
@ -153,7 +159,8 @@ kdb_trap(type, regs)
}
extern char * trap_type[];
extern int TRAP_TYPES;
#define TRAP_TYPES 15
/*extern int TRAP_TYPES;*/
/*
* Print trap reason.
@ -237,3 +244,8 @@ db_write_bytes(addr, size, data)
#endif
}
int
Debugger()
{
asm ("trap #15");
}

View File

@ -26,9 +26,15 @@
/*
* HISTORY
* $Log: db_trace.c,v $
* Revision 1.1 1993/08/08 12:22:09 glass
* lots of changes, too many printfs
* Revision 1.2 1993/08/10 08:42:55 glass
* fixed problem that caused two consecutive segments to be using the same
* pmeg unknowingly. still too many printfs, not sure how many are actualy
* in the machine dependent code. reaches cpu_startup() where it stops
* deliberately. next project: autoconfig(), maybe kgdb
*
* Revision 1.1 93/08/08 12:22:09 glass
* lots of changes, too many printfs
*
* Revision 2.5 91/10/09 16:17:23 af
* Added parens in initializers for db_regs.
* [91/10/07 af]
@ -76,7 +82,7 @@
#include <machine/setjmp.h>
#define jmp_buf_t jmp_buf
extern jmp_buf_t *db_recover;
jmp_buf_t *db_recover;
/*
* Register list
@ -284,7 +290,7 @@ findentry( sp )
jmp_buf_t db_jmpbuf;
jmp_buf_t *savejmp = db_recover;
if (_setjmp(db_recover = &db_jmpbuf)) {
if (setjmp(db_recover = &db_jmpbuf)) {
/* oops -- we touched something we ought not to have */
/* cannot trace caller of "start" */
sp->k_entry = MAXINT;

View File

@ -8,15 +8,15 @@ _intrcnt:
.text
#define INTERRUPT_HANDLE(interrupt num) \
addql #1,_intrcnt+interrupt_num \
movw sr,sp@- | push current SR value \
clrw sp@- | padded to longword \
jbsr _intrhand | handle interrupt \
addql #4,sp | pop SR
moveml sp@+,#0x0303 \
addql #2,sp \
addql #1, _cnt+V_INTR \
#define INTERRUPT_HANDLE(interrupt_num) \
addql #1,_intrcnt+interrupt_num ;\
movw sr,sp@- ; /* push current SR value */\
clrw sp@- ; /* padded to longword */\
jbsr _intrhand ; /* handle interrupt */\
addql #4,sp ; /* pop SR */\
moveml sp@+,#0x0303 ; \
addql #2,sp ; \
addql #1, _cnt+V_INTR ; \
jra rei
.globl _level1intr, _level2intr, _level3intr, _level4intr

View File

@ -75,17 +75,45 @@ ENTRY(set_control_word)
*
* [I don't think the ENTRY() macro will do the right thing with this -- glass]
*/
.globl _getsp
.globl _getsp; .align 2
_getsp:
movl sp,d0 | get current SP
addql #4,d0 | compensate for return address
rts
.globl _getsfc, _getdfc
.align 2
_getsfc:
movc sfc,d0
rts
.align 2
_getdfc:
movc dfc,d0
rts
/*
* non-local gotos
*/
ENTRY(setjmp)
movl sp@(4),a0 | savearea pointer
moveml #0xFCFC,a0@ | save d2-d7/a2-a7
movl sp@,a0@(48) | and return address
moveq #0,d0 | return 0
rts
ENTRY(qsetjmp)
movl sp@(4),a0 | savearea pointer
lea a0@(40),a0 | skip regs we do not save
movl a6,a0@+ | save FP
movl sp,a0@+ | save SP
movl sp@,a0@ | and return address
moveq #0,d0 | return 0
rts
ENTRY(longjmp)
movl sp@(4),a0
moveml a0@+,#0xFCFC
movl a0@,sp@
moveq #1,d0
rts

View File

@ -28,8 +28,10 @@
#include "machine/pte.h"
#include "machine/mon.h"
#include "machine/isr.h"
#include "net/netisr.h"
char kstack[NBPG]; /* totally bogus */
struct proc *proc0paddr = &proc0;
@ -721,6 +723,7 @@ netintr()
intrhand(sr)
int sr;
{
#if 0
register struct isr *isr;
register int found = 0;
register int ipl;
@ -753,4 +756,6 @@ intrhand(sr)
printf("intrhand: unexpected sr 0x%x\n", sr);
break;
}
#endif
}

View File

@ -473,14 +473,19 @@ pmeg_t pmeg_allocate_invalid(pmap, va)
}
pmap_remove_range(pmegp->pmeg_owner, pmegp->pmeg_va,
pmegp->pmeg_va+NBSG);
}
} else
panic("pmeg_allocate_invalid: failed\n");
if (!pmegp)
panic("pmeg_allocate_invalid: unable to allocate pmeg");
pmegp->pmeg_owner = pmap;
pmegp->pmeg_owner_version = pmap->pm_version;
pmegp->pmeg_va = va;
pmegp->pmeg_wired_count = 0;
pmegp->pmeg_reserved = 0;
pmegp->pmeg_vpages = 0;
pmegp = (pmeg_t) enqueue_tail(&pmeg_active_queue, pmegp);
enqueue_tail(&pmeg_active_queue, pmegp);
printf("pmeg_allocate_invalid: pmeg %d allocated to pmap %x\n",
pmegp->pmeg_index, pmap);
return pmegp;
}
@ -1261,14 +1266,14 @@ add_pte: /* can be destructive */
if (mem_type & PG_TYPE)
set_pte(va, pte_proto | PG_NC);
else {
printf("before pv_link\n");
nflags = pv_link(kernel_pmap, pa, va, PG_TO_PV_FLAGS(pte_proto));
printf("after pv_link\n");
if (nflags & PV_NC)
set_pte(va, pte_proto | PG_NC);
else
set_pte(va, pte_proto);
}
printf("pmap_enter_kernel: va: %x pa: %x pte_proto: %x\n", va, pa,
pte_proto);
pmegp->pmeg_vpages++; /* assumes pmap_enter can never insert
a non-valid page*/
splx(s);