Use PAGE_SIZE rather than NBPG.

This commit is contained in:
thorpej 2003-04-08 23:39:14 +00:00
parent 04269f6445
commit cf9d21bf8e
8 changed files with 37 additions and 35 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: biostramp.S,v 1.10 2001/12/14 20:30:10 christos Exp $ */
/* $NetBSD: biostramp.S,v 1.11 2003/04/08 23:48:48 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -73,8 +73,8 @@
#define addr32 .byte 0x67
#define data32 .byte 0x66
.set MYBASE,NBPG
.set MYSCRATCH,NBPG+NBPG
.set MYBASE,PAGE_SIZE
.set MYSCRATCH,PAGE_SIZE+PAGE_SIZE
.set CR3_ADDR,(MYSCRATCH-4)
.set IDTR_SAVE_ADDR,CR3_ADDR-6
.set GDTR_SAVE_ADDR,IDTR_SAVE_ADDR-6

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.6 2003/02/09 15:49:34 drochner Exp $ */
/* $NetBSD: locore.S,v 1.7 2003/04/08 23:48:48 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -163,7 +163,7 @@
* XXX 4 == sizeof pde
*/
.set _C_LABEL(PTmap),(PDSLOT_PTE << PDSHIFT)
.set _C_LABEL(PTD),(_C_LABEL(PTmap) + PDSLOT_PTE * NBPG)
.set _C_LABEL(PTD),(_C_LABEL(PTmap) + PDSLOT_PTE * PAGE_SIZE)
.set _C_LABEL(PTDpde),(_C_LABEL(PTD) + PDSLOT_PTE * 4)
/*
@ -173,7 +173,7 @@
* XXX 4 == sizeof pde
*/
.set _C_LABEL(APTmap),(PDSLOT_APTE << PDSHIFT)
.set _C_LABEL(APTD),(_C_LABEL(APTmap) + PDSLOT_APTE * NBPG)
.set _C_LABEL(APTD),(_C_LABEL(APTmap) + PDSLOT_APTE * PAGE_SIZE)
.set _C_LABEL(APTDpde),(_C_LABEL(PTD) + PDSLOT_APTE * 4)
@ -199,7 +199,7 @@
#if NLAPIC > 0
#ifdef __ELF__
.align NBPG
.align PAGE_SIZE
#else
.align 12
#endif
@ -214,7 +214,7 @@ _C_LABEL(lapic_tpr):
_C_LABEL(lapic_ppr):
.space LAPIC_ISR-LAPIC_PPRI
_C_LABEL(lapic_isr):
.space NBPG-LAPIC_ISR
.space PAGE_SIZE-LAPIC_ISR
#else
_C_LABEL(lapic_tpr):
.long 0
@ -506,10 +506,10 @@ try586: /* Use the `cpuid' instruction. */
* text | data | bss | [syms] | page dir | proc0 kstack
* 0 1 2 3
*/
#define PROC0PDIR ((0) * NBPG)
#define PROC0STACK ((1) * NBPG)
#define SYSMAP ((1+UPAGES) * NBPG)
#define TABLESIZE ((1+UPAGES) * NBPG) /* + nkpde * NBPG */
#define PROC0PDIR ((0) * PAGE_SIZE)
#define PROC0STACK ((1) * PAGE_SIZE)
#define SYSMAP ((1+UPAGES) * PAGE_SIZE)
#define TABLESIZE ((1+UPAGES) * PAGE_SIZE) /* + nkpde * PAGE_SIZE */
/* Find end of kernel image. */
movl $RELOC(end),%edi
@ -561,7 +561,7 @@ try586: /* Use the `cpuid' instruction. */
*/
#define fillkpt \
1: movl %eax,(%ebx) ; \
addl $NBPG,%eax ; /* increment physical address */ \
addl $PAGE_SIZE,%eax ; /* increment physical address */ \
addl $4,%ebx ; /* next pte */ \
loop 1b ;
@ -1095,8 +1095,8 @@ ENTRY(copyoutstr)
/* Compute number of bytes in first page. */
movl %edi,%eax
andl $PGOFSET,%eax
movl $NBPG,%ecx
subl %eax,%ecx # ecx = NBPG - (src % NBPG)
movl $PAGE_SIZE,%ecx
subl %eax,%ecx # ecx = PAGE_SIZE - (src % PAGE_SIZE)
GET_CURPCB(%eax)
movl $6f,PCB_ONFAULT(%eax)
@ -1143,7 +1143,7 @@ ENTRY(copyoutstr)
jmp copystr_return
4: /* Go to next page, if any. */
movl $NBPG,%ecx
movl $PAGE_SIZE,%ecx
testl %edx,%edx
jnz 1b

View File

