Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add arm sysarch() support.

  • Loading branch information...
commit 7c739e0261c983947e1af4796d753b36d5e51237 1 parent 087c41c
staceyson authored

Showing 1 changed file with 21 additions and 6 deletions. Show diff stats Hide diff stats

  1. +21 6 work/qemu-1.4.0/bsd-user/syscall.c
27 work/qemu-1.4.0/bsd-user/syscall.c
@@ -348,30 +348,45 @@ static abi_long do_freebsd_sysarch(void *env, int op, abi_ulong parms)
348 348 #ifdef TARGET_ARM
349 349 static abi_long do_freebsd_sysarch(void *env, int op, abi_ulong parms)
350 350 {
  351 + int ret = 0;
351 352
352 353 switch (op) {
  354 + case TARGET_FREEBSD_ARM_SYNC_ICACHE:
  355 + case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF:
  356 + break;
  357 +
353 358 case TARGET_FREEBSD_ARM_SET_TP:
354 359 cpu_set_tls(env, parms);
355   - return 0;
  360 + break;
  361 +
  362 + case TARGET_FREEBSD_ARM_GET_TP:
  363 + /* XXX Need a cpu_get_tls() */
  364 + if (put_user(env->cp15.c13_tls2, params, abi_ulong))
  365 + ret = -TARGET_EFAULT;
  366 + break;
  367 +
  368 + default:
  369 + ret = -TARGET_EINVAL;
  370 + break;
356 371 }
357 372
358   - return -TARGET_EINVAL;
  373 + return (ret);
359 374 }
360 375 #endif
361 376
362 377 #ifdef TARGET_MIPS
363   -static abi_long do_freebsd_sysarch(void *env, int op, abi_ulong parms)
  378 +static abi_long do_freebsd_sysarch(CPUMIPSState *env, int op, abi_ulong parms)
364 379 {
365 380 int ret = 0;
366   - CPUMIPSState *mips_env = (CPUMIPSState *)env;
367 381
368 382 switch(op) {
369 383 case TARGET_MIPS_SET_TLS:
370   - mips_env->tls_value = parms;
  384 + cpu_set_tls(env, parms);
371 385 break;
372 386
373 387 case TARGET_MIPS_GET_TLS:
374   - if (put_user(mips_env->tls_value, parms, abi_ulong))
  388 + /* XXX Need a cpu_get_tls() */
  389 + if (put_user(env->tls_value, parms, abi_ulong))
375 390 ret = -TARGET_EFAULT;
376 391 break;
377 392 default:

0 comments on commit 7c739e0

Please sign in to comment.
Something went wrong with that request. Please try again.