The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/fs/ntfs/ntfsendian.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * ntfsendian.h
    3  *
    4  * Copyright (C) 1998, 1999 Martin von L÷wis
    5  * Copyright (C) 1998 Joseph Malicki
    6  * Copyright (C) 1999 Werner Seiler
    7  * Copyright (C) 2001 Anton Altaparmakov (AIA)
    8  */
    9 #include <asm/byteorder.h>
   10 
   11 #define CPU_TO_LE16(a) __cpu_to_le16(a)
   12 #define CPU_TO_LE32(a) __cpu_to_le32(a)
   13 #define CPU_TO_LE64(a) __cpu_to_le64(a)
   14 
   15 #define LE16_TO_CPU(a) __cpu_to_le16(a)
   16 #define LE32_TO_CPU(a) __cpu_to_le32(a)
   17 #define LE64_TO_CPU(a) __cpu_to_le64(a)
   18 
   19 #define NTFS_GETU8(p)      (*(ntfs_u8*)(p))
   20 #define NTFS_GETU16(p)     ((ntfs_u16)LE16_TO_CPU(*(ntfs_u16*)(p)))
   21 #define NTFS_GETU24(p)     ((ntfs_u32)NTFS_GETU16(p) | \
   22                            ((ntfs_u32)NTFS_GETU8(((char*)(p)) + 2) << 16))
   23 #define NTFS_GETU32(p)     ((ntfs_u32)LE32_TO_CPU(*(ntfs_u32*)(p)))
   24 #define NTFS_GETU40(p)     ((ntfs_u64)NTFS_GETU32(p) | \
   25                            (((ntfs_u64)NTFS_GETU8(((char*)(p)) + 4)) << 32))
   26 #define NTFS_GETU48(p)     ((ntfs_u64)NTFS_GETU32(p) | \
   27                            (((ntfs_u64)NTFS_GETU16(((char*)(p)) + 4)) << 32))
   28 #define NTFS_GETU56(p)     ((ntfs_u64)NTFS_GETU32(p) | \
   29                            (((ntfs_u64)NTFS_GETU24(((char*)(p)) + 4)) << 32))
   30 #define NTFS_GETU64(p)     ((ntfs_u64)LE64_TO_CPU(*(ntfs_u64*)(p)))
   31  
   32  /* Macros writing unsigned integers */
   33 #define NTFS_PUTU8(p,v)      ((*(ntfs_u8*)(p)) = (v))
   34 #define NTFS_PUTU16(p,v)     ((*(ntfs_u16*)(p)) = CPU_TO_LE16(v))
   35 #define NTFS_PUTU24(p,v)     NTFS_PUTU16(p, (v) & 0xFFFF);\
   36                              NTFS_PUTU8(((char*)(p)) + 2, (v) >> 16)
   37 #define NTFS_PUTU32(p,v)     ((*(ntfs_u32*)(p)) = CPU_TO_LE32(v))
   38 #define NTFS_PUTU64(p,v)     ((*(ntfs_u64*)(p)) = CPU_TO_LE64(v))
   39  
   40  /* Macros reading signed integers */
   41 #define NTFS_GETS8(p)        ((*(ntfs_s8*)(p)))
   42 #define NTFS_GETS16(p)       ((ntfs_s16)LE16_TO_CPU(*(short*)(p)))
   43 #define NTFS_GETS24(p)       (NTFS_GETU24(p) < 0x800000 ? \
   44                                         (int)NTFS_GETU24(p) : \
   45                                         (int)(NTFS_GETU24(p) - 0x1000000))
   46 #define NTFS_GETS32(p)       ((ntfs_s32)LE32_TO_CPU(*(int*)(p)))
   47 #define NTFS_GETS40(p)       (((ntfs_s64)NTFS_GETU32(p)) | \
   48                              (((ntfs_s64)NTFS_GETS8(((char*)(p)) + 4)) << 32))
   49 #define NTFS_GETS48(p)       (((ntfs_s64)NTFS_GETU32(p)) | \
   50                              (((ntfs_s64)NTFS_GETS16(((char*)(p)) + 4)) << 32))
   51 #define NTFS_GETS56(p)       (((ntfs_s64)NTFS_GETU32(p)) | \
   52                              (((ntfs_s64)NTFS_GETS24(((char*)(p)) + 4)) << 32))
   53 #define NTFS_GETS64(p)       ((ntfs_s64)NTFS_GETU64(p))
   54  
   55 #define NTFS_PUTS8(p,v)      NTFS_PUTU8(p,v)
   56 #define NTFS_PUTS16(p,v)     NTFS_PUTU16(p,v)
   57 #define NTFS_PUTS24(p,v)     NTFS_PUTU24(p,v)
   58 #define NTFS_PUTS32(p,v)     NTFS_PUTU32(p,v)
   59 #define NTFS_PUTS64(p,v)     NTFS_PUTU64(p,v)
   60 

Cache object: d5ece9f140b720bc5a3eaf4eb411ecc4


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.