mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2024-11-23 00:16:24 -06:00
9b9c65b968
* Optimize the JEP106 list by using __attribute__((packed)) to remove padding. The x86 & x86_64 series support unaligned accesses just fine, after all, and this is not remotely a hot path. * Optimize several string-related constructs by switching to fixed-length char arrays, which avoids pointers + relocations. * app/interrupt.c: array of different-length strings, but most of those are lengthy enough for this to be a clear win, especially on x86_64; * system/usbhcd.c: array of same-length strings; * tests/tests.h: array of structs containing same-length strings. * Reduce the size of the list of tests by using a narrower type for the cpu mode, which reduces padding.
38 lines
812 B
C
38 lines
812 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef TESTS_H
|
|
#define TESTS_H
|
|
/**
|
|
* \file
|
|
*
|
|
* Provides support for identifying and running the memory tests.
|
|
*
|
|
*//*
|
|
* Copyright (C) 2020-2022 Martin Whitaker.
|
|
*/
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "config.h"
|
|
|
|
#define NUM_TEST_PATTERNS 11
|
|
|
|
typedef struct {
|
|
bool enabled;
|
|
uint8_t cpu_mode;
|
|
int stages;
|
|
int iterations;
|
|
int errors;
|
|
char description[40];
|
|
} test_pattern_t;
|
|
|
|
extern test_pattern_t test_list[NUM_TEST_PATTERNS];
|
|
|
|
typedef enum { FAST_PASS, FULL_PASS, NUM_PASS_TYPES } pass_type_t;
|
|
|
|
extern int ticks_per_pass[NUM_PASS_TYPES];
|
|
extern int ticks_per_test[NUM_PASS_TYPES][NUM_TEST_PATTERNS];
|
|
|
|
int run_test(int my_cpu, int test, int stage, int iterations);
|
|
|
|
#endif // TESTS_H
|