kbuild: create a way to create preprocessor constants from C expressions
[linux-block.git] / kernel / bounds.c
diff --git a/kernel/bounds.c b/kernel/bounds.c
new file mode 100644 (file)
index 0000000..85bb281
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Generate definitions needed by the preprocessor.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+
+#define __GENERATING_BOUNDS_H
+/* Include headers that define the enum constants of interest */
+
+#define DEFINE(sym, val) \
+        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+
+#define BLANK() asm volatile("\n->" : : )
+
+void foo(void)
+{
+       /* The enum constants to put into include/linux/bounds.h */
+       /* End of constants */
+}