arch/csky/include/asm/bitops.h
Source file repositories/reference/linux-study-clean/arch/csky/include/asm/bitops.h
File Facts
- System
- Linux kernel
- Corpus path
arch/csky/include/asm/bitops.h- Extension
.h- Size
- 1406 bytes
- Lines
- 80
- Domain
- Architecture Layer
- Bucket
- arch/csky
- 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/barrier.hasm-generic/bitops/ffz.hasm-generic/bitops/fls64.hasm-generic/bitops/sched.hasm-generic/bitops/hweight.hasm-generic/bitops/lock.hasm-generic/bitops/atomic.hasm-generic/bitops/non-atomic.hasm-generic/bitops/le.hasm-generic/bitops/ext2-atomic.h
Detected Declarations
function ffsfunction __ffsfunction flsfunction __fls
Annotated Snippet
#ifndef __ASM_CSKY_BITOPS_H
#define __ASM_CSKY_BITOPS_H
#include <linux/compiler.h>
#include <asm/barrier.h>
/*
* asm-generic/bitops/ffs.h
*/
static inline __attribute_const__ int ffs(int x)
{
if (!x)
return 0;
asm volatile (
"brev %0\n"
"ff1 %0\n"
"addi %0, 1\n"
: "=&r"(x)
: "0"(x));
return x;
}
/*
* asm-generic/bitops/__ffs.h
*/
static __always_inline __attribute_const__ unsigned long __ffs(unsigned long x)
{
asm volatile (
"brev %0\n"
"ff1 %0\n"
: "=&r"(x)
: "0"(x));
return x;
}
/*
* asm-generic/bitops/fls.h
*/
static __always_inline __attribute_const__ int fls(unsigned int x)
{
asm volatile(
"ff1 %0\n"
: "=&r"(x)
: "0"(x));
return (32 - x);
}
/*
* asm-generic/bitops/__fls.h
*/
static __always_inline __attribute_const__ unsigned long __fls(unsigned long x)
{
return fls(x) - 1;
}
#include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/fls64.h>
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/atomic.h>
/*
* bug fix, why only could use atomic!!!!
*/
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
#endif /* __ASM_CSKY_BITOPS_H */
Annotation
- Immediate include surface: `linux/compiler.h`, `asm/barrier.h`, `asm-generic/bitops/ffz.h`, `asm-generic/bitops/fls64.h`, `asm-generic/bitops/sched.h`, `asm-generic/bitops/hweight.h`, `asm-generic/bitops/lock.h`, `asm-generic/bitops/atomic.h`.
- Detected declarations: `function ffs`, `function __ffs`, `function fls`, `function __fls`.
- Atlas domain: Architecture Layer / arch/csky.
- 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.