Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
edac.h File Reference
#include <linux/atomic.h>
#include <linux/device.h>
#include <linux/kobject.h>
#include <linux/completion.h>
#include <linux/workqueue.h>
#include <linux/debugfs.h>

Go to the source code of this file.

Data Structures

struct  edac_mc_layer
 
struct  dimm_info
 
struct  rank_info
 
struct  csrow_info
 
struct  errcount_attribute_data
 
struct  mem_ctl_info
 

Macros

#define EDAC_OPSTATE_INVAL   -1
 
#define EDAC_OPSTATE_POLL   0
 
#define EDAC_OPSTATE_NMI   1
 
#define EDAC_OPSTATE_INT   2
 
#define EDAC_MC_LABEL_LEN   31
 
#define MC_PROC_NAME_MAX_LEN   7
 
#define DEV_FLAG_UNKNOWN   BIT(DEV_UNKNOWN)
 
#define DEV_FLAG_X1   BIT(DEV_X1)
 
#define DEV_FLAG_X2   BIT(DEV_X2)
 
#define DEV_FLAG_X4   BIT(DEV_X4)
 
#define DEV_FLAG_X8   BIT(DEV_X8)
 
#define DEV_FLAG_X16   BIT(DEV_X16)
 
#define DEV_FLAG_X32   BIT(DEV_X32)
 
#define DEV_FLAG_X64   BIT(DEV_X64)
 
#define MEM_FLAG_EMPTY   BIT(MEM_EMPTY)
 
#define MEM_FLAG_RESERVED   BIT(MEM_RESERVED)
 
#define MEM_FLAG_UNKNOWN   BIT(MEM_UNKNOWN)
 
#define MEM_FLAG_FPM   BIT(MEM_FPM)
 
#define MEM_FLAG_EDO   BIT(MEM_EDO)
 
#define MEM_FLAG_BEDO   BIT(MEM_BEDO)
 
#define MEM_FLAG_SDR   BIT(MEM_SDR)
 
#define MEM_FLAG_RDR   BIT(MEM_RDR)
 
#define MEM_FLAG_DDR   BIT(MEM_DDR)
 
#define MEM_FLAG_RDDR   BIT(MEM_RDDR)
 
#define MEM_FLAG_RMBS   BIT(MEM_RMBS)
 
#define MEM_FLAG_DDR2   BIT(MEM_DDR2)
 
#define MEM_FLAG_FB_DDR2   BIT(MEM_FB_DDR2)
 
#define MEM_FLAG_RDDR2   BIT(MEM_RDDR2)
 
#define MEM_FLAG_XDR   BIT(MEM_XDR)
 
#define MEM_FLAG_DDR3   BIT(MEM_DDR3)
 
#define MEM_FLAG_RDDR3   BIT(MEM_RDDR3)
 
#define EDAC_FLAG_UNKNOWN   BIT(EDAC_UNKNOWN)
 
#define EDAC_FLAG_NONE   BIT(EDAC_NONE)
 
#define EDAC_FLAG_PARITY   BIT(EDAC_PARITY)
 
#define EDAC_FLAG_EC   BIT(EDAC_EC)
 
#define EDAC_FLAG_SECDED   BIT(EDAC_SECDED)
 
#define EDAC_FLAG_S2ECD2ED   BIT(EDAC_S2ECD2ED)
 
#define EDAC_FLAG_S4ECD4ED   BIT(EDAC_S4ECD4ED)
 
#define EDAC_FLAG_S8ECD8ED   BIT(EDAC_S8ECD8ED)
 
#define EDAC_FLAG_S16ECD16ED   BIT(EDAC_S16ECD16ED)
 
#define SCRUB_FLAG_SW_PROG   BIT(SCRUB_SW_PROG)
 
#define SCRUB_FLAG_SW_SRC   BIT(SCRUB_SW_SRC)
 
#define SCRUB_FLAG_SW_PROG_SRC   BIT(SCRUB_SW_PROG_SRC)
 
#define SCRUB_FLAG_SW_TUN   BIT(SCRUB_SW_SCRUB_TUNABLE)
 
#define SCRUB_FLAG_HW_PROG   BIT(SCRUB_HW_PROG)
 
#define SCRUB_FLAG_HW_SRC   BIT(SCRUB_HW_SRC)
 
