arch/sh/include/asm/futex.h
Source file repositories/reference/linux-study-clean/arch/sh/include/asm/futex.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/include/asm/futex.h- Extension
.h- Size
- 1381 bytes
- Lines
- 73
- Domain
- Architecture Layer
- Bucket
- arch/sh
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
Dependency Surface
linux/futex.hlinux/uaccess.hasm/errno.hasm/futex-irq.hasm/futex-cas.hasm/futex-llsc.h
Detected Declarations
function futex_atomic_cmpxchg_inatomicfunction arch_futex_atomic_op_inuser
Annotated Snippet
switch (op) {
case FUTEX_OP_SET:
newval = oparg;
break;
case FUTEX_OP_ADD:
newval = oldval + oparg;
break;
case FUTEX_OP_OR:
newval = oldval | oparg;
break;
case FUTEX_OP_ANDN:
newval = oldval & ~oparg;
break;
case FUTEX_OP_XOR:
newval = oldval ^ oparg;
break;
default:
ret = -ENOSYS;
break;
}
if (ret) break;
ret = futex_atomic_cmpxchg_inatomic(&prev, uaddr, oldval, newval);
} while (!ret && prev != oldval);
if (!ret)
*oval = oldval;
return ret;
}
#endif /* __ASM_SH_FUTEX_H */
Annotation
- Immediate include surface: `linux/futex.h`, `linux/uaccess.h`, `asm/errno.h`, `asm/futex-irq.h`, `asm/futex-cas.h`, `asm/futex-llsc.h`.
- Detected declarations: `function futex_atomic_cmpxchg_inatomic`, `function arch_futex_atomic_op_inuser`.
- Atlas domain: Architecture Layer / arch/sh.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.