MIPS: Yosemite, Emma: Fix off-by-two in arcs_cmdline buffer size check
[linux-2.6/linux-mips.git] / arch / arm / mach-ux500 / hotplug.c
blob572015e57cd997f6b355de1a835404a94df12abc
1 /*
2 * Copyright (C) STMicroelectronics 2009
3 * Copyright (C) ST-Ericsson SA 2010
5 * License Terms: GNU General Public License v2
6 * Based on ARM realview platform
8 * Author: Sundar Iyer <sundar.iyer@stericsson.com>
11 #include <linux/kernel.h>
12 #include <linux/errno.h>
13 #include <linux/smp.h>
15 #include <asm/cacheflush.h>
17 extern volatile int pen_release;
19 static inline void platform_do_lowpower(unsigned int cpu)
21 flush_cache_all();
23 /* we put the platform to just WFI */
24 for (;;) {
25 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
26 : : : "memory");
27 if (pen_release == cpu_logical_map(cpu)) {
29 * OK, proper wakeup, we're done
31 break;
36 int platform_cpu_kill(unsigned int cpu)
38 return 1;
42 * platform-specific code to shutdown a CPU
44 * Called with IRQs disabled
46 void platform_cpu_die(unsigned int cpu)
48 /* directly enter low power state, skipping secure registers */
49 platform_do_lowpower(cpu);
52 int platform_cpu_disable(unsigned int cpu)
55 * we don't allow CPU 0 to be shutdown (it is still too special
56 * e.g. clock tick interrupts)
58 return cpu == 0 ? -EPERM : 0;