#define SCRUB_FLAG_HW_PROG_SRC   BIT(SCRUB_HW_PROG_SRC)
 
#define SCRUB_FLAG_HW_TUN   BIT(SCRUB_HW_TUNABLE)
 
#define OP_ALLOC   0x100
 
#define OP_RUNNING_POLL   0x201
 
#define OP_RUNNING_INTERRUPT   0x202
 
#define OP_RUNNING_POLL_INTR   0x203
 
#define OP_OFFLINE   0x300
 
#define EDAC_MAX_LAYERS   3
 
#define EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2)
 
#define EDAC_DIMM_PTR(layers, var, nlayers, layer0, layer1, layer2)
 

Enumerations

enum  dev_type {
  DEV_UNKNOWN = 0, DEV_X1, DEV_X2, DEV_X4,
  DEV_X8, DEV_X16, DEV_X32, DEV_X64
}
 
enum  hw_event_mc_err_type { HW_EVENT_ERR_CORRECTED, HW_EVENT_ERR_UNCORRECTED, HW_EVENT_ERR_FATAL }
 
enum  mem_type {
  MEM_EMPTY = 0, MEM_RESERVED, MEM_UNKNOWN, MEM_FPM,
  MEM_EDO, MEM_BEDO, MEM_SDR, MEM_RDR,
  MEM_DDR, MEM_RDDR, MEM_RMBS, MEM_DDR2,
  MEM_FB_DDR2, MEM_RDDR2, MEM_XDR, MEM_DDR3,
  MEM_RDDR3
}
 
enum  edac_type {
  EDAC_UNKNOWN = 0, EDAC_NONE, EDAC_RESERVED, EDAC_PARITY,
  EDAC_EC, EDAC_SECDED, EDAC_S2ECD2ED, EDAC_S4ECD4ED,
  EDAC_S8ECD8ED, EDAC_S16ECD16ED
}
 
enum  scrub_type {
  SCRUB_UNKNOWN = 0, SCRUB_NONE, SCRUB_SW_PROG, SCRUB_SW_SRC,
  SCRUB_SW_PROG_SRC, SCRUB_SW_TUNABLE, SCRUB_HW_PROG, SCRUB_HW_SRC,
  SCRUB_HW_PROG_SRC, SCRUB_HW_TUNABLE
}
 
enum  edac_mc_layer_type { EDAC_MC_LAYER_BRANCH, EDAC_MC_LAYER_CHANNEL, EDAC_MC_LAYER_SLOT, EDAC_MC_LAYER_CHIP_SELECT }
 

Functions

int edac_handler_set (void)
 
void edac_atomic_assert_error (void)
 
struct bus_typeedac_get_sysfs_subsys (void)
 
void edac_put_sysfs_subsys (void)
 

Variables

int edac_op_state
 
int edac_err_assert
 
atomic_t edac_handlers
 
struct bus_type edac_subsys
 

Macro Definition Documentation

#define DEV_FLAG_UNKNOWN   BIT(DEV_UNKNOWN)

Definition at line 78 of file edac.h.

#define DEV_FLAG_X1   BIT(DEV_X1)

Definition at line 79 of file edac.h.

#define DEV_FLAG_X16   BIT(DEV_X16)

Definition at line 83 of file edac.h.

#define DEV_FLAG_X2   BIT(DEV_X2)

Definition at line 80 of file edac.h.

#define DEV_FLAG_X32   BIT(DEV_X32)

Definition at line 84 of file edac.h.

#define DEV_FLAG_X4   BIT(DEV_X4)

Definition at line 81 of file edac.h.

#define DEV_FLAG_X64   BIT(DEV_X64)

Definition at line 85 of file edac.h.

#define DEV_FLAG_X8   BIT(DEV_X8)

Definition at line 82 of file edac.h.

#define EDAC_DIMM_OFF (   layers,
  nlayers,
  layer0,
  layer1,
  layer2 
)
Value:
({ \
int __i; \
if ((nlayers) == 1) \
__i = layer0; \
else if ((nlayers) == 2) \
__i = (layer1) + ((layers[1]).size * (layer0)); \
else if ((nlayers) == 3) \
__i = (layer2) + ((layers[2]).size * ((layer1) + \
((layers[1]).size * (layer0)))); \
else \
__i = -EINVAL; \
__i; \
})

