diff options
author | neel <neel@FreeBSD.org> | 2013-01-04 19:28:32 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2013-01-04 19:28:32 +0000 |
commit | 38ad3ee53626ccab6f22009b0723f2fb7903ecc1 (patch) | |
tree | 9981bd6a02de01af545d4aff19c0afbef003cfe5 /sys/amd64 | |
parent | 736fc919674c3c284d5611e7e9b572385c4dbc0e (diff) | |
parent | 661fe3468922dc71771a1f31a3562d73f41c4374 (diff) | |
download | FreeBSD-src-38ad3ee53626ccab6f22009b0723f2fb7903ecc1.zip FreeBSD-src-38ad3ee53626ccab6f22009b0723f2fb7903ecc1.tar.gz |
IFC @ r244983.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/fpu.c | 14 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 43 |
2 files changed, 48 insertions, 9 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 17d2694..18130b5 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -135,6 +135,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ +static uma_zone_t fpu_save_area_zone; static struct savefpu *fpu_initialstate; struct xsave_area_elm_descr { @@ -313,6 +314,10 @@ fpuinitstate(void *arg __unused) } } + fpu_save_area_zone = uma_zcreate("FPU_save_area", + cpu_max_ext_state_size, NULL, NULL, NULL, NULL, + XSAVE_AREA_ALIGN - 1, 0); + start_emulating(); intr_restore(saveintr); } @@ -985,19 +990,10 @@ is_fpu_kern_thread(u_int flags) /* * FPU save area alloc/free/init utility routines */ -static uma_zone_t fpu_save_area_zone; - struct savefpu * fpu_save_area_alloc(void) { - if (fpu_save_area_zone == NULL) { - fpu_save_area_zone = uma_zcreate("FPU_save_area", - cpu_max_ext_state_size, - NULL, NULL, NULL, NULL, - XSAVE_AREA_ALIGN - 1, 0); - } - return (uma_zalloc(fpu_save_area_zone, 0)); } diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 06b45b2..8e06ff9 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -5446,3 +5446,46 @@ pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, else *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } + +#include "opt_ddb.h" +#ifdef DDB +#include <ddb/ddb.h> + +DB_SHOW_COMMAND(pte, pmap_print_pte) +{ + pmap_t pmap; + pml4_entry_t *pml4; + pdp_entry_t *pdp; + pd_entry_t *pde; + pt_entry_t *pte; + vm_offset_t va; + + if (have_addr) { + va = (vm_offset_t)addr; + pmap = PCPU_GET(curpmap); /* XXX */ + } else { + db_printf("show pte addr\n"); + return; + } + pml4 = pmap_pml4e(pmap, va); + db_printf("VA %#016lx pml4e %#016lx", va, *pml4); + if ((*pml4 & PG_V) == 0) { + db_printf("\n"); + return; + } + pdp = pmap_pml4e_to_pdpe(pml4, va); + db_printf(" pdpe %#016lx", *pdp); + if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { + db_printf("\n"); + return; + } + pde = pmap_pdpe_to_pde(pdp, va); + db_printf(" pde %#016lx", *pde); + if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { + db_printf("\n"); + return; + } + pte = pmap_pde_to_pte(pde, va); + db_printf(" pte %#016lx\n", *pte); +} +#endif |