-static int notrace dmpatch_replace_code(unsigned long addr, unsigned long size, int expect, const char *desc)
+static unsigned char *g_get_patch[MAX_PATCH] = { NULL };
+static unsigned char *g_put_patch[MAX_PATCH] = { NULL };
+
+static void notrace dmpatch_restore_code(unsigned char *opCode)
+{
+ unsigned long align;
+
+ if (opCode)
+ {
+ align = (unsigned long)opCode / g_ko_param.pgsize * g_ko_param.pgsize;
+ set_mem_rw(align, 1);
+ *opCode = 0x80;
+ set_mem_ro(align, 1);
+ }
+}
+
+static int notrace dmpatch_replace_code
+(
+ unsigned long addr,
+ unsigned long size,
+ int expect,
+ const char *desc,
+ unsigned char **patch
+)