aboutsummaryrefslogtreecommitdiffstats
path: root/templates/headers.h.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/headers.h.tmpl')
-rw-r--r--templates/headers.h.tmpl20
1 files changed, 20 insertions, 0 deletions
diff --git a/templates/headers.h.tmpl b/templates/headers.h.tmpl
new file mode 100644
index 0000000..ad6a0f7
--- /dev/null
+++ b/templates/headers.h.tmpl
@@ -0,0 +1,20 @@
+#ifndef {{ name.upper() }}_MAP_H
+#define {{ name.upper() }}_MAP_H
+
+/* {{ name }} Memory Map Structs */
+
+/* WARNING: Currently assumes perfect packing */
+
+{% for sec_name, values in sections.iteritems() %}
+typedef struct {
+{% for val in values %}
+ {{ val.ctype() }} {{ val.slug }};
+{% endfor %}
+} {{ name }}_{{ sec_name }}_map;
+#define {{ name }}_{{ sec_name }}_offset {{ values[0].addr_pp() }}
+/* Usage (?)
+ * void *uint32_t {{ name }}_{{ sec_name }}_map...
+ */
+{% endfor %}
+
+#endif