diff options
Diffstat (limited to 'usr/src/compat/freebsd/amd64/machine/pmap.h')
| -rw-r--r-- | usr/src/compat/freebsd/amd64/machine/pmap.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/usr/src/compat/freebsd/amd64/machine/pmap.h b/usr/src/compat/freebsd/amd64/machine/pmap.h new file mode 100644 index 0000000000..d0303bdd56 --- /dev/null +++ b/usr/src/compat/freebsd/amd64/machine/pmap.h @@ -0,0 +1,44 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2014 Pluribus Networks Inc. + */ + +#ifndef _COMPAT_FREEBSD_AMD64_MACHINE_PMAP_H_ +#define _COMPAT_FREEBSD_AMD64_MACHINE_PMAP_H_ + + /* ---- 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_A 0x020 /* A Accessed */ +#define PG_M 0x040 /* D Dirty */ +#define PG_PS 0x080 /* PS Page size (0=4k,1=2M) */ + +/* + * Page Protection Exception bits + */ +#define PGEX_P 0x01 /* Protection violation vs. not present */ +#define PGEX_W 0x02 /* during a Write cycle */ +#define PGEX_U 0x04 /* access from User mode (UPL) */ +#define PGEX_RSV 0x08 /* reserved PTE field is non-zero */ +#define PGEX_I 0x10 /* during an instruction fetch */ + +typedef u_int64_t pd_entry_t; +typedef u_int64_t pt_entry_t; +typedef u_int64_t pdp_entry_t; +typedef u_int64_t pml4_entry_t; + +#define vtophys(va) pmap_kextract(((vm_offset_t) (va))) +vm_paddr_t pmap_kextract(vm_offset_t va); + +#endif /* _COMPAT_FREEBSD_AMD64_MACHINE_PMAP_H_ */ |
