mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 10:40:19 -04:00
panic_cpu variable should be volatile
This is to prevent caching of its value in a register when it is checked and modified by multiple CPUs in parallel. Also, move the variable into the scope of the only function that uses it. Reviewed by: jhb Hint from: mdf MFC after: 1 week
This commit is contained in:
parent
6f0ebf473d
commit
64dd590ece
1 changed files with 3 additions and 4 deletions
|
|
@ -513,10 +513,6 @@ shutdown_reset(void *junk, int howto)
|
|||
/* NOTREACHED */ /* assuming reset worked */
|
||||
}
|
||||
|
||||
#ifdef SMP
|
||||
static u_int panic_cpu = NOCPU;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Panic is called on unresolvable fatal errors. It prints "panic: mesg",
|
||||
* and then reboots. If we are called twice, then we avoid trying to sync
|
||||
|
|
@ -525,6 +521,9 @@ static u_int panic_cpu = NOCPU;
|
|||
void
|
||||
panic(const char *fmt, ...)
|
||||
{
|
||||
#ifdef SMP
|
||||
static volatile u_int panic_cpu = NOCPU;
|
||||
#endif
|
||||
struct thread *td = curthread;
|
||||
int bootopt, newpanic;
|
||||
va_list ap;
|
||||
|
|
|
|||
Loading…
Reference in a new issue