EDAC_DIMM_OFF - Macro responsible to get a pointer offset inside a pointer array for the element given by [layer0,layer1,layer2] position

: a struct edac_mc_layer array, describing how many elements were allocated for each layer : Number of layers at the array : layer0 position : layer1 position. Unused if n_layers < 2 : layer2 position. Unused if n_layers < 3

For 1 layer, this macro returns &var[layer0] - &var For 2 layers, this macro is similar to allocate a bi-dimensional array and to return "&var[layer0][layer1] - &var" For 3 layers, this macro is similar to allocate a tri-dimensional array and to return "&var[layer0][layer1][layer2] - &var"

A loop could be used here to make it more generic, but, as we only have 3 layers, this is a little faster. By design, layers can never be 0 or more than 3. If that ever happens, a NULL is returned, causing an OOPS during the memory allocation routine, with would point to the developer that he's doing something wrong.

Definition at line 437 of file edac.h.

#define EDAC_DIMM_PTR (   layers,
  var,
  nlayers,
  layer0,
  layer1,
  layer2 
)
Value:
({ \
typeof(*var) __p; \
int ___i = EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2); \
if (___i < 0) \
__p = NULL; \
else \
__p = (var)[___i]; \
__p; \
})

Definition at line 470 of file edac.h.

#define EDAC_FLAG_EC   BIT(EDAC_EC)

Definition at line 213 of file edac.h.

#define EDAC_FLAG_NONE   BIT(EDAC_NONE)

Definition at line 211 of file edac.h.

#define EDAC_FLAG_PARITY   BIT(EDAC_PARITY)

Definition at line 212 of file edac.h.

#define EDAC_FLAG_S16ECD16ED   BIT(EDAC_S16ECD16ED)

Definition at line 218 of file edac.h.

#define EDAC_FLAG_S2ECD2ED   BIT(EDAC_S2ECD2ED)

Definition at line 215 of file edac.h.

#define EDAC_FLAG_S4ECD4ED   BIT(EDAC_S4ECD4ED)

Definition at line 216 of file edac.h.

#define EDAC_FLAG_S8ECD8ED   BIT(EDAC_S8ECD8ED)

Definition at line 217 of file edac.h.

#define EDAC_FLAG_SECDED   BIT(EDAC_SECDED)

Definition at line 214 of file edac.h.

#define EDAC_FLAG_UNKNOWN   BIT(EDAC_UNKNOWN)

Definition at line 210 of file edac.h.

#define EDAC_MAX_LAYERS   3

Definition at line 412 of file edac.h.

#define EDAC_MC_LABEL_LEN   31

Definition at line 51 of file edac.h.

#define EDAC_OPSTATE_INT   2

Definition at line 27 of file edac.h.

#define EDAC_OPSTATE_INVAL   -1

Definition at line 24 of file edac.h.

#define EDAC_OPSTATE_NMI   1

Definition at line 26 of file edac.h.

#define EDAC_OPSTATE_POLL   0

Definition at line 25 of file edac.h.

#define MC_PROC_NAME_MAX_LEN   7

Definition at line 52 of file edac.h.

#define MEM_FLAG_BEDO   BIT(MEM_BEDO)

Definition at line 171 of file edac.h.

#define MEM_FLAG_DDR   BIT(MEM_DDR)

Definition at line 174 of file edac.h.

#define MEM_FLAG_DDR2   BIT(MEM_DDR2)

Definition at line 177 of file edac.h.

#define MEM_FLAG_DDR3   BIT(MEM_DDR3)

Definition at line 181 of file edac.h.

#define MEM_FLAG_EDO   BIT(MEM_EDO)

Definition at line 170 of file edac.h.

#define MEM_FLAG_EMPTY   BIT(MEM_EMPTY)

Definition at line 166 of file edac.h.

#define MEM_FLAG_FB_DDR2   BIT(MEM_FB_DDR2)

Definition at line 178 of file edac.h.

#define MEM_FLAG_FPM   BIT(MEM_FPM)

Definition at line 169 of file edac.h.

#define MEM_FLAG_RDDR   BIT(MEM_RDDR)

Definition at line 175 of file edac.h.

#define MEM_FLAG_RDDR2   BIT(MEM_RDDR2)

