mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muli Ben-Yehuda <mulix@actcom.co.il>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] add num_possible_cpus() to fix 2.5.29 apm.c compilation
Date: Sun, 28 Jul 2002 17:17:50 +0300	[thread overview]
Message-ID: <20020728141750.GB9573@alhambra.actcom.co.il> (raw)

[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]

This patch fixes the apm.c breakage in 2.5.29 by providing definitions
for num_possible_cpus() for UP and SMP. There were several patches
posted to fix it, but I think this is what the author intended. Rusty?

Patch against latest bitkeeper, compiles fine on UP and SMP. Don't
have an SMP machine to test it own. 

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.477   -> 1.478  
#	include/asm-i386/smp.h	1.11    -> 1.12   
#	arch/i386/kernel/apm.c	1.34    -> 1.35   
#	 include/linux/smp.h	1.12    -> 1.13   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/28	mulix@alhambra.merseine.nu	1.478
# fix compilation failure in apm.c due to missing num_possible_cpus()
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
--- a/arch/i386/kernel/apm.c	Sun Jul 28 17:07:57 2002
+++ b/arch/i386/kernel/apm.c	Sun Jul 28 17:07:57 2002
@@ -214,6 +214,7 @@
 #include <linux/sched.h>
 #include <linux/pm.h>
 #include <linux/kernel.h>
+#include <linux/smp.h>
 #include <linux/smp_lock.h>
 
 #include <asm/system.h>
diff -Nru a/include/asm-i386/smp.h b/include/asm-i386/smp.h
--- a/include/asm-i386/smp.h	Sun Jul 28 17:07:57 2002
+++ b/include/asm-i386/smp.h	Sun Jul 28 17:07:57 2002
@@ -93,6 +93,11 @@
 	return hweight32(cpu_online_map);
 }
 
+extern inline unsigned int num_possible_cpus(void)
+{
+	return hweight32(phys_cpu_present_map);
+}
+
 extern inline int any_online_cpu(unsigned int mask)
 {
 	if (mask & cpu_online_map)
diff -Nru a/include/linux/smp.h b/include/linux/smp.h
--- a/include/linux/smp.h	Sun Jul 28 17:07:57 2002
+++ b/include/linux/smp.h	Sun Jul 28 17:07:57 2002
@@ -96,6 +96,7 @@
 #define cpu_online_map				1
 #define cpu_online(cpu)				({ cpu; 1; })
 #define num_online_cpus()			1
+#define num_possible_cpus()                     1
 #define __per_cpu_data
 #define per_cpu(var, cpu)			var
 #define this_cpu(var)				var

-- 
http://vipe.technion.ac.il/~mulix/
http://syscalltrack.sf.net/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2002-07-28 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-28 14:17 Muli Ben-Yehuda [this message]
2002-07-30  3:20 ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020728141750.GB9573@alhambra.actcom.co.il \
    --to=mulix@actcom.co.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®