]> git.saurik.com Git - apple/xnu.git/blob - bsd/ufs/ufs/ufs_byte_order.h
68b705a3ab1b013abc5ec0ecd7d35f12ac5dd6fe
[apple/xnu.git] / bsd / ufs / ufs / ufs_byte_order.h
1 /*
2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /* Copyright 1998 Apple Computer, Inc.
31 *
32 * UFS byte swapping routines to make a big endian file system useful on a
33 * little endian machine.
34 *
35 */
36
37 #ifdef KERNEL_PRIVATE
38
39 #ifndef _UFS_BYTE_ORDER_H_
40 #define _UFS_BYTE_ORDER_H_
41
42 #include <sys/appleapiopts.h>
43
44 #ifdef __APPLE_API_PRIVATE
45 #include <rev_endian_fs.h>
46 #include <sys/vnode.h>
47 #include <sys/buf.h>
48 #include <ufs/ufs/quota.h>
49 #include <ufs/ufs/inode.h>
50 #include <ufs/ffs/fs.h>
51
52 void byte_swap_longlongs(unsigned long long *, int);
53 void byte_swap_ints(int *, int);
54 void byte_swap_shorts(short *, int);
55
56 /* void byte_swap_superblock(struct fs *); */
57 void byte_swap_sbin(struct fs *);
58 void byte_swap_sbout(struct fs *);
59 void byte_swap_csum(struct csum *);
60 void byte_swap_ocylgroup(struct cg *);
61 void byte_swap_cgin(struct cg *, struct fs *);
62 void byte_swap_cgout(struct cg *, struct fs *);
63
64 void byte_swap_inode_in(struct dinode *, struct inode *);
65 void byte_swap_inode_out(struct inode *, struct dinode *);
66
67 void byte_swap_dir_block_in(char *, int);
68 void byte_swap_dir_block_out(buf_t);
69 void byte_swap_direct(struct direct *);
70 void byte_swap_dirtemplate_in(struct dirtemplate *);
71 void byte_swap_minidir_in(struct direct *);
72
73 #endif /* __APPLE_API_PRIVATE */
74 #endif /* _UFS_BYTE_ORDER_H_ */
75 #endif /* KERNEL_PRIVATE */