2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Open a file with the specified mode.
9 #include <aros/debug.h>
10 #include <exec/memory.h>
11 #include <exec/lists.h>
12 #include <proto/exec.h>
13 #include <utility/tagitem.h>
14 #include <dos/dosextens.h>
15 #include <dos/stdio.h>
16 #include <proto/dos.h>
17 #include <proto/utility.h>
19 #include "dos_intern.h"
22 extern void BCPL_thunk(void);
23 #define __is_process(task) (((struct Task *)task)->tc_Node.ln_Type == NT_PROCESS)
25 #include <proto/dos.h>
27 /* See rom/dos/callglobvec.c for documentation */
29 AROS_UFH5(LONG
, CallGlobVec
,
30 AROS_UFHA(LONG
, function
, D0
),
31 AROS_UFHA(LONG
, d1
, D1
),
32 AROS_UFHA(LONG
, d2
, D2
),
33 AROS_UFHA(LONG
, d3
, D3
),
34 AROS_UFHA(LONG
, d4
, D4
))
38 struct Process
*me
= (struct Process
*)FindTask(NULL
);
42 D(bug("%s: 0x%d (0x%x, 0x%x, 0x%x, 0x%x) GV %p\n", __func__
, function
, d1
, d2
, d3
, d4
, __is_process(me
) ? me
->pr_GlobVec
: NULL
));
44 if (!__is_process(me
))
47 oldReturnAddr
= me
->pr_ReturnAddr
;
48 ret
= AROS_UFC8(LONG
, BCPL_thunk
,
49 AROS_UFCA(LONG
, d1
, D1
),
50 AROS_UFCA(LONG
, d2
, D2
),
51 AROS_UFCA(LONG
, d3
, D3
),
52 AROS_UFCA(LONG
, d4
, D4
),
53 AROS_UFCA(APTR
, me
->pr_Task
.tc_SPLower
, A1
),
54 AROS_UFCA(APTR
, me
->pr_GlobVec
, A2
),
55 AROS_UFCA(APTR
, &me
->pr_ReturnAddr
, A3
),
56 AROS_UFCA(LONG_FUNC
, ((LONG_FUNC
*)me
->pr_GlobVec
)[function
], A4
));
57 me
->pr_ReturnAddr
= oldReturnAddr
;