[PATCH] minor cleanups

Manfred Spraul (manfreds@colorfullife.com)
Sat, 11 Sep 1999 09:39:47 +0000


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

I've send these 2 patches to Linus before, but I never received any
replies.

Both patches are against 2.3.16, but I've just tested them with 2.3.18.

patch-globals: remove a few unreferences global variables from
arch/i386/kernel/smp.c

patch-cleanup: initialize_secondary() is a x86 hack, it should be called
from arch/i386 and it shouldn't be referenced in init/main.c

--
	Manfred
--------------8AFA51AD2F06C79A43865222
Content-Type: text/plain; charset=us-ascii;
 name="patch-globals"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-globals"

// Kernel Version: // VERSION = 2 // PATCHLEVEL = 3 // SUBLEVEL = 16 // EXTRAVERSION = --- 2.3/arch/i386/kernel/smp.c Thu Aug 19 19:33:55 1999 +++ build-2.3/arch/i386/kernel/smp.c Fri Sep 3 13:42:25 1999 @@ -111,21 +111,13 @@ static volatile unsigned long cpu_callin_map[NR_CPUS] = {0,}; /* We always use 0 the rest is ready for parallel delivery */ static volatile unsigned long cpu_callout_map[NR_CPUS] = {0,}; /* We always use 0 the rest is ready for parallel delivery */ volatile unsigned long smp_invalidate_needed; /* Used for the invalidate map that's also checked in the spinlock */ -volatile unsigned long kstack_ptr; /* Stack vector for booting CPUs */ struct cpuinfo_x86 cpu_data[NR_CPUS]; /* Per CPU bogomips and other parameters */ static unsigned int num_processors = 1; /* Internal processor count */ -unsigned long mp_ioapic_addr = 0xFEC00000; /* Address of the I/O apic (not yet used) */ unsigned char boot_cpu_id = 0; /* Processor that is doing the boot up */ static int smp_activated = 0; /* Tripped once we need to start cross invalidating */ int apic_version[NR_CPUS]; /* APIC version number */ -unsigned long apic_retval; /* Just debugging the assembler.. */ - -volatile unsigned long kernel_counter=0; /* Number of times the processor holds the lock */ -volatile unsigned long syscall_count=0; /* Number of times the processor holds the syscall lock */ volatile unsigned long ipi_count; /* Number of IPIs delivered */ - -const char lk_lockmsg[] = "lock from interrupt context at %p\n"; int mp_bus_id_to_type [MAX_MP_BUSSES] = { -1, }; extern int nr_ioapics;

--------------8AFA51AD2F06C79A43865222 Content-Type: text/plain; charset=us-ascii; name="patch-cleanup" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-cleanup"

// Kernel Version: // VERSION = 2 // PATCHLEVEL = 3 // SUBLEVEL = 16 // 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 Sep 1 18:20:18 1999 +++ build-2.3/arch/alpha/kernel/smp.c Fri Sep 3 13:30:05 1999 @@ -579,17 +579,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 Thu Jul 22 22:25:37 1999 +++ build-2.3/arch/i386/kernel/head.S Fri Sep 3 13:30:05 1999 @@ -243,6 +243,15 @@ 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 # the first CPU calls start_kernel + # all other CPUs call initialize_secondary + 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 Sep 1 18:20:23 1999 +++ build-2.3/arch/ppc/kernel/smp.c Fri Sep 3 13:30:05 1999 @@ -388,11 +388,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 Sep 1 18:20:24 1999 +++ build-2.3/arch/sparc/kernel/smp.c Fri Sep 3 13:31:15 1999 @@ -100,13 +100,6 @@ local_flush_tlb_all(); } -/* Only broken Intel needs this, thus it should not even be referenced - * globally... - */ -void __init initialize_secondary(void) -{ -} - extern int cpu_idle(void); /* 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 Sep 1 18:20:29 1999 +++ build-2.3/arch/sparc64/kernel/smp.c Fri Sep 3 13:30:05 1999 @@ -164,10 +164,6 @@ extern int cpu_idle(void); extern void init_IRQ(void); -void initialize_secondary(void) -{ -} - int start_secondary(void *unused) { trap_init(); Only in 2.3/drivers/net: sk_mca.h.orig 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 Sep 1 18:20:49 1999 +++ build-2.3/init/main.c Fri Sep 3 13:30:05 1999 @@ -438,8 +438,6 @@ #endif -extern void initialize_secondary(void); - /* * Activate the first processor. */ @@ -447,14 +445,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

--------------8AFA51AD2F06C79A43865222--

- 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/