@ -1,4 +1,4 @@
/* $NetBSD: mptramp.S,v 1.2 2003/03/01 16:36:37 fvdl Exp $ */
/* $NetBSD: mptramp.S,v 1.3 2003/04/08 23:48:49 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -152,7 +152,7 @@ _TRMP_LABEL(mp_startup)
movw %ax, %fs
movw %ax, %gs
movl $ (MP_TRAMPOLINE+NBPG-16),%esp # bootstrap stack end,
movl $ (MP_TRAMPOLINE+PAGE_SIZE-16),%esp # bootstrap stack end,
# with scratch space..
#ifdef MPDEBUG

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.33 2003/01/17 23:36:12 thorpej Exp $
# $NetBSD: genassym.cf,v 1.34 2003/04/08 23:39:14 thorpej Exp $
#
# Copyright (c) 1997
# Jonathan Stone. All rights reserved.
@ -54,6 +54,8 @@ include <mips/vmparam.h>
include <mips/pte.h>
include <mips/locore.h>
define PAGE_SIZE PAGE_SIZE
# Important offsets into the lwp and proc structs & associated constants
define L_FORW offsetof(struct lwp, l_forw)
define L_BACK offsetof(struct lwp, l_back)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.151 2003/02/08 00:50:33 cgd Exp $ */
/* $NetBSD: locore.S,v 1.152 2003/04/08 23:39:15 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -987,7 +987,7 @@ END(MachFPInterrupt)
LEAF(mips_pagecopy)
#if defined(__mips_n32) || defined(_LP64)
li a2, NBPG >> 6
li a2, PAGE_SIZE >> 6
1: ld t0, 0(a1)
ld ta0, 32(a1)
@ -1012,7 +1012,7 @@ LEAF(mips_pagecopy)
addu a0, 64
#else
/* o32 */
li a2, NBPG >> 5
li a2, PAGE_SIZE >> 5
1: lw t0, 0(a1)
lw ta0, 16(a1)
@ -1042,7 +1042,7 @@ END(mips_pagecopy)
LEAF(mips_pagezero)
#if defined(__mips_n32) || defined(_LP64)
li a1, NBPG >> 6
li a1, PAGE_SIZE >> 6
1: sd zero, 0(a0) # try to miss cache first
sd zero, 32(a0)
@ -1057,7 +1057,7 @@ LEAF(mips_pagezero)
addu a0, 64
#else
/* o32 */
li a1, NBPG >> 5
li a1, PAGE_SIZE >> 5
1: sw zero, 0(a0)
sw zero, 16(a0) # try to miss cache first

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_mips1.S,v 1.56 2003/01/17 23:36:14 thorpej Exp $ */
/* $NetBSD: locore_mips1.S,v 1.57 2003/04/08 23:39:15 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@ -1095,8 +1095,8 @@ entry0set:
nop
tlbwi # set TLB entry #0
addu s0, s0, NBPG
mtc0 s0, MIPS_COP_0_TLB_HI # VPN = va+NBPG
addu s0, s0, PAGE_SIZE
mtc0 s0, MIPS_COP_0_TLB_HI # VPN = va+PAGE_SIZE
nop
tlbp # probe 2nd VPN
mfc0 s1, MIPS_COP_0_TLB_INDEX
@ -1106,7 +1106,7 @@ entry0set:
mtc0 s1, MIPS_COP_0_TLB_HI
mtc0 zero, MIPS_COP_0_TLB_LOW
nop
tlbwi # TBIS(va+NBPG)
tlbwi # TBIS(va+PAGE_SIZE)
nop
mtc0 s0, MIPS_COP_0_TLB_HI # set 2nd VPN again
entry1set:

View File

@ -1,4 +1,4 @@
/* $NetBSD: mipsX_subr.S,v 1.11 2003/01/17 23:36:15 thorpej Exp $ */
/* $NetBSD: mipsX_subr.S,v 1.12 2003/04/08 23:39:15 thorpej Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -2203,7 +2203,7 @@ END(MIPSX(TBIA))
#ifdef USE_64BIT_INSTRUCTIONS
LEAF(MIPSX(pagezero))
li a1, NBPG >> 6
li a1, PAGE_SIZE >> 6
1: sd zero, 0(a0) # try to miss cache first
sd zero, 32(a0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gfevar.h,v 1.3 2003/03/17 16:41:16 matt Exp $ */
/* $NetBSD: if_gfevar.h,v 1.4 2003/04/08 23:46:04 thorpej Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@ -37,11 +37,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#define GE_RXDESC_MEMSIZE (1 * NBPG)
#define GE_RXDESC_MEMSIZE (1 * PAGE_SIZE)
#define GE_RXDESC_MAX 64
#define GE_RXBUF_SIZE 2048
#define GE_RXBUF_MEMSIZE (GE_RXDESC_MAX*GE_RXBUF_SIZE)
#define GE_RXBUF_NSEGS ((GE_RXBUF_MEMSIZE/NBPG)+1)
#define GE_RXBUF_NSEGS ((GE_RXBUF_MEMSIZE/PAGE_SIZE)+1)
#define GE_DMSEG_MAX (GE_RXBUF_NSEGS)
struct gfe_dmamem {
@ -55,9 +55,9 @@ struct gfe_dmamem {
/* With a 4096 page size, we get 256 descriptors per page.
*/
#define GE_TXMEM_SIZE (1 * NBPG)
#define GE_TXMEM_SIZE (1 * PAGE_SIZE)
#define GE_TXDESC_MAX (GE_TXMEM_SIZE / 16)
#define GE_TXBUF_SIZE (4 * NBPG)
#define GE_TXBUF_SIZE (4 * PAGE_SIZE)
struct gfe_txqueue {
struct ifqueue txq_pendq; /* these are ready to go to the GT */