~ubuntu-branches/ubuntu/precise/util-linux/precise-proposed

« back to all changes in this revision

Viewing changes to include/bitops.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-06-20 22:31:50 UTC
  • mfrom: (1.6.3 upstream) (4.5.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110620223150-lz8wrv0946ihcz3z
Tags: 2.19.1-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - Build for multiarch.
  - Add pre-depends on multiarch-support.
  - configure.ac: don't try to be clever about extracting a path name from
    $libdir to append to /usr in a way that's not overridable; instead,
    reuse the built-in configurable libexecdir.
  - Fix up the .pc.in files to know about libexecdir, so our substitutions
    don't leave us with unusable pkg-config files.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - Mention mountall(8) in fstab(5) manpages, along with its special
    options.
  - Since upstart is required in Ubuntu, the hwclock.sh init script is not
    called on startup and the hwclockfirst.sh init script is removed.
  - Drop depends on initscripts for the above.
  - Replace hwclock udev rule with an Upstart job.
  - For the case where mount is called with a directory to mount, look
    that directory up in mountall's /lib/init/fstab if we couldn't find
    it mentioned anywhere else.  This means "mount /proc", "mount /sys",
    etc. work.
  - mount.8 points to the cifs-utils package, not the obsolete smbfs one. 
* Dropped changes:
  - mount.preinst: lsb_release has been fixed in lucid and above to be
    usable without configuration, so we don't have to diverge from Debian
    here anymore.
* Changes merged upstream:
  - sfdisk support for '+' with '-N'
  - mount/umount.c: fix a segfault on umount with empty mtab entry
  - Fix arbitrary unmount with fuse security issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#define BITOPS_H
3
3
 
4
4
#include <stdint.h>
5
 
#include <endian.h>
6
5
 
7
6
/*
8
7
 * Bit map related macros. Usually provided by libc.
20
19
# define isclr(a,i)     (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
21
20
#endif
22
21
 
23
 
#if !defined __BYTE_ORDER || !(__BYTE_ORDER == __LITTLE_ENDIAN) && !(__BYTE_ORDER == __BIG_ENDIAN)
24
 
#error missing __BYTE_ORDER
25
 
#endif
26
 
 
27
22
/*
28
23
 * Byte swab macros (based on linux/byteorder/swab.h)
29
24
 */
51
46
                (uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) ))
52
47
 
53
48
 
54
 
#if (__BYTE_ORDER == __BIG_ENDIAN)
 
49
#ifdef WORDS_BIGENDIAN
55
50
 
56
51
#define cpu_to_le16(x) swab16(x)
57
52
#define cpu_to_le32(x) swab32(x)
67
62
#define be32_to_cpu(x) (x)
68
63
#define be64_to_cpu(x) (x)
69
64
 
70
 
#else /* __BYTE_ORDER != __BIG_ENDIAN */
 
65
#else /* !WORDS_BIGENDIAN */
71
66
 
72
67
#define cpu_to_le16(x) (x)
73
68
#define cpu_to_le32(x) (x)
83
78
#define be32_to_cpu(x) swab32(x)
84
79
#define be64_to_cpu(x) swab64(x)
85
80
 
86
 
#endif /* __BYTE_ORDER */
 
81
#endif /* WORDS_BIGENDIAN */
87
82
 
88
83
#endif /* BITOPS_H */
89
84