OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [fs/] [xiafs/] [xiafs_mac.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1628 jcastillo
/*
2
 *  linux/fs/xiafs/xiafs_mac.h
3
 *
4
 *  Copyright (C) Q. Frank Xia, 1993.
5
 */
6
 
7
extern char internal_error_message[];
8
#define INTERN_ERR              internal_error_message, __FILE__, __LINE__
9
#define WHERE_ERR               __FILE__, __LINE__
10
 
11
#define XIAFS_ZSHIFT(sp)                ((sp)->u.xiafs_sb.s_zone_shift)
12
#define XIAFS_ZSIZE(sp)         (BLOCK_SIZE << XIAFS_ZSHIFT(sp))
13
#define XIAFS_ZSIZE_BITS(sp)    (BLOCK_SIZE_BITS + XIAFS_ZSHIFT(sp))
14
#define XIAFS_ADDRS_PER_Z(sp)           (BLOCK_SIZE >> (2 - XIAFS_ZSHIFT(sp)))
15
#define XIAFS_ADDRS_PER_Z_BITS(sp)      (BLOCK_SIZE_BITS - 2 + XIAFS_ZSHIFT(sp))
16
#define XIAFS_BITS_PER_Z(sp)    (BLOCK_SIZE  << (3 + XIAFS_ZSHIFT(sp)))
17
#define XIAFS_BITS_PER_Z_BITS(sp)       (BLOCK_SIZE_BITS + 3 + XIAFS_ZSHIFT(sp))
18
#define XIAFS_INODES_PER_Z(sp)  (_XIAFS_INODES_PER_BLOCK << XIAFS_ZSHIFT(sp))
19
 
20
/* Use the most significant bytes of zone pointers to store block counter. */
21
/* This is ugly, but it works. Note, We have another 7 bytes for "expansion". */
22
 
23
#define XIAFS_GET_BLOCKS(row_ip, blocks)  \
24
  blocks=((((row_ip)->i_zone[0] >> 24) & 0xff )|\
25
          (((row_ip)->i_zone[1] >> 16) & 0xff00 )|\
26
          (((row_ip)->i_zone[2] >>  8) & 0xff0000 ) )
27
 
28
/* XIAFS_PUT_BLOCKS should be called before saving zone pointers */
29
#define XIAFS_PUT_BLOCKS(row_ip, blocks)  \
30
  (row_ip)->i_zone[2]=((blocks)<< 8) & 0xff000000;\
31
  (row_ip)->i_zone[1]=((blocks)<<16) & 0xff000000;\
32
  (row_ip)->i_zone[0]=((blocks)<<24) & 0xff000000

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.