Completely remove now unused pc_other_cpus, pc_cpumask.

Tested by:	pluknet
This commit is contained in:
Attilio Rao 2011-07-04 10:45:54 +00:00
parent 7b744f6b01
commit a2f4e284b0
3 changed files with 2 additions and 42 deletions

View File

@ -39,13 +39,11 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/cpuset.h>
#include <sys/pcpu.h>
#include <sys/sysctl.h>
#include <kvm.h>
#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include "kvm_private.h"
@ -120,9 +118,6 @@ _kvm_pcpu_clear(void)
void *
kvm_getpcpu(kvm_t *kd, int cpu)
{
long kcpusetsize;
ssize_t nbytes;
uintptr_t readptr;
char *buf;
if (kd == NULL) {
@ -130,10 +125,6 @@ kvm_getpcpu(kvm_t *kd, int cpu)
return (NULL);
}
kcpusetsize = sysconf(_SC_CPUSET_SIZE);
if (kcpusetsize == -1 || (u_long)kcpusetsize > sizeof(cpuset_t))
return ((void *)-1);
if (maxcpu == 0)
if (_kvm_pcpu_init(kd) < 0)
return ((void *)-1);
@ -146,26 +137,8 @@ kvm_getpcpu(kvm_t *kd, int cpu)
_kvm_err(kd, kd->program, "out of memory");
return ((void *)-1);
}
nbytes = sizeof(struct pcpu) - 2 * kcpusetsize;
readptr = (uintptr_t)pcpu_data[cpu];
if (kvm_read(kd, readptr, buf, nbytes) != nbytes) {
_kvm_err(kd, kd->program, "unable to read per-CPU data");
free(buf);
return ((void *)-1);
}
/* Fetch the valid cpuset_t objects. */
CPU_ZERO((cpuset_t *)(buf + nbytes));
CPU_ZERO((cpuset_t *)(buf + nbytes + sizeof(cpuset_t)));
readptr += nbytes;
if (kvm_read(kd, readptr, buf + nbytes, kcpusetsize) != kcpusetsize) {
_kvm_err(kd, kd->program, "unable to read per-CPU data");
free(buf);
return ((void *)-1);
}
readptr += kcpusetsize;
if (kvm_read(kd, readptr, buf + nbytes + sizeof(cpuset_t),
kcpusetsize) != kcpusetsize) {
if (kvm_read(kd, (uintptr_t)pcpu_data[cpu], buf,
sizeof(struct pcpu)) != sizeof(struct pcpu)) {
_kvm_err(kd, kd->program, "unable to read per-CPU data");
free(buf);
return ((void *)-1);

View File

@ -87,7 +87,6 @@ pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
KASSERT(cpuid >= 0 && cpuid < MAXCPU,
("pcpu_init: invalid cpuid %d", cpuid));
pcpu->pc_cpuid = cpuid;
CPU_SETOF(cpuid, &pcpu->pc_cpumask);
cpuid_to_pcpu[cpuid] = pcpu;
STAILQ_INSERT_TAIL(&cpuhead, pcpu, pc_allcpu);
cpu_pcpu_init(pcpu, cpuid, size);

View File

@ -196,18 +196,6 @@ struct pcpu {
* if only to make kernel debugging easier.
*/
PCPU_MD_FIELDS;
/*
* XXX
* For the time being, keep the cpuset_t objects as the very last
* members of the structure.
* They are actually tagged to be removed soon, but as long as this
* does not happen, it is necessary to find a way to implement
* easilly interfaces to userland and leaving them last makes that
* possible.
*/
cpuset_t pc_cpumask; /* This cpu mask */
cpuset_t pc_other_cpus; /* Mask of all other cpus */
} __aligned(CACHE_LINE_SIZE);
#ifdef _KERNEL