2020-05-24 15:30:55 -05:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef BADRAM_H
|
|
|
|
#define BADRAM_H
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
|
|
|
* \file
|
2020-05-24 15:30:55 -05:00
|
|
|
*
|
2022-02-19 10:17:40 -06:00
|
|
|
* Provides functions for generating patterns for the Linux kernel BadRAM extension.
|
|
|
|
*
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Initialises the pattern array.
|
|
|
|
*/
|
|
|
|
void badram_init(void);
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Inserts a single faulty address into the pattern array. Returns
|
|
|
|
* true iff the array was changed.
|
|
|
|
*/
|
|
|
|
bool badram_insert(uintptr_t addr);
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Displays the pattern array in the scrollable display region in the
|
|
|
|
* format used by the Linux kernel.
|
|
|
|
*/
|
|
|
|
void badram_display(void);
|
|
|
|
|
|
|
|
#endif // BADRAM_H
|