hotplug.c 823 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * SMP support for R-Mobile / SH-Mobile
  3. *
  4. * Copyright (C) 2010 Magnus Damm
  5. *
  6. * Based on realview, Copyright (C) 2002 ARM Ltd, All Rights Reserved
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/errno.h>
  14. #include <linux/smp.h>
  15. int platform_cpu_kill(unsigned int cpu)
  16. {
  17. return 1;
  18. }
  19. void platform_cpu_die(unsigned int cpu)
  20. {
  21. while (1) {
  22. /*
  23. * here's the WFI
  24. */
  25. asm(".word 0xe320f003\n"
  26. :
  27. :
  28. : "memory", "cc");
  29. }
  30. }
  31. int platform_cpu_disable(unsigned int cpu)
  32. {
  33. /*
  34. * we don't allow CPU 0 to be shutdown (it is still too special
  35. * e.g. clock tick interrupts)
  36. */
  37. return cpu == 0 ? -EPERM : 0;
  38. }