forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/mips/vdso/genvdso.c
....@@ -1,11 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2015 Imagination Technologies
34 * Author: Alex Smith <alex.smith@imgtec.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License as published by the
7
- * Free Software Foundation; either version 2 of the License, or (at your
8
- * option) any later version.
95 */
106
117 /*
....@@ -263,6 +259,18 @@
263259 fprintf(out_file, "#include <linux/linkage.h>\n");
264260 fprintf(out_file, "#include <linux/mm.h>\n");
265261 fprintf(out_file, "#include <asm/vdso.h>\n");
262
+ fprintf(out_file, "static int vdso_mremap(\n");
263
+ fprintf(out_file, " const struct vm_special_mapping *sm,\n");
264
+ fprintf(out_file, " struct vm_area_struct *new_vma)\n");
265
+ fprintf(out_file, "{\n");
266
+ fprintf(out_file, " unsigned long new_size =\n");
267
+ fprintf(out_file, " new_vma->vm_end - new_vma->vm_start;\n");
268
+ fprintf(out_file, " if (vdso_image.size != new_size)\n");
269
+ fprintf(out_file, " return -EINVAL;\n");
270
+ fprintf(out_file, " current->mm->context.vdso =\n");
271
+ fprintf(out_file, " (void *)(new_vma->vm_start);\n");
272
+ fprintf(out_file, " return 0;\n");
273
+ fprintf(out_file, "}\n");
266274
267275 /* Write out the stripped VDSO data. */
268276 fprintf(out_file,
....@@ -287,6 +295,7 @@
287295 fprintf(out_file, "\t.mapping = {\n");
288296 fprintf(out_file, "\t\t.name = \"[vdso]\",\n");
289297 fprintf(out_file, "\t\t.pages = vdso_pages,\n");
298
+ fprintf(out_file, "\t\t.mremap = vdso_mremap,\n");
290299 fprintf(out_file, "\t},\n");
291300
292301 /* Calculate and write symbol offsets to <output file> */