pmap.c (203152) | pmap.c (203180) |
---|---|
1/* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1994 John S. Dyson 5 * All rights reserved. 6 * Copyright (c) 1994 David Greenman 7 * All rights reserved. 8 * --- 52 unchanged lines hidden (view full) --- 61 * this module may delay invalidate or reduced protection 62 * operations until such time as they are actually 63 * necessary. This module is given full information as 64 * to which processors are currently using which maps, 65 * and to when physical maps must be made correct. 66 */ 67 68#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1994 John S. Dyson 5 * All rights reserved. 6 * Copyright (c) 1994 David Greenman 7 * All rights reserved. 8 * --- 52 unchanged lines hidden (view full) --- 61 * this module may delay invalidate or reduced protection 62 * operations until such time as they are actually 63 * necessary. This module is given full information as 64 * to which processors are currently using which maps, 65 * and to when physical maps must be made correct. 66 */ 67 68#include <sys/cdefs.h> |
69__FBSDID("$FreeBSD: head/sys/mips/mips/pmap.c 203152 2010-01-29 05:38:41Z rrs $"); | 69__FBSDID("$FreeBSD: head/sys/mips/mips/pmap.c 203180 2010-01-30 01:54:29Z neel $"); |
70 71#include "opt_ddb.h" 72#include "opt_msgbuf.h" 73#include <sys/param.h> 74#include <sys/systm.h> 75#include <sys/proc.h> 76#include <sys/msgbuf.h> 77#include <sys/vmmeter.h> --- 272 unchanged lines hidden (view full) --- 350 * Steal thread0 kstack. 351 */ 352 kstack0 = pmap_steal_memory(KSTACK_PAGES << PAGE_SHIFT); 353 354 355 virtual_avail = VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET; 356 virtual_end = VM_MAX_KERNEL_ADDRESS; 357 | 70 71#include "opt_ddb.h" 72#include "opt_msgbuf.h" 73#include <sys/param.h> 74#include <sys/systm.h> 75#include <sys/proc.h> 76#include <sys/msgbuf.h> 77#include <sys/vmmeter.h> --- 272 unchanged lines hidden (view full) --- 350 * Steal thread0 kstack. 351 */ 352 kstack0 = pmap_steal_memory(KSTACK_PAGES << PAGE_SHIFT); 353 354 355 virtual_avail = VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET; 356 virtual_end = VM_MAX_KERNEL_ADDRESS; 357 |
358#ifdef SMP |
|
358 /* | 359 /* |
360 * Steal some virtual address space to map the pcpu area. 361 */ 362 virtual_avail = roundup2(virtual_avail, PAGE_SIZE * 2); 363 pcpup = (struct pcpu *)virtual_avail; 364 virtual_avail += PAGE_SIZE * 2; 365 if (bootverbose) 366 printf("pcpu is available at virtual address %p.\n", pcpup); 367#endif 368 369 /* |
|
359 * Steal some virtual space that will not be in kernel_segmap. This 360 * va memory space will be used to map in kernel pages that are 361 * outside the 512Meg region. Note that we only do this steal when 362 * we do have memory in this region, that way for systems with 363 * smaller memory we don't "steal" any va ranges :-) 364 */ 365 if (memory_larger_than_512meg) { 366 for (i = 0; i < MAXCPU; i++) { --- 56 unchanged lines hidden (view full) --- 423 * The kernel's pmap is statically allocated so we don't have to use 424 * pmap_create, which is unlikely to work correctly at this part of 425 * the boot sequence (XXX and which no longer exists). 426 */ 427 PMAP_LOCK_INIT(kernel_pmap); 428 kernel_pmap->pm_segtab = kernel_segmap; 429 kernel_pmap->pm_active = ~0; 430 TAILQ_INIT(&kernel_pmap->pm_pvlist); | 370 * Steal some virtual space that will not be in kernel_segmap. This 371 * va memory space will be used to map in kernel pages that are 372 * outside the 512Meg region. Note that we only do this steal when 373 * we do have memory in this region, that way for systems with 374 * smaller memory we don't "steal" any va ranges :-) 375 */ 376 if (memory_larger_than_512meg) { 377 for (i = 0; i < MAXCPU; i++) { --- 56 unchanged lines hidden (view full) --- 434 * The kernel's pmap is statically allocated so we don't have to use 435 * pmap_create, which is unlikely to work correctly at this part of 436 * the boot sequence (XXX and which no longer exists). 437 */ 438 PMAP_LOCK_INIT(kernel_pmap); 439 kernel_pmap->pm_segtab = kernel_segmap; 440 kernel_pmap->pm_active = ~0; 441 TAILQ_INIT(&kernel_pmap->pm_pvlist); |
431 kernel_pmap->pm_asid[PCPU_GET(cpuid)].asid = PMAP_ASID_RESERVED; 432 kernel_pmap->pm_asid[PCPU_GET(cpuid)].gen = 0; | 442 kernel_pmap->pm_asid[0].asid = PMAP_ASID_RESERVED; 443 kernel_pmap->pm_asid[0].gen = 0; |
433 pmap_max_asid = VMNUM_PIDS; 434 MachSetPID(0); 435} 436 437/* 438 * Initialize a vm_page's machine-dependent fields. 439 */ 440void --- 2919 unchanged lines hidden --- | 444 pmap_max_asid = VMNUM_PIDS; 445 MachSetPID(0); 446} 447 448/* 449 * Initialize a vm_page's machine-dependent fields. 450 */ 451void --- 2919 unchanged lines hidden --- |