]> Pileus Git - ~andy/linux/blobdiff - arch/arm/kernel/process.c
Merge remote-tracking branch 'asoc/topic/sgtl5000' into asoc-next
[~andy/linux] / arch / arm / kernel / process.c
index 566d0d71a1e7e2c0cdd1716f097de8a1fdf582ef..94f6b05f9e24e8cd1d79063f03a9b2dd16791c67 100644 (file)
@@ -197,6 +197,7 @@ void machine_shutdown(void)
  */
 void machine_halt(void)
 {
+       local_irq_disable();
        smp_send_stop();
 
        local_irq_disable();
@@ -211,6 +212,7 @@ void machine_halt(void)
  */
 void machine_power_off(void)
 {
+       local_irq_disable();
        smp_send_stop();
 
        if (pm_power_off)
@@ -230,6 +232,7 @@ void machine_power_off(void)
  */
 void machine_restart(char *cmd)
 {
+       local_irq_disable();
        smp_send_stop();
 
        arm_pm_restart(reboot_mode, cmd);
@@ -426,6 +429,7 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
 }
 
 #ifdef CONFIG_MMU
+#ifdef CONFIG_KUSER_HELPERS
 /*
  * The vectors page is always readable from user space for the
  * atomic helpers. Insert it into the gate_vma so that it is visible
@@ -458,25 +462,30 @@ int in_gate_area_no_mm(unsigned long addr)
 {
        return in_gate_area(NULL, addr);
 }
+#define is_gate_vma(vma)       ((vma) == &gate_vma)
+#else
+#define is_gate_vma(vma)       0
+#endif
 
 const char *arch_vma_name(struct vm_area_struct *vma)
 {
-       return (vma == &gate_vma) ? "[vectors]" :
+       return is_gate_vma(vma) ? "[vectors]" :
                (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ?
                 "[sigpage]" : NULL;
 }
 
+static struct page *signal_page;
 extern struct page *get_signal_page(void);
 
 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 {
        struct mm_struct *mm = current->mm;
-       struct page *page;
        unsigned long addr;
        int ret;
 
-       page = get_signal_page();
-       if (!page)
+       if (!signal_page)
+               signal_page = get_signal_page();
+       if (!signal_page)
                return -ENOMEM;
 
        down_write(&mm->mmap_sem);
@@ -488,7 +497,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 
        ret = install_special_mapping(mm, addr, PAGE_SIZE,
                VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC,
-               &page);
+               &signal_page);
 
        if (ret == 0)
                mm->context.sigpage = addr;