77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#endif
#ifdef OF_MORPHOS
const ULONG __abox__ = 1;
#endif
struct ExecBase *SysBase;
struct OFLibC libC;
#if defined(OF_AMIGAOS_M68K)
__asm__ (
".text\n"
".globl ___restore_a4\n"
".align 1\n"
"___restore_a4:\n"
|
>
|
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
#endif
#ifdef OF_MORPHOS
const ULONG __abox__ = 1;
#endif
struct ExecBase *SysBase;
struct OFLibC libC;
struct Library *ObjFWRTBase;
#if defined(OF_AMIGAOS_M68K)
__asm__ (
".text\n"
".globl ___restore_a4\n"
".align 1\n"
"___restore_a4:\n"
|
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
}
static void *
libNull(void)
{
return NULL;
}
bool
OFInit(unsigned int version, struct OFLibC *libC_)
{
#ifdef OF_AMIGAOS_M68K
OF_M68K_ARG(struct ObjFWBase *, base, a6)
#else
register struct ObjFWBase *r12 __asm__("r12");
struct ObjFWBase *base = r12;
#endif
#ifdef OF_MORPHOS
void *frame;
#endif
uintptr_t *iter, *iter0;
if (version > 1)
return false;
if (base->initialized)
return true;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
|
}
static void *
libNull(void)
{
return NULL;
}
static void __saveds
OFInitPart2(uintptr_t *iter0, struct Library *RTBase)
{
uintptr_t *iter;
ObjFWRTBase = RTBase;
for (iter = iter0; *iter != 0; iter++);
while (iter > iter0) {
void (*ctor)(void) = (void (*)(void))*--iter;
ctor();
}
}
bool
OFInit(unsigned int version, struct OFLibC *libC_, struct Library *RTBase)
{
#ifdef OF_AMIGAOS_M68K
OF_M68K_ARG(struct ObjFWBase *, base, a6)
#else
register struct ObjFWBase *r12 __asm__("r12");
struct ObjFWBase *base = r12;
#endif
#ifdef OF_MORPHOS
void *frame;
#endif
uintptr_t *iter0;
if (version > 1)
return false;
if (base->initialized)
return true;
|
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
"la %1, __CTOR_LIST__@l(%1)\n\t"
: "=r"(frame), "=r"(iter0)
);
libC.__register_frame(frame);
#endif
for (iter = iter0; *iter != 0; iter++);
while (iter > iter0) {
void (*ctor)(void) = (void (*)(void))*--iter;
ctor();
}
base->initialized = true;
return true;
}
void *
|
<
|
<
<
<
<
|
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
|
"la %1, __CTOR_LIST__@l(%1)\n\t"
: "=r"(frame), "=r"(iter0)
);
libC.__register_frame(frame);
#endif
OFInitPart2(iter0, RTBase);
base->initialized = true;
return true;
}
void *
|