Rewrite of the last bugfix wrt. Z2 bounce buffer memory allocation:
Don't manipulate the memlist passed from the kickstart rom + bootloader, as we want it unchanged in case we boot via /dev/reload. Instead, make z2mem_start known to pmap.c; and use int in pmap_bootstrap to detect the right segment to correct and the amount. XXX The transformation of z2mem from physical to virtual kernel addresses in amiga_init.c must not be done before the pmap_bootstrap() call now!
This commit is contained in:
parent
7a26a7952d
commit
8311e65b64
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: amiga_init.c,v 1.46 1996/07/29 20:53:35 is Exp $ */
|
||||
/* $NetBSD: amiga_init.c,v 1.47 1996/08/02 15:07:23 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Michael L. Hitch
|
||||
|
@ -100,7 +100,7 @@ u_int namigahwpg;
|
|||
vm_offset_t amigashdwaddr;
|
||||
u_int namigashdwpg;
|
||||
|
||||
static vm_offset_t z2mem_start; /* XXX */
|
||||
vm_offset_t z2mem_start; /* XXX */
|
||||
static vm_offset_t z2mem_end; /* XXX */
|
||||
int use_z2_mem = 1; /* XXX */
|
||||
|
||||
|
@ -285,9 +285,6 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync)
|
|||
RELOC(z2mem_start, vm_offset_t) =
|
||||
RELOC(z2mem_end, vm_offset_t) - sp->ms_size;
|
||||
}
|
||||
/* XXX is: mark reserved area _here_. */
|
||||
sp->ms_size = RELOC(z2mem_start, vm_offset_t) -
|
||||
sp->ms_start;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -906,6 +903,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync)
|
|||
chipmem_start = CHIPMEMADDR + chipmem_start;
|
||||
chipmem_end = CHIPMEMADDR + chipmem_end;
|
||||
|
||||
/* XXX is: this MUST NOT BE DONE before the pmap_bootstrap() call */
|
||||
if (z2mem_end) {
|
||||
z2mem_end = ZTWOMEMADDR + NZTWOMEMPG * NBPG;
|
||||
z2mem_start = ZTWOMEMADDR;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.c,v 1.35 1996/07/29 20:53:41 is Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.36 1996/08/02 15:07:26 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991 Regents of the University of California.
|
||||
|
@ -254,6 +254,8 @@ static vm_size_t avail_remaining;
|
|||
u_long noncontig_enable;
|
||||
#endif
|
||||
|
||||
extern vm_offset_t z2mem_start;
|
||||
|
||||
boolean_t pmap_testbit __P((register vm_offset_t, int));
|
||||
void pmap_enter_ptpage __P((register pmap_t, register vm_offset_t));
|
||||
|
||||
|
@ -344,17 +346,22 @@ pmap_bootstrap(firstaddr, loadaddr)
|
|||
if (phys_segs[i].end == 0x08000000)
|
||||
continue; /* skip A4000 motherboard mem */
|
||||
#endif
|
||||
#if 0
|
||||
/*
|
||||
* Deal with Zorro II memory stolen for DMA bounce buffers.
|
||||
* This needs to be handled better.
|
||||
*
|
||||
* XXX is: disabled. This is handled now in amiga_init.c
|
||||
* by removing the stolen memory from the memlist.
|
||||
*
|
||||
* XXX is: enabled again, but check real size and position.
|
||||
* We check z2mem_start is in this segment, and set its end
|
||||
* to the z2mem_start.
|
||||
*
|
||||
*/
|
||||
if (phys_segs[i].start == 0x00200000)
|
||||
phys_segs[i].end -= MAXPHYS;
|
||||
#endif
|
||||
if ((phys_segs[i].start <= z2mem_start) &&
|
||||
(phys_segs[i].end > z2mem_start))
|
||||
phys_segs[i].end = z2mem_start;
|
||||
|
||||
phys_segs[i].first_page = phys_segs[i - 1].first_page +
|
||||
(phys_segs[i - 1].end - phys_segs[i - 1].start) / NBPG;
|
||||
avail_remaining += (phys_segs[i].end - phys_segs[i].start) / NBPG;
|
||||
|
|
Loading…
Reference in New Issue