Speed-up finding next free cluster by starting the search from where the
[AROS.git] / arch / .unmaintained / ppc-native / machine.h
blob78ae7ef1570636bf91921bbf87b764ec5be47047
1 #ifndef AROS_MACHINE_H
2 #define AROS_MACHINE_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 NOTE: This file must compile *without* any other header !
10 Desc: machine.h include file for Amiga/m68k
11 Lang: english
14 /* Information generated by machine.c */
15 #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
16 #define AROS_BIG_ENDIAN 1 /* Big or little endian */
17 #define AROS_SIZEOFULONG 4 /* Size of an ULONG */
18 #define AROS_WORDALIGN 2 /* Alignment for WORD */
19 #define AROS_LONGALIGN 2 /* Alignment for LONG */
20 #define AROS_PTRALIGN 2 /* Alignment for PTR */
21 #define AROS_IPTRALIGN 2 /* Alignment for IPTR */
22 #define AROS_DOUBLEALIGN 2 /* Alignment for double */
23 #define AROS_WORSTALIGN 8 /* Worst case alignment */
25 #define AROS_GET_SYSBASE extern struct ExecBase * SysBase;
26 #define AROS_GET_DOSBASE extern struct DosLibrary * DOSBase;
28 /* do we need a function attribute to get parameters on the stack? */
29 #define __stackparm
32 How much do I have to add to sp to get the address of the first
33 byte on the stack?
35 #define SP_OFFSET 0
38 One entry in a libraries' jumptable. For assembler compatibility, the
39 field jmp should contain the code for an absolute jmp to a 32bit
40 address. There are also a couple of macros which you should use to
41 access the vector table from C.
43 struct JumpVec
45 unsigned char vec[4];
48 /* Any jump to an unimplemented vector will cause an access to this address */
49 #define _aros_empty_vector 0xc0edbabe
51 /* Internal macros */
52 #define __AROS_SET_VEC(v,a) (*(ULONG*)(v)->vec=(ULONG)(a))
53 #define __AROS_GET_VEC(v) ((APTR)(*(ULONG*)(v)->vec))
55 /* Use these to acces a vector table */
56 #define LIB_VECTSIZE (sizeof (struct JumpVec))
57 #define __AROS_GETJUMPVEC(lib,n) ((struct JumpVec *)(((UBYTE *)lib)-(n*LIB_VECTSIZE)))
58 #define __AROS_GETVECADDR(lib,n) (__AROS_GET_VEC(__AROS_GETJUMPVEC(lib,n)))
59 #define __AROS_SETVECADDR(lib,n,addr) (__AROS_SET_VEC(__AROS_GETJUMPVEC(lib,n),(APTR)(addr)))
60 #define __AROS_INITVEC(lib,n) __AROS_SETVECADDR(lib,n,_aros_not_implemented)
63 We want to activate the execstubs and preserve all registers
64 when calling obtainsemaphore, obtainsemaphoreshared, releasesemaphore,
65 getcc, permit, forbid, enable, disable
67 #undef UseExecstubs
68 #define UseExecstubs 1
70 /* Macros to test/set failure of AllocEntry() */
71 #define AROS_ALLOCENTRY_FAILED(memType) \
72 ((struct MemList *)((IPTR)(memType) | 0x80ul<<(sizeof(APTR)-1)*8))
73 #define AROS_CHECK_ALLOCENTRY(memList) \
74 (!((IPTR)(memList) & 0x80ul<<(sizeof(APTR)-1)*8))
77 Find the next valid alignment for a structure if the next x bytes must
78 be skipped.
80 #define AROS_ALIGN(x) (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
82 /* Prototypes */
83 extern void _aros_not_implemented ();
84 extern void aros_not_implemented ();
86 /* How much stack do we need ? Lots :-) */
87 #define AROS_STACKSIZE 100000
89 /* RawDoFmt hook */
90 #define RDFCALL(hook,data,dptr) ((void(*)(UBYTE __d0,APTR __a3))(hook))(data,dptr);
92 /* What to do with the library base in header, prototype and call */
93 #define __AROS_LH_BASE(basetype,basename) basetype basename __asm("r2")
94 #define __AROS_LP_BASE(basetype,basename) void * __asm("r2")
95 #define __AROS_LC_BASE(basetype,basename) basename
96 #define __AROS_LD_BASE(basetype,basename) basetype __asm("r2")
98 /* How to transform an argument in header, prototype and call */
99 #define __AROS_LHA(type,name,reg) type name
100 #define __AROS_LPA(type,name,reg) type
101 #define __AROS_LCA(type,name,reg) name
102 #define __AROS_LDA(type,name,reg) type
103 #define __AROS_UFHA(type,name,reg) type name
104 #define __AROS_UFPA(type,name,reg) type
105 #define __AROS_UFCA(type,name,reg) name
106 #define __AROS_UFDA(type,name,reg) type
108 /* Prefix for library function in header, prototype and call */
109 #define __AROS_LH_PREFIX /* eps */
110 #define __AROS_LP_PREFIX /* eps */
111 #define __AROS_LC_PREFIX /* eps */
112 #define __AROS_LD_PREFIX /* eps */
113 #define __AROS_UFH_PREFIX /* eps */
114 #define __AROS_UFP_PREFIX /* eps */
115 #define __AROS_UFC_PREFIX /* eps */
116 #define __AROS_UFD_PREFIX /* eps */
118 /* if this is defined, all AROS_LP*-macros will expand to nothing. */
119 #define __AROS_USE_MACROS_FOR_LIBCALL
121 #endif /* AROS_MACHINE_H */