46 void *ptr = _data.func.vmalloc_exec(_data.args.vmalloc_size);
49 breakpoint_2(_data.token.error, _data.func.vmalloc_exec, 0);
53 void *entry_ptr = (
void *)
breakpoint_1(_data.token.hypercall, ptr);
54 void *task = _data.func.kthread_create_on_node(entry_ptr, NULL, -1,
"bdagent");
57 breakpoint_2(_data.token.error, _data.func.kthread_create_on_node, task);
61 int ret = _data.func.wake_up_process(task);
64 breakpoint_2(_data.token.error, _data.func.wake_up_process, ret);
struct data::@2 args
The arguments of the agent.
struct data::@0 token
The tokens used to communicate with Intocore.
static __default_fn_attr unsigned long breakpoint(unsigned long token)
Generate INT3 instruction for hypercall.
void *() kthread_create_on_node_fn(int(*threadfn)(void *data), void *data, int node, const char namefmt[],...)
__agent_trampoline("kthread")
The trampoline of the agent.
vmalloc_exec_fn * vmalloc_exec
#define breakpoint_1(token, p1)
Hypercall using 1 argument.
struct data _data __agent_data("kthread")
The section used for this agent is .kthread_data'.
#define breakpoint_2(token, p1, p2)
Hypercall using 2 argument.
wake_up_process_fn * wake_up_process
#define __agent_exit(x)
Generates the exit asm-code using a label.
kthread_create_on_node_fn * kthread_create_on_node
int() wake_up_process_fn(void *p)
struct data::@1 func
The functions used by this agent.
unsigned long vmalloc_size
The size of allocation.
void *() vmalloc_exec_fn(unsigned long size)
__fn_naked void trampoline(void)
The trampoline of the agent.
__agent_text("kthread")
Allocates a memory region with size of _data.args.vmalloc_size, deploy the main agent in that memory ...