tools/testing/selftests/powerpc/benchmarks/exec_target.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/benchmarks/exec_target.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/powerpc/benchmarks/exec_target.c
Extension
.c
Size
572 bytes
Lines
29
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0+

/*
 * Part of fork context switch microbenchmark.
 *
 * Copyright 2018, Anton Blanchard, IBM Corp.
 */

#define _GNU_SOURCE
#include <sys/syscall.h>

void _start(void)
{
	asm volatile (
		"li %%r0, %[sys_exit];"
		"li %%r3, 0;"
		"sc;"
		:
		: [sys_exit] "i" (SYS_exit)
		/*
		 * "sc" will clobber r0, r3-r13, cr0, ctr, xer and memory.
		 * Even though sys_exit never returns, handle clobber
		 * registers.
		 */
		: "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
		  "r11", "r12", "r13", "cr0", "ctr", "xer", "memory"
	);
}

Annotation

Implementation Notes