mp.c 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * mp.c: OpenBoot Prom Multiprocessor support routines. Don't call
  3. * these on a UP or else you will halt and catch fire. ;)
  4. *
  5. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  6. */
  7. #include <linux/types.h>
  8. #include <linux/kernel.h>
  9. #include <linux/sched.h>
  10. #include <asm/openprom.h>
  11. #include <asm/oplib.h>
  12. extern void restore_current(void);
  13. /* Start cpu with prom-tree node 'cpunode' using context described
  14. * by 'ctable_reg' in context 'ctx' at program counter 'pc'.
  15. *
  16. * XXX Have to look into what the return values mean. XXX
  17. */
  18. int
  19. prom_startcpu(int cpunode, struct linux_prom_registers *ctable_reg, int ctx, char *pc)
  20. {
  21. int ret;
  22. unsigned long flags;
  23. spin_lock_irqsave(&prom_lock, flags);
  24. switch(prom_vers) {
  25. case PROM_V0:
  26. case PROM_V2:
  27. default:
  28. ret = -1;
  29. break;
  30. case PROM_V3:
  31. ret = (*(romvec->v3_cpustart))(cpunode, (int) ctable_reg, ctx, pc);
  32. break;
  33. }
  34. restore_current();
  35. spin_unlock_irqrestore(&prom_lock, flags);
  36. return ret;
  37. }