summaryrefslogtreecommitdiff
path: root/tools/intel_l3_parity.h
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2013-09-10 14:21:23 -0700
committerBen Widawsky <benjamin.widawsky@intel.com>2013-09-20 09:42:07 -0700
commit799aeb6d00881fc8f19b80ddf70f8b2b4c532f28 (patch)
tree84a0286b97eda54da3e0ec1189a418931e60780a /tools/intel_l3_parity.h
parentbfa7a5906d53a016b43eaa5592d91c1fb955daf7 (diff)
intel_l3_parity: Support a daemonic mode
v2: Add a comment explaining the dangers of directly accessing the DFT register (Daniel) Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tools/intel_l3_parity.h')
-rw-r--r--tools/intel_l3_parity.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/intel_l3_parity.h b/tools/intel_l3_parity.h
new file mode 100644
index 00000000..65697c4f
--- /dev/null
+++ b/tools/intel_l3_parity.h
@@ -0,0 +1,31 @@
+#ifndef INTEL_L3_PARITY_H_
+#define INTEL_L3_PARITY_H_
+
+#include <stdint.h>
+#include <stdbool.h>
+
+struct l3_parity {
+ struct udev *udev;
+ struct udev_monitor *uevent_monitor;
+ int fd;
+ fd_set fdset;
+};
+
+struct l3_location {
+ uint8_t slice;
+ uint16_t row;
+ uint8_t bank;
+ uint8_t subbank;
+};
+
+#if HAVE_UDEV
+int l3_uevent_setup(struct l3_parity *par);
+/* Listens (blocks) for an l3 parity event. Returns the location of the error. */
+int l3_listen(struct l3_parity *par, bool daemon, struct l3_location *loc);
+#define l3_uevent_teardown(par) {}
+#else
+#define l3_uevent_setup(par, daemon, loc) -1
+#define l3_listen(par) -1
+#endif
+
+#endif