revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / networks / atheros5000 / initializers.h
blobe7fbcae43fbb1667eb11d3db719a648aef3d2895
1 /*
3 $VER: initializers.h 41.5 (30.9.2007)
4 Copyright (C) 2000-2007 Neil Cafferkey
6 This file is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of the
9 License, or (at your option) any later version.
11 This file is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this file; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 MA 02111-1307, USA.
23 #ifndef EXEC_INITIALIZERS_H
24 #define EXEC_INITIALIZERS_H
26 #include <exec/types.h>
29 /* Use the OFFSET macro as the offset parameter of one of the other
30 macros */
32 #ifdef OFFSET
33 #undef OFFSET
34 #endif
36 #define OFFSET(struct_name, struct_field) \
37 ((UPINT)(&(((struct struct_name *)0)->struct_field)))
39 /* Use the following macros in the structure definition */
41 #define INITBYTEDEF(name) \
42 UBYTE name ## _c; UBYTE name ## _o1; UBYTE name ## _o2; \
43 UBYTE name ## _o3; UBYTE name ## _v; UBYTE name ## _p
44 #define INITWORDDEF(name) \
45 UBYTE name ## _c; UBYTE name ## _o1; UBYTE name ## _o2; \
46 UWORD name ## _v
47 #define INITLONGDEF(name) \
48 UBYTE name ## _c; UBYTE name ## _o1; UBYTE name ## _o2; \
49 ULONG name ## _v
50 #define INITPINTDEF(name) \
51 UBYTE name ## _c; UBYTE name ## _o1; UBYTE name ## _o2; \
52 UPINT name ## _v
54 #define SMALLINITBYTEDEF(name) \
55 UBYTE name ## _c; UBYTE name ## _o; UBYTE name ## _v; UBYTE name ## _p
56 #define SMALLINITWORDDEF(name) \
57 UBYTE name ## _c; UBYTE name ## _o; UWORD name ## _v
58 #define SMALLINITLONGDEF(name) \
59 UBYTE name ## _c; UBYTE name ## _o; ULONG name ## _v
60 #define SMALLINITPINTDEF(name) \
61 UBYTE name ## _c; UBYTE name ## _o; UPINT name ## _v
63 #define INITENDDEF UBYTE the_end
65 /* Private macro */
67 #define PINTSIZECODE (((sizeof(PINT) == sizeof(ULONG)) ? 0 : 3) << 4)
69 /* Use the following macros to fill in a structure */
71 #define NEWINITBYTE(offset, value) \
72 0xe0, (UBYTE)((offset) >> 16), (UBYTE)((offset) >> 8), (UBYTE)(offset), \
73 (UBYTE)(value), 0
74 #define NEWINITWORD(offset, value) \
75 0xd0, (UBYTE)((offset) >> 16), (UBYTE)((offset) >> 8), (UBYTE)(offset), \
76 (UWORD)(value)
77 #define NEWINITLONG(offset, value) \
78 0xc0, (UBYTE)((offset) >> 16), (UBYTE)((offset) >> 8), (UBYTE)(offset), \
79 (ULONG)(value)
80 #define INITPINT(offset, value) \
81 0xc0 | PINTSIZECODE, (UBYTE)((offset) >> 16), (UBYTE)((offset) >> 8), \
82 (UBYTE)(offset), (UPINT)(value)
84 #define SMALLINITBYTE(offset, value) \
85 0xa0, (offset), (UBYTE)(value), 0
86 #define SMALLINITWORD(offset, value) \
87 0x90, (offset), (UWORD)(value)
88 #define SMALLINITLONG(offset, value) \
89 0x80, (offset), (ULONG)(value)
90 #define SMALLINITPINT(offset, value) \
91 0x80 | PINTSIZECODE, (offset), (UPINT)(value)
93 #define INITEND 0
95 /* Obsolete definitions */
97 #define INITBYTE(offset, value) \
98 (0xe000 | ((UWORD)(offset) >> 16)), \
99 (UWORD)(offset), (UWORD)((value) << 8)
100 #define INITWORD(offset, value) \
101 (0xd000 | ((UWORD)(offset) >> 16)), (UWORD)(offset), (UWORD)(value)
102 #define INITLONG(offset, value) \
103 (0xc000 | ((UWORD)(offset) >> 16)), (UWORD)(offset), \
104 (UWORD)((value) >> 16), (UWORD)(value)
105 #define INITAPTR(offset, value) \
106 (0xc000 | ((UWORD)(offset) >> 16)), (UWORD)(offset), \
107 (UWORD)((ULONG)(value) >> 16), (UWORD)(value)
109 #endif