diff options
author | phk <phk@FreeBSD.org> | 1996-05-02 22:25:18 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-05-02 22:25:18 +0000 |
commit | 7dad665664d82142d979dc0c80aa4d54a7bc2b56 (patch) | |
tree | 699aa9f5061281c3bb4f96ad209c3682bbf615aa /sys/amd64/include/pmap.h | |
parent | a65c6cdecd5f9ae488d0af2af11ab84f0d6c2d37 (diff) | |
download | FreeBSD-src-7dad665664d82142d979dc0c80aa4d54a7bc2b56.zip FreeBSD-src-7dad665664d82142d979dc0c80aa4d54a7bc2b56.tar.gz |
Move atdevbase out of locore.s and into machdep.c
Macroize locore.s' page table setup even more, now it's almost readable.
Rename PG_U to PG_A (so that I can...)
Rename PG_u to PG_U. "PG_u" was just too ugly...
Remove some unused vars in pmap.c
Remove PG_KR and PG_KW
Remove SSIZE
Remove SINCR
Remove BTOPKERNBASE
This concludes my spring cleaning, modulus any bug fixes for messes I
have made on the way.
(Funny to be back here in pmap.c, that's where my first significant
contribution to 386BSD was... :-)
Diffstat (limited to 'sys/amd64/include/pmap.h')
-rw-r--r-- | sys/amd64/include/pmap.h | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 73798ad..a843fbf 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -42,28 +42,36 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.36 1996/04/30 12:02:11 phk Exp $ + * $Id: pmap.h,v 1.37 1996/05/02 14:20:04 phk Exp $ */ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ -#define PG_V 0x00000001 -#define PG_RW 0x00000002 -#define PG_u 0x00000004 -#define PG_PROT 0x00000006 /* all protection bits . */ -#define PG_NC_PWT 0x00000008 /* page cache write through */ -#define PG_NC_PCD 0x00000010 /* page cache disable */ -#define PG_N 0x00000018 /* Non-cacheable */ -#define PG_U 0x00000020 /* page was accessed */ -#define PG_M 0x00000040 /* page was modified */ -#define PG_PS 0x00000080 /* page is big size */ -#define PG_G 0x00000100 /* page is global */ -#define PG_W 0x00000200 /* "Wired" pseudoflag */ -#define PG_FRAME 0xfffff000 - -#define PG_KR 0x00000000 -#define PG_KW 0x00000002 +/* + * Page-directory and page-table entires follow this format, with a few + * of the fields not present here and there, depending on a lot of things. + */ + /* ---- Intel Nomenclature ---- */ +#define PG_V 0x001 /* P Valid */ +#define PG_RW 0x002 /* R/W Read/Write */ +#define PG_U 0x004 /* U/S User/Supervisor */ +#define PG_NC_PWT 0x008 /* PWT Write through */ +#define PG_NC_PCD 0x010 /* PCD Cache disable */ +#define PG_A 0x020 /* A Accessed */ +#define PG_M 0x040 /* D Dirty */ +#define PG_PS 0x080 /* PS Page size (0=4k,1=4M) */ +#define PG_G 0x100 /* G Global */ +#define PG_AVAIL1 0x200 /* / Available for system */ +#define PG_AVAIL2 0x400 /* < programmers use */ +#define PG_AVAIL3 0x800 /* \ */ + + +/* Our various interpretations of the above */ +#define PG_W PG_AVAIL1 /* "Wired" pseudoflag */ +#define PG_FRAME (~PAGE_MASK) +#define PG_PROT (PG_RW|PG_U) /* all protection bits . */ +#define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */ /* * Page Protection Exception bits @@ -78,14 +86,6 @@ */ #define VADDR(pdi, pti) ((vm_offset_t)(((pdi)<<PDRSHIFT)|((pti)<<PAGE_SHIFT))) -/* - * NKPDE controls the virtual space of the kernel, what ever is left, minus - * the alternate page table area is given to the user (NUPDE) - */ -/* - * NKPDE controls the virtual space of the kernel, what ever is left is - * given to the user (NUPDE) - */ #ifndef NKPT #if 0 #define NKPT 26 /* actual number of kernel page tables */ @@ -109,6 +109,12 @@ #define KSTKPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ #define KSTKPTEOFF (NPTEPG-UPAGES) /* pte entry for kernel stack */ +/* + * XXX doesn't really belong here I guess... + */ +#define ISA_HOLE_START 0xa0000 +#define ISA_HOLE_LENGTH (0x100000-ISA_HOLE_START) + #ifndef LOCORE typedef unsigned int *pd_entry_t; typedef unsigned int *pt_entry_t; @@ -151,7 +157,7 @@ static __inline vm_offset_t pmap_kextract(vm_offset_t va) { vm_offset_t pa = *(int *)vtopte(va); - pa = (pa & PG_FRAME) | (va & ~PG_FRAME); + pa = (pa & PG_FRAME) | (va & PAGE_MASK); return pa; } #endif |