|
|
1.1 root 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 [email protected]
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: * File: scsi_endian.h
28: * Author: Alessandro Forin, Carnegie Mellon University
29: * Date: 6/91
30: *
31: * Byte/Bit order issues are solved here.
32: */
33:
34:
35: #ifndef _SCSI_ENDIAN_H_
36: #define _SCSI_ENDIAN_H_ 1
37:
38: /*
39: * Macros to take care of bitfield placement within a byte.
40: * It might be possible to extend these to something that
41: * takes care of multibyte structures, using perhaps the
42: * type ("t") parameter. Someday.
43: */
44: #if BYTE_MSF
45:
46: #define BITFIELD_2(t,a,b) t b,a
47: #define BITFIELD_3(t,a,b,c) t c,b,a
48: #define BITFIELD_4(t,a,b,c,d) t d,c,b,a
49: #define BITFIELD_5(t,a,b,c,d,e) t e,d,c,b,a
50: #define BITFIELD_6(t,a,b,c,d,e,f) t f,e,d,c,b,a
51: #define BITFIELD_7(t,a,b,c,d,e,f,g) t g,f,e,d,c,b,a
52: #define BITFIELD_8(t,a,b,c,d,e,f,g,h) t h,g,f,e,d,c,b,a
53:
54: #else /*BYTE_MSF*/
55:
56: #define BITFIELD_2(t,a,b) t a,b
57: #define BITFIELD_3(t,a,b,c) t a,b,c
58: #define BITFIELD_4(t,a,b,c,d) t a,b,c,d
59: #define BITFIELD_5(t,a,b,c,d,e) t a,b,c,d,e
60: #define BITFIELD_6(t,a,b,c,d,e,f) t a,b,c,d,e
61: #define BITFIELD_7(t,a,b,c,d,e,f,g) t a,b,c,d,e,f,g
62: #define BITFIELD_8(t,a,b,c,d,e,f,g,h) t a,b,c,d,e,f,g,h
63:
64: #endif /*BYTE_MSF*/
65:
66: #endif /*_SCSI_ENDIAN_H_*/
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.