diff --git a/sys/fs/msdosfs/bpb.h b/sys/fs/msdosfs/bpb.h index 88b9eefb859a..42c941b00ee8 100644 --- a/sys/fs/msdosfs/bpb.h +++ b/sys/fs/msdosfs/bpb.h @@ -113,8 +113,14 @@ struct bpb_a { * 16-bit and 32-bit quantities on byte boundaries. If this is not true, * use the macros for the big-endian case. */ + #include -#if (BYTE_ORDER == LITTLE_ENDIAN) /* && defined(UNALIGNED_ACCESS) */ + +#ifdef __i386__ +#define UNLALIGNED_ACCESS +#endif + +#if (BYTE_ORDER == LITTLE_ENDIAN) && defined(UNALIGNED_ACCESS) #define getushort(x) *((u_int16_t *)(x)) #define getulong(x) *((u_int32_t *)(x)) #define putushort(p, v) (*((u_int16_t *)(p)) = (v)) diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index adcfad041f26..da4919040725 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -84,7 +84,7 @@ struct msdosfsmount { u_long pm_fatblocksize; /* size of fat blocks in bytes */ u_long pm_fatblocksec; /* size of fat blocks in sectors */ u_long pm_fatsize; /* size of fat in bytes */ - u_long pm_fatmask; /* mask to use for fat numbers */ + u_int32_t pm_fatmask; /* mask to use for fat numbers */ u_long pm_fsinfo; /* fsinfo block number */ u_long pm_nxtfree; /* next free cluster in fsinfo block */ u_int pm_fatmult; /* these 2 values are used in fat */ diff --git a/sys/msdosfs/bpb.h b/sys/msdosfs/bpb.h index 88b9eefb859a..42c941b00ee8 100644 --- a/sys/msdosfs/bpb.h +++ b/sys/msdosfs/bpb.h @@ -113,8 +113,14 @@ struct bpb_a { * 16-bit and 32-bit quantities on byte boundaries. If this is not true, * use the macros for the big-endian case. */ + #include -#if (BYTE_ORDER == LITTLE_ENDIAN) /* && defined(UNALIGNED_ACCESS) */ + +#ifdef __i386__ +#define UNLALIGNED_ACCESS +#endif + +#if (BYTE_ORDER == LITTLE_ENDIAN) && defined(UNALIGNED_ACCESS) #define getushort(x) *((u_int16_t *)(x)) #define getulong(x) *((u_int32_t *)(x)) #define putushort(p, v) (*((u_int16_t *)(p)) = (v)) diff --git a/sys/msdosfs/msdosfsmount.h b/sys/msdosfs/msdosfsmount.h index adcfad041f26..da4919040725 100644 --- a/sys/msdosfs/msdosfsmount.h +++ b/sys/msdosfs/msdosfsmount.h @@ -84,7 +84,7 @@ struct msdosfsmount { u_long pm_fatblocksize; /* size of fat blocks in bytes */ u_long pm_fatblocksec; /* size of fat blocks in sectors */ u_long pm_fatsize; /* size of fat in bytes */ - u_long pm_fatmask; /* mask to use for fat numbers */ + u_int32_t pm_fatmask; /* mask to use for fat numbers */ u_long pm_fsinfo; /* fsinfo block number */ u_long pm_nxtfree; /* next free cluster in fsinfo block */ u_int pm_fatmult; /* these 2 values are used in fat */