summaryrefslogtreecommitdiff
path: root/linux-user/qemu.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2010-07-27 10:25:30 -0700
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-07-29 08:32:28 +0200
commit9955ffac9a31aad346fe7f0fcefebe88da7f9df5 (patch)
tree6717fb9286c007302a39846fd6ecb4be088c0f18 /linux-user/qemu.h
parentd97ef72eed202460a13dfe4a92fd95ac9e6ddf11 (diff)
downloadqemu-9955ffac9a31aad346fe7f0fcefebe88da7f9df5.tar.gz
linux-user: Reduce lseek+reads while loading elf files.
Define BPRM_BUF_SIZE to 1k and read that amount initially. If the data we want from the binary is in this buffer, use it instead of reading from the file again. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'linux-user/qemu.h')
-rw-r--r--linux-user/qemu.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 1878d5a61e..794fe49133 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -31,6 +31,7 @@
* task_struct fields in the kernel
*/
struct image_info {
+ abi_ulong load_bias;
abi_ulong load_addr;
abi_ulong start_code;
abi_ulong end_code;
@@ -144,12 +145,16 @@ extern unsigned long mmap_min_addr;
*/
#define MAX_ARG_PAGES 33
+/* Read a good amount of data initially, to hopefully get all the
+ program headers loaded. */
+#define BPRM_BUF_SIZE 1024
+
/*
* This structure is used to hold the arguments that are
* used when loading binaries.
*/
struct linux_binprm {
- char buf[128];
+ char buf[BPRM_BUF_SIZE] __attribute__((aligned));
void *page[MAX_ARG_PAGES];
abi_ulong p;
int fd;