linux/drivers/xen/mcelog.c

/******************************************************************************
 * mcelog.c
 * Driver for receiving and transferring machine check error infomation
 *
 * Copyright (c) 2012 Intel Corporation
 * Author: Liu, Jinsong <[email protected]>
 * Author: Jiang, Yunhong <[email protected]>
 * Author: Ke, Liping <[email protected]>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation; or, when distributed
 * separately from the Linux kernel or incorporated into other
 * software packages, subject to the following license:
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this source file (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy, modify,
 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#define pr_fmt(fmt)

#include <linux/init.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
#include <linux/uaccess.h>
#include <linux/capability.h>
#include <linux/poll.h>
#include <linux/sched.h>

#include <xen/interface/xen.h>
#include <xen/events.h>
#include <xen/interface/vcpu.h>
#include <xen/xen.h>
#include <asm/xen/hypercall.h>
#include <asm/xen/hypervisor.h>

static struct mc_info g_mi;
static struct mcinfo_logical_cpu *g_physinfo;
static uint32_t ncpus;

static DEFINE_MUTEX(mcelog_lock);

static struct xen_mce_log xen_mcelog =;

static DEFINE_SPINLOCK(xen_mce_chrdev_state_lock);
static int xen_mce_chrdev_open_count;	/* #times opened */
static int xen_mce_chrdev_open_exclu;	/* already open exclusive? */

static DECLARE_WAIT_QUEUE_HEAD(xen_mce_chrdev_wait);

static int xen_mce_chrdev_open(struct inode *inode, struct file *file)
{}

static int xen_mce_chrdev_release(struct inode *inode, struct file *file)
{}

static ssize_t xen_mce_chrdev_read(struct file *filp, char __user *ubuf,
				size_t usize, loff_t *off)
{}

static __poll_t xen_mce_chrdev_poll(struct file *file, poll_table *wait)
{}

static long xen_mce_chrdev_ioctl(struct file *f, unsigned int cmd,
				unsigned long arg)
{}

static const struct file_operations xen_mce_chrdev_ops =;

static struct miscdevice xen_mce_chrdev_device =;

/*
 * Caller should hold the mcelog_lock
 */
static void xen_mce_log(struct xen_mce *mce)
{}

static int convert_log(struct mc_info *mi)
{}

static int mc_queue_handle(uint32_t flags)
{}

/* virq handler for machine check error info*/
static void xen_mce_work_fn(struct work_struct *work)
{}
static DECLARE_WORK(xen_mce_work, xen_mce_work_fn);

static irqreturn_t xen_mce_interrupt(int irq, void *dev_id)
{}

static int bind_virq_for_mce(void)
{}

static int __init xen_late_init_mcelog(void)
{}
device_initcall(xen_late_init_mcelog);