summaryrefslogtreecommitdiff
path: root/bsd-user/elfload.c
diff options
context:
space:
mode:
authorJuergen Lock <nox@jelal.kn-bremen.de>2009-10-17 00:34:26 +0200
committerBlue Swirl <blauwirbel@gmail.com>2009-10-18 15:16:08 +0000
commit78cfb07fe0dc556cae662a0fab5fe1bd33daabdb (patch)
tree9d8123e0e1875cfbd1ba7544122f31b4519e7e80 /bsd-user/elfload.c
parent976b2037e5eaa7dc18ca7062c9276ec03aaa37a9 (diff)
downloadqemu-78cfb07fe0dc556cae662a0fab5fe1bd33daabdb.tar.gz
qemu-78cfb07fe0dc556cae662a0fab5fe1bd33daabdb.tar.bz2
qemu-78cfb07fe0dc556cae662a0fab5fe1bd33daabdb.zip
bsd-user: FreeBSD update
basic FreeBSD sysarch(2) handling fixed syscall errno return Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'bsd-user/elfload.c')
-rw-r--r--bsd-user/elfload.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 8ac14b795e..7374912b19 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -126,6 +126,9 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
regs->rax = 0;
regs->rsp = infop->start_stack;
regs->rip = infop->entry;
+ if (bsd_type == target_freebsd) {
+ regs->rdi = infop->start_stack;
+ }
}
#else
@@ -249,8 +252,13 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
#else
if (personality(infop->personality) == PER_LINUX32)
regs->u_regs[14] = infop->start_stack - 16 * 4;
- else
+ else {
regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS;
+ if (bsd_type == target_freebsd) {
+ regs->u_regs[8] = infop->start_stack;
+ regs->u_regs[11] = infop->start_stack;
+ }
+ }
#endif
}