mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2024-11-23 08:26:23 -06:00
4078b7760e
The old barrier implementation was very slow when running on a multi-socket machine (pcmemtest issue 16). The new implementation provides two options: - when blocked, spin on a thread-local flag - when blocked, execute a HLT instruction and wait for a NMI The first option might be faster, but we need to measure it to find out. A new boot command line option is provided to select between the two, with a third setting that uses a mixture of the two.
26 lines
453 B
C
26 lines
453 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef ASSERT_H
|
|
#define ASSERT_H
|
|
/**
|
|
* \file
|
|
*
|
|
* Provides a function to terminate the program if an unexpected and fatal
|
|
* error is detected.
|
|
*
|
|
*//*
|
|
* Copyright (C) 2022 Martin Whitaker.
|
|
*/
|
|
|
|
/*
|
|
* Terminates the program (using a breakpoint exception) if expr is equal
|
|
* to zero.
|
|
*/
|
|
static inline void assert(int expr)
|
|
{
|
|
if (!expr) {
|
|
__asm__ __volatile__ ("int $3");
|
|
}
|
|
}
|
|
|
|
#endif // ASSERT_H
|