diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-02 19:53:33 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-06-02 19:53:33 +0000 |
commit | 97d21422318f091283d37d2468f9655013b14b95 (patch) | |
tree | 37de805b7852867f7aaeb9ee7052c4ac270cf339 /sys | |
parent | bcd3f8f0d9fbf81babcd87d65fd75f73642581a2 (diff) |
All I wanted was to fix the bogus PG_SZ macro, but this is better:
Do not try to map the message buffer with large pages, it's just as easy to
simply use as many 8KB pages as necessary. From NetBSD.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/include/pte.h | 10 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/pmap.c | 38 |
2 files changed, 7 insertions, 41 deletions
diff --git a/sys/arch/sparc64/include/pte.h b/sys/arch/sparc64/include/pte.h index a749bc3d6c2..520260ca9bf 100644 --- a/sys/arch/sparc64/include/pte.h +++ b/sys/arch/sparc64/include/pte.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pte.h,v 1.6 2006/06/02 18:53:57 miod Exp $ */ +/* $OpenBSD: pte.h,v 1.7 2006/06/02 19:53:30 miod Exp $ */ /* $NetBSD: pte.h,v 1.7 2001/07/31 06:55:46 eeh Exp $ */ /* @@ -143,14 +143,6 @@ extern void tlb_flush_ctx(int ctx); #define PGSZ_4M 3 #define PGSZ_SHIFT 61 - -/* - * Why couldn't Sun pick better page sizes? - * - * Page sizes are 2**(12+(3*sz)), except for 8K which - * is 2**12+1 instead of 2**12. - */ -#define PG_SZ(s) (1<<(12+(s?(3*s):1))) #define TLB_SZ(s) (((uint64_t)(s))<<PGSZ_SHIFT) /* TLB data masks */ diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index 66e42129441..bbb59f704ec 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.28 2006/06/02 00:26:08 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.29 2006/06/02 19:53:32 miod Exp $ */ /* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */ #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ /* @@ -468,26 +468,6 @@ struct page_size_map page_size_map[] = { }; /* - * Calculate the largest page size that will map this. - * - * You really need to do this both on VA and PA. - */ -#define PMAP_PAGE_SIZE(va, pa, len, pgsz, pglen) \ -do { \ - for ((pgsz) = PGSZ_4M; (pgsz); (pgsz)--) { \ - (pglen) = PG_SZ(pgsz); \ - \ - if (((len) >= (pgsz)) && \ - ((pa) & ((pglen)-1) & ~PG_SZ(PGSZ_8K)) == 0 && \ - ((va) & ((pglen)-1) & ~PG_SZ(PGSZ_8K)) == 0) \ - break; \ - } \ - (pgsz) = 0; \ - (pglen) = PG_SZ(pgsz); \ -} while (0) - - -/* * Enter a TTE into the kernel pmap only. Don't do anything else. * * Use only during bootstrapping since it does no locking and @@ -1329,12 +1309,8 @@ remap_data: va = (vaddr_t)msgbufp; prom_map_phys(phys_msgbuf, msgbufsiz, (vaddr_t)msgbufp, -1); while (msgbufsiz) { - int pgsz; - psize_t psize; - - PMAP_PAGE_SIZE(va, phys_msgbuf, msgbufsiz, pgsz, psize); data = TSB_DATA(0 /* global */, - pgsz, + PGSZ_8K, phys_msgbuf, 1 /* priv */, 1 /* Write */, @@ -1342,12 +1318,10 @@ remap_data: FORCE_ALIAS /* ALIAS -- Disable D$ */, 1 /* valid */, 0 /* IE */); - do { - pmap_enter_kpage(va, data); - va += NBPG; - msgbufsiz -= NBPG; - phys_msgbuf += NBPG; - } while (psize-=NBPG); + pmap_enter_kpage(va, data); + va += PAGE_SIZE; + msgbufsiz -= PAGE_SIZE; + phys_msgbuf += PAGE_SIZE; } BDPRINTF(PDB_BOOT1, ("Done inserting mesgbuf into pmap_kernel()\r\n")); |