#include <linux/kernel.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <asm/mce.h>
#include <asm/cpu_device_id.h>
#include <asm/traps.h>
#include <asm/insn.h>
#include <asm/insn-eval.h>
#include "internal.h"
enum context { … };
enum ser { … };
enum exception { … };
static struct severity { … } severities[] = …;
#define mc_recoverable(mcg) …
static bool is_copy_from_user(struct pt_regs *regs)
{ … }
static noinstr int error_context(struct mce *m, struct pt_regs *regs)
{ … }
static noinstr int mce_severity_amd(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{ … }
static noinstr int mce_severity_intel(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{ … }
int noinstr mce_severity(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{ … }
#ifdef CONFIG_DEBUG_FS
static void *s_start(struct seq_file *f, loff_t *pos)
{ … }
static void *s_next(struct seq_file *f, void *data, loff_t *pos)
{ … }
static void s_stop(struct seq_file *f, void *data)
{ … }
static int s_show(struct seq_file *f, void *data)
{ … }
static const struct seq_operations severities_seq_ops = …;
static int severities_coverage_open(struct inode *inode, struct file *file)
{ … }
static ssize_t severities_coverage_write(struct file *file,
const char __user *ubuf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations severities_coverage_fops = …;
static int __init severities_debugfs_init(void)
{ … }
late_initcall(severities_debugfs_init);
#endif