arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
Source file repositories/reference/linux-study-clean/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/include/asm/mach-cavium-octeon/mangle-port.h- Extension
.h- Size
- 1744 bytes
- Lines
- 65
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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
asm/byteorder.h
Detected Declarations
function Copyrightfunction __should_swizzle_addr
Annotated Snippet
#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H
#define __ASM_MACH_GENERIC_MANGLE_PORT_H
#include <asm/byteorder.h>
#ifdef __BIG_ENDIAN
static inline bool __should_swizzle_bits(volatile void *a)
{
extern const bool octeon_should_swizzle_table[];
u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
return octeon_should_swizzle_table[did];
}
# define __swizzle_addr_b(port) (port)
# define __swizzle_addr_w(port) (port)
# define __swizzle_addr_l(port) (port)
# define __swizzle_addr_q(port) (port)
#else /* __LITTLE_ENDIAN */
#define __should_swizzle_bits(a) false
static inline bool __should_swizzle_addr(u64 p)
{
/* boot bus? */
return ((p >> 40) & 0xff) == 0;
}
# define __swizzle_addr_b(port) \
(__should_swizzle_addr(port) ? (port) ^ 7 : (port))
# define __swizzle_addr_w(port) \
(__should_swizzle_addr(port) ? (port) ^ 6 : (port))
# define __swizzle_addr_l(port) \
(__should_swizzle_addr(port) ? (port) ^ 4 : (port))
# define __swizzle_addr_q(port) (port)
#endif /* __BIG_ENDIAN */
# define ioswabb(a, x) (x)
# define __mem_ioswabb(a, x) (x)
# define ioswabw(a, x) (__should_swizzle_bits(a) ? \
le16_to_cpu((__force __le16)(x)) : \
(x))
# define __mem_ioswabw(a, x) (x)
# define ioswabl(a, x) (__should_swizzle_bits(a) ? \
le32_to_cpu((__force __le32)(x)) : \
(x))
# define __mem_ioswabl(a, x) (x)
# define ioswabq(a, x) (__should_swizzle_bits(a) ? \
le64_to_cpu((__force __le64)(x)) : \
(x))
# define __mem_ioswabq(a, x) (x)
#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
Annotation
- Immediate include surface: `asm/byteorder.h`.
- Detected declarations: `function Copyright`, `function __should_swizzle_addr`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.