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 247360 2013-02-26 23:35:27Z attilio $");
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 int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
221
222#define PV_ENTRY_ZONE_MIN 2048 /* min pv entries in uma zone */
223
224#ifndef PMAP_SHPGPERPROC
225#define PMAP_SHPGPERPROC 200
226#endif
227
--- 1109 unchanged lines hidden (view full) ---
1337 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
1338
1339 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
1340 pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
1341
1342 TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
1343 pv_entry_high_water = 9 * (pv_entry_max / 10);
1344
1345 uma_zone_reserve_kva(pvzone, pv_entry_max);
1346
1347 /* Pre-fill pvzone with initial number of pv entries. */
1348 uma_prealloc(pvzone, PV_ENTRY_ZONE_MIN);
1349
1350 /* Initialize ptbl allocation. */
1351 ptbl_init();
1352}
1353
--- 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 247360 2013-02-26 23:35:27Z attilio $");
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 int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
221
222#define PV_ENTRY_ZONE_MIN 2048 /* min pv entries in uma zone */
223
224#ifndef PMAP_SHPGPERPROC
225#define PMAP_SHPGPERPROC 200
226#endif
227
--- 1109 unchanged lines hidden (view full) ---
1337 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
1338
1339 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
1340 pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
1341
1342 TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
1343 pv_entry_high_water = 9 * (pv_entry_max / 10);
1344
1345 uma_zone_reserve_kva(pvzone, pv_entry_max);
1346
1347 /* Pre-fill pvzone with initial number of pv entries. */
1348 uma_prealloc(pvzone, PV_ENTRY_ZONE_MIN);
1349
1350 /* Initialize ptbl allocation. */
1351 ptbl_init();
1352}
1353
--- 1823 unchanged lines hidden ---