Commit c69810559ba962ad5da4ae6b9069ee6159d2efd1

Authored by bellard
1 parent 28c4f361

arm nwfpe support - added code no-code-copy option - __preinit_array_start bug fix (untested)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@612 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 31 additions and 6 deletions
linux-user/main.c
... ... @@ -39,6 +39,8 @@ const char interp[] __attribute__((section(".interp"))) = "/lib/ld-linux.so.2";
39 39 /* for recent libc, we add these dummy symbols which are not declared
40 40 when generating a linked object (bug in ld ?) */
41 41 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
  42 +long __preinit_array_start[0];
  43 +long __preinit_array_end[0];
42 44 long __init_array_start[0];
43 45 long __init_array_end[0];
44 46 long __fini_array_start[0];
... ... @@ -254,11 +256,25 @@ void cpu_loop(CPUARMState *env)
254 256 trapnr = cpu_arm_exec(env);
255 257 switch(trapnr) {
256 258 case EXCP_UDEF:
257   - info.si_signo = SIGILL;
258   - info.si_errno = 0;
259   - info.si_code = TARGET_ILL_ILLOPN;
260   - info._sifields._sigfault._addr = env->regs[15];
261   - queue_signal(info.si_signo, &info);
  259 + {
  260 + TaskState *ts = env->opaque;
  261 + uint32_t opcode;
  262 +
  263 + /* we handle the FPU emulation here, as Linux */
  264 + /* we get the opcode */
  265 + opcode = ldl_raw((uint8_t *)env->regs[15]);
  266 +
  267 + if (EmulateAll(opcode, &ts->fpa, env->regs) == 0) {
  268 + info.si_signo = SIGILL;
  269 + info.si_errno = 0;
  270 + info.si_code = TARGET_ILL_ILLOPN;
  271 + info._sifields._sigfault._addr = env->regs[15];
  272 + queue_signal(info.si_signo, &info);
  273 + } else {
  274 + /* increment PC */
  275 + env->regs[15] += 4;
  276 + }
  277 + }
262 278 break;
263 279 case EXCP_SWI:
264 280 {
... ... @@ -783,6 +799,9 @@ void usage(void)
783 799 "-s size set the stack size in bytes (default=%ld)\n"
784 800 "\n"
785 801 "debug options:\n"
  802 +#ifdef USE_CODE_COPY
  803 + "-no-code-copy disable code copy acceleration\n"
  804 +#endif
786 805 "-d activate log (logfile=%s)\n"
787 806 "-p pagesize set the host page size to 'pagesize'\n",
788 807 TARGET_ARCH,
... ... @@ -847,7 +866,13 @@ int main(int argc, char **argv)
847 866 fprintf(stderr, "page size must be a power of two\n");
848 867 exit(1);
849 868 }
850   - } else {
  869 + } else
  870 +#ifdef USE_CODE_COPY
  871 + if (!strcmp(r, "no-code-copy")) {
  872 + code_copy_enabled = 0;
  873 + } else
  874 +#endif
  875 + {
851 876 usage();
852 877 }
853 878 }
... ...