Change cpuno to cpuid.

This commit is contained in:
dfr 2001-01-24 17:12:37 +00:00
parent 14133b4f7e
commit 82b0a074c7
4 changed files with 32 additions and 32 deletions

View File

@ -69,7 +69,7 @@ ASSYM(GD_CURPROC, offsetof(struct globaldata, gd_curproc));
ASSYM(GD_FPCURPROC, offsetof(struct globaldata, gd_fpcurproc));
ASSYM(GD_CURPCB, offsetof(struct globaldata, gd_curpcb));
ASSYM(GD_SWITCHTIME, offsetof(struct globaldata, gd_switchtime));
ASSYM(GD_CPUNO, offsetof(struct globaldata, gd_cpuno));
ASSYM(GD_CPUID, offsetof(struct globaldata, gd_cpuid));
ASSYM(GD_ASTPENDING, offsetof(struct globaldata, gd_astpending));
ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));

View File

@ -70,7 +70,7 @@ int smp_started;
int boot_cpu_id;
u_int32_t all_cpus;
static struct globaldata *cpuno_to_globaldata[NCPUS];
static struct globaldata *cpuid_to_globaldata[NCPUS];
int smp_active = 0; /* are the APs allowed to run? */
SYSCTL_INT(_machdep, OID_AUTO, smp_active, CTLFLAG_RW, &smp_active, 0, "");
@ -94,18 +94,18 @@ SYSCTL_INT(_machdep, OID_AUTO, forward_roundrobin_enabled, CTLFLAG_RW,
* Initialise a struct globaldata.
*/
void
globaldata_init(struct globaldata *globaldata, int cpuno, size_t sz)
globaldata_init(struct globaldata *globaldata, int cpuid, size_t sz)
{
bzero(globaldata, sz);
globaldata->gd_cpuno = cpuno;
globaldata->gd_other_cpus = all_cpus & ~(1 << cpuno);
cpuno_to_globaldata[cpuno] = globaldata;
globaldata->gd_cpuid = cpuid;
globaldata->gd_other_cpus = all_cpus & ~(1 << cpuid);
cpuid_to_globaldata[cpuid] = globaldata;
}
struct globaldata *
globaldata_find(int cpuno)
globaldata_find(int cpuid)
{
return cpuno_to_globaldata[cpuno];
return cpuid_to_globaldata[cpuid];
}
/* Other stuff */
@ -659,16 +659,16 @@ smp_ipi_selected(u_int32_t cpus, u_int64_t ipi)
CTR2(KTR_SMP, "smp_ipi_selected: cpus: %x ipi: %lx", cpus, ipi);
ia64_mf();
while (cpus) {
int cpuno = ffs(cpus) - 1;
cpus &= ~(1 << cpuno);
int cpuid = ffs(cpus) - 1;
cpus &= ~(1 << cpuid);
globaldata = cpuno_to_globaldata[cpuno];
globaldata = cpuid_to_globaldata[cpuid];
if (globaldata) {
atomic_set_64(&globaldata->gd_pending_ipis, ipi);
ia64_mf();
#if 0
CTR1(KTR_SMP, "calling alpha_pal_wripir(%d)", cpuno);
alpha_pal_wripir(cpuno);
CTR1(KTR_SMP, "calling alpha_pal_wripir(%d)", cpuid);
alpha_pal_wripir(cpuid);
#endif
}
}
@ -698,7 +698,7 @@ smp_ipi_all_but_self(u_int64_t ipi)
void
smp_ipi_self(u_int64_t ipi)
{
smp_ipi_selected(1 << PCPU_GET(cpuno), ipi);
smp_ipi_selected(1 << PCPU_GET(cpuid), ipi);
}
/*
@ -709,7 +709,7 @@ smp_handle_ipi(struct trapframe *frame)
{
u_int64_t ipis;
u_int64_t ipi;
int cpuno = PCPU_GET(cpuno);
int cpuid = PCPU_GET(cpuid);
do {
ipis = PCPU_GET(pending_ipis);
@ -732,8 +732,8 @@ smp_handle_ipi(struct trapframe *frame)
case IPI_AST:
CTR0(KTR_SMP, "IPI_AST");
atomic_clear_int(&checkstate_need_ast, 1<<cpuno);
atomic_set_int(&checkstate_pending_ast, 1<<cpuno);
atomic_clear_int(&checkstate_need_ast, 1<<cpuid);
atomic_set_int(&checkstate_pending_ast, 1<<cpuid);
if ((frame->tf_cr_ipsr & IA64_PSR_CPL)
== IA64_PSR_CPL_USER)
ast(frame); /* XXX */
@ -743,22 +743,22 @@ smp_handle_ipi(struct trapframe *frame)
CTR0(KTR_SMP, "IPI_CHECKSTATE");
if ((frame->tf_cr_ipsr & IA64_PSR_CPL)
== IA64_PSR_CPL_USER)
checkstate_cpustate[cpuno] = CHECKSTATE_USER;
checkstate_cpustate[cpuid] = CHECKSTATE_USER;
else if (curproc->p_intr_nesting_level == 1)
checkstate_cpustate[cpuno] = CHECKSTATE_SYS;
checkstate_cpustate[cpuid] = CHECKSTATE_SYS;
else
checkstate_cpustate[cpuno] = CHECKSTATE_INTR;
checkstate_curproc[cpuno] = PCPU_GET(curproc);
atomic_set_int(&checkstate_probed_cpus, 1<<cpuno);
checkstate_cpustate[cpuid] = CHECKSTATE_INTR;
checkstate_curproc[cpuid] = PCPU_GET(curproc);
atomic_set_int(&checkstate_probed_cpus, 1<<cpuid);
break;
case IPI_STOP:
CTR0(KTR_SMP, "IPI_STOP");
atomic_set_int(&stopped_cpus, 1<<cpuno);
while ((started_cpus & (1<<cpuno)) == 0)
atomic_set_int(&stopped_cpus, 1<<cpuid);
while ((started_cpus & (1<<cpuid)) == 0)
ia64_mf();
atomic_clear_int(&started_cpus, 1<<cpuno);
atomic_clear_int(&stopped_cpus, 1<<cpuno);
atomic_clear_int(&started_cpus, 1<<cpuid);
atomic_clear_int(&stopped_cpus, 1<<cpuid);
break;
}
}

