Rusty Russell | 11 Mar 07:01 2009

[PATCH] cpumask: update 32-bit APM not to mug current->cpus_allowed.

Impact: cleanup, avoid cpumask games.

The APM code wants to run on CPU 0: we create an "on_cpu0" wrapper
which uses work_on_cpu() if we're not already on cpu 0.

This introduces a new failure mode: -ENOMEM, so we add an explicit err
arg and handle Linux-style errnos in apm_err().

Signed-off-by: Rusty Russell <rusty <at>>
To: Stephen Rothwell <sfr <at>>
Cc: linux-laptop <at>
 arch/x86/kernel/apm_32.c |  276 +++++++++++++++++++++++++++--------------------
 1 file changed, 159 insertions(+), 117 deletions(-)

diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
 <at>  <at>  -466,7 +466,7  <at>  <at>  static const lookup_t error_table[] = {
  *	 <at> err: APM BIOS return code
  *	Write a meaningful log entry to the kernel log in the event of
- *	an APM error.
+ *	an APM error.  Note that this also handles (negative) kernel errors.

 static void apm_error(char *str, int err)
 <at>  <at>  -478,41 +478,12  <at>  <at>  static void apm_error(char *str, int err
 	if (i < ERROR_COUNT)
(Continue reading)