6 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 NOTE: This file must compile *without* any other header !
11 Desc: machine.h include file for Amiga/m68k
15 /* Information generated by machine.c */
16 #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
17 #define AROS_BIG_ENDIAN 1 /* Big or little endian */
18 #define AROS_SIZEOFULONG 4 /* Size of an ULONG */
19 #define AROS_WORDALIGN 2 /* Alignment for WORD */
20 #define AROS_LONGALIGN 2 /* Alignment for LONG */
21 #define AROS_PTRALIGN 2 /* Alignment for PTR */
22 #define AROS_IPTRALIGN 2 /* Alignment for IPTR */
23 #define AROS_DOUBLEALIGN 2 /* Alignment for double */
24 #define AROS_WORSTALIGN 8 /* Worst case alignment */
26 #define AROS_GET_SYSBASE extern struct ExecBase * SysBase;
27 #define AROS_GET_DOSBASE extern struct DosLibrary * DOSBase;
29 /* do we need a function attribute to get parameters on the stack? */
33 How much do I have to add to sp to get the address of the first
39 One entry in a libraries' jumptable. For assembler compatibility, the
40 field jmp should contain the code for an absolute jmp to a 32bit
41 address. There are also a couple of macros which you should use to
42 access the vector table from C.
50 /* Any jump to an unimplemented vector will cause an access to this address */
51 #define _aros_empty_vector 0xc0edbabe
54 #define __AROS_ASMJMP 0x4EF9
55 #define __AROS_SET_VEC(v,a) (*(ULONG*)(v)->vec=(ULONG)(a))
56 #define __AROS_GET_VEC(v) ((APTR)(*(ULONG*)(v)->vec))
58 /* Use these to acces a vector table */
59 //#define LIB_VECTSIZE (sizeof (struct JumpVec))
60 #define __AROS_GETJUMPVEC(lib,n) ((struct JumpVec *)(((UBYTE *)lib)-(n*LIB_VECTSIZE)))
61 #define __AROS_GETVECADDR(lib,n) (__AROS_GET_VEC(__AROS_GETJUMPVEC(lib,n)))
62 #define __AROS_SETVECADDR(lib,n,addr) (__AROS_SET_VEC(__AROS_GETJUMPVEC(lib,n),(APTR)(addr)))
63 #define __AROS_INITVEC(lib,n) __AROS_SETVECADDR(lib,n,_aros_not_implemented)
66 We want to activate the execstubs and preserve all registers
67 when calling obtainsemaphore, obtainsemaphoreshared, releasesemaphore,
68 getcc, permit, forbid, enable, disable
71 #define UseExecstubs 1
73 /* Macros to test/set failure of AllocEntry() */
74 #define AROS_ALLOCENTRY_FAILED(memType) \
75 ((struct MemList *)((IPTR)(memType) | 0x80ul<<(sizeof(APTR)-1)*8))
76 #define AROS_CHECK_ALLOCENTRY(memList) \
77 (!((IPTR)(memList) & 0x80ul<<(sizeof(APTR)-1)*8))
80 Find the next valid alignment for a structure if the next x bytes must
83 #define AROS_ALIGN(x) (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
86 extern void _aros_not_implemented (void);
87 extern void aros_not_implemented (void);
89 /* How much stack do we need ? Lots :-) */
90 #define AROS_STACKSIZE 32768
93 #define RDFCALL(hook,data,dptr) ((void(*)(UBYTE __d0,APTR __a3))(hook))(data,dptr);
95 /* What to do with the library base in header, prototype and call */
96 #define __AROS_LH_BASE(basetype,basename) basetype basename = (basetype)REG_A6
97 #define __AROS_LP_BASE(basetype,basename) basetype __base = basename
98 #define __AROS_LC_BASE(basetype,basename) REG_A6 = (LONG)__base
99 #define __AROS_LD_BASE(basetype,basename) basetype basename
102 /* How to transform an argument in header, prototype and call */
103 #define __AROS_LHA(type,name,reg) type name = (type) REG_##reg
104 #define __AROS_LPA(type,name,reg) type r##reg = name
105 #define __AROS_LCA(type,name,reg) REG_##reg = (LONG)r##reg
106 #define __AROS_LDA(type,name,reg) type
107 #define __AROS_UFHA(type,name,reg) type name = (type) REG_##reg
108 #define __AROS_UFPA(type,name,reg) type r##reg = name
109 #define __AROS_UFCA(type,name,reg) REG_##reg = (LONG)r##reg
110 #define __AROS_UFDA(type,name,reg) type
112 /* Prefix for library function in header, prototype and call */
113 #define __AROS_LH_PREFIX /* eps */
114 #define __AROS_LP_PREFIX /* eps */
115 #define __AROS_LC_PREFIX /* eps */
116 #define __AROS_LD_PREFIX /* eps */
117 #define __AROS_UFH_PREFIX /* eps */
118 #define __AROS_UFP_PREFIX /* eps */
119 #define __AROS_UFC_PREFIX /* eps */
120 #define __AROS_UFD_PREFIX /* eps */
122 /* if this is defined, all AROS_LP*-macros will expand to nothing. */
123 #define __AROS_USE_MACROS_FOR_LIBCALL
125 #endif /* AROS_MACHINE_H */