linux/drivers/edac/skx_common.c

// SPDX-License-Identifier: GPL-2.0
/*
 *
 * Shared code by both skx_edac and i10nm_edac. Originally split out
 * from the skx_edac driver.
 *
 * This file is linked into both skx_edac and i10nm_edac drivers. In
 * order to avoid link errors, this file must be like a pure library
 * without including symbols and defines which would otherwise conflict,
 * when linked once into a module and into a built-in object, at the
 * same time. For example, __this_module symbol references when that
 * file is being linked into a built-in object.
 *
 * Copyright (c) 2018, Intel Corporation.
 */

#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/adxl.h>
#include <acpi/nfit.h>
#include <asm/mce.h>
#include "edac_module.h"
#include "skx_common.h"

static const char * const component_names[] =;

static int component_indices[ARRAY_SIZE(component_names)];
static int adxl_component_count;
static const char * const *adxl_component_names;
static u64 *adxl_values;
static char *adxl_msg;
static unsigned long adxl_nm_bitmap;

static char skx_msg[MSG_SIZE];
static skx_decode_f driver_decode;
static skx_show_retry_log_f skx_show_retry_rd_err_log;
static u64 skx_tolm, skx_tohm;
static LIST_HEAD(dev_edac_list);
static bool skx_mem_cfg_2lm;

int skx_adxl_get(void)
{}
EXPORT_SYMBOL_GPL();

void skx_adxl_put(void)
{}
EXPORT_SYMBOL_GPL();

static bool skx_adxl_decode(struct decoded_addr *res, bool error_in_1st_level_mem)
{}

void skx_set_mem_cfg(bool mem_cfg_2lm)
{}
EXPORT_SYMBOL_GPL();

void skx_set_decode(skx_decode_f decode, skx_show_retry_log_f show_retry_log)
{}
EXPORT_SYMBOL_GPL();

int skx_get_src_id(struct skx_dev *d, int off, u8 *id)
{}
EXPORT_SYMBOL_GPL();

int skx_get_node_id(struct skx_dev *d, u8 *id)
{}
EXPORT_SYMBOL_GPL();

static int get_width(u32 mtr)
{}

/*
 * We use the per-socket device @cfg->did to count how many sockets are present,
 * and to detemine which PCI buses are associated with each socket. Allocate
 * and build the full list of all the skx_dev structures that we need here.
 */
int skx_get_all_bus_mappings(struct res_config *cfg, struct list_head **list)
{}
EXPORT_SYMBOL_GPL();

int skx_get_hi_lo(unsigned int did, int off[], u64 *tolm, u64 *tohm)
{}
EXPORT_SYMBOL_GPL();

static int skx_get_dimm_attr(u32 reg, int lobit, int hibit, int add,
			     int minval, int maxval, const char *name)
{}

#define numrank(reg)
#define numrow(reg)
#define numcol(reg)

int skx_get_dimm_info(u32 mtr, u32 mcmtr, u32 amap, struct dimm_info *dimm,
		      struct skx_imc *imc, int chan, int dimmno,
		      struct res_config *cfg)
{}
EXPORT_SYMBOL_GPL();

int skx_get_nvdimm_info(struct dimm_info *dimm, struct skx_imc *imc,
			int chan, int dimmno, const char *mod_str)
{}
EXPORT_SYMBOL_GPL();

int skx_register_mci(struct skx_imc *imc, struct pci_dev *pdev,
		     const char *ctl_name, const char *mod_str,
		     get_dimm_config_f get_dimm_config,
		     struct res_config *cfg)
{}
EXPORT_SYMBOL_GPL();

static void skx_unregister_mci(struct skx_imc *imc)
{}

static void skx_mce_output_error(struct mem_ctl_info *mci,
				 const struct mce *m,
				 struct decoded_addr *res)
{}

static bool skx_error_in_1st_level_mem(const struct mce *m)
{}

static bool skx_error_in_mem(const struct mce *m)
{}

int skx_mce_check_error(struct notifier_block *nb, unsigned long val,
			void *data)
{}
EXPORT_SYMBOL_GPL();

void skx_remove(void)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_EDAC_DEBUG
/*
 * Debug feature.
 * Exercise the address decode logic by writing an address to
 * /sys/kernel/debug/edac/{skx,i10nm}_test/addr.
 */
static struct dentry *skx_test;

static int debugfs_u64_set(void *data, u64 val)
{}
DEFINE_SIMPLE_ATTRIBUTE();

void skx_setup_debug(const char *name)
{}
EXPORT_SYMBOL_GPL();

void skx_teardown_debug(void)
{}
EXPORT_SYMBOL_GPL();
#endif /*CONFIG_EDAC_DEBUG*/

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();