14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#import "ObjFWRT.h"
#import "private.h"
#include <exec/libraries.h>
#include <exec/nodes.h>
#include <exec/resident.h>
#include <proto/exec.h>
|
>
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#import "ObjFWRT.h"
#import "amiga-library.h"
#import "private.h"
#include <exec/libraries.h>
#include <exec/nodes.h>
#include <exec/resident.h>
#include <proto/exec.h>
|
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
extern id glue_objc_createTaggedPointer(void);
#ifdef OF_MORPHOS
const ULONG __abox__ = 1;
#endif
struct ExecBase *SysBase;
struct objc_libc libc;
FILE *stdout;
FILE *stderr;
#if defined(OF_AMIGAOS_M68K)
__asm__ (
".text\n"
".globl ___restore_a4\n"
".align 1\n"
"___restore_a4:\n"
|
|
<
|
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
extern id glue_objc_createTaggedPointer(void);
#ifdef OF_MORPHOS
const ULONG __abox__ = 1;
#endif
struct ExecBase *SysBase;
struct objc_libc libc;
FILE **__sF;
#if defined(OF_AMIGAOS_M68K)
__asm__ (
".text\n"
".globl ___restore_a4\n"
".align 1\n"
"___restore_a4:\n"
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
static void *
lib_null(void)
{
return NULL;
}
bool
objc_init(unsigned int version, struct objc_libc *libc_, FILE *stdout_,
FILE *stderr_)
{
#ifdef OF_AMIGAOS_M68K
OBJC_M68K_ARG(struct ObjFWRTBase *, base, a6)
#else
register struct ObjFWRTBase *r12 __asm__("r12");
struct ObjFWRTBase *base = r12;
#endif
#ifdef OF_MORPHOS
void *frame;
#endif
uintptr_t *iter, *iter0;
if (version > 1)
return false;
memcpy(&libc, libc_, sizeof(libc));
stdout = stdout_;
stderr = stderr_;
#ifdef OF_AMIGAOS_M68K
if ((size_t)_EH_FRAME_BEGINS__ != (size_t)_EH_FRAME_OBJECTS__)
return false;
for (size_t i = 1; i <= (size_t)_EH_FRAME_BEGINS__; i++)
libc.__register_frame_info((&_EH_FRAME_BEGINS__)[i],
|
|
<
>
>
>
|
<
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
|
static void *
lib_null(void)
{
return NULL;
}
bool
objc_init(unsigned int version, struct objc_libc *libc_, FILE **sF)
{
#ifdef OF_AMIGAOS_M68K
OBJC_M68K_ARG(struct ObjFWRTBase *, base, a6)
#else
register struct ObjFWRTBase *r12 __asm__("r12");
struct ObjFWRTBase *base = r12;
#endif
#ifdef OF_MORPHOS
void *frame;
#endif
uintptr_t *iter, *iter0;
if (version > 1)
return false;
if (base->initialized)
return true;
memcpy(&libc, libc_, sizeof(libc));
__sF = sF;
#ifdef OF_AMIGAOS_M68K
if ((size_t)_EH_FRAME_BEGINS__ != (size_t)_EH_FRAME_OBJECTS__)
return false;
for (size_t i = 1; i <= (size_t)_EH_FRAME_BEGINS__; i++)
libc.__register_frame_info((&_EH_FRAME_BEGINS__)[i],
|
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
|
#endif
,
.rt_Version = OBJFWRT_LIB_MAJOR,
.rt_Type = NT_LIBRARY,
.rt_Pri = 0,
.rt_Name = (char *)OBJFWRT_AMIGA_LIB,
.rt_IdString = (char *)"ObjFWRT " VERSION_STRING
" \xA9 2008-2019 Jonathan Schleifer",
.rt_Init = &init_table,
#ifdef OF_MORPHOS
.rt_Revision = OBJFWRT_LIB_MINOR,
.rt_Tags = NULL,
#endif
};
|
|
|
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
|
#endif
,
.rt_Version = OBJFWRT_LIB_MAJOR,
.rt_Type = NT_LIBRARY,
.rt_Pri = 0,
.rt_Name = (char *)OBJFWRT_AMIGA_LIB,
.rt_IdString = (char *)"ObjFWRT " VERSION_STRING
" \xA9 2008-2020 Jonathan Schleifer",
.rt_Init = &init_table,
#ifdef OF_MORPHOS
.rt_Revision = OBJFWRT_LIB_MINOR,
.rt_Tags = NULL,
#endif
};
|