include/linux/livepatch_external.h

Source file repositories/reference/linux-study-clean/include/linux/livepatch_external.h

File Facts

System
Linux kernel
Corpus path
include/linux/livepatch_external.h
Extension
.h
Size
2603 bytes
Lines
77
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct klp_callbacks {
	klp_pre_patch_t		pre_patch;
	klp_post_patch_t	post_patch;
	klp_pre_unpatch_t	pre_unpatch;
	klp_post_unpatch_t	post_unpatch;
	bool post_unpatch_enabled;
};

/*
 * 'struct klp_{func,object}_ext' are compact "external" representations of
 * 'struct klp_{func,object}'.   They are used by objtool for livepatch
 * generation.  The structs are then read by the livepatch module and converted
 * to the real structs before calling klp_enable_patch().
 *
 * TODO make these the official API for klp_enable_patch().  That should
 * simplify livepatch's interface as well as its data structure lifetime
 * management.
 */
struct klp_func_ext {
	const char *old_name;
	void *new_func;
	unsigned long sympos;
};

struct klp_object_ext {
	const char *name;
	struct klp_func_ext *funcs;
	struct klp_callbacks callbacks;
	unsigned int nr_funcs;
};

#endif /* _LINUX_LIVEPATCH_EXTERNAL_H_ */

Annotation

Implementation Notes