Skip to content

Commit bce3dfd

Browse files
committed
Declare __mp_lock_spinout in a single place
Using a single decl helps the compiler catch type mismatches. In this case it would have saved claudio some time while trying a wip diff. ok claudio@ miod@
1 parent 2d066be commit bce3dfd

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

sys/arch/amd64/amd64/pmap.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: pmap.c,v 1.178 2024/11/02 07:58:58 mpi Exp $ */
1+
/* $OpenBSD: pmap.c,v 1.179 2025/06/18 15:05:53 jca Exp $ */
22
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
33

44
/*
@@ -3185,7 +3185,6 @@ pmap_steal_memory(vsize_t size, vaddr_t *start, vaddr_t *end)
31853185
*/
31863186
#ifdef MP_LOCKDEBUG
31873187
#include <ddb/db_output.h>
3188-
extern int __mp_lock_spinout;
31893188
#endif
31903189

31913190
volatile long tlb_shoot_wait __attribute__((section(".kudata")));

sys/arch/amd64/amd64/vmm_machdep.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmm_machdep.c,v 1.57 2025/06/03 19:15:29 sf Exp $ */
1+
/* $OpenBSD: vmm_machdep.c,v 1.58 2025/06/18 15:05:53 jca Exp $ */
22
/*
33
* Copyright (c) 2014 Mike Larkin <[email protected]>
44
*
@@ -48,7 +48,6 @@
4848

4949
#ifdef MP_LOCKDEBUG
5050
#include <ddb/db_output.h>
51-
extern int __mp_lock_spinout;
5251
#endif /* MP_LOCKDEBUG */
5352

5453
void *l1tf_flush_region;

sys/arch/hppa/hppa/lock_machdep.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: lock_machdep.c,v 1.15 2024/07/03 01:36:50 jsg Exp $ */
1+
/* $OpenBSD: lock_machdep.c,v 1.16 2025/06/18 15:05:53 jca Exp $ */
22

33
/*
44
* Copyright (c) 2007 Artur Grabowski <[email protected]>
@@ -70,9 +70,6 @@ ___mp_lock_init(struct __mp_lock *lock)
7070
#ifndef DDB
7171
#error "MP_LOCKDEBUG requires DDB"
7272
#endif
73-
74-
/* CPU-dependent timing, this needs to be settable from ddb. */
75-
extern int __mp_lock_spinout;
7673
#endif
7774

7875
static __inline void

sys/arch/m88k/m88k/mutex.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: mutex.c,v 1.1 2020/05/26 11:55:10 aoyama Exp $ */
1+
/* $OpenBSD: mutex.c,v 1.2 2025/06/18 15:05:53 jca Exp $ */
22

33
/*
44
* Copyright (c) 2020 Miodrag Vallat
@@ -28,10 +28,6 @@
2828

2929
#include <ddb/db_output.h>
3030

31-
#ifdef MP_LOCKDEBUG
32-
extern int __mp_lock_spinout; /* kern_lock.c */
33-
#endif /* MP_LOCKDEBUG */
34-
3531
static inline int
3632
atomic_swap(volatile int *lockptr, int new)
3733
{

sys/arch/powerpc/powerpc/lock_machdep.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: lock_machdep.c,v 1.12 2024/04/03 19:30:59 gkoehler Exp $ */
1+
/* $OpenBSD: lock_machdep.c,v 1.13 2025/06/18 15:05:53 jca Exp $ */
22

33
/*
44
* Copyright (c) 2021 George Koehler <[email protected]>
@@ -42,9 +42,6 @@
4242
#ifndef DDB
4343
#error "MP_LOCKDEBUG requires DDB"
4444
#endif
45-
46-
/* CPU-dependent timing, needs this to be settable from ddb. */
47-
extern int __mp_lock_spinout;
4845
#endif
4946

5047
static __inline void

sys/sys/systm.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: systm.h,v 1.174 2025/06/16 20:21:33 kettenis Exp $ */
1+
/* $OpenBSD: systm.h,v 1.175 2025/06/18 15:05:53 jca Exp $ */
22
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
33

44
/*-
@@ -107,6 +107,10 @@ extern struct vnode *swapdev_vp;/* vnode equivalent to above */
107107

108108
extern int nowake; /* dead wakeup(9) channel */
109109

110+
#ifdef MP_LOCKDEBUG
111+
extern int __mp_lock_spinout;
112+
#endif
113+
110114
struct proc;
111115
struct process;
112116
#define curproc curcpu()->ci_curproc

0 commit comments

Comments
 (0)