1/*-
2 * Copyright (C) 2007-2009 Semihalf, Rafal Jaworowski <raj@semihalf.com>
3 * Copyright (C) 2006 Semihalf, Marian Balakowicz <m8@semihalf.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 35 unchanged lines hidden (view full) ---
44 * 0xc100_0000 - 0xc100_3fff : reserved for page zero/copy
45 * 0xc100_4000 - 0xc200_3fff : reserved for ptbl bufs
46 * 0xc200_4000 - 0xc200_8fff : guard page + kstack0
47 * 0xc200_9000 - 0xfeef_ffff : actual free KVA space
48 * 0xfef0_0000 - 0xffff_ffff : I/O devices region
49 */
50
51#include <sys/cdefs.h>
52__FBSDID("$FreeBSD: head/sys/powerpc/booke/pmap.c 242535 2012-11-03 23:22:49Z alc $");
53
54#include <sys/param.h>
55#include <sys/malloc.h>
56#include <sys/ktr.h>
57#include <sys/proc.h>
58#include <sys/user.h>
59#include <sys/queue.h>
60#include <sys/systm.h>
--- 151 unchanged lines hidden (view full) ---
212/**************************************************************************/
213/* Page table management */
214/**************************************************************************/
215
216static struct rwlock_padalign pvh_global_lock;
217
218/* Data for the pv entry allocation mechanism */
219static uma_zone_t pvzone;
220static struct vm_object pvzone_obj;
221static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
222
223#define PV_ENTRY_ZONE_MIN 2048 /* min pv entries in uma zone */
224
225#ifndef PMAP_SHPGPERPROC
226#define PMAP_SHPGPERPROC 200
227#endif
228
--- 1109 unchanged lines hidden (view full) ---
1338 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
1339
1340 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
1341 pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
1342
1343 TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
1344 pv_entry_high_water = 9 * (pv_entry_max / 10);
1345
1346 uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
1347
1348 /* Pre-fill pvzone with initial number of pv entries. */
1349 uma_prealloc(pvzone, PV_ENTRY_ZONE_MIN);
1350
1351 /* Initialize ptbl allocation. */
1352 ptbl_init();
1353}
1354
--- 1823 unchanged lines hidden ---
2 * Copyright (C) 2007-2009 Semihalf, Rafal Jaworowski <raj@semihalf.com>
3 * Copyright (C) 2006 Semihalf, Marian Balakowicz <m8@semihalf.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 35 unchanged lines hidden (view full) ---
44 * 0xc100_0000 - 0xc100_3fff : reserved for page zero/copy
45 * 0xc100_4000 - 0xc200_3fff : reserved for ptbl bufs
46 * 0xc200_4000 - 0xc200_8fff : guard page + kstack0
47 * 0xc200_9000 - 0xfeef_ffff : actual free KVA space
48 * 0xfef0_0000 - 0xffff_ffff : I/O devices region
49 */
50
51#include <sys/cdefs.h>
52__FBSDID("$FreeBSD: head/sys/powerpc/booke/pmap.c 242535 2012-11-03 23:22:49Z alc $");
53
54#include <sys/param.h>
55#include <sys/malloc.h>
56#include <sys/ktr.h>
57#include <sys/proc.h>
58#include <sys/user.h>
59#include <sys/queue.h>
60#include <sys/systm.h>
--- 151 unchanged lines hidden (view full) ---
212/**************************************************************************/
213/* Page table management */
214/**************************************************************************/
215
216static struct rwlock_padalign pvh_global_lock;
217
218/* Data for the pv entry allocation mechanism */
219static uma_zone_t pvzone;
220static struct vm_object pvzone_obj;
221static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
222
223#define PV_ENTRY_ZONE_MIN 2048 /* min pv entries in uma zone */
224
225#ifndef PMAP_SHPGPERPROC
226#define PMAP_SHPGPERPROC 200
227#endif
228
--- 1109 unchanged lines hidden (view full) ---
1338 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
1339
1340 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
1341 pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
1342
1343 TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
1344 pv_entry_high_water = 9 * (pv_entry_max / 10);
1345
1346 uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
1347
1348 /* Pre-fill pvzone with initial number of pv entries. */
1349 uma_prealloc(pvzone, PV_ENTRY_ZONE_MIN);
1350
1351 /* Initialize ptbl allocation. */
1352 ptbl_init();
1353}
1354
--- 1823 unchanged lines hidden ---