A few local variables exist only so the contents of a global variable
can be copied to them, and use that value only for reading.
Just remove them and rename some global variables. Also change
vdso64_[start|end] to be character arrays to be consistent with other
architectures, and get rid of the global variable vdso64_kbase.
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
#include <asm/facility.h>
#include <asm/timex.h>
#include <asm/facility.h>
#include <asm/timex.h>
-extern char vdso64_start, vdso64_end;
-static void *vdso64_kbase = &vdso64_start;
-static unsigned int vdso64_pages;
-static struct page **vdso64_pagelist;
+extern char vdso64_start[], vdso64_end[];
+static unsigned int vdso_pages;
+static struct page **vdso_pagelist;
/*
* Should the kernel map a VDSO page into processes and pass its
/*
* Should the kernel map a VDSO page into processes and pass its
static vm_fault_t vdso_fault(const struct vm_special_mapping *sm,
struct vm_area_struct *vma, struct vm_fault *vmf)
{
static vm_fault_t vdso_fault(const struct vm_special_mapping *sm,
struct vm_area_struct *vma, struct vm_fault *vmf)
{
- struct page **vdso_pagelist;
- unsigned long vdso_pages;
-
- vdso_pagelist = vdso64_pagelist;
- vdso_pages = vdso64_pages;
-
if (vmf->pgoff >= vdso_pages)
return VM_FAULT_SIGBUS;
if (vmf->pgoff >= vdso_pages)
return VM_FAULT_SIGBUS;
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
- unsigned long vdso_pages;
unsigned long vdso_base;
int rc;
unsigned long vdso_base;
int rc;
if (is_compat_task())
return 0;
if (is_compat_task())
return 0;
- vdso_pages = vdso64_pages;
/*
* pick a base address for the vDSO in process space. We try to put
* it at vdso_base which is the "natural" base for it, but we might
/*
* pick a base address for the vDSO in process space. We try to put
* it at vdso_base which is the "natural" base for it, but we might
- /* Calculate the size of the 64 bit vDSO */
- vdso64_pages = ((&vdso64_end - &vdso64_start) >> PAGE_SHIFT) + 1;
+ /* Calculate the size of the vDSO */
+ vdso_pages = ((vdso64_end - vdso64_start) >> PAGE_SHIFT) + 1;
/* Make sure pages are in the correct state */
/* Make sure pages are in the correct state */
- vdso64_pagelist = kcalloc(vdso64_pages + 1, sizeof(struct page *),
- GFP_KERNEL);
- if (!vdso64_pagelist) {
+ vdso_pagelist = kcalloc(vdso_pages + 1, sizeof(struct page *),
+ GFP_KERNEL);
+ if (!vdso_pagelist) {
vdso_enabled = 0;
return -ENOMEM;
}
vdso_enabled = 0;
return -ENOMEM;
}
- for (i = 0; i < vdso64_pages - 1; i++) {
- struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE);
+ for (i = 0; i < vdso_pages - 1; i++) {
+ struct page *pg = virt_to_page(vdso64_start + i * PAGE_SIZE);
- vdso64_pagelist[i] = pg;
- vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data);
- vdso64_pagelist[vdso64_pages] = NULL;
+ vdso_pagelist[vdso_pages - 1] = virt_to_page(vdso_data);
+ vdso_pagelist[vdso_pages] = NULL;
get_page(virt_to_page(vdso_data));
get_page(virt_to_page(vdso_data));