Remove unnecessary volatile qualifiers from test state variables.

Thread safety is ensured by the barriers.
This commit is contained in:
Martin Whitaker 2022-02-19 12:44:14 +00:00
parent e032df50d2
commit 02bcec2418
2 changed files with 39 additions and 39 deletions

View File

@ -71,20 +71,20 @@ static uintptr_t high_load_addr;
static barrier_t *start_barrier = NULL; static barrier_t *start_barrier = NULL;
static volatile bool start_run = false; static bool start_run = false;
static volatile bool start_pass = false; static bool start_pass = false;
static volatile bool start_test = false; static bool start_test = false;
static volatile bool rerun_test = false; static bool rerun_test = false;
static volatile bool dummy_run = false; static bool dummy_run = false;
static volatile int window_num = 0; static int window_num = 0;
static volatile uintptr_t window_start = 0; static uintptr_t window_start = 0;
static volatile uintptr_t window_end = 0; static uintptr_t window_end = 0;
static volatile size_t num_mapped_pages = 0; static size_t num_mapped_pages = 0;
static volatile int test_stage = 0; static int test_stage = 0;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Public Variables // Public Variables
@ -94,24 +94,24 @@ static volatile int test_stage = 0;
uint8_t chunk_index[MAX_CPUS]; uint8_t chunk_index[MAX_CPUS];
volatile int num_active_cpus = 1; int num_active_cpus = 0;
volatile int master_cpu = 0; int master_cpu = 0;
barrier_t *run_barrier = NULL; barrier_t *run_barrier = NULL;
spinlock_t *error_mutex = NULL; spinlock_t *error_mutex = NULL;
volatile vm_map_t vm_map[MAX_MEM_SEGMENTS]; vm_map_t vm_map[MAX_MEM_SEGMENTS];
volatile int vm_map_size = 0; int vm_map_size = 0;
volatile int pass_num = 0; int pass_num = 0;
volatile int test_num = 0; int test_num = 0;
volatile bool restart = false; bool restart = false;
volatile bool bail = false; bool bail = false;
volatile uintptr_t test_addr[MAX_CPUS]; uintptr_t test_addr[MAX_CPUS];
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Private Functions // Private Functions

View File

@ -27,12 +27,12 @@ extern uint8_t chunk_index[MAX_CPUS];
* The number of CPU cores being used for the current test. This is always * The number of CPU cores being used for the current test. This is always
* either 1 or the full number of enabled CPU cores. * either 1 or the full number of enabled CPU cores.
*/ */
extern volatile int num_active_cpus; extern int num_active_cpus;
/* /*
* The current master CPU core. * The current master CPU core.
*/ */
extern volatile int master_cpu; extern int master_cpu;
/* /*
* A barrier used when running tests. * A barrier used when running tests.
@ -75,34 +75,34 @@ typedef struct {
/* /*
* The list of memory segments currently mapped into virtual memory. * The list of memory segments currently mapped into virtual memory.
*/ */
extern volatile vm_map_t vm_map[MAX_MEM_SEGMENTS]; extern vm_map_t vm_map[MAX_MEM_SEGMENTS];
/* /*
* The number of memory segments currently mapped into virtual memory. * The number of memory segments currently mapped into virtual memory.
*/ */
extern volatile int vm_map_size; extern int vm_map_size;
/* /*
* The number of completed test passes. * The number of completed test passes.
*/ */
extern volatile int pass_num; extern int pass_num;
/* /*
* The current test number. * The current test number.
*/ */
extern volatile int test_num; extern int test_num;
/* /*
* A flag indicating that testing should be restarted due to a configuration * A flag indicating that testing should be restarted due to a configuration
* change. * change.
*/ */
extern volatile bool restart; extern bool restart;
/* /*
* A flag indicating that the current test should be aborted. * A flag indicating that the current test should be aborted.
*/ */
extern volatile bool bail; extern bool bail;
/* /*
* The base address of the block of memory currently being tested. * The base address of the block of memory currently being tested.
*/ */
extern volatile uintptr_t test_addr[MAX_CPUS]; extern uintptr_t test_addr[MAX_CPUS];
#endif // TEST_H #endif // TEST_H