arch/sparc/include/asm/bitops_32.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/bitops_32.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/bitops_32.h- Extension
.h- Size
- 2852 bytes
- Lines
- 109
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
linux/compiler.hasm/byteorder.hasm-generic/bitops/non-atomic.hasm-generic/bitops/ffz.hasm-generic/bitops/__ffs.hasm-generic/bitops/sched.hasm-generic/bitops/ffs.hasm-generic/bitops/fls.hasm-generic/bitops/__fls.hasm-generic/bitops/fls64.hasm-generic/bitops/hweight.hasm-generic/bitops/lock.hasm-generic/bitops/le.hasm-generic/bitops/ext2-atomic.h
Detected Declarations
function test_and_set_bitfunction set_bitfunction test_and_clear_bitfunction clear_bitfunction test_and_change_bitfunction change_bit
Annotated Snippet
#ifndef _SPARC_BITOPS_H
#define _SPARC_BITOPS_H
#include <linux/compiler.h>
#include <asm/byteorder.h>
#ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
unsigned long sp32___set_bit(unsigned long *addr, unsigned long mask);
unsigned long sp32___clear_bit(unsigned long *addr, unsigned long mask);
unsigned long sp32___change_bit(unsigned long *addr, unsigned long mask);
/*
* Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0'
* is in the highest of the four bytes and bit '31' is the high bit
* within the first byte. Sparc is BIG-Endian. Unless noted otherwise
* all bit-ops return 0 if bit was previously clear and != 0 otherwise.
*/
static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
return sp32___set_bit(ADDR, mask) != 0;
}
static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
(void) sp32___set_bit(ADDR, mask);
}
static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
return sp32___clear_bit(ADDR, mask) != 0;
}
static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
(void) sp32___clear_bit(ADDR, mask);
}
static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
return sp32___change_bit(ADDR, mask) != 0;
}
static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
ADDR = ((unsigned long *) addr) + (nr >> 5);
mask = 1 << (nr & 31);
(void) sp32___change_bit(ADDR, mask);
}
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
Annotation
- Immediate include surface: `linux/compiler.h`, `asm/byteorder.h`, `asm-generic/bitops/non-atomic.h`, `asm-generic/bitops/ffz.h`, `asm-generic/bitops/__ffs.h`, `asm-generic/bitops/sched.h`, `asm-generic/bitops/ffs.h`, `asm-generic/bitops/fls.h`.
- Detected declarations: `function test_and_set_bit`, `function set_bit`, `function test_and_clear_bit`, `function clear_bit`, `function test_and_change_bit`, `function change_bit`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.