Skip to contentSkip to conversation

loader.c: Add support Motrola S-record format.

PATCH New Yoshinori Sato 1 participant 1 message Aug 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loader.c: Add support Motrola S-record format.

Since the Renesas development environment may use the S-Record format, it is convenient to handle this as well as the HEX format.

---
 include/hw/loader.h |  14 +++
 hw/core/loader.c    | 212 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 226 insertions(+)
include/hw/loader.h +14 -0
index a9eeea3952..b6590f53b1 100644
@@ -55,6 +55,20 @@ int load_image_targphys_as(const char *filename,
  */
 int load_targphys_hex_as(const char *filename, hwaddr *entry, AddressSpace *as);
 
+/**
+ * load_targphys_srec_as:
+ * @filename: Path to the .hex file
+ * @entry: Store the entry point given by the .hex file
+ * @as: The AddressSpace to load the .hex file to. The value of
+ *      address_space_memory is used if nothing is supplied here.
+ *
+ * Load a fixed .srec file into memory.
+ *
+ * Returns the size of the loaded .hex file on success, -1 otherwise.
+ */
+int load_targphys_srec_as(const char *filename,
+                          hwaddr *entry, AddressSpace *as);
+
 /** load_image_targphys:
  * Same as load_image_targphys_as(), but doesn't allow the caller to specify
  * an AddressSpace.
hw/core/loader.c +212 -0

215 lines not on this page · raw message

Signature · 1 line
2.20.1