143c143
< write_file(const char *filename)
---
> write_file(const char *filename, const char *host_filename)
161c161
< bytes += m5_write_file(buf, len, offset, filename);
---
> bytes += m5_write_file(buf, len, offset, host_filename);
227c227
< if (argc != 1)
---
> if (argc != 1 && argc != 2)
230a231
> const char *host_filename = (argc == 2) ? argv[1] : argv[0];
232c233
< write_file(filename);
---
> write_file(filename, host_filename);
347c348
< { "writefile", do_write_file, "<filename>" },
---
> { "writefile", do_write_file, "<filename> [host filename]" },