| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: lock.h,v 1.89 2020/03/08 15:05:18 ad Exp $ */ | | 1 | /* $NetBSD: lock.h,v 1.90 2020/07/06 22:32:22 rin Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1999, 2000, 2006, 2007 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999, 2000, 2006, 2007 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, |
9 | * NASA Ames Research Center, by Ross Harvey, and by Andrew Doran. | | 9 | * NASA Ames Research Center, by Ross Harvey, and by Andrew Doran. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -65,26 +65,30 @@ | | | @@ -65,26 +65,30 @@ |
65 | * @(#)lock.h 8.12 (Berkeley) 5/19/95 | | 65 | * @(#)lock.h 8.12 (Berkeley) 5/19/95 |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #ifndef _SYS_LOCK_H_ | | 68 | #ifndef _SYS_LOCK_H_ |
69 | #define _SYS_LOCK_H_ | | 69 | #define _SYS_LOCK_H_ |
70 | | | 70 | |
71 | #include <sys/stdint.h> | | 71 | #include <sys/stdint.h> |
72 | #include <sys/mutex.h> | | 72 | #include <sys/mutex.h> |
73 | | | 73 | |
74 | #include <machine/lock.h> | | 74 | #include <machine/lock.h> |
75 | | | 75 | |
76 | #ifdef _KERNEL | | 76 | #ifdef _KERNEL |
77 | | | 77 | |
| | | 78 | #ifdef _KERNEL_OPT |
| | | 79 | #include "opt_lockdebug.h" |
| | | 80 | #endif |
| | | 81 | |
78 | /* | | 82 | /* |
79 | * From <machine/lock.h>. | | 83 | * From <machine/lock.h>. |
80 | */ | | 84 | */ |
81 | #ifndef SPINLOCK_SPIN_HOOK | | 85 | #ifndef SPINLOCK_SPIN_HOOK |
82 | #define SPINLOCK_SPIN_HOOK | | 86 | #define SPINLOCK_SPIN_HOOK |
83 | #endif | | 87 | #endif |
84 | #ifndef SPINLOCK_BACKOFF_HOOK | | 88 | #ifndef SPINLOCK_BACKOFF_HOOK |
85 | #define SPINLOCK_BACKOFF_HOOK nullop(NULL) | | 89 | #define SPINLOCK_BACKOFF_HOOK nullop(NULL) |
86 | #endif | | 90 | #endif |
87 | #ifndef SPINLOCK_BACKOFF_MIN | | 91 | #ifndef SPINLOCK_BACKOFF_MIN |
88 | #define SPINLOCK_BACKOFF_MIN 4 | | 92 | #define SPINLOCK_BACKOFF_MIN 4 |
89 | #endif | | 93 | #endif |
90 | #ifndef SPINLOCK_BACKOFF_MAX | | 94 | #ifndef SPINLOCK_BACKOFF_MAX |