View File

@ -49,7 +49,7 @@ struct globaldata {
struct pcb *gd_curpcb; /* current pcb */
struct timeval gd_switchtime;
int gd_switchticks;
u_int gd_cpuno; /* this cpu number */
u_int gd_cpuid; /* this cpu number */
u_int gd_other_cpus; /* all other cpus */
u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */
u_int64_t gd_pending_ipis; /* pending IPI events */
@ -69,8 +69,8 @@ struct globaldata {
SLIST_HEAD(cpuhead, globaldata);
extern struct cpuhead cpuhead;
void globaldata_init(struct globaldata *pcpu, int cpuno, size_t sz);
struct globaldata *globaldata_find(int cpuno);
void globaldata_init(struct globaldata *pcpu, int cpuid, size_t sz);
struct globaldata *globaldata_find(int cpuid);
#endif /* _KERNEL */

View File

@ -49,7 +49,7 @@ struct globaldata {
struct pcb *gd_curpcb; /* current pcb */
struct timeval gd_switchtime;
int gd_switchticks;
u_int gd_cpuno; /* this cpu number */
u_int gd_cpuid; /* this cpu number */
u_int gd_other_cpus; /* all other cpus */
u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */
u_int64_t gd_pending_ipis; /* pending IPI events */
@ -69,8 +69,8 @@ struct globaldata {
SLIST_HEAD(cpuhead, globaldata);
extern struct cpuhead cpuhead;
void globaldata_init(struct globaldata *pcpu, int cpuno, size_t sz);
struct globaldata *globaldata_find(int cpuno);
void globaldata_init(struct globaldata *pcpu, int cpuid, size_t sz);
struct globaldata *globaldata_find(int cpuid);
#endif /* _KERNEL */