]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - include/cramfs/cramfs_fs.h
powerpc: hiddendragon: remove orphan board
[karo-tx-uboot.git] / include / cramfs / cramfs_fs.h
index 7b292c0c1ecc50a69ed6d68a82b81ebf9f456f12..e0c14f04af57489bcb3da6184f53b4199ab5742a 100644 (file)
@@ -1,14 +1,6 @@
 #ifndef __CRAMFS_H
 #define __CRAMFS_H
 
-#ifndef __KERNEL__
-
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned int u32;
-
-#endif
-
 #define CRAMFS_MAGIC           0x28cd3d45      /* some random number */
 #define CRAMFS_SIGNATURE       "Compressed ROMFS"
 
@@ -16,12 +8,12 @@ typedef unsigned int u32;
  * Width of various bitfields in struct cramfs_inode.
  * Primarily used to generate warnings in mkcramfs.
  */
-#define CRAMFS_MODE_WIDTH 16
-#define CRAMFS_UID_WIDTH 16
-#define CRAMFS_SIZE_WIDTH 24
-#define CRAMFS_GID_WIDTH 8
-#define CRAMFS_NAMELEN_WIDTH 6
-#define CRAMFS_OFFSET_WIDTH 26
+#define CRAMFS_MODE_WIDTH      16
+#define CRAMFS_UID_WIDTH       16
+#define CRAMFS_SIZE_WIDTH      24
+#define CRAMFS_GID_WIDTH       8
+#define CRAMFS_NAMELEN_WIDTH   6
+#define CRAMFS_OFFSET_WIDTH    26
 
 /*
  * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
@@ -34,8 +26,10 @@ typedef unsigned int u32;
  */
 struct cramfs_inode {
        u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
+
        /* SIZE for device files is i_rdev */
        u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
+
        /* NAMELEN is the length of the file name, divided by 4 and
           rounded up.  (cramfs doesn't support hard links.) */
        /* OFFSET: For symlinks and non-empty regular files, this
@@ -90,9 +84,17 @@ struct cramfs_super {
                                | CRAMFS_FLAG_WRONG_SIGNATURE \
                                | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
 
+#define CRAMFS_16(x)   (x)
+#define CRAMFS_24(x)   (x)
+#define CRAMFS_32(x)   (x)
+#define CRAMFS_GET_NAMELEN(x)  ((x)->namelen)
+#define CRAMFS_GET_OFFSET(x)   ((x)->offset)
+#define CRAMFS_SET_OFFSET(x,y) ((x)->offset = (y))
+#define CRAMFS_SET_NAMELEN(x,y) ((x)->namelen = (y))
+
 /* Uncompression interfaces to the underlying zlib */
-int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
+int cramfs_uncompress_block(void *dst, void *src, int srclen);
 int cramfs_uncompress_init(void);
 int cramfs_uncompress_exit(void);
 
-#endif
+#endif /* __CRAMFS_H */