From e6df3abfe0a507318c787cd458b11afca8cdee87 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 29 Sep 2014 21:43:25 +0200 Subject: [PATCH] clean up _start(): it is now safe to call OS traps without inline assembly. --- libretro/start.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/libretro/start.c b/libretro/start.c index acd6a98a5e..a045ff9f74 100644 --- a/libretro/start.c +++ b/libretro/start.c @@ -71,28 +71,12 @@ void _start() SysEnvRec env; long bss_size; - Ptr bss; env.processor = 0; - __asm__ __volatile__ ( - "move.w #2, %%d0\n\t" // versionRequested - "lea %0, %%a0\n\t" // &env - "dc.w 0xa090\n\t" // _SysEnvirons - : - : "m"(env) - : "%a0", "%a1", "%d0", "%d1", "%d2", "memory", "cc" - ); - + SysEnvirons(0, &env); + bss_size = header->bss_end - header->data_end; - //Ptr bss = NewPtrClear(bss_size); - __asm__ __volatile__ ( - "move.l %1, %%d0\n\t" - "dc.w 0xa31e\n\t" // _NewPtrClear - "move.l %%a0 , %0\n\t" - : "=g"(bss) - : "g"(bss_size) - : "%a0", "%a1", "%d0", "%d1", "%d2", "memory", "cc" - ); + Ptr bss = NewPtrClear(bss_size); long n = header->reloc_count; long *relocs = (long*)( (char*)header + header->reloc_start ); @@ -116,7 +100,7 @@ void _start() } if(env.processor >= env68040) { - __asm__ __volatile__ ("dc.w 0xa0bd" : : : "%a0", "%a1", "%d0", "%d1", "%d2", "cc"); // FlushCache(); + FlushCodeCache(); } { char *p = (char*)&__init_section;