mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
SCHEDULER_STOPPED(): Move it (back) to 'systm.h'
It's not an assertion, so doesn't logically belong to 'kassert.h'. Moreover, a subsequent commit will make it rely on a variable whose declaration also belongs to 'systm.h'. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43571
This commit is contained in:
parent
12d6a032df
commit
cd0c52e50b
|
@ -179,17 +179,6 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2);
|
|||
#define CRITICAL_ASSERT(td) \
|
||||
KASSERT((td)->td_critnest >= 1, ("Not in critical section"))
|
||||
|
||||
/*
|
||||
* If we have already panic'd and this is the thread that called
|
||||
* panic(), then don't block on any mutexes but silently succeed.
|
||||
* Otherwise, the kernel will deadlock since the scheduler isn't
|
||||
* going to run the thread that holds any lock we need.
|
||||
*/
|
||||
#define SCHEDULER_STOPPED_TD(td) ({ \
|
||||
MPASS((td) == curthread); \
|
||||
__predict_false((td)->td_stopsched); \
|
||||
})
|
||||
#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread)
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* _SYS_KASSERT_H_ */
|
||||
|
|
|
@ -99,6 +99,18 @@ struct ucred;
|
|||
#include <sys/pcpu.h> /* curthread */
|
||||
#include <sys/kpilite.h>
|
||||
|
||||
/*
|
||||
* If we have already panic'd and this is the thread that called
|
||||
* panic(), then don't block on any mutexes but silently succeed.
|
||||
* Otherwise, the kernel will deadlock since the scheduler isn't
|
||||
* going to run the thread that holds any lock we need.
|
||||
*/
|
||||
#define SCHEDULER_STOPPED_TD(td) ({ \
|
||||
MPASS((td) == curthread); \
|
||||
__predict_false((td)->td_stopsched); \
|
||||
})
|
||||
#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread)
|
||||
|
||||
extern int osreldate;
|
||||
|
||||
extern const void *zero_region; /* address space maps to a zeroed page */
|
||||
|
|
Loading…
Reference in a new issue