Revision 6f1f31c0 linux-user/main.c
b/linux-user/main.c | ||
---|---|---|
246 | 246 |
|
247 | 247 |
#ifdef TARGET_ARM |
248 | 248 |
|
249 |
/* XXX: find a better solution */ |
|
250 |
extern void tb_invalidate_page_range(target_ulong start, target_ulong end); |
|
251 |
|
|
252 |
static void arm_cache_flush(target_ulong start, target_ulong last) |
|
253 |
{ |
|
254 |
target_ulong addr, last1; |
|
255 |
|
|
256 |
if (last < start) |
|
257 |
return; |
|
258 |
addr = start; |
|
259 |
for(;;) { |
|
260 |
last1 = ((addr + TARGET_PAGE_SIZE) & TARGET_PAGE_MASK) - 1; |
|
261 |
if (last1 > last) |
|
262 |
last1 = last; |
|
263 |
tb_invalidate_page_range(addr, last1 + 1); |
|
264 |
if (last1 == last) |
|
265 |
break; |
|
266 |
addr = last1 + 1; |
|
267 |
} |
|
268 |
} |
|
269 |
|
|
249 | 270 |
void cpu_loop(CPUARMState *env) |
250 | 271 |
{ |
251 | 272 |
int trapnr; |
... | ... | |
281 | 302 |
/* system call */ |
282 | 303 |
insn = ldl((void *)(env->regs[15] - 4)); |
283 | 304 |
n = insn & 0xffffff; |
284 |
if (n >= ARM_SYSCALL_BASE) { |
|
305 |
if (n == ARM_NR_cacheflush) { |
|
306 |
arm_cache_flush(env->regs[0], env->regs[1]); |
|
307 |
} else if (n >= ARM_SYSCALL_BASE) { |
|
285 | 308 |
/* linux syscall */ |
286 | 309 |
n -= ARM_SYSCALL_BASE; |
287 | 310 |
env->regs[0] = do_syscall(env, |
... | ... | |
792 | 815 |
void usage(void) |
793 | 816 |
{ |
794 | 817 |
printf("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003 Fabrice Bellard\n" |
795 |
"usage: qemu-" TARGET_ARCH " [-h] [-d] [-L path] [-s size] program [arguments...]\n" |
|
818 |
"usage: qemu-" TARGET_ARCH " [-h] [-d opts] [-L path] [-s size] program [arguments...]\n"
|
|
796 | 819 |
"Linux CPU emulator (compiled for %s emulation)\n" |
797 | 820 |
"\n" |
798 | 821 |
"-h print this help\n" |
... | ... | |
803 | 826 |
#ifdef USE_CODE_COPY |
804 | 827 |
"-no-code-copy disable code copy acceleration\n" |
805 | 828 |
#endif |
806 |
"-d activate log (logfile=%s)\n"
|
|
829 |
"-d options activate log (logfile=%s)\n"
|
|
807 | 830 |
"-p pagesize set the host page size to 'pagesize'\n", |
808 | 831 |
TARGET_ARCH, |
809 | 832 |
interp_prefix, |
... | ... | |
850 | 873 |
} else if (!strcmp(r, "d")) { |
851 | 874 |
int mask; |
852 | 875 |
CPULogItem *item; |
876 |
|
|
877 |
if (optind >= argc) |
|
878 |
break; |
|
853 | 879 |
|
854 |
mask = cpu_str_to_log_mask(optarg); |
|
880 |
r = argv[optind++]; |
|
881 |
mask = cpu_str_to_log_mask(r); |
|
855 | 882 |
if (!mask) { |
856 | 883 |
printf("Log items (comma separated):\n"); |
857 | 884 |
for(item = cpu_log_items; item->mask != 0; item++) { |
Also available in: Unified diff