aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-06-20 13:43:27 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-06-20 13:43:27 +0000
commit7587cf44019d593bb12703e7046bd7738996c55c (patch)
treedd23aa84ab6f33037c5f6c5a165d25ffeaf22a8b /vl.c
parent70867490723b3a5b342f95ff9fa496376f0b0dd7 (diff)
accept bigger PC BIOSes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@946 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index fb073c24ac..b2ef506de8 100644
--- a/vl.c
+++ b/vl.c
@@ -291,6 +291,18 @@ char *pstrcat(char *buf, int buf_size, const char *s)
}
/* 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;