.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Imagination Technologies |
---|
3 | 4 | * 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. |
---|
9 | 5 | */ |
---|
10 | 6 | |
---|
11 | 7 | /* |
---|
.. | .. |
---|
263 | 259 | fprintf(out_file, "#include <linux/linkage.h>\n"); |
---|
264 | 260 | fprintf(out_file, "#include <linux/mm.h>\n"); |
---|
265 | 261 | 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"); |
---|
266 | 274 | |
---|
267 | 275 | /* Write out the stripped VDSO data. */ |
---|
268 | 276 | fprintf(out_file, |
---|
.. | .. |
---|
287 | 295 | fprintf(out_file, "\t.mapping = {\n"); |
---|
288 | 296 | fprintf(out_file, "\t\t.name = \"[vdso]\",\n"); |
---|
289 | 297 | fprintf(out_file, "\t\t.pages = vdso_pages,\n"); |
---|
| 298 | + fprintf(out_file, "\t\t.mremap = vdso_mremap,\n"); |
---|
290 | 299 | fprintf(out_file, "\t},\n"); |
---|
291 | 300 | |
---|
292 | 301 | /* Calculate and write symbol offsets to <output file> */ |
---|