diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-04-23 17:12:42 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-04-23 17:12:42 +0000 |
commit | 5fe141fd30d35516eac3674f7b62be51ba34543f (patch) | |
tree | 731317581b49ea6baa75544180a38bcfb64dc7fe /vl.c | |
parent | ce2f4b3cb9c1c542a6de6f0cdcd4771fe03a8bb6 (diff) |
generic ELF loader
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1831 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 29 |
1 files changed, 0 insertions, 29 deletions
@@ -332,35 +332,6 @@ int strstart(const char *str, const char *val, const char **ptr) return 1; } -/* return the size or -1 if error */ -int get_image_size(const char *filename) -{ - int fd, size; - fd = open(filename, O_RDONLY | O_BINARY); - if (fd < 0) - return -1; - size = lseek(fd, 0, SEEK_END); - close(fd); - return size; -} - -/* return the size or -1 if error */ -int load_image(const char *filename, uint8_t *addr) -{ - int fd, size; - fd = open(filename, O_RDONLY | O_BINARY); - if (fd < 0) - return -1; - size = lseek(fd, 0, SEEK_END); - lseek(fd, 0, SEEK_SET); - if (read(fd, addr, size) != size) { - close(fd); - return -1; - } - close(fd); - return size; -} - void cpu_outb(CPUState *env, int addr, int val) { #ifdef DEBUG_IOPORT |