]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/reiser4progs/files/align.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / reiser4progs / files / align.patch
1 --- orig/include/reiser4/plugin.h       2005-03-26 16:52:16.913589432 -0800
2 +++ reiser4progs-1.0.4/include/reiser4/plugin.h 2005-03-26 17:05:13.324557024 -0800
3 @@ -36,6 +36,28 @@
4  #define EXTENT_HOLE_UNIT               (0)
5  #define EXTENT_UNALLOC_UNIT            (1)
6  
7 +#if __arm__
8 +/* Getting this right requires machine dependent knowledge of the
9 + * minimum structure packing gcc implements for the architecture, on
10 + * ARM it is 4, so we need 'packed' for <4 and must not use 'packed'
11 + * for 8! (packed,align(4) is the default.)
12 + */
13 +#define PACKED8  __attribute__ ((packed,aligned(1)))
14 +#define PACKED16 __attribute__ ((packed,aligned(2)))
15 +#define PACKED32 __attribute__ ((aligned(4)))
16 +#define PACKED64 __attribute__ ((aligned(8)))
17 +#else
18 +#define PACKED8  __attribute__ ((aligned(1)))
19 +#define PACKED16 __attribute__ ((aligned(2)))
20 +#define PACKED32 __attribute__ ((aligned(4)))
21 +#define PACKED64 __attribute__ ((aligned(8)))
22 +#endif
23 +
24 +#define PACKEDt(t) __attribute__ ((packed,aligned(__alignof__ (t)) ))
25 +#define PACKEDt2(t1,t2) __attribute__ ((packed,aligned(\
26 +               __alignof__ (t1) < __alignof__ (t2) ? __alignof__ (t2) : __alignof__ (t1) )))
27 +#define PACKED __attribute__((packed))
28 +
29  /* Defining the types for disk structures. All types like f32_t are fake ones
30     and needed to avoid gcc-2.95.x bug with size of typedefined aligned types. */
31  typedef uint8_t  f8_t;  typedef f8_t  d8_t  __attribute__((aligned(1)));
32 --- orig/include/reiser4/types.h        2005-03-26 16:52:16.915589128 -0800
33 +++ reiser4progs-1.0.4/include/reiser4/types.h  2005-03-26 17:08:29.143787976 -0800
34 @@ -33,7 +33,7 @@
35  
36         /* Filesystem label in use. */
37         char ms_label[16];
38 -};
39 +} PACKED16;
40  
41  typedef struct reiser4_master_sb reiser4_master_sb_t;
42  
43 @@ -63,7 +63,7 @@
44  
45         /* Error message related to saved status and stack trace. */
46         char ss_message[SS_MESSAGE_SIZE];
47 -};
48 +} PACKED64;
49  
50  typedef struct reiser4_status_sb reiser4_status_sb_t;
51  
52 --- orig/plugin/format/format40/format40.h      2005-03-26 16:52:17.022572864 -0800
53 +++ reiser4progs-1.0.4/plugin/format/format40/format40.h        2005-03-26 17:09:21.068894160 -0800
54 @@ -36,7 +36,7 @@
55         d64_t sb_flags;
56         
57         char sb_unused[432];
58 -} __attribute__((packed));
59 +} PACKED;
60  
61  typedef struct format40_super format40_super_t;
62  
63 @@ -60,7 +60,7 @@
64         d16_t sb_policy;
65         d64_t sb_flags;
66         d64_t sb_reserved;
67 -} __attribute__((packed));
68 +} PACKED;
69  
70  typedef struct format40_backup format40_backup_t;
71  #endif
72 --- orig/plugin/item/cde40/cde40.h      2005-03-26 16:52:17.041569976 -0800
73 +++ reiser4progs-1.0.4/plugin/item/cde40/cde40.h        2005-03-26 17:12:11.154037288 -0800
74 @@ -21,7 +21,7 @@
75  
76  struct cde40 {
77         d16_t units;
78 -};
79 +} PACKED16;
80  
81  typedef struct cde40 cde40_t;
82  
83 @@ -29,7 +29,7 @@
84  struct objid3 {
85         d8_t locality[8];
86         d8_t objectid[8];
87 -};
88 +} PACKED8;
89  
90  typedef struct objid3 objid3_t;
91  
92 @@ -37,21 +37,21 @@
93  struct hash3 {
94         d8_t objectid[8];
95         d8_t offset[8];
96 -};
97 +} PACKED8;
98  
99  typedef struct hash3 hash3_t;
100  
101  struct entry3 {
102         hash3_t hash;
103         d16_t offset;
104 -};
105 +} PACKEDt2(hash3_t, d16_t);
106  
107  typedef struct entry3 entry3_t;
108  
109  struct cde403 {
110         d16_t units;
111         entry3_t entry[0];
112 -};
113 +} PACKEDt2(d16_t, entry3_t);
114  
115  typedef struct cde403  cde403_t;
116  #endif
117 @@ -61,7 +61,7 @@
118         d8_t locality[8];
119         d8_t ordering[8];
120         d8_t objectid[8];
121 -};
122 +} PACKED8;
123  
124  typedef struct objid4 objid4_t;
125  
126 @@ -69,21 +69,21 @@
127         d8_t ordering[8];
128         d8_t objectid[8];
129         d8_t offset[8];
130 -};
131 +} PACKED8;
132  
133  typedef struct hash4 hash4_t;
134  
135  struct entry4 {
136         hash4_t hash;
137         d16_t offset;
138 -};
139 +} PACKEDt2(hash4_t, d16_t);
140  
141  typedef struct entry4 entry4_t;
142  
143  struct cde404 {
144         d16_t units;
145         entry4_t entry[0];
146 -};
147 +} PACKEDt2(d16_t, entry4_t);
148  
149  typedef struct cde404  cde404_t;
150  #endif
151 --- orig/plugin/item/ctail40/ctail40.h  2005-03-26 16:52:17.050568608 -0800
152 +++ reiser4progs-1.0.4/plugin/item/ctail40/ctail40.h    2005-03-26 17:12:25.634835872 -0800
153 @@ -15,7 +15,7 @@
154         /* Cluster size is block size shifted to this field. */
155         d8_t shift;
156         d8_t body[0];
157 -};
158 +} PACKED8;
159  
160  typedef struct ctail40 ctail40_t;
161  
162 --- orig/plugin/item/extent40/extent40.h        2005-03-26 16:52:17.056567696 -0800
163 +++ reiser4progs-1.0.4/plugin/item/extent40/extent40.h  2005-03-26 17:12:43.461125864 -0800
164 @@ -24,7 +24,7 @@
165  struct extent40 {
166         d64_t start;
167         d64_t width;
168 -};
169 +} PACKED64;
170  
171  typedef struct extent40 extent40_t;
172  
173 --- orig/plugin/item/nodeptr40/nodeptr40.h      2005-03-26 16:52:17.057567544 -0800
174 +++ reiser4progs-1.0.4/plugin/item/nodeptr40/nodeptr40.h        2005-03-26 17:12:56.313172056 -0800
175 @@ -11,7 +11,7 @@
176  
177  struct nodeptr40 {
178         d64_t ptr;
179 -};
180 +} PACKED64;
181  
182  extern reiser4_core_t *nodeptr40_core;
183  typedef struct nodeptr40 nodeptr40_t;
184 --- orig/plugin/item/stat40/stat40.h    2005-03-26 16:52:17.061566936 -0800
185 +++ reiser4progs-1.0.4/plugin/item/stat40/stat40.h      2005-03-26 17:13:13.492560392 -0800
186 @@ -22,7 +22,7 @@
187  
188  struct stat40 {
189         d16_t extmask;
190 -};
191 +} PACKED16;
192  
193  typedef struct stat40 stat40_t;
194  extern reiser4_core_t *stat40_core;
195 --- orig/plugin/journal/journal40/journal40.h   2005-03-26 16:52:17.071565416 -0800
196 +++ reiser4progs-1.0.4/plugin/journal/journal40/journal40.h     2005-03-26 17:15:34.993049048 -0800
197 @@ -53,7 +53,7 @@
198  
199  struct journal40_header {
200         d64_t jh_last_commited;
201 -};
202 +} PACKED64;
203  
204  typedef struct journal40_header journal40_header_t;
205  
206 @@ -66,7 +66,7 @@
207         d64_t jf_free_blocks;
208         d64_t jf_used_oids;
209         d64_t jf_next_oid;
210 -};
211 +} PACKED64;
212  
213  typedef struct journal40_footer journal40_footer_t;
214  
215 @@ -100,7 +100,7 @@
216         d64_t th_free_blocks;
217         d64_t th_used_oids;
218         d64_t th_next_oid;
219 -};
220 +} PACKED64;
221  
222  typedef struct journal40_tx_header journal40_tx_header_t;
223  
224 @@ -131,7 +131,7 @@
225         d32_t lh_total;
226         d32_t lh_serial;
227         d64_t lh_next_block;
228 -};
229 +} PACKED64;
230  
231  typedef struct journal40_lr_header journal40_lr_header_t;
232  
233 @@ -150,7 +150,7 @@
234  struct journal40_lr_entry {
235         d64_t le_original;
236         d64_t le_wandered;
237 -};
238 +} PACKED64;
239  
240  typedef struct journal40_lr_entry journal40_lr_entry_t;
241  
242 --- orig/plugin/key/key_large/key_large.h       2005-03-26 16:52:17.073565112 -0800
243 +++ reiser4progs-1.0.4/plugin/key/key_large/key_large.h 2005-03-26 17:15:59.982250112 -0800
244 @@ -39,7 +39,7 @@
245  union key_large {
246         d64_t el[KEY_LARGE_LAST_INDEX];
247         int pad;
248 -};
249 +} PACKED64;
250  
251  typedef union key_large key_large_t;
252  
253 --- orig/plugin/key/key_short/key_short.h       2005-03-26 16:52:17.076564656 -0800
254 +++ reiser4progs-1.0.4/plugin/key/key_short/key_short.h 2005-03-26 17:16:13.687166648 -0800
255 @@ -38,7 +38,7 @@
256  union key_short {
257         d64_t el[KEY_SHORT_LAST_INDEX];
258         int pad;
259 -};
260 +} PACKED64;
261  
262  typedef union key_short key_short_t;
263  
264 --- orig/plugin/node/node40/node40.h    2005-03-26 16:52:17.082563744 -0800
265 +++ reiser4progs-1.0.4/plugin/node/node40/node40.h      2005-03-26 17:17:08.539827776 -0800
266 @@ -45,7 +45,7 @@
267         d8_t level;
268         
269         d8_t pad;
270 -}  __attribute__((packed));
271 +} PACKED;
272  
273  typedef struct node40_header node40_header_t;  
274  
275 @@ -166,7 +166,7 @@
276  union key3 {
277         d64_t el[3];
278         int pad;
279 -};
280 +} PACKED64;
281  
282  typedef union key3 key3_t;
283  
284 @@ -176,7 +176,7 @@
285         d16_t offset;
286         d16_t flags;
287         d16_t pid;
288 -} __attribute__((packed));
289 +} PACKED;
290  
291  typedef struct item_header3 item_header3_t;
292  #endif
293 @@ -185,7 +185,7 @@
294  union key4 {
295         d64_t el[4];
296         int pad;
297 -};
298 +} PACKED64;
299  
300  typedef union key4 key4_t;
301  
302 @@ -195,7 +195,7 @@
303         d16_t offset;
304         d16_t flags;
305         d16_t pid;
306 -} __attribute__((packed));
307 +} PACKED;
308  
309  typedef struct item_header4 item_header4_t;
310  #endif
311 --- orig/plugin/sdext/sdext_flags/sdext_flags.h 2005-03-26 16:52:17.111559336 -0800
312 +++ reiser4progs-1.0.4/plugin/sdext/sdext_flags/sdext_flags.h   2005-03-26 17:17:36.787533472 -0800
313 @@ -11,7 +11,7 @@
314  
315  struct sdext_flags {
316         d32_t flags;
317 -} __attribute__((packed));
318 +} PACKED;
319  
320  typedef struct sdext_flags sdext_flags_t;
321  
322 --- orig/plugin/sdext/sdext_lt/sdext_lt.h       2005-03-26 16:52:17.112559184 -0800
323 +++ reiser4progs-1.0.4/plugin/sdext/sdext_lt/sdext_lt.h 2005-03-26 17:17:43.199558696 -0800
324 @@ -13,7 +13,7 @@
325         d32_t atime;
326         d32_t mtime;
327         d32_t ctime;
328 -} __attribute__((packed));
329 +} PACKED;
330  
331  typedef struct sdext_lt sdext_lt_t;
332  
333 --- orig/plugin/sdext/sdext_lw/sdext_lw.h       2005-03-26 16:52:17.117558424 -0800
334 +++ reiser4progs-1.0.4/plugin/sdext/sdext_lw/sdext_lw.h 2005-03-26 17:17:50.272483448 -0800
335 @@ -13,7 +13,7 @@
336         d16_t mode;
337         d32_t nlink;
338         d64_t size;
339 -} __attribute__((packed));
340 +} PACKED;
341  
342  typedef struct sdext_lw sdext_lw_t;
343  
344 --- orig/plugin/sdext/sdext_plug/sdext_plug.h   2005-03-26 16:52:17.118558272 -0800
345 +++ reiser4progs-1.0.4/plugin/sdext/sdext_plug/sdext_plug.h     2005-03-26 17:18:02.400639688 -0800
346 @@ -14,14 +14,14 @@
347  struct sdext_plug_slot {
348          d16_t member;
349          d16_t plug;
350 -} __attribute__((packed));
351 +} PACKED;
352  
353  typedef struct sdext_plug_slot sdext_plug_slot_t;
354  
355  struct sdext_plug {
356          d16_t count;
357          sdext_plug_slot_t slot[0];
358 -}  __attribute__((packed));
359 +} PACKED;
360  
361  typedef struct sdext_plug sdext_plug_t;
362  
363 --- orig/plugin/sdext/sdext_unix/sdext_unix.h   2005-03-26 16:52:17.120557968 -0800
364 +++ reiser4progs-1.0.4/plugin/sdext/sdext_unix/sdext_unix.h     2005-03-26 17:18:12.969033048 -0800
365 @@ -20,7 +20,7 @@
366                 d64_t rdev;
367                 d64_t bytes;
368         } u;
369 -} __attribute__((packed));
370 +} PACKED;
371  
372  typedef struct sdext_unix sdext_unix_t;
373