tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S- Extension
.S- Size
- 1704 bytes
- Lines
- 98
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
common.hcheck-reversed.Scheck.S
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#include "common.h"
.data
.balign 8
success_message:
.ascii "success: switch_endian_test\n\0"
.balign 8
failure_message:
.ascii "failure: switch_endian_test\n\0"
.section ".toc"
.balign 8
pattern:
.8byte 0x5555AAAA5555AAAA
.text
FUNC_START(_start)
/* Load the pattern */
ld r15, pattern@TOC(%r2)
/* Setup CR, only CR2-CR4 are maintained */
lis r3, 0x00FF
ori r3, r3, 0xF000
mtcr r3
/* Load the pattern slightly modified into the registers */
mr r3, r15
addi r4, r15, 4
addi r5, r15, 32
mtlr r5
addi r5, r15, 5
addi r6, r15, 6
addi r7, r15, 7
addi r8, r15, 8
/* r9 - r12 are clobbered */
addi r13, r15, 13
addi r14, r15, 14
/* Skip r15 we're using it */
addi r16, r15, 16
addi r17, r15, 17
addi r18, r15, 18
addi r19, r15, 19
addi r20, r15, 20
addi r21, r15, 21
addi r22, r15, 22
addi r23, r15, 23
addi r24, r15, 24
addi r25, r15, 25
addi r26, r15, 26
addi r27, r15, 27
addi r28, r15, 28
addi r29, r15, 29
addi r30, r15, 30
addi r31, r15, 31
/*
* Call the syscall to switch endian.
* It clobbers r9-r12, XER, CTR and CR0-1,5-7.
*/
li r0, __NR_switch_endian
sc
tdi 0, 0, 0x48 // b +8 if the endian was switched
Annotation
- Immediate include surface: `common.h`, `check-reversed.S`, `check.S`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
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.