Re: [PATCH] move initialize_secondary() from start_kernel() into

Manfred Spraul (manfreds@colorfullife.com)
Wed, 02 Jun 1999 17:53:36 +0200


This is a multi-part message in MIME format.
--------------7E8F9775E5DCCB41E4CD38EC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

"David S. Miller" wrote:
> From: Manfred Spraul <manfreds@colorfullife.com>
>
> * I did not remove the initialize_secondary() functions
> from arch/{alpha, ppc, sparc, sparc64} because
> I've heard that the most up to date versions
> are maintained in individual CVS trees.
> This is really not the case anymore, we're pretty synchronized at this
> point.

Here's the long version, I've removed initialize_secondary from all
architectures except i386.
--------------7E8F9775E5DCCB41E4CD38EC
Content-Type: text/plain; charset=us-ascii;
name="patch-SMPCLEANUP-2.3.4"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-SMPCLEANUP-2.3.4"

// $Header: /pub/cvs/ms/patches/patch-SMPCLEANUP-2.3.4,v 1.2 1999/06/02 15:53:35 ms Exp $
// Kernel Version:
// VERSION = 2
// PATCHLEVEL = 3
// SUBLEVEL = 4
// EXTRAVERSION =
diff -r -u -P -x CVS -x *,v 2.3/arch/alpha/kernel/smp.c build-2.3/arch/alpha/kernel/smp.c
--- 2.3/arch/alpha/kernel/smp.c Wed May 19 14:20:13 1999
+++ build-2.3/arch/alpha/kernel/smp.c Wed Jun 2 17:32:59 1999
@@ -565,17 +565,6 @@
mb();
}

-/*
- * Only broken Intel needs this, thus it should not even be
- * referenced globally.
- */
-
-void __init
-initialize_secondary(void)
-{
-}
-
-
extern void update_one_process(struct task_struct *p, unsigned long ticks,
unsigned long user, unsigned long system,
int cpu);
diff -r -u -P -x CVS -x *,v 2.3/arch/i386/kernel/head.S build-2.3/arch/i386/kernel/head.S
--- 2.3/arch/i386/kernel/head.S Fri Jan 15 07:57:25 1999
+++ build-2.3/arch/i386/kernel/head.S Wed Jun 2 14:24:36 1999
@@ -242,6 +242,14 @@
xorl %eax,%eax
lldt %ax
cld # gcc2 wants the direction flag cleared at all times
+#ifdef __SMP__
+ movb ready, %cl
+ cmpb $1,%cl
+ je 1f
+ call SYMBOL_NAME(initialize_secondary)
+ jmp L6
+1:
+#endif
call SYMBOL_NAME(start_kernel)
L6:
jmp L6 # main should never return here, but
diff -r -u -P -x CVS -x *,v 2.3/arch/ppc/kernel/smp.c build-2.3/arch/ppc/kernel/smp.c
--- 2.3/arch/ppc/kernel/smp.c Wed May 19 14:16:08 1999
+++ build-2.3/arch/ppc/kernel/smp.c Wed Jun 2 17:33:15 1999
@@ -373,11 +373,6 @@
smp_commenced = 1;
}

-/* intel needs this */
-void __init initialize_secondary(void)
-{
-}
-
/* Activate a secondary processor. */
asmlinkage int __init start_secondary(void *unused)
{
diff -r -u -P -x CVS -x *,v 2.3/arch/sparc/kernel/smp.c build-2.3/arch/sparc/kernel/smp.c
--- 2.3/arch/sparc/kernel/smp.c Wed May 19 14:15:46 1999
+++ build-2.3/arch/sparc/kernel/smp.c Wed Jun 2 17:33:23 1999
@@ -100,13 +100,6 @@
local_flush_tlb_all();
}

-/* Only broken Intel needs this, thus it should not even be referenced
- * globally...
- */
-__initfunc(void initialize_secondary(void))
-{
-}
-
extern int cpu_idle(void *unused);

/* Activate a secondary processor. */
diff -r -u -P -x CVS -x *,v 2.3/arch/sparc64/kernel/smp.c build-2.3/arch/sparc64/kernel/smp.c
--- 2.3/arch/sparc64/kernel/smp.c Wed Jun 2 14:00:10 1999
+++ build-2.3/arch/sparc64/kernel/smp.c Wed Jun 2 17:33:34 1999
@@ -160,10 +160,6 @@
extern int cpu_idle(void *unused);
extern void init_IRQ(void);

-void initialize_secondary(void)
-{
-}
-
int start_secondary(void *unused)
{
trap_init();
diff -r -u -P -x CVS -x *,v 2.3/init/main.c build-2.3/init/main.c
--- 2.3/init/main.c Wed May 19 14:20:14 1999
+++ build-2.3/init/main.c Wed Jun 2 14:24:36 1999
@@ -1116,8 +1116,6 @@

#endif

-extern void initialize_secondary(void);
-
/*
* Activate the first processor.
*/
@@ -1125,14 +1123,6 @@
asmlinkage void __init start_kernel(void)
{
char * command_line;
-
-#ifdef __SMP__
- static int boot_cpu = 1;
- /* "current" has been set up, we need to load it now */
- if (!boot_cpu)
- initialize_secondary();
- boot_cpu = 0;
-#endif

/*
* Interrupts are still disabled. Do necessary setups, then

--------------7E8F9775E5DCCB41E4CD38EC--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/