~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to arch/x86/vdso/vma.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#include <asm/proto.h>
16
16
#include <asm/vdso.h>
17
17
 
18
 
#include "vextern.h"            /* Just for VMAGIC.  */
19
 
#undef VEXTERN
20
 
 
21
18
unsigned int __read_mostly vdso_enabled = 1;
22
19
 
23
20
extern char vdso_start[], vdso_end[];
26
23
static struct page **vdso_pages;
27
24
static unsigned vdso_size;
28
25
 
29
 
static inline void *var_ref(void *p, char *name)
30
 
{
31
 
        if (*(void **)p != (void *)VMAGIC) {
32
 
                printk("VDSO: variable %s broken\n", name);
33
 
                vdso_enabled = 0;
34
 
        }
35
 
        return p;
36
 
}
37
 
 
38
26
static int __init init_vdso_vars(void)
39
27
{
40
28
        int npages = (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE;
41
29
        int i;
42
 
        char *vbase;
43
30
 
44
31
        vdso_size = npages << PAGE_SHIFT;
45
32
        vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
54
41
                copy_page(page_address(p), vdso_start + i*PAGE_SIZE);
55
42
        }
56
43
 
57
 
        vbase = vmap(vdso_pages, npages, 0, PAGE_KERNEL);
58
 
        if (!vbase)
59
 
                goto oom;
60
 
 
61
 
        if (memcmp(vbase, "\177ELF", 4)) {
62
 
                printk("VDSO: I'm broken; not ELF\n");
63
 
                vdso_enabled = 0;
64
 
        }
65
 
 
66
 
#define VEXTERN(x) \
67
 
        *(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
68
 
#include "vextern.h"
69
 
#undef VEXTERN
70
 
        vunmap(vbase);
71
44
        return 0;
72
45
 
73
46
 oom: