Fix the DDB breakpoint code when using the 4MB page support.

This commit is contained in:
John Dyson 1997-08-07 05:15:52 +00:00
parent 991d8bd99f
commit d3d1eb995b
5 changed files with 56 additions and 21 deletions

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_interface.c,v 1.34 1997/07/18 21:27:52 fsmp Exp $
* $Id: db_interface.c,v 1.35 1997/07/20 08:37:17 bde Exp $
*/
/*
@ -254,14 +254,23 @@ db_write_bytes(addr, size, data)
ptep0 = pmap_pte(kernel_pmap, addr);
oldmap0 = *ptep0;
*ptep0 |= PG_RW;
if ((*ptep0 & PG_PS) == 0) {
addr1 = trunc_page(addr + size - 1);
addr1 = trunc_page(addr + size - 1);
/* Map another page if the data crosses a page boundary. */
if (trunc_page(addr) != addr1) {
ptep1 = pmap_pte(kernel_pmap, addr1);
oldmap1 = *ptep1;
*ptep1 |= PG_RW;
/* Map another page if the data crosses a page boundary. */
if (trunc_page(addr) != addr1) {
ptep1 = pmap_pte(kernel_pmap, addr1);
oldmap1 = *ptep1;
*ptep1 |= PG_RW;
}
} else {
addr1 = trunc_4mpage(addr + size - 1);
if (trunc_4mpage(addr) != addr1) {
ptep1 = pmap_pte(kernel_pmap, addr1);
oldmap1 = *ptep1;
*ptep1 |= PG_RW;
}
}
invltlb();

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.156 1997/08/05 22:24:08 dyson Exp $
* $Id: pmap.c,v 1.157 1997/08/07 03:52:50 dyson Exp $
*/
/*
@ -232,8 +232,15 @@ pmap_pte(pmap, va)
register pmap_t pmap;
vm_offset_t va;
{
if (pmap && *pmap_pde(pmap, va)) {
return get_ptbase(pmap) + i386_btop(va);
unsigned *pdeaddr;
if (pmap) {
pdeaddr = (unsigned *) pmap_pde(pmap, va);
if (*pdeaddr & PG_PS)
return pdeaddr;
if (*pdeaddr) {
return get_ptbase(pmap) + i386_btop(va);
}
}
return (0);
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_interface.c,v 1.34 1997/07/18 21:27:52 fsmp Exp $
* $Id: db_interface.c,v 1.35 1997/07/20 08:37:17 bde Exp $
*/
/*
@ -254,14 +254,23 @@ db_write_bytes(addr, size, data)
ptep0 = pmap_pte(kernel_pmap, addr);
oldmap0 = *ptep0;
*ptep0 |= PG_RW;
if ((*ptep0 & PG_PS) == 0) {
addr1 = trunc_page(addr + size - 1);
addr1 = trunc_page(addr + size - 1);
/* Map another page if the data crosses a page boundary. */
if (trunc_page(addr) != addr1) {
ptep1 = pmap_pte(kernel_pmap, addr1);
oldmap1 = *ptep1;
*ptep1 |= PG_RW;
/* Map another page if the data crosses a page boundary. */
if (trunc_page(addr) != addr1) {
ptep1 = pmap_pte(kernel_pmap, addr1);
oldmap1 = *ptep1;
*ptep1 |= PG_RW;
}
} else {
addr1 = trunc_4mpage(addr + size - 1);
if (trunc_4mpage(addr) != addr1) {
ptep1 = pmap_pte(kernel_pmap, addr1);
oldmap1 = *ptep1;
*ptep1 |= PG_RW;
}
}
invltlb();

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.156 1997/08/05 22:24:08 dyson Exp $
* $Id: pmap.c,v 1.157 1997/08/07 03:52:50 dyson Exp $
*/
/*
@ -232,8 +232,15 @@ pmap_pte(pmap, va)
register pmap_t pmap;
vm_offset_t va;
{
if (pmap && *pmap_pde(pmap, va)) {
return get_ptbase(pmap) + i386_btop(va);
unsigned *pdeaddr;
if (pmap) {
pdeaddr = (unsigned *) pmap_pde(pmap, va);
if (*pdeaddr & PG_PS)
return pdeaddr;
if (*pdeaddr) {
return get_ptbase(pmap) + i386_btop(va);
}
}
return (0);
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)param.h 5.8 (Berkeley) 6/28/91
* $Id: param.h,v 1.30 1997/07/24 23:48:51 fsmp Exp $
* $Id: param.h,v 1.31 1997/08/04 19:14:47 fsmp Exp $
*/
#ifndef _MACHINE_PARAM_H_
@ -64,6 +64,7 @@
#define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t)))
#define PDRSHIFT 22 /* LOG2(NBPDR) */
#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */
#define PDRMASK (NBPDR-1)
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1<<DEV_BSHIFT)
@ -121,6 +122,8 @@
*/
#define trunc_page(x) ((unsigned)(x) & ~PAGE_MASK)
#define round_page(x) ((((unsigned)(x)) + PAGE_MASK) & ~PAGE_MASK)
#define trunc_4mpage(x) ((unsigned)(x) & ~PDRMASK)
#define round_4mpage(x) ((((unsigned)(x)) + PDRMASK) & ~PDRMASK)
#define atop(x) ((unsigned)(x) >> PAGE_SHIFT)
#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT)