Blame view

kernel/livepatch/patch.h 1.12 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
c349cdcab   Josh Poimboeuf   livepatch: move p...
2
3
4
5
6
7
8
9
10
11
12
  #ifndef _LIVEPATCH_PATCH_H
  #define _LIVEPATCH_PATCH_H
  
  #include <linux/livepatch.h>
  #include <linux/list.h>
  #include <linux/ftrace.h>
  
  /**
   * struct klp_ops - structure for tracking registered ftrace ops structs
   *
   * A single ftrace_ops is shared between all enabled replacement functions
19514910d   Petr Mladek   livepatch: Change...
13
   * (klp_func structs) which have the same old_func.  This allows the switch
c349cdcab   Josh Poimboeuf   livepatch: move p...
14
15
16
17
18
19
20
21
22
23
24
25
26
   * between function versions to happen instantaneously by updating the klp_ops
   * struct's func_stack list.  The winner is the klp_func at the top of the
   * func_stack (front of the list).
   *
   * @node:	node for the global klp_ops list
   * @func_stack:	list head for the stack of klp_func's (active func is on top)
   * @fops:	registered ftrace ops struct
   */
  struct klp_ops {
  	struct list_head node;
  	struct list_head func_stack;
  	struct ftrace_ops fops;
  };
19514910d   Petr Mladek   livepatch: Change...
27
  struct klp_ops *klp_find_ops(void *old_func);
c349cdcab   Josh Poimboeuf   livepatch: move p...
28
29
30
  
  int klp_patch_object(struct klp_object *obj);
  void klp_unpatch_object(struct klp_object *obj);
d83a7cb37   Josh Poimboeuf   livepatch: change...
31
  void klp_unpatch_objects(struct klp_patch *patch);
d697bad58   Petr Mladek   livepatch: Remove...
32
  void klp_unpatch_objects_dynamic(struct klp_patch *patch);
c349cdcab   Josh Poimboeuf   livepatch: move p...
33
34
  
  #endif /* _LIVEPATCH_PATCH_H */