28 #include <linux/slab.h>    29 #include <linux/string.h>    30 #include <linux/module.h>    31 #include <linux/vmalloc.h>    32 #include <linux/version.h>    33 #include <linux/cpumask.h>    34 #include <linux/sched.h>    35 #include <linux/kallsyms.h>    37 #include <asm/tlbflush.h>    49         ALERT(
"platform_alloc_rw: invalid length\n");
    56         ALERT(
"platform_alloc_rw: failed to vmalloc mem: %lld\n", len);
    68         ALERT(
"platform_alloc_rwe: invalid length\n");
    72     addr = __vmalloc(len, GFP_KERNEL, PAGE_KERNEL_EXEC);
    75         ALERT(
"platform_alloc_rwe: failed to vmalloc executable mem: %lld\n", len);
    87         ALERT(
"platform_free_rw: invalid address %p\n", addr);
   101         ALERT(
"platform_free_rwe: invalid address %p\n", addr);
   111     if (is_vmalloc_addr(virt))
   112         return (
void *)page_to_phys(vmalloc_to_page(virt));
   114         return (
void *)virt_to_phys(virt);
   132     memcpy(dst, src, num);
   138 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)   146 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)   154     int64_t num_cpus = num_online_cpus();
   170             ALERT(
"Failed to locate sched_setaffinity\n");
 void * memset(void *block, int c, size_t size)
 
constexpr const auto addr
 
constexpr const auto current
 
constexpr page_table_x64::integer_pointer virt