diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-03-15 11:26:39 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-03-15 11:26:39 +0000 |
commit | ee921a065e370dfce498c7928965d41244de47b4 (patch) | |
tree | 8e5bcbc6f9099dbae7fe940ff98a392022cf5648 | |
parent | 76289c260a26d9464a6c67297d944b6dfb523b4a (diff) |
Allow CPU_INFO_UNIT() to be used before cpu0 attaches.
-rw-r--r-- | sys/arch/alpha/include/cpu.h | 6 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/cpuvar.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h index 508c3d00c58..4b0c16725fb 100644 --- a/sys/arch/alpha/include/cpu.h +++ b/sys/arch/alpha/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.36 2008/10/15 23:23:44 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.37 2009/03/15 11:26:37 miod Exp $ */ /* $NetBSD: cpu.h,v 1.45 2000/08/21 02:03:12 thorpej Exp $ */ /*- @@ -214,7 +214,7 @@ struct cpu_info { void fpusave_cpu(struct cpu_info *, int); void fpusave_proc(struct proc *, int); -#define CPU_INFO_UNIT(ci) ((ci)->ci_dev->dv_unit) +#define CPU_INFO_UNIT(ci) ((ci)->ci_dev ? (ci)->ci_dev->dv_unit : 0) #define CPU_INFO_ITERATOR int #define CPU_INFO_FOREACH(cii, ci) for (cii = 0, ci = curcpu(); \ ci != NULL; ci = ci->ci_next) @@ -344,7 +344,7 @@ do { \ #define CPU_BOOTED_KERNEL 6 /* string: booted kernel name */ #define CPU_FP_SYNC_COMPLETE 7 /* int: always fixup sync fp traps */ #define CPU_CHIPSET 8 /* chipset information */ -#define CPU_ALLOWAPERTURE 9 +#define CPU_ALLOWAPERTURE 9 #define CPU_MAXID 10 /* valid machdep IDs */ diff --git a/sys/arch/sparc/sparc/cpuvar.h b/sys/arch/sparc/sparc/cpuvar.h index 63b12a0d66f..da47f1aa735 100644 --- a/sys/arch/sparc/sparc/cpuvar.h +++ b/sys/arch/sparc/sparc/cpuvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpuvar.h,v 1.16 2008/10/15 23:23:50 deraadt Exp $ */ +/* $OpenBSD: cpuvar.h,v 1.17 2009/03/15 11:26:38 miod Exp $ */ /* $NetBSD: cpuvar.h,v 1.4 1997/07/06 21:14:25 pk Exp $ */ /* @@ -88,7 +88,7 @@ struct cpu_info { #define CPU_INFO_ITERATOR int #define CPU_INFO_FOREACH(cii, ci) \ for (cii = 0, ci = curcpu(); ci != NULL; ci = ci->ci_next) -#define CPU_INFO_UNIT(ci) ((ci)->ci_softc->dv.dv_unit) +#define CPU_INFO_UNIT(ci) ((ci)->ci_softc ? (ci)->ci_softc->dv.dv_unit : 0) #define MAXCPUS 1 #define cpu_unidle(ci) |