From 420c66102dff0eb493dc933d0e433b49fdc40e05 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Tue, 15 Sep 2009 04:54:32 +0000 Subject: cpu status flag, cpuid added to cpu_info. cpu_info pointer array, cpu_info iterator, cpu_number() implementation added. constraint modifier fixed in lock.h to output correct assembly. calling proc_trampoline_mp in exception.S. --- sys/arch/mips64/include/cpu.h | 52 ++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 13 deletions(-) (limited to 'sys/arch/mips64/include/cpu.h') diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index 0de6f4cc98a..cf133a71d95 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.35 2009/08/06 21:54:27 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.36 2009/09/15 04:54:31 syuu Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -356,38 +356,64 @@ extern vaddr_t uncached_base; #ifndef _LOCORE +#include +#include #include +#include + struct cpu_info { + struct device ci_dev; /* our device */ + struct cpu_info *ci_self; /* pointer to this structure */ + struct cpu_info *ci_next; /* next cpu */ struct proc *ci_curproc; struct schedstate_percpu ci_schedstate; int ci_want_resched; /* need_resched() invoked */ - + cpuid_t ci_cpuid; /* our CPU ID */ u_int32_t ci_randseed; /* per cpu random seed */ +#ifdef MULTIPROCESSOR + u_long ci_flags; /* flags; see below */ +#endif }; +#define CPUF_PRIMARY 0x01 /* CPU is primary CPU */ +#define CPUF_PRESENT 0x02 /* CPU is present */ +#define CPUF_RUNNING 0x04 /* CPU is running */ + extern struct cpu_info cpu_info_primary; +extern struct cpu_info *cpu_info_list; +#define CPU_INFO_ITERATOR int +#define CPU_INFO_FOREACH(cii, ci) for (cii = 0, ci = cpu_info_list; \ + ci != NULL; ci = ci->ci_next) -#define curcpu() (&cpu_info_primary) +#define CPU_INFO_UNIT(ci) ((ci)->ci_dev.dv_unit) -#define CPU_IS_PRIMARY(ci) 1 -#define CPU_INFO_ITERATOR int -#define CPU_INFO_FOREACH(cii, ci) \ - for (cii = 0, ci = curcpu(); ci != NULL; ci = NULL) -#define CPU_INFO_UNIT(ci) 0 -#define MAXCPUS 1 -#define cpu_unidle(ci) +#ifdef MULTIPROCESSOR +#define MAXCPUS 4 +#define curcpu() (cpu_info[cpu_number()]) +#define CPU_IS_PRIMARY(ci) ((ci)->ci_flags & CPUF_PRIMARY) +#define cpu_number() hw_cpu_number() -#define cpu_number() 0 +extern struct cpuset cpus_running; +extern struct cpu_info *cpu_info[]; +void cpu_unidle(struct cpu_info *); +void cpu_boot_secondary_processors(void); + +#include +#else +#define MAXCPUS 1 +#define curcpu() (&cpu_info_primary) +#define CPU_IS_PRIMARY(ci) 1 +#define cpu_number() 0 +#define cpu_unidle(ci) +#endif #include #endif /* _LOCORE */ -#include - #ifndef _LOCORE /* -- cgit v1.2.3