arch/sh/include/uapi/asm/swab.h
Source file repositories/reference/linux-study-clean/arch/sh/include/uapi/asm/swab.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sh/include/uapi/asm/swab.h- Extension
.h- Size
- 933 bytes
- Lines
- 51
- 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.
Dependency Surface
linux/compiler.hlinux/types.hasm-generic/swab.h
Detected Declarations
function Copyrightfunction __arch_swab16function __arch_swab64
Annotated Snippet
#ifndef __ASM_SH_SWAB_H
#define __ASM_SH_SWAB_H
/*
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2000, 2001 Paolo Alberelli
*/
#include <linux/compiler.h>
#include <linux/types.h>
#include <asm-generic/swab.h>
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
__asm__(
"swap.b %1, %0\n\t"
"swap.w %0, %0\n\t"
"swap.b %0, %0"
: "=r" (x)
: "r" (x));
return x;
}
#define __arch_swab32 __arch_swab32
static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
{
__asm__(
"swap.b %1, %0"
: "=r" (x)
: "r" (x));
return x;
}
#define __arch_swab16 __arch_swab16
static inline __u64 __arch_swab64(__u64 val)
{
union {
struct { __u32 a,b; } s;
__u64 u;
} v, w;
v.u = val;
w.s.b = __arch_swab32(v.s.a);
w.s.a = __arch_swab32(v.s.b);
return w.u;
}
#define __arch_swab64 __arch_swab64
#endif /* __ASM_SH_SWAB_H */
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/types.h`, `asm-generic/swab.h`.
- Detected declarations: `function Copyright`, `function __arch_swab16`, `function __arch_swab64`.
- Atlas domain: Architecture Layer / arch/sh.
- 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.