Adjust for new kcore.h

This commit is contained in:
thorpej 1997-04-09 21:00:35 +00:00
parent 00c04fe742
commit a2be180b39
4 changed files with 50 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.13 1997/04/04 20:49:06 gwr Exp $ */
/* $NetBSD: machdep.c,v 1.14 1997/04/09 21:00:35 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -632,7 +632,8 @@ dumpsys()
struct bdevsw *dsw;
kcore_seg_t *kseg_p;
cpu_kcore_hdr_t *chdr_p;
cpu_ram_seg_t *crs_p;
struct sun3x_kcore_hdr *sh;
phys_ram_seg_t *crs_p;
char *vaddr;
vm_offset_t paddr;
int psize, todo, seg, segsz;
@ -669,6 +670,7 @@ dumpsys()
*/
kseg_p = (kcore_seg_t *)KERNBASE;
chdr_p = (cpu_kcore_hdr_t *) (kseg_p + 1);
sh = &chdr_p->un._sun3x;
CORE_SETMAGIC(*kseg_p, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
kseg_p->c_size = sizeof(*chdr_p);
pmap_set_kcore_hdr(chdr_p);
@ -682,8 +684,8 @@ dumpsys()
todo = dumpsize; /* pages */
vaddr = (char*)vmmap; /* Borrow /dev/mem VA */
for (seg = 0; seg < NPHYS_RAM_SEGS; seg++) {
crs_p = &chdr_p->ram_segs[seg];
for (seg = 0; seg < SUN3X_NPHYS_RAM_SEGS; seg++) {
crs_p = &sh->ram_segs[seg];
paddr = crs_p->start;
segsz = crs_p->size;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.19 1997/04/01 02:15:33 jeremy Exp $ */
/* $NetBSD: pmap.c,v 1.20 1997/04/09 21:00:40 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -117,6 +117,7 @@
#include <sys/malloc.h>
#include <sys/user.h>
#include <sys/queue.h>
#include <sys/kcore.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -301,7 +302,7 @@ vm_offset_t tmp_vpages[2];
* RAM, this list will have only one entry, which will describe the entire
* range of available memory.
*/
struct pmap_physmem_struct avail_mem[NPHYS_RAM_SEGS];
struct pmap_physmem_struct avail_mem[SUN3X_NPHYS_RAM_SEGS];
u_int total_phys_mem;
/*************************************************************************/
@ -931,7 +932,7 @@ pmap_alloc_pv()
* pv_heads in spite of the non-contiguity.
*/
total_mem = 0;
for (i = 0; i < NPHYS_RAM_SEGS; i++) {
for (i = 0; i < SUN3X_NPHYS_RAM_SEGS; i++) {
avail_mem[i].pmem_pvbase = _btop(total_mem);
total_mem += avail_mem[i].pmem_end -
avail_mem[i].pmem_start;
@ -3598,18 +3599,27 @@ void
pmap_set_kcore_hdr(chdr_p)
cpu_kcore_hdr_t *chdr_p;
{
struct sun3x_kcore_hdr *sh = &chdr_p->un._sun3x;
u_long spa, len;
int i;
extern char machine[];
chdr_p->ckh_contig_end = virtual_contig_end;
chdr_p->ckh_kernCbase = (u_long) kernCbase;
for (i = 0; i < NPHYS_RAM_SEGS; i++) {
/*
* Fill in dispatch information.
*/
strcpy(chdr_p->name, machine);
chdr_p->page_size = NBPG;
chdr_p->kernbase = KERNBASE;
sh->contig_end = virtual_contig_end;
sh->kernCbase = (u_long) kernCbase;
for (i = 0; i < SUN3X_NPHYS_RAM_SEGS; i++) {
spa = avail_mem[i].pmem_start;
spa = _trunc_page(spa);
len = avail_mem[i].pmem_end - spa;
len = _round_page(len);
chdr_p->ram_segs[i].start = spa;
chdr_p->ram_segs[i].size = len;
sh->ram_segs[i].start = spa;
sh->ram_segs[i].size = len;
}
}
@ -3649,7 +3659,7 @@ pmap_free_pages()
return 0;
i++;
}
while (i < NPHYS_RAM_SEGS) {
while (i < SUN3X_NPHYS_RAM_SEGS) {
if (avail < avail_mem[i].pmem_start) {
/* Avail is inside a hole, march it
* up to the next bank.

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.13 1997/04/04 20:49:06 gwr Exp $ */
/* $NetBSD: machdep.c,v 1.14 1997/04/09 21:00:35 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -632,7 +632,8 @@ dumpsys()
struct bdevsw *dsw;
kcore_seg_t *kseg_p;
cpu_kcore_hdr_t *chdr_p;
cpu_ram_seg_t *crs_p;
struct sun3x_kcore_hdr *sh;
phys_ram_seg_t *crs_p;
char *vaddr;
vm_offset_t paddr;
int psize, todo, seg, segsz;
@ -669,6 +670,7 @@ dumpsys()
*/
kseg_p = (kcore_seg_t *)KERNBASE;
chdr_p = (cpu_kcore_hdr_t *) (kseg_p + 1);
sh = &chdr_p->un._sun3x;
CORE_SETMAGIC(*kseg_p, KCORE_MAGIC, MID_MACHINE, CORE_CPU);
kseg_p->c_size = sizeof(*chdr_p);
pmap_set_kcore_hdr(chdr_p);
@ -682,8 +684,8 @@ dumpsys()
todo = dumpsize; /* pages */
vaddr = (char*)vmmap; /* Borrow /dev/mem VA */
for (seg = 0; seg < NPHYS_RAM_SEGS; seg++) {
crs_p = &chdr_p->ram_segs[seg];
for (seg = 0; seg < SUN3X_NPHYS_RAM_SEGS; seg++) {
crs_p = &sh->ram_segs[seg];
paddr = crs_p->start;
segsz = crs_p->size;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.19 1997/04/01 02:15:33 jeremy Exp $ */
/* $NetBSD: pmap.c,v 1.20 1997/04/09 21:00:40 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -117,6 +117,7 @@
#include <sys/malloc.h>
#include <sys/user.h>
#include <sys/queue.h>
#include <sys/kcore.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -301,7 +302,7 @@ vm_offset_t tmp_vpages[2];
* RAM, this list will have only one entry, which will describe the entire
* range of available memory.
*/
struct pmap_physmem_struct avail_mem[NPHYS_RAM_SEGS];
struct pmap_physmem_struct avail_mem[SUN3X_NPHYS_RAM_SEGS];
u_int total_phys_mem;
/*************************************************************************/
@ -931,7 +932,7 @@ pmap_alloc_pv()
* pv_heads in spite of the non-contiguity.
*/
total_mem = 0;
for (i = 0; i < NPHYS_RAM_SEGS; i++) {
for (i = 0; i < SUN3X_NPHYS_RAM_SEGS; i++) {
avail_mem[i].pmem_pvbase = _btop(total_mem);
total_mem += avail_mem[i].pmem_end -
avail_mem[i].pmem_start;
@ -3598,18 +3599,27 @@ void
pmap_set_kcore_hdr(chdr_p)
cpu_kcore_hdr_t *chdr_p;
{
struct sun3x_kcore_hdr *sh = &chdr_p->un._sun3x;
u_long spa, len;
int i;
extern char machine[];
chdr_p->ckh_contig_end = virtual_contig_end;
chdr_p->ckh_kernCbase = (u_long) kernCbase;
for (i = 0; i < NPHYS_RAM_SEGS; i++) {
/*
* Fill in dispatch information.
*/
strcpy(chdr_p->name, machine);
chdr_p->page_size = NBPG;
chdr_p->kernbase = KERNBASE;
sh->contig_end = virtual_contig_end;
sh->kernCbase = (u_long) kernCbase;
for (i = 0; i < SUN3X_NPHYS_RAM_SEGS; i++) {
spa = avail_mem[i].pmem_start;
spa = _trunc_page(spa);
len = avail_mem[i].pmem_end - spa;
len = _round_page(len);
chdr_p->ram_segs[i].start = spa;
chdr_p->ram_segs[i].size = len;
sh->ram_segs[i].start = spa;
sh->ram_segs[i].size = len;
}
}
@ -3649,7 +3659,7 @@ pmap_free_pages()
return 0;
i++;
}
while (i < NPHYS_RAM_SEGS) {
while (i < SUN3X_NPHYS_RAM_SEGS) {
if (avail < avail_mem[i].pmem_start) {
/* Avail is inside a hole, march it
* up to the next bank.