mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
Use atomic memory read/write functions in tests.
This ensures compiler optimisations won't interfere with the tests.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Provides some common definitions and helper functions for the memory
|
||||
* tests.
|
||||
*
|
||||
* Copyright (C) 2020 Martin Whitaker.
|
||||
* Copyright (C) 2020-2021 Martin Whitaker.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
@@ -13,6 +13,19 @@
|
||||
|
||||
#include "test.h"
|
||||
|
||||
/*
|
||||
* Test word atomic read and write functions.
|
||||
*/
|
||||
#ifdef __x86_64__
|
||||
#include "memrw64.h"
|
||||
#define read_word read64
|
||||
#define write_word write64
|
||||
#else
|
||||
#include "memrw32.h"
|
||||
#define read_word read32
|
||||
#define write_word write32
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A wrapper for guiding branch prediction.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user