diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-11-03 20:09:42 -0500 |
---|---|---|
committer | Michael Ellerman <michael@ellerman.id.au> | 2005-11-03 20:09:42 -0500 |
commit | b8f510219edc719d4c305918e16edc578bcfc16f (patch) | |
tree | 7f0303abf4ce15d1f35516ee36fc8aebc270db6d /arch | |
parent | 40765d2b8b86446b4ac8ec880cf4fdf56ce4ae7e (diff) |
powerpc: Implement smp_release_cpus() in C not asm
There's no reason for smp_release_cpus() to be asm, and most people can make
more sense of C code. Add an extern declaration to smp.h and remove the custom
one in machine_kexec.c
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 18 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 23 | ||||
-rw-r--r-- | arch/ppc64/kernel/head.S | 18 | ||||
-rw-r--r-- | arch/ppc64/kernel/machine_kexec.c | 1 |
4 files changed, 21 insertions, 39 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index ba30e3177b05..45d81976987f 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -1914,24 +1914,6 @@ _GLOBAL(hmt_start_secondary) | |||
1914 | blr | 1914 | blr |
1915 | #endif | 1915 | #endif |
1916 | 1916 | ||
1917 | #if defined(CONFIG_KEXEC) || defined(CONFIG_SMP) | ||
1918 | _GLOBAL(smp_release_cpus) | ||
1919 | /* All secondary cpus are spinning on a common | ||
1920 | * spinloop, release them all now so they can start | ||
1921 | * to spin on their individual paca spinloops. | ||
1922 | * For non SMP kernels, the secondary cpus never | ||
1923 | * get out of the common spinloop. | ||
1924 | * XXX This does nothing useful on iSeries, secondaries are | ||
1925 | * already waiting on their paca. | ||
1926 | */ | ||
1927 | li r3,1 | ||
1928 | LOADADDR(r5,__secondary_hold_spinloop) | ||
1929 | std r3,0(r5) | ||
1930 | sync | ||
1931 | blr | ||
1932 | #endif /* CONFIG_SMP */ | ||
1933 | |||
1934 | |||
1935 | /* | 1917 | /* |
1936 | * We put a few things here that have to be page-aligned. | 1918 | * We put a few things here that have to be page-aligned. |
1937 | * This stuff goes at the beginning of the bss, which is page-aligned. | 1919 | * This stuff goes at the beginning of the bss, which is page-aligned. |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index d4a3c5dd1a21..275d86ddd612 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -103,8 +103,6 @@ extern void htab_initialize(void); | |||
103 | extern void early_init_devtree(void *flat_dt); | 103 | extern void early_init_devtree(void *flat_dt); |
104 | extern void unflatten_device_tree(void); | 104 | extern void unflatten_device_tree(void); |
105 | 105 | ||
106 | extern void smp_release_cpus(void); | ||
107 | |||
108 | int have_of = 1; | 106 | int have_of = 1; |
109 | int boot_cpuid = 0; | 107 | int boot_cpuid = 0; |
110 | int boot_cpuid_phys = 0; | 108 | int boot_cpuid_phys = 0; |
@@ -400,6 +398,27 @@ void __init early_setup(unsigned long dt_ptr) | |||
400 | } | 398 | } |
401 | 399 | ||
402 | 400 | ||
401 | #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) | ||
402 | void smp_release_cpus(void) | ||
403 | { | ||
404 | extern unsigned long __secondary_hold_spinloop; | ||
405 | |||
406 | DBG(" -> smp_release_cpus()\n"); | ||
407 | |||
408 | /* All secondary cpus are spinning on a common spinloop, release them | ||
409 | * all now so they can start to spin on their individual paca | ||
410 | * spinloops. For non SMP kernels, the secondary cpus never get out | ||
411 | * of the common spinloop. | ||
412 | * This is useless but harmless on iSeries, secondaries are already | ||
413 | * waiting on their paca spinloops. */ | ||
414 | |||
415 | __secondary_hold_spinloop = 1; | ||
416 | mb(); | ||
417 | |||
418 | DBG(" <- smp_release_cpus()\n"); | ||
419 | } | ||
420 | #endif /* CONFIG_SMP || CONFIG_KEXEC */ | ||
421 | |||
403 | /* | 422 | /* |
404 | * Initialize some remaining members of the ppc64_caches and systemcfg structures | 423 | * Initialize some remaining members of the ppc64_caches and systemcfg structures |
405 | * (at least until we get rid of them completely). This is mostly some | 424 | * (at least until we get rid of them completely). This is mostly some |
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 0b65efe1682e..db1cf397be2d 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S | |||
@@ -1914,24 +1914,6 @@ _GLOBAL(hmt_start_secondary) | |||
1914 | blr | 1914 | blr |
1915 | #endif | 1915 | #endif |
1916 | 1916 | ||
1917 | #if defined(CONFIG_KEXEC) || defined(CONFIG_SMP) | ||
1918 | _GLOBAL(smp_release_cpus) | ||
1919 | /* All secondary cpus are spinning on a common | ||
1920 | * spinloop, release them all now so they can start | ||
1921 | * to spin on their individual paca spinloops. | ||
1922 | * For non SMP kernels, the secondary cpus never | ||
1923 | * get out of the common spinloop. | ||
1924 | * XXX This does nothing useful on iSeries, secondaries are | ||
1925 | * already waiting on their paca. | ||
1926 | */ | ||
1927 | li r3,1 | ||
1928 | LOADADDR(r5,__secondary_hold_spinloop) | ||
1929 | std r3,0(r5) | ||
1930 | sync | ||
1931 | blr | ||
1932 | #endif /* CONFIG_SMP */ | ||
1933 | |||
1934 | |||
1935 | /* | 1917 | /* |
1936 | * We put a few things here that have to be page-aligned. | 1918 | * We put a few things here that have to be page-aligned. |
1937 | * This stuff goes at the beginning of the bss, which is page-aligned. | 1919 | * This stuff goes at the beginning of the bss, which is page-aligned. |
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c index bf7cc4f8210f..ff8679f260f3 100644 --- a/arch/ppc64/kernel/machine_kexec.c +++ b/arch/ppc64/kernel/machine_kexec.c | |||
@@ -244,7 +244,6 @@ static void kexec_prepare_cpus(void) | |||
244 | 244 | ||
245 | static void kexec_prepare_cpus(void) | 245 | static void kexec_prepare_cpus(void) |
246 | { | 246 | { |
247 | extern void smp_release_cpus(void); | ||
248 | /* | 247 | /* |
249 | * move the secondarys to us so that we can copy | 248 | * move the secondarys to us so that we can copy |
250 | * the new kernel 0-0x100 safely | 249 | * the new kernel 0-0x100 safely |