clean up _start(): it is now safe to call OS traps without inline assembly.

This commit is contained in:
Wolfgang Thaller 2014-09-29 21:43:25 +02:00
parent eb5d22bac5
commit e6df3abfe0

View File

@ -71,28 +71,12 @@ void _start()
SysEnvRec env; SysEnvRec env;
long bss_size; long bss_size;
Ptr bss;
env.processor = 0; env.processor = 0;
__asm__ __volatile__ ( SysEnvirons(0, &env);
"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"
);
bss_size = header->bss_end - header->data_end; bss_size = header->bss_end - header->data_end;
//Ptr bss = NewPtrClear(bss_size); 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"
);
long n = header->reloc_count; long n = header->reloc_count;
long *relocs = (long*)( (char*)header + header->reloc_start ); long *relocs = (long*)( (char*)header + header->reloc_start );
@ -116,7 +100,7 @@ void _start()
} }
if(env.processor >= env68040) if(env.processor >= env68040)
{ {
__asm__ __volatile__ ("dc.w 0xa0bd" : : : "%a0", "%a1", "%d0", "%d1", "%d2", "cc"); // FlushCache(); FlushCodeCache();
} }
{ {
char *p = (char*)&__init_section; char *p = (char*)&__init_section;