Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/sysctl.h>
#include <linux/highmem.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/ctype.h>
#include <linux/edac.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <asm/page.h>
#include <asm/edac.h>
#include "edac_core.h"
#include "edac_module.h"
#include <ras/ras_event.h>
Go to the source code of this file.
Macros | |
#define | CREATE_TRACE_POINTS |
#define | TRACE_INCLUDE_PATH ../../include/ras |
#define | OTHER_LABEL " or " |
Variables | |
const char * | edac_mem_types [] |
const char * | edac_layer_name [] |
edac_align_ptr - Prepares the pointer offsets for a single-shot allocation : pointer to a pointer with the memory offset to be used. At return, this will be incremented to point to the next offset : Size of the data structure to be reserved : Number of elements that should be reserved
If 'size' is a constant, the compiler will optimize this whole function down to either a no-op or the addition of a constant to the value of '*p'.
The 'p' pointer is absolutely needed to keep the proper advancing further in memory to the proper offsets when allocating the struct along with its embedded structs, as edac_device_alloc_ctl_info() does it above, for example.
At return, the pointer 'p' will be incremented to be used on a next call to this function.
int edac_mc_add_mc | ( | struct mem_ctl_info * | mci | ) |
|
read |
edac_mc_alloc: Allocate and partially fill a struct mem_ctl_info structure : Memory controller number : Number of MC hierarchy layers layers: Describes each layer as seen by the Memory Controller : size of private storage needed
Everything is kmalloc'ed as one big chunk - more efficient. Only can be used if all structures have the same lifetime - otherwise you have to allocate and initialize your own structures.
Use edac_mc_free() to free mc structures allocated by this function.
NOTE: drivers handle multi-rank memories in different ways: in some drivers, one multi-rank memory stick is mapped as one entry, while, in others, a single multi-rank memory stick would be mapped into several entries. Currently, this function will allocate multiple struct dimm_info on such scenarios, as grouping the multiple ranks require drivers change.
Returns: On failure: NULL On success: struct mem_ctl_info pointer
|
read |
|
read |
edac_mc_find: Search for a mem_ctl_info structure whose index is 'idx'.
If found, return a pointer to the structure. Else return NULL.
Caller must hold mem_ctls_mutex.
int edac_mc_find_csrow_by_page | ( | struct mem_ctl_info * | mci, |
unsigned long | page | ||
) |
void edac_mc_free | ( | struct mem_ctl_info * | mci | ) |
edac_mc_free 'Free' a previously allocated 'mci' structure : pointer to a struct mem_ctl_info structure
void edac_mc_handle_error | ( | const enum hw_event_mc_err_type | type, |
struct mem_ctl_info * | mci, | ||
const u16 | error_count, | ||
const unsigned long | page_frame_number, | ||
const unsigned long | offset_in_page, | ||
const unsigned long | syndrome, | ||
const int | top_layer, | ||
const int | mid_layer, | ||
const int | low_layer, | ||
const char * | msg, | ||
const char * | other_detail | ||
) |
edac_mc_handle_error - reports a memory event to userspace
: severity of the error (CE/UE/Fatal) : a struct mem_ctl_info pointer : Number of errors of the same type : mem page where the error occurred : offset of the error inside the page : ECC syndrome : Memory layer[0] position : Memory layer[1] position : Memory layer[2] position : Message meaningful to the end users that explains the event : Technical details about the event that may help hardware manufacturers and EDAC developers to analyse the event
EXPORT_SYMBOL | ( | edac_mc_find | ) |
EXPORT_SYMBOL_GPL | ( | edac_mem_types | ) |
EXPORT_SYMBOL_GPL | ( | edac_mc_alloc | ) |
EXPORT_SYMBOL_GPL | ( | edac_mc_free | ) |
EXPORT_SYMBOL_GPL | ( | find_mci_by_dev | ) |
EXPORT_SYMBOL_GPL | ( | edac_mc_add_mc | ) |
EXPORT_SYMBOL_GPL | ( | edac_mc_del_mc | ) |
EXPORT_SYMBOL_GPL | ( | edac_mc_find_csrow_by_page | ) |
EXPORT_SYMBOL_GPL | ( | edac_layer_name | ) |
EXPORT_SYMBOL_GPL | ( | edac_mc_handle_error | ) |
|
read |