Do the cpu_kcore_hdr initialization a little differently.

(also fix - was not setting pg_frame, pg_valid)
This commit is contained in:
gwr 1997-10-05 20:43:27 +00:00
parent 00fe95a86e
commit c669b1bdeb
5 changed files with 49 additions and 39 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.24 1997/10/04 20:03:46 gwr Exp $ */
/* $NetBSD: machdep.c,v 1.25 1997/10/05 20:43:40 gwr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -423,7 +423,7 @@ setregs(p, pack, stack)
/*
* Info for CTL_HW
*/
char machine[] = MACHINE; /* from <machine/param.h> */
char machine[16] = MACHINE; /* from <machine/param.h> */
char cpu_model[120];
/*
@ -727,19 +727,31 @@ dumpsys()
return;
}
printf("\ndumping to dev %x, offset %d\n",
printf("\ndumping to dev 0x%x, offset %d\n",
(int) dumpdev, (int) dumplo);
/*
* We put the dump header is in physical page zero,
* so there is no extra work here to write it out.
* All we do is initialize the header.
*/
/* Set pointers to all three parts. */
kseg_p = (kcore_seg_t *)KERNBASE;
chdr_p = (cpu_kcore_hdr_t *) (kseg_p + 1);
sh = &chdr_p->un._sun3x;
/* Fill in kcore_seg_t part. */
CORE_SETMAGIC(*kseg_p, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
kseg_p->c_size = sizeof(*chdr_p);
pmap_set_kcore_hdr(chdr_p);
/* Fill in cpu_kcore_hdr_t part. */
bcopy(machine, chdr_p->name, sizeof(chdr_p->name));
chdr_p->page_size = NBPG;
chdr_p->kernbase = KERNBASE;
/* Fill in the sun3x_kcore_hdr part. */
pmap_kcore_hdr(sh);
/*
* Now dump physical memory. Note that physical memory

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.27 1997/09/19 13:55:44 leo Exp $ */
/* $NetBSD: pmap.c,v 1.28 1997/10/05 20:43:36 gwr Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -3543,25 +3543,18 @@ pmap_update()
}
/*
* Fill in the cpu_kcore header for dumpsys()
* (See machdep.c)
* Fill in the sun3x-specific part of the kernel core header
* for dumpsys(). (See machdep.c for the rest.)
*/
void
pmap_set_kcore_hdr(chdr_p)
cpu_kcore_hdr_t *chdr_p;
pmap_kcore_hdr(sh)
struct sun3x_kcore_hdr *sh;
{
struct sun3x_kcore_hdr *sh = &chdr_p->un._sun3x;
u_long spa, len;
int i;
extern char machine[];
/*
* Fill in dispatch information.
*/
strcpy(chdr_p->name, machine);
chdr_p->page_size = NBPG;
chdr_p->kernbase = KERNBASE;
sh->pg_frame = MMU_SHORT_PTE_BASEADDR;
sh->pg_valid = MMU_DT_PAGE;
sh->contig_end = virtual_contig_end;
sh->kernCbase = (u_long) kernCbase;
for (i = 0; i < SUN3X_NPHYS_RAM_SEGS; i++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.h,v 1.12 1997/05/29 22:18:24 gwr Exp $ */
/* $NetBSD: machdep.h,v 1.13 1997/10/05 20:43:27 gwr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@ -86,13 +86,13 @@
/* Prototypes... */
struct cpu_kcore_hdr;
struct frame;
struct fpframe;
struct mmu_rootptr;
struct pcb;
struct proc;
struct reg;
struct sun3x_kcore_hdr;
struct trapframe;
struct uio;
@ -164,8 +164,8 @@ void netintr __P((void));
void proc_trampoline __P((void));
void pmap_bootstrap __P((vm_offset_t nextva));
void pmap_kcore_hdr __P((struct sun3x_kcore_hdr *));
int pmap_pa_exists __P((vm_offset_t pa));
void pmap_set_kcore_hdr __P((struct cpu_kcore_hdr *));
void savectx __P((struct pcb *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.24 1997/10/04 20:03:46 gwr Exp $ */
/* $NetBSD: machdep.c,v 1.25 1997/10/05 20:43:40 gwr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -423,7 +423,7 @@ setregs(p, pack, stack)
/*
* Info for CTL_HW
*/
char machine[] = MACHINE; /* from <machine/param.h> */
char machine[16] = MACHINE; /* from <machine/param.h> */
char cpu_model[120];
/*
@ -727,19 +727,31 @@ dumpsys()
return;
}
printf("\ndumping to dev %x, offset %d\n",
printf("\ndumping to dev 0x%x, offset %d\n",
(int) dumpdev, (int) dumplo);
/*
* We put the dump header is in physical page zero,
* so there is no extra work here to write it out.
* All we do is initialize the header.
*/
/* Set pointers to all three parts. */
kseg_p = (kcore_seg_t *)KERNBASE;
chdr_p = (cpu_kcore_hdr_t *) (kseg_p + 1);
sh = &chdr_p->un._sun3x;
/* Fill in kcore_seg_t part. */
CORE_SETMAGIC(*kseg_p, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
kseg_p->c_size = sizeof(*chdr_p);
pmap_set_kcore_hdr(chdr_p);
/* Fill in cpu_kcore_hdr_t part. */
bcopy(machine, chdr_p->name, sizeof(chdr_p->name));
chdr_p->page_size = NBPG;
chdr_p->kernbase = KERNBASE;
/* Fill in the sun3x_kcore_hdr part. */
pmap_kcore_hdr(sh);
/*
* Now dump physical memory. Note that physical memory

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.27 1997/09/19 13:55:44 leo Exp $ */
/* $NetBSD: pmap.c,v 1.28 1997/10/05 20:43:36 gwr Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -3543,25 +3543,18 @@ pmap_update()
}
/*
* Fill in the cpu_kcore header for dumpsys()
* (See machdep.c)
* Fill in the sun3x-specific part of the kernel core header
* for dumpsys(). (See machdep.c for the rest.)
*/
void
pmap_set_kcore_hdr(chdr_p)
cpu_kcore_hdr_t *chdr_p;
pmap_kcore_hdr(sh)
struct sun3x_kcore_hdr *sh;
{
struct sun3x_kcore_hdr *sh = &chdr_p->un._sun3x;
u_long spa, len;
int i;
extern char machine[];
/*
* Fill in dispatch information.
*/
strcpy(chdr_p->name, machine);
chdr_p->page_size = NBPG;
chdr_p->kernbase = KERNBASE;
sh->pg_frame = MMU_SHORT_PTE_BASEADDR;
sh->pg_valid = MMU_DT_PAGE;
sh->contig_end = virtual_contig_end;
sh->kernCbase = (u_long) kernCbase;
for (i = 0; i < SUN3X_NPHYS_RAM_SEGS; i++) {