summary refs log tree commit diff stats
path: root/hw/xtensa/bootparam.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-06-21 10:39:58 +0400
committerMax Filippov <jcmvbkbc@gmail.com>2014-06-29 02:32:41 +0400
commitb707ab757e66e05a8447b4efe15733b10659a3dd (patch)
tree89168327a350a038766e95c911742586c2d62834 /hw/xtensa/bootparam.h
parent37ed7c4b24f265c2a8c7248666544c9755514ec2 (diff)
downloadfocaccia-qemu-b707ab757e66e05a8447b4efe15733b10659a3dd.tar.gz
focaccia-qemu-b707ab757e66e05a8447b4efe15733b10659a3dd.zip
hw/xtensa: remove extraneous xtensa_ prefix from file names
While at it rename lx60 (named after the first board of the family) to
more generic xtfpga (the family name).

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'hw/xtensa/bootparam.h')
-rw-r--r--hw/xtensa/bootparam.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h
new file mode 100644
index 0000000000..38ef32bdb6
--- /dev/null
+++ b/hw/xtensa/bootparam.h
@@ -0,0 +1,25 @@
+#ifndef HW_XTENSA_BOOTPARAM
+#define HW_XTENSA_BOOTPARAM
+
+typedef struct BpTag {
+    uint16_t tag;
+    uint16_t size;
+} BpTag;
+
+static inline ram_addr_t put_tag(ram_addr_t addr, uint16_t tag,
+        size_t size, const void *data)
+{
+    BpTag bp_tag = {
+        .tag = tswap16(tag),
+        .size = tswap16((size + 3) & ~3),
+    };
+
+    cpu_physical_memory_write(addr, &bp_tag, sizeof(bp_tag));
+    addr += sizeof(bp_tag);
+    cpu_physical_memory_write(addr, data, size);
+    addr += (size + 3) & ~3;
+
+    return addr;
+}
+
+#endif