[BACK]Return to bpb.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / fs / msdosfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/fs/msdosfs/bpb.h between version 1.4.20.2 and 1.5

version 1.4.20.2, 2007/02/01 08:48:32 version 1.5, 2006/11/30 15:59:23
Line 110  struct bpb_a {
Line 110  struct bpb_a {
  * and longs are just character arrays of the appropriate length.  This is   * and longs are just character arrays of the appropriate length.  This is
  * because the compiler forces shorts and longs to align on word or   * because the compiler forces shorts and longs to align on word or
  * halfword boundaries.   * halfword boundaries.
    *
    * XXX The little-endian code here assumes that the processor can access
    * 16-bit and 32-bit quantities on byte boundaries.  If this is not true,
    * use the macros for the big-endian case.
  */   */
   #include <machine/endian.h>
 #include <sys/endian.h>  #ifdef __STDC__
   #define __ICAST(q,a,x)  ((q u_int ## a ## _t *)(q void *)(x))
 #define getushort(p)    le16dec(p)  #else
 #define getulong(p)     le32dec(p)  #define __ICAST(q,a,x)  ((q u_int/**/a/**/_t *)(q void *)(x))
 #define putushort(p, v) le16enc((p), (v))  #endif
 #define putulong(p, v)  le32enc((p), (v))  #if (BYTE_ORDER == LITTLE_ENDIAN) && defined(UNALIGNED_ACCESS)
   #define getushort(x)    *__ICAST(const,16,x)
   #define getulong(x)     *__ICAST(const,32,x)
   #define putushort(p, v) (void)(*__ICAST(,16,p) = (v))
   #define putulong(p, v)  (void)(*__ICAST(,32,p) = (v))
   #else
   #define getushort(x)    ((u_int16_t)(__ICAST(const,8,x)[0] \
                            | (__ICAST(const,8,x)[1] << 8)))
   #define getulong(x)     ((u_int32_t)(__ICAST(const,8,x)[0] \
                            | (__ICAST(const,8,x)[1] << 8) \
                            | (__ICAST(const,8,x)[2] << 16) \
                            | (__ICAST(const,8,x)[3] << 24)))
   #define putushort(p, v) (void)(__ICAST(,8,p)[0] = (v),  \
                            __ICAST(,8,p)[1] = (v) >> 8)
   #define putulong(p, v)  (void)(__ICAST(,8,p)[0] = (v),  \
                            __ICAST(,8,p)[1] = (v) >> 8, \
                            __ICAST(,8,p)[2] = (v) >> 16,\
                            __ICAST(,8,p)[3] = (v) >> 24)
   #endif
   
 /*  /*
  * BIOS Parameter Block (BPB) for DOS 3.3   * BIOS Parameter Block (BPB) for DOS 3.3

Legend:
Removed from v.1.4.20.2  
changed lines
  Added in v.1.5

CVSweb <webmaster@jp.NetBSD.org>