diff options
Diffstat (limited to 'sys/arch/m88k/include/cpu.h')
-rw-r--r-- | sys/arch/m88k/include/cpu.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h index bb5a253b778..948bb00fe56 100644 --- a/sys/arch/m88k/include/cpu.h +++ b/sys/arch/m88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.6 2005/10/12 19:05:43 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.7 2005/10/13 19:48:32 miod Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -61,6 +61,20 @@ #include <machine/pcb.h> #include <machine/psl.h> +#ifndef _LOCORE + +static unsigned cpu_number(void); + +static __inline__ unsigned cpu_number(void) +{ + unsigned cpu; + + __asm__ __volatile__ ("ldcr %0, cr18" : "=r" (cpu)); + return (cpu & 3); +} + +#endif /* _LOCORE */ + /* * definitions of cpu-dependent requirements * referenced in generic code |