Merge branch 'spi/next' of git://git.secretlab.ca/git/linux-2.6
[linux-2.6.git] / drivers / edac / edac_mce.c
blob9ccdc5b140e775804a47c745022df5456d7acb5f
1 /* Provides edac interface to mcelog events
3 * This file may be distributed under the terms of the
4 * GNU General Public License version 2.
6 * Copyright (c) 2009 by:
7 * Mauro Carvalho Chehab <mchehab@redhat.com>
9 * Red Hat Inc. http://www.redhat.com
12 #include <linux/module.h>
13 #include <linux/edac_mce.h>
14 #include <asm/mce.h>
16 int edac_mce_enabled;
17 EXPORT_SYMBOL_GPL(edac_mce_enabled);
21 * Extension interface
24 static LIST_HEAD(edac_mce_list);
25 static DEFINE_MUTEX(edac_mce_lock);
27 int edac_mce_register(struct edac_mce *edac_mce)
29 mutex_lock(&edac_mce_lock);
30 list_add_tail(&edac_mce->list, &edac_mce_list);
31 mutex_unlock(&edac_mce_lock);
32 return 0;
34 EXPORT_SYMBOL(edac_mce_register);
36 void edac_mce_unregister(struct edac_mce *edac_mce)
38 mutex_lock(&edac_mce_lock);
39 list_del(&edac_mce->list);
40 mutex_unlock(&edac_mce_lock);
42 EXPORT_SYMBOL(edac_mce_unregister);
44 int edac_mce_parse(struct mce *mce)
46 struct edac_mce *edac_mce;
48 list_for_each_entry(edac_mce, &edac_mce_list, list) {
49 if (edac_mce->check_error(edac_mce->priv, mce))
50 return 1;
53 /* Nobody queued the error */
54 return 0;
56 EXPORT_SYMBOL_GPL(edac_mce_parse);
58 MODULE_LICENSE("GPL");
59 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
60 MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
61 MODULE_DESCRIPTION("EDAC Driver for mcelog captured errors");