Release 4.14 arch/x86/boot/bitops.h
/* -*- linux-c -*- ------------------------------------------------------- *
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright 2007 rPath, Inc. - All Rights Reserved
*
* This file is part of the Linux kernel, and is made available under
* the terms of the GNU General Public License version 2.
*
* ----------------------------------------------------------------------- */
/*
* Very simple bitops for the boot code.
*/
#ifndef BOOT_BITOPS_H
#define BOOT_BITOPS_H
#define _LINUX_BITOPS_H
/* Inhibit inclusion of <linux/bitops.h> */
#include <linux/types.h>
static inline bool constant_test_bit(int nr, const void *addr)
{
const u32 *p = (const u32 *)addr;
return ((1UL << (nr & 31)) & (p[nr >> 5])) != 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
H. Peter Anvin | 51 | 100.00% | 2 | 100.00% |
Total | 51 | 100.00% | 2 | 100.00% |
static inline bool variable_test_bit(int nr, const void *addr)
{
bool v;
const u32 *p = (const u32 *)addr;
asm("btl %2,%1; setc %0" : "=qm" (v) : "m" (*p), "Ir" (nr));
return v;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
H. Peter Anvin | 34 | 100.00% | 2 | 100.00% |
Total | 34 | 100.00% | 2 | 100.00% |
#define test_bit(nr,addr) \
(__builtin_constant_p(nr) ? \
constant_test_bit((nr),(addr)) : \
variable_test_bit((nr),(addr)))
static inline void set_bit(int nr, void *addr)
{
asm("btsl %1,%0" : "+m" (*(u32 *)addr) : "Ir" (nr));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
H. Peter Anvin | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#endif /* BOOT_BITOPS_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
H. Peter Anvin | 127 | 99.22% | 2 | 66.67% |
Américo Wang | 1 | 0.78% | 1 | 33.33% |
Total | 128 | 100.00% | 3 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.