arch/powerpc/kernel/static_call.c

Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/static_call.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/kernel/static_call.c
Extension
.c
Size
1719 bytes
Lines
66
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration 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

if (func && !is_short) {
			err = patch_ulong(tramp + PPC_SCT_DATA, _func);
			if (err)
				goto out;
		}

		if (!func)
			err = patch_instruction(tramp, ppc_inst(PPC_RAW_BLR()));
		else if (is_ret0)
			err = patch_branch(tramp, _ret0, 0);
		else if (is_short)
			err = patch_branch(tramp, _func, 0);
		else
			err = patch_instruction(tramp, ppc_inst(PPC_RAW_NOP()));
	} else {
		err = 0;
	}

out:
	mutex_unlock(&text_mutex);

	if (err)
		panic("%s: patching failed %pS at %pS\n", __func__, func, tramp);
}
EXPORT_SYMBOL_GPL(arch_static_call_transform);

Annotation

Implementation Notes