Definition at line 179 of file edac.h.

#define MEM_FLAG_RDDR3   BIT(MEM_RDDR3)

Definition at line 182 of file edac.h.

#define MEM_FLAG_RDR   BIT(MEM_RDR)

Definition at line 173 of file edac.h.

#define MEM_FLAG_RESERVED   BIT(MEM_RESERVED)

Definition at line 167 of file edac.h.

#define MEM_FLAG_RMBS   BIT(MEM_RMBS)

Definition at line 176 of file edac.h.

#define MEM_FLAG_SDR   BIT(MEM_SDR)

Definition at line 172 of file edac.h.

#define MEM_FLAG_UNKNOWN   BIT(MEM_UNKNOWN)

Definition at line 168 of file edac.h.

#define MEM_FLAG_XDR   BIT(MEM_XDR)

Definition at line 180 of file edac.h.

#define OP_ALLOC   0x100

Definition at line 258 of file edac.h.

#define OP_OFFLINE   0x300

Definition at line 262 of file edac.h.

#define OP_RUNNING_INTERRUPT   0x202

Definition at line 260 of file edac.h.

#define OP_RUNNING_POLL   0x201

Definition at line 259 of file edac.h.

#define OP_RUNNING_POLL_INTR   0x203

Definition at line 261 of file edac.h.

#define SCRUB_FLAG_HW_PROG   BIT(SCRUB_HW_PROG)

Definition at line 250 of file edac.h.

#define SCRUB_FLAG_HW_PROG_SRC   BIT(SCRUB_HW_PROG_SRC)

Definition at line 252 of file edac.h.

#define SCRUB_FLAG_HW_SRC   BIT(SCRUB_HW_SRC)

Definition at line 251 of file edac.h.

#define SCRUB_FLAG_HW_TUN   BIT(SCRUB_HW_TUNABLE)

Definition at line 253 of file edac.h.

#define SCRUB_FLAG_SW_PROG   BIT(SCRUB_SW_PROG)

Definition at line 246 of file edac.h.

#define SCRUB_FLAG_SW_PROG_SRC   BIT(SCRUB_SW_PROG_SRC)

Definition at line 248 of file edac.h.

#define SCRUB_FLAG_SW_SRC   BIT(SCRUB_SW_SRC)

Definition at line 247 of file edac.h.

#define SCRUB_FLAG_SW_TUN   BIT(SCRUB_SW_SCRUB_TUNABLE)

Definition at line 249 of file edac.h.

Enumeration Type Documentation

enum __u8 dev_type

enum dev_type - describe the type of memory DRAM chips used at the stick : Can't be determined, or MC doesn't support detect it : 1 bit for data : 2 bits for data : 4 bits for data : 8 bits for data : 16 bits for data : 32 bits for data : 64 bits for data

Typical values are x4 and x8.

Enumerator:
DEV_UNKNOWN 
DEV_X1 
DEV_X2 
DEV_X4 
DEV_X8 
DEV_X16 
DEV_X32 
DEV_X64 

Definition at line 67 of file edac.h.

enum edac_mc_layer - memory controller hierarchy layer

: memory layer is named "branch" : memory layer is named "channel" : memory layer is named "slot" : memory layer is named "chip select"

This enum is used by the drivers to tell edac_mc_sysfs what name should be used when describing a memory stick location.

Enumerator:
EDAC_MC_LAYER_BRANCH 
EDAC_MC_LAYER_CHANNEL 
EDAC_MC_LAYER_SLOT 
EDAC_MC_LAYER_CHIP_SELECT 

Definition at line 383 of file edac.h.

enum edac_type

enum edac-type - Error Detection and Correction capabilities and mode : Unknown if ECC is available : Doesn't support ECC : Reserved ECC type : Detects parity errors : Error Checking - no correction : Single bit error correction, Double detection : Chipkill x2 devices - do these exist? : Chipkill x4 devices : Chipkill x8 devices : Chipkill x16 devices

Enumerator:
EDAC_UNKNOWN 
EDAC_NONE 
EDAC_RESERVED 
EDAC_PARITY 
EDAC_EC 
EDAC_SECDED 
EDAC_S2ECD2ED 
EDAC_S4ECD4ED 
EDAC_S8ECD8ED 
EDAC_S16ECD16ED 

