diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2018-09-15 20:50:42 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2018-09-15 20:50:42 +0200 |
| commit | 9ac669fc01dbfef707ecaa6b618c0d03294cca16 (patch) | |
| tree | 3207995766ab5664c60026daae5da268806a3262 /tools/include/linux/bitmap.h | |
| parent | fbfa9260085b5b578a049a90135e5c51928c5f7f (diff) | |
| parent | 67314ec7b0250290cc85eaa7a2f88a8ddb9e8547 (diff) | |
| download | cachepc-linux-9ac669fc01dbfef707ecaa6b618c0d03294cca16.tar.gz cachepc-linux-9ac669fc01dbfef707ecaa6b618c0d03294cca16.zip | |
Merge tag 'y2038' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground into timers/core
Pull more y2038 work from Arnd Bergman:
y2038: convert more syscalls
Here is another set of system call changes to prepare the change over to
64-bit time_t. As before, the strategy is to change system calls that
take a 'struct timespec' argument over to 'struct __kernel_timespec',
which for now is defined to be the same but will get redefined to use a
64-bit time_t argument once we are ready to modify the system call tables.
The major change from previous patches is that the plan is no longer
to directly use the 'compat' system calls for providing compatibility
with the existing 32-bit time_t based entry points. Instead, we rename
the compat code to something that makes more sense on 32-bit architectures,
e.g. compat_timespec becomes old_timespec32.
With the renamed types in place, change over the 'stat' and 'utimes'
families of system calls, sched_rr_get_interval, recvmmsg and
rt_sigtimedwait. Another series for poll, select and io_pgetevents is
currently being tested.
Diffstat (limited to 'tools/include/linux/bitmap.h')
| -rw-r--r-- | tools/include/linux/bitmap.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h index 63440cc8d618..e63662db131b 100644 --- a/tools/include/linux/bitmap.h +++ b/tools/include/linux/bitmap.h @@ -97,6 +97,23 @@ static inline int test_and_set_bit(int nr, unsigned long *addr) } /** + * test_and_clear_bit - Clear a bit and return its old value + * @nr: Bit to clear + * @addr: Address to count from + */ +static inline int test_and_clear_bit(int nr, unsigned long *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old; + + old = *p; + *p = old & ~mask; + + return (old & mask) != 0; +} + +/** * bitmap_alloc - Allocate bitmap * @nbits: Number of bits */ |
