aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-04-23 18:25:41 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-04-23 18:25:41 +0000
commita4f81979e8c82ea8fb9f3c96692b9c58c8e88e5a (patch)
treed7a0f82647ef2a6ed3c56e29d71722f5ada72022 /linux-user/main.c
parent89344d5ad7751010874300ff2b25953edcd6d3cb (diff)
ARM "Angel" semihosting syscalls (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1383 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 4d1f8ce88c..bcdf8441b8 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -363,6 +363,9 @@ void cpu_loop(CPUARMState *env)
n = insn & 0xffffff;
if (n == ARM_NR_cacheflush) {
arm_cache_flush(env->regs[0], env->regs[1]);
+ } else if (n == ARM_NR_semihosting
+ || n == ARM_NR_thumb_semihosting) {
+ env->regs[0] = do_arm_semihosting (env);
} else if (n >= ARM_SYSCALL_BASE) {
/* linux syscall */
n -= ARM_SYSCALL_BASE;
@@ -1207,6 +1210,10 @@ int main(int argc, char **argv)
env->regs[i] = regs->uregs[i];
}
env->cpsr = regs->uregs[16];
+ ts->stack_base = info->start_stack;
+ ts->heap_base = info->brk;
+ /* This will be filled in on the first SYS_HEAPINFO call. */
+ ts->heap_limit = 0;
}
#elif defined(TARGET_SPARC)
{