~ubuntu-branches/ubuntu/natty/linux-ti-omap4/natty

« back to all changes in this revision

Viewing changes to arch/x86/kernel/process_32.c

  • Committer: Bazaar Package Importer
  • Author(s): Bryan Wu, Bryan Wu
  • Date: 2011-04-04 21:33:36 UTC
  • Revision ID: james.westby@ubuntu.com-20110404213336-qav5h157bnma7eye
Tags: 2.6.38-1208.11
[ Bryan Wu ]

* [Config] Update to 2.6.38.2 kernel config and other changes
* SAUCE (no-up) trace: fix compiling error
* Rebased to 2.6.38.2 based Linaro kernel release
* Updates WLAN/BT/FM/Audio supporting from Andy Green and Sebastien Jan
  (u0 tag of for-ubuntu branch in Andy's tree)
* Rebased to Ubuntu master branch from 2.6.38-7.38 to 2.6.38-8.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <linux/uaccess.h>
39
39
#include <linux/io.h>
40
40
#include <linux/kdebug.h>
 
41
#include <linux/notifier.h>
 
42
#include <linux/idle.h>
 
43
#include <trace/pm.h>
41
44
 
42
45
#include <asm/pgtable.h>
43
46
#include <asm/system.h>
59
62
 
60
63
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
61
64
 
 
65
DEFINE_TRACE(pm_idle_exit);
 
66
DEFINE_TRACE(pm_idle_entry);
 
67
 
 
68
static DEFINE_PER_CPU(unsigned char, is_idle);
 
69
 
 
70
void enter_idle(void)
 
71
{
 
72
        percpu_write(is_idle, 1);
 
73
        trace_pm_idle_entry();
 
74
        notify_idle(IDLE_START);
 
75
}
 
76
EXPORT_SYMBOL_GPL(enter_idle);
 
77
 
 
78
void __exit_idle(void)
 
79
{
 
80
        if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
 
81
                return;
 
82
        notify_idle(IDLE_END);
 
83
        trace_pm_idle_exit();
 
84
}
 
85
EXPORT_SYMBOL_GPL(__exit_idle);
 
86
 
 
87
/* Called from interrupts to signify idle end */
 
88
void exit_idle(void)
 
89
{
 
90
        /* idle loop has pid 0 */
 
91
        if (current->pid)
 
92
                return;
 
93
        __exit_idle();
 
94
}
 
95
EXPORT_SYMBOL_GPL(exit_idle);
 
96
 
62
97
/*
63
98
 * Return saved PC of a blocked thread.
64
99
 */
107
142
                                play_dead();
108
143
 
109
144
                        local_irq_disable();
 
145
                        enter_idle();
110
146
                        /* Don't trace irqs off for idle */
111
147
                        stop_critical_timings();
112
148
                        pm_idle();
113
149
                        start_critical_timings();
 
150
 
 
151
                        /*
 
152
                         * In many cases the interrupt that ended idle
 
153
                         * has already called exit_idle. But some idle
 
154
                         * loops can be woken up without interrupt.
 
155
                         */
 
156
                        __exit_idle();
114
157
                }
115
158
                tick_nohz_restart_sched_tick();
116
159
                preempt_enable_no_resched();