From 78cfb07fe0dc556cae662a0fab5fe1bd33daabdb Mon Sep 17 00:00:00 2001 From: Juergen Lock Date: Sat, 17 Oct 2009 00:34:26 +0200 Subject: bsd-user: FreeBSD update basic FreeBSD sysarch(2) handling fixed syscall errno return Signed-off-by: Juergen Lock Signed-off-by: Blue Swirl --- bsd-user/elfload.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bsd-user/elfload.c') 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 } -- cgit v1.2.3