subr_smp.c (223758) | subr_smp.c (224159) |
---|---|
1/*- 2 * Copyright (c) 2001, John Baldwin <jhb@FreeBSD.org>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 */ 29 30/* 31 * This module holds the global variables and machine independent functions 32 * used for the kernel SMP support. 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001, John Baldwin <jhb@FreeBSD.org>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 */ 29 30/* 31 * This module holds the global variables and machine independent functions 32 * used for the kernel SMP support. 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/kern/subr_smp.c 223758 2011-07-04 12:04:52Z attilio $"); | 36__FBSDID("$FreeBSD: head/sys/kern/subr_smp.c 224159 2011-07-17 23:05:24Z rwatson $"); |
37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/ktr.h> 42#include <sys/proc.h> 43#include <sys/bus.h> 44#include <sys/lock.h> --- 20 unchanged lines hidden (view full) --- 65 66int mp_ncpus; 67/* export this for libkvm consumers. */ 68int mp_maxcpus = MAXCPU; 69 70volatile int smp_started; 71u_int mp_maxid; 72 | 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/ktr.h> 42#include <sys/proc.h> 43#include <sys/bus.h> 44#include <sys/lock.h> --- 20 unchanged lines hidden (view full) --- 65 66int mp_ncpus; 67/* export this for libkvm consumers. */ 68int mp_maxcpus = MAXCPU; 69 70volatile int smp_started; 71u_int mp_maxid; 72 |
73SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD, NULL, "Kernel SMP"); | 73SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD|CTLFLAG_CAPRD, NULL, "Kernel SMP"); |
74 | 74 |
75SYSCTL_UINT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD, &mp_maxid, 0, | 75SYSCTL_INT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxid, 0, |
76 "Max CPU ID."); 77 | 76 "Max CPU ID."); 77 |
78SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD, &mp_maxcpus, 0, 79 "Max number of CPUs that the system was compiled for."); | 78SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxcpus, 79 0, "Max number of CPUs that the system was compiled for."); |
80 81int smp_active = 0; /* are the APs allowed to run? */ 82SYSCTL_INT(_kern_smp, OID_AUTO, active, CTLFLAG_RW, &smp_active, 0, 83 "Number of Auxillary Processors (APs) that were successfully started"); 84 85int smp_disabled = 0; /* has smp been disabled? */ | 80 81int smp_active = 0; /* are the APs allowed to run? */ 82SYSCTL_INT(_kern_smp, OID_AUTO, active, CTLFLAG_RW, &smp_active, 0, 83 "Number of Auxillary Processors (APs) that were successfully started"); 84 85int smp_disabled = 0; /* has smp been disabled? */ |
86SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN, &smp_disabled, 0, 87 "SMP has been disabled from the loader"); | 86SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, 87 &smp_disabled, 0, "SMP has been disabled from the loader"); |
88TUNABLE_INT("kern.smp.disabled", &smp_disabled); 89 90int smp_cpus = 1; /* how many cpu's running */ | 88TUNABLE_INT("kern.smp.disabled", &smp_disabled); 89 90int smp_cpus = 1; /* how many cpu's running */ |
91SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD, &smp_cpus, 0, | 91SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, |
92 "Number of CPUs online"); 93 94int smp_topology = 0; /* Which topology we're using. */ 95SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RD, &smp_topology, 0, 96 "Topology override setting; 0 is default provided by hardware."); 97TUNABLE_INT("kern.smp.topology", &smp_topology); 98 99#ifdef SMP --- 623 unchanged lines hidden --- | 92 "Number of CPUs online"); 93 94int smp_topology = 0; /* Which topology we're using. */ 95SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RD, &smp_topology, 0, 96 "Topology override setting; 0 is default provided by hardware."); 97TUNABLE_INT("kern.smp.topology", &smp_topology); 98 99#ifdef SMP --- 623 unchanged lines hidden --- |