Hi Kefeng,The original users are all "char*", so same here ;)
On Sat, May 29, 2021 at 12:47 PM Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> wrote:
Add setup_initial_init_mm() helper to setup kernel text,Thanks for your patch!
data and brk.
Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
--- a/include/linux/mm_types.h"void *" (for all four)?
+++ b/include/linux/mm_types.h
@@ -564,6 +564,16 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(char *start_code,
+ char *end_code,
+ char *end_data,
+ char *brk)
+{Gr{oetje,eeting}s,
+ init_mm.start_code = (unsigned long)start_code;
+ init_mm.end_code = (unsigned long)end_code;
+ init_mm.end_data = (unsigned long)end_data;
+ init_mm.brk = (unsigned long)brk;
+}
Geert