arch/s390/kernel/runtime_instr.c

Source file repositories/reference/linux-study-clean/arch/s390/kernel/runtime_instr.c

File Facts

System
Linux kernel
Corpus path
arch/s390/kernel/runtime_instr.c
Extension
.c
Size
2252 bytes
Lines
103
Domain
Architecture Layer
Bucket
arch/s390
Inferred role
Architecture Layer: syscall or user/kernel boundary
Status
core 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.

Dependency Surface

Detected Declarations

Annotated Snippet

SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
{
	struct runtime_instr_cb *cb;

	if (!test_facility(64))
		return -EOPNOTSUPP;

	if (command == S390_RUNTIME_INSTR_STOP) {
		disable_runtime_instr();
		return 0;
	}

	if (command != S390_RUNTIME_INSTR_START)
		return -EINVAL;

	if (!current->thread.ri_cb) {
		cb = kzalloc_obj(*cb);
		if (!cb)
			return -ENOMEM;
	} else {
		cb = current->thread.ri_cb;
		memset(cb, 0, sizeof(*cb));
	}

	init_runtime_instr_cb(cb);

	/* now load the control block to make it available */
	preempt_disable();
	current->thread.ri_cb = cb;
	load_runtime_instr_cb(cb);
	preempt_enable();
	return 0;
}

Annotation

Implementation Notes