1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: scsi_endian.h,v $
29 * Revision 2.2 91/06/19 14:29:16 rvb
30 * Created.
31 * [91/06/11 af]
32 *
33 */
34 /*
35 * File: scsi_endian.h
36 * Author: Alessandro Forin, Carnegie Mellon University
37 * Date: 6/91
38 *
39 * Byte/Bit order issues are solved here.
40 */
41
42
43 #ifndef _SCSI_ENDIAN_H_
44 #define _SCSI_ENDIAN_H_ 1
45
46 /*
47 * Macros to take care of bitfield placement within a byte.
48 * It might be possible to extend these to something that
49 * takes care of multibyte structures, using perhaps the
50 * type ("t") parameter. Someday.
51 */
52 #if BYTE_MSF
53
54 #define BITFIELD_2(t,a,b) t b,a
55 #define BITFIELD_3(t,a,b,c) t c,b,a
56 #define BITFIELD_4(t,a,b,c,d) t d,c,b,a
57 #define BITFIELD_5(t,a,b,c,d,e) t e,d,c,b,a
58 #define BITFIELD_6(t,a,b,c,d,e,f) t f,e,d,c,b,a
59 #define BITFIELD_7(t,a,b,c,d,e,f,g) t g,f,e,d,c,b,a
60 #define BITFIELD_8(t,a,b,c,d,e,f,g,h) t h,g,f,e,d,c,b,a
61
62 #else /*BYTE_MSF*/
63
64 #define BITFIELD_2(t,a,b) t a,b
65 #define BITFIELD_3(t,a,b,c) t a,b,c
66 #define BITFIELD_4(t,a,b,c,d) t a,b,c,d
67 #define BITFIELD_5(t,a,b,c,d,e) t a,b,c,d,e
68 #define BITFIELD_6(t,a,b,c,d,e,f) t a,b,c,d,e
69 #define BITFIELD_7(t,a,b,c,d,e,f,g) t a,b,c,d,e,f,g
70 #define BITFIELD_8(t,a,b,c,d,e,f,g,h) t a,b,c,d,e,f,g,h
71
72 #endif /*BYTE_MSF*/
73
74 #endif /*_SCSI_ENDIAN_H_*/
Cache object: 7109789dc88281ce5203d33e2550bace
|