Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * mp.c:  OpenBoot Prom Multiprocessor support routines.  Don't call
0004  *        these on a UP or else you will halt and catch fire. ;)
0005  *
0006  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
0007  */
0008 
0009 #include <linux/types.h>
0010 #include <linux/kernel.h>
0011 #include <linux/sched.h>
0012 
0013 #include <asm/openprom.h>
0014 #include <asm/oplib.h>
0015 
0016 extern void restore_current(void);
0017 
0018 /* Start cpu with prom-tree node 'cpunode' using context described
0019  * by 'ctable_reg' in context 'ctx' at program counter 'pc'.
0020  *
0021  * XXX Have to look into what the return values mean. XXX
0022  */
0023 int
0024 prom_startcpu(int cpunode, struct linux_prom_registers *ctable_reg, int ctx, char *pc)
0025 {
0026     int ret;
0027     unsigned long flags;
0028 
0029     spin_lock_irqsave(&prom_lock, flags);
0030     switch(prom_vers) {
0031     case PROM_V0:
0032     case PROM_V2:
0033     default:
0034         ret = -1;
0035         break;
0036     case PROM_V3:
0037         ret = (*(romvec->v3_cpustart))(cpunode, (int) ctable_reg, ctx, pc);
0038         break;
0039     }
0040     restore_current();
0041     spin_unlock_irqrestore(&prom_lock, flags);
0042 
0043     return ret;
0044 }