~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to arch/arm/kernel/suspend.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <linux/init.h>
2
2
 
 
3
#include <asm/idmap.h>
3
4
#include <asm/pgalloc.h>
4
5
#include <asm/pgtable.h>
5
6
#include <asm/memory.h>
6
7
#include <asm/suspend.h>
7
8
#include <asm/tlbflush.h>
8
9
 
9
 
static pgd_t *suspend_pgd;
10
 
 
11
10
extern int __cpu_suspend(unsigned long, int (*)(unsigned long));
12
11
extern void cpu_resume_mmu(void);
13
12
 
21
20
        *save_ptr = virt_to_phys(ptr);
22
21
 
23
22
        /* This must correspond to the LDM in cpu_resume() assembly */
24
 
        *ptr++ = virt_to_phys(suspend_pgd);
 
23
        *ptr++ = virt_to_phys(idmap_pgd);
25
24
        *ptr++ = sp;
26
25
        *ptr++ = virt_to_phys(cpu_do_resume);
27
26
 
42
41
        struct mm_struct *mm = current->active_mm;
43
42
        int ret;
44
43
 
45
 
        if (!suspend_pgd)
 
44
        if (!idmap_pgd)
46
45
                return -EINVAL;
47
46
 
48
47
        /*
59
58
 
60
59
        return ret;
61
60
}
62
 
 
63
 
static int __init cpu_suspend_init(void)
64
 
{
65
 
        suspend_pgd = pgd_alloc(&init_mm);
66
 
        if (suspend_pgd) {
67
 
                unsigned long addr = virt_to_phys(cpu_resume_mmu);
68
 
                identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE);
69
 
        }
70
 
        return suspend_pgd ? 0 : -ENOMEM;
71
 
}
72
 
core_initcall(cpu_suspend_init);