2020-05-24 15:30:55 -05:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef ERROR_H
|
|
|
|
#define ERROR_H
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
*
|
2020-05-24 15:30:55 -05:00
|
|
|
* Provides functions that can be called by the memory tests to report errors.
|
|
|
|
*
|
2022-02-19 13:56:55 -06:00
|
|
|
*//*
|
2022-02-19 10:17:40 -06:00
|
|
|
* Copyright (C) 2020-2022 Martin Whitaker.
|
2020-05-24 15:30:55 -05:00
|
|
|
*/
|
|
|
|
|
2021-12-05 07:47:31 -06:00
|
|
|
#include <stdbool.h>
|
2020-05-24 15:30:55 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "test.h"
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* The number of errors recorded during the current run.
|
|
|
|
*/
|
|
|
|
extern uint64_t error_count;
|
|
|
|
|
2023-11-29 05:53:05 -06:00
|
|
|
/**
|
|
|
|
* The number of correctable ECC errors recorded during the current run.
|
|
|
|
*/
|
|
|
|
extern uint64_t error_count_cecc;
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Initialises the error records.
|
|
|
|
*/
|
|
|
|
void error_init(void);
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Adds an address error to the error reports.
|
|
|
|
*/
|
2022-02-19 07:01:42 -06:00
|
|
|
void addr_error(testword_t *addr1, testword_t *addr2, testword_t good, testword_t bad);
|
2020-05-24 15:30:55 -05:00
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Adds a data error to the error reports.
|
|
|
|
*/
|
2022-02-19 07:01:42 -06:00
|
|
|
void data_error(testword_t *addr, testword_t good, testword_t bad, bool use_for_badram);
|
2020-05-24 15:30:55 -05:00
|
|
|
|
2023-11-29 05:53:05 -06:00
|
|
|
/**
|
|
|
|
* Adds an ECC error to the error reports.
|
|
|
|
* ECC Error details are stored in ecc_status
|
|
|
|
*/
|
|
|
|
void ecc_error();
|
|
|
|
|
2020-05-24 15:30:55 -05:00
|
|
|
#if REPORT_PARITY_ERRORS
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Adds a parity error to the error reports.
|
|
|
|
*/
|
|
|
|
void parity_error(void);
|
|
|
|
#endif
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Refreshes the error display after the error mode is changed.
|
|
|
|
*/
|
|
|
|
void error_update(void);
|
|
|
|
|
|
|
|
#endif // ERROR_H
|