1 #ifndef EXEC_INITIALIZERS_H
2 #define EXEC_INITIALIZERS_H
4 #include <aros/system.h>
7 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
10 Desc: Macros to build init structs (eg. for InitStruct())
14 #define OFFSET(structName, structEntry) \
15 ((IPTR)&(((struct structName *) 0)->structEntry))
18 #define INITBYTE(offset,value) 0xe000,(UWORD) (offset),(UWORD) ((value)<<8)
19 #define INITWORD(offset,value) 0xd000,(UWORD) (offset),(UWORD) (value)
20 #define INITLONG(offset,value) 0xc000,(UWORD) (offset), \
21 (UWORD) ((value)>>16), \
22 (UWORD) ((value) & 0xffff)
23 #define INITSTRUCT(size,offset,value,count) \
24 (UWORD) (0xc000|(size<<12)|(count<<8)| \
25 ((UWORD) ((offset)>>16)), \
26 ((UWORD) (offset)) & 0xffff)
28 #define INITBYTE(offset,value) (0x00e0 | ((((ULONG)offset) & 0xff) << 8)),(UWORD) (((ULONG)offset) >> 8),(UWORD) ((value) & 0xff)
29 #define INITWORD(offset,value) (0x00d0 | ((((ULONG)offset) & 0xff) << 8)),(UWORD) (((ULONG)offset) >> 8),(UWORD) (value)
30 #define INITLONG(offset,value) (0x00c0 | ((((ULONG)offset) & 0xff) << 8)),(UWORD) (((ULONG)offset) >> 8), \
31 (UWORD) ((value) & 0xffff), \
32 (UWORD) ((value) >> 16)
33 #define INITSTRUCT(size,offset,value,count) \
34 (UWORD) (0x00c0|((size)<<4)|((count)<<0)| \
35 ((UWORD) ((((ULONG)offset) & 0xff) << 8))), \
36 ((UWORD) (((ULONG)offset) >> 8))
39 #endif /* EXEC_INITIALIZERS_H */