diff options
| author | 2016-11-18 15:38:14 +0000 | |
|---|---|---|
| committer | 2016-11-18 15:38:14 +0000 | |
| commit | 740d69f48eecef314e6083a7183d19040fe044f6 (patch) | |
| tree | e66e28204ddf142729e2fae75fa71bf029dce1a8 | |
| parent | Add more maps to print. As discussed with rzalamena@ (diff) | |
| download | wireguard-openbsd-740d69f48eecef314e6083a7183d19040fe044f6.tar.xz wireguard-openbsd-740d69f48eecef314e6083a7183d19040fe044f6.zip | |
Use the ErrorEPC register for curcpu().
| -rw-r--r-- | sys/arch/loongson/include/asm.h | 8 | ||||
| -rw-r--r-- | sys/arch/loongson/loongson/locore.S | 18 |
2 files changed, 24 insertions, 2 deletions
diff --git a/sys/arch/loongson/include/asm.h b/sys/arch/loongson/include/asm.h index a3bf821871e..d028fb9b120 100644 --- a/sys/arch/loongson/include/asm.h +++ b/sys/arch/loongson/include/asm.h @@ -1,3 +1,9 @@ -/* $OpenBSD: asm.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ +/* $OpenBSD: asm.h,v 1.2 2016/11/18 15:38:14 visa Exp $ */ /* public domain */ + +#ifdef MULTIPROCESSOR +#define HW_GET_CPU_INFO(ci, tmp) \ + dmfc0 ci, COP_0_ERROR_PC +#endif + #include <mips64/asm.h> diff --git a/sys/arch/loongson/loongson/locore.S b/sys/arch/loongson/loongson/locore.S index bd1b71069b8..b2248fd73cb 100644 --- a/sys/arch/loongson/loongson/locore.S +++ b/sys/arch/loongson/loongson/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.5 2013/06/05 01:28:04 pirofti Exp $ */ +/* $OpenBSD: locore.S,v 1.6 2016/11/18 15:38:14 visa Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -93,3 +93,19 @@ LEAF(hibernate_resume_machdep, 0) /* { */ END(hibernate_resume_machdep) /* } */ #endif /* HIBERNATE */ + +#ifdef MULTIPROCESSOR + +LEAF(hw_getcurcpu, 0) + GET_CPU_INFO(v0, v1) + jr ra + nop +END(hw_getcurcpu) + +LEAF(hw_setcurcpu, 0) + dmtc0 a0, COP_0_ERROR_PC + jr ra + nop +END(hw_setcurcpu) + +#endif /* MULTIPROCESSOR */ |
