diff options
author | James Clarke <jrtc27@jrtc27.com> | 2020-01-31 20:57:51 +0000 |
---|---|---|
committer | James Clarke <jrtc27@jrtc27.com> | 2020-01-31 20:57:51 +0000 |
commit | 725a0190770b0094f18d0fdc22660fa6845841f7 (patch) | |
tree | ac5fbaccc655ef86be0ba401a423bb4dfea3517c /fesvr/htif.h | |
parent | c050d113fe4d5a0554b9ece58aa352a065e6a70c (diff) | |
download | spike-725a0190770b0094f18d0fdc22660fa6845841f7.zip spike-725a0190770b0094f18d0fdc22660fa6845841f7.tar.gz spike-725a0190770b0094f18d0fdc22660fa6845841f7.tar.bz2 |
Support loading multiple ELF files via a new payload HTIF option
Firmware implementations, such as OpenSBI's fw_jump, make use of this
feature on other targets to avoid having to be rebuilt every time the
payload is updated.
Diffstat (limited to 'fesvr/htif.h')
-rw-r--r-- | fesvr/htif.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fesvr/htif.h b/fesvr/htif.h index cc1e320..d69bd42 100644 --- a/fesvr/htif.h +++ b/fesvr/htif.h @@ -7,6 +7,7 @@ #include "syscall.h" #include "device.h" #include <string.h> +#include <map> #include <vector> class htif_t : public chunked_memif_t @@ -36,6 +37,7 @@ class htif_t : public chunked_memif_t virtual size_t chunk_align() = 0; virtual size_t chunk_max_size() = 0; + virtual std::map<std::string, uint64_t> load_payload(const std::string& payload, reg_t* entry); virtual void load_program(); virtual void idle() {} @@ -69,6 +71,7 @@ class htif_t : public chunked_memif_t syscall_t syscall_proxy; bcd_t bcd; std::vector<device_t*> dynamic_devices; + std::vector<std::string> payloads; const std::vector<std::string>& target_args() { return targs; } @@ -94,6 +97,8 @@ class htif_t : public chunked_memif_t +signature=FILE\n\ --chroot=PATH Use PATH as location of syscall-servicing binaries\n\ +chroot=PATH\n\ + --payload=PATH Load PATH memory as an additional ELF payload\n\ + +payload=PATH\n\ \n\ HOST OPTIONS (currently unsupported)\n\ --disk=DISK Add DISK device. Use a ramdisk since this isn't\n\ @@ -110,6 +115,7 @@ TARGET (RISC-V BINARY) OPTIONS\n\ {"disk", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 1 }, \ {"signature", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 2 }, \ {"chroot", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 3 }, \ +{"payload", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 4 }, \ {0, 0, 0, 0} #endif // __HTIF_H |