Definition at line 197 of file edac.h.

enum hw_event_mc_err_type - type of the detected error

: Corrected Error - Indicates that an ECC corrected error was detected : Uncorrected Error - Indicates an error that can't be corrected by ECC, but it is not fatal (maybe it is on an unused memory area, or the memory controller could recover from it for example, by re-trying the operation). : Fatal Error - Uncorrected error that could not be recovered.

Enumerator:
HW_EVENT_ERR_CORRECTED 
HW_EVENT_ERR_UNCORRECTED 
HW_EVENT_ERR_FATAL 

Definition at line 100 of file edac.h.

enum mem_type

enum mem_type - memory types. For a more detailed reference, please see http://en.wikipedia.org/wiki/DRAM

Empty csrow : Reserved csrow type : Unknown csrow type : FPM - Fast Page Mode, used on systems up to 1995. : EDO - Extended data out, used on systems up to 1998. : BEDO - Burst Extended data out, an EDO variant. : SDR - Single data rate SDRAM http://en.wikipedia.org/wiki/Synchronous_dynamic_random-access_memory They use 3 pins for chip select: Pins 0 and 2 are for rank 0; pins 1 and 3 are for rank 1, if the memory is dual-rank. : Registered SDR SDRAM : Double data rate SDRAM http://en.wikipedia.org/wiki/DDR_SDRAM : Registered Double data rate SDRAM This is a variant of the DDR memories. A registered memory has a buffer inside it, hiding part of the memory details to the memory controller. : Rambus DRAM, used on a few Pentium III/IV controllers. : DDR2 RAM, as described at JEDEC JESD79-2F. Those memories are labed as "PC2-" instead of "PC" to differenciate from DDR. : Fully-Buffered DDR2, as described at JEDEC Std No. 205 and JESD206. Those memories are accessed per DIMM slot, and not by a chip select signal. : Registered DDR2 RAM This is a variant of the DDR2 memories. : Rambus XDR It is an evolution of the original RAMBUS memories, created to compete with DDR2. Weren't used on any x86 arch, but cell_edac PPC memory controller uses it. : DDR3 RAM : Registered DDR3 RAM This is a variant of the DDR3 memories.

Enumerator:
MEM_EMPTY 
MEM_RESERVED 
MEM_UNKNOWN 
MEM_FPM 
MEM_EDO 
MEM_BEDO 
MEM_SDR 
MEM_RDR 
MEM_DDR 
MEM_RDDR 
MEM_RMBS 
MEM_DDR2 
MEM_FB_DDR2 
MEM_RDDR2 
MEM_XDR 
MEM_DDR3 
MEM_RDDR3 

Definition at line 146 of file edac.h.

enum scrub_type

enum scrub_type - scrubbing capabilities Unknown if scrubber is available : No scrubber : SW progressive (sequential) scrubbing : Software scrub only errors : Progressive software scrub from an error : Software scrub frequency is tunable : HW progressive (sequential) scrubbing : Hardware scrub only errors : Progressive hardware scrub from an error SCRUB_HW_TUNABLE: Hardware scrub frequency is tunable

Enumerator:
SCRUB_UNKNOWN 
SCRUB_NONE 
SCRUB_SW_PROG 
SCRUB_SW_SRC 
SCRUB_SW_PROG_SRC 
SCRUB_SW_TUNABLE 
SCRUB_HW_PROG 
SCRUB_HW_SRC 
SCRUB_HW_PROG_SRC 
SCRUB_HW_TUNABLE 

Definition at line 233 of file edac.h.

Function Documentation

void edac_atomic_assert_error ( void  )

Definition at line 48 of file edac_stub.c.

struct bus_type* edac_get_sysfs_subsys ( void  )
read

Definition at line 65 of file edac_stub.c.

int edac_handler_set ( void  )

Definition at line 36 of file edac_stub.c.

void edac_put_sysfs_subsys ( void  )

Definition at line 85 of file edac_stub.c.

Variable Documentation

int edac_err_assert

Definition at line 27 of file edac_stub.c.

atomic_t edac_handlers

Definition at line 24 of file edac_stub.c.

int edac_op_state

Definition at line 21 of file edac_stub.c.

struct bus_type edac_subsys

Definition at line 58 of file edac_stub.c.