Use dos.library/CreateNewProc() instead of alib/CreateNewProcTags()
[tangerine.git] / arch / ppc-all / common / include / aros / abi.h
blob058dc64eaf858fcae2196fbe3f67e6ed9dd634bc
1 #ifndef AROS_ABI_H
2 #define AROS_ABI_H
4 /*
5 Copyright C 2003, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: AROS/PPC Application Binary Interface
9 Lang: English
12 // vim:ts=8:sts=4:sw=4
14 #include <exec/types.h>
17 Note:
19 This file *HAS TO BE INCLUDED* either directly or indirectly by
20 every single library function. They will never work otherwise.
21 Hopefully this is probably always done by aros/libcall.h file
25 Per-Task global structure holding function parameters passed through
26 M68K-like register frame. The structure will grow in future in order to
27 allow mixing PPC with M68K code.
30 #ifdef __KERNEL__
33 Define return() macro which not only returns given value. It also stores
34 it in CallOS structure in virtual register D0. Usefull by emulation
37 #define return(val) do {return CallOS->D[0] = (ULONG)(val);}while(0)
39 #endif /* __KERNEL__ */
41 struct CallOS {
42 // public:
43 ULONG D[8]; // Data registers
44 ULONG A[8]; // Address registers
48 Define global register pointer. This way we may take for granted, that r2
49 will always point to the register frame pointer. It would have been so
50 anyway, since according to PPC EAbi the r2 register is reserved for local
51 data pointer purpouses.
53 register struct CallOS *CallOS asm("r2");
55 /* Usefull macros making code more human-readable */
56 #define __D0 (CallOS->D[0])
57 #define __D1 (CallOS->D[1])
58 #define __D2 (CallOS->D[2])
59 #define __D3 (CallOS->D[3])
60 #define __D4 (CallOS->D[4])
61 #define __D5 (CallOS->D[5])
62 #define __D6 (CallOS->D[6])
63 #define __D7 (CallOS->D[7])
65 #define __A0 (CallOS->A[0])
66 #define __A1 (CallOS->A[1])
67 #define __A2 (CallOS->A[2])
68 #define __A3 (CallOS->A[3])
69 #define __A4 (CallOS->A[4])
70 #define __A5 (CallOS->A[5])
71 #define __A6 (CallOS->A[6])
72 #define __A7 (CallOS->A[7])
74 #endif /* AROS_ABI_H */