summaryrefslogtreecommitdiffstats
path: root/arch/sparc/prom
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/prom')
-rw-r--r--arch/sparc/prom/console.c18
-rw-r--r--arch/sparc/prom/devmap.c9
-rw-r--r--arch/sparc/prom/devops.c13
-rw-r--r--arch/sparc/prom/misc.c13
-rw-r--r--arch/sparc/prom/mp.c13
-rw-r--r--arch/sparc/prom/segment.c7
-rw-r--r--arch/sparc/prom/tree.c6
7 files changed, 53 insertions, 26 deletions
diff --git a/arch/sparc/prom/console.c b/arch/sparc/prom/console.c
index 9551094d0..4c999477b 100644
--- a/arch/sparc/prom/console.c
+++ b/arch/sparc/prom/console.c
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.11 1997/03/18 17:58:10 jj Exp $
+/* $Id: console.c,v 1.14 1997/05/14 20:44:58 davem Exp $
* console.c: Routines that deal with sending and receiving IO
* to/from the current console device using the PROM.
*
@@ -14,6 +14,9 @@
#include <asm/system.h>
#include <linux/string.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
+
/* Non blocking get character from console input device, returns -1
* if no input was taken. This can be used for polling.
*/
@@ -38,11 +41,12 @@ prom_nbgetchar(void)
}
break;
case PROM_AP1000:
+ default:
i = -1;
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
return i; /* Ugh, we could spin forever on unsupported proms ;( */
@@ -81,9 +85,12 @@ prom_nbputchar(char c)
#endif
break;
+ default:
+ i = -1;
+ break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
return i; /* Ugh, we could spin forever on unsupported proms ;( */
@@ -130,7 +137,7 @@ prom_query_input_device()
save_flags(flags); cli();
st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdin);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
if(prom_node_has_property(st_p, "keyboard"))
@@ -177,7 +184,7 @@ prom_query_output_device()
save_flags(flags); cli();
st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdout);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
propl = prom_getproperty(st_p, "device_type", propb, sizeof(propb));
@@ -208,6 +215,7 @@ prom_query_output_device()
}
break;
case PROM_AP1000:
+ default:
return PROMDEV_I_UNK;
};
return PROMDEV_O_UNK;
diff --git a/arch/sparc/prom/devmap.c b/arch/sparc/prom/devmap.c
index 841d63a47..cd99ac3d6 100644
--- a/arch/sparc/prom/devmap.c
+++ b/arch/sparc/prom/devmap.c
@@ -1,4 +1,4 @@
-/* $Id: devmap.c,v 1.3 1996/09/19 20:27:19 davem Exp $
+/* $Id: devmap.c,v 1.5 1997/05/14 20:44:59 davem Exp $
* promdevmap.c: Map device/IO areas to virtual addresses.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -11,6 +11,9 @@
#include <asm/openprom.h>
#include <asm/oplib.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
+
/* Just like the routines in palloc.c, these should not be used
* by the kernel at all. Bootloader facility mainly. And again,
* this is only available on V2 proms and above.
@@ -33,7 +36,7 @@ prom_mapio(char *vhint, int ios, unsigned int paddr, unsigned int num_bytes)
ret = (*(romvec->pv_v2devops.v2_dumb_mmap))(vhint, ios, paddr,
num_bytes);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
return ret;
@@ -49,7 +52,7 @@ prom_unmapio(char *vaddr, unsigned int num_bytes)
save_flags(flags); cli();
(*(romvec->pv_v2devops.v2_dumb_munmap))(vaddr, num_bytes);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
return;
diff --git a/arch/sparc/prom/devops.c b/arch/sparc/prom/devops.c
index 2b33dd2b7..f7feb0815 100644
--- a/arch/sparc/prom/devops.c
+++ b/arch/sparc/prom/devops.c
@@ -1,4 +1,4 @@
-/* $Id: devops.c,v 1.7 1997/03/18 17:58:19 jj Exp $
+/* $Id: devops.c,v 1.10 1997/05/14 20:44:59 davem Exp $
* devops.c: Device operations using the PROM.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -10,6 +10,9 @@
#include <asm/openprom.h>
#include <asm/oplib.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
+
/* Open the device described by the string 'dstr'. Returns the handle
* to that device used for subsequent operations on that device.
* Returns -1 on failure.
@@ -35,7 +38,7 @@ prom_devopen(char *dstr)
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
@@ -57,10 +60,11 @@ prom_devclose(int dhandle)
(*(romvec->pv_v2devops.v2_dev_close))(dhandle);
break;
case PROM_AP1000:
+ default:
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
return 0;
@@ -83,10 +87,11 @@ prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
(*(romvec->pv_v2devops.v2_dev_seek))(dhandle, seekhi, seeklo);
break;
case PROM_AP1000:
+ default:
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
diff --git a/arch/sparc/prom/misc.c b/arch/sparc/prom/misc.c
index d23d93f61..fede033dd 100644
--- a/arch/sparc/prom/misc.c
+++ b/arch/sparc/prom/misc.c
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.13 1997/04/10 05:12:59 davem Exp $
+/* $Id: misc.c,v 1.15 1997/05/14 20:45:00 davem Exp $
* misc.c: Miscellaneous prom functions that don't belong
* anywhere else.
*
@@ -13,6 +13,9 @@
#include <asm/oplib.h>
#include <asm/auxio.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
+
/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
@@ -22,7 +25,7 @@ prom_reboot(char *bcommand)
(*(romvec->pv_reboot))(bcommand);
/* Never get here. */
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
}
@@ -40,7 +43,7 @@ prom_feval(char *fstring)
else
(*(romvec->pv_fortheval.v2_eval))(fstring);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
}
@@ -72,7 +75,7 @@ prom_cmdline(void)
save_flags(flags); cli();
(*(romvec->pv_abort))();
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
install_linux_ticker();
@@ -97,7 +100,7 @@ again:
(*(romvec->pv_halt))();
/* Never get here. */
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
goto again; /* PROM is out to get me -DaveM */
diff --git a/arch/sparc/prom/mp.c b/arch/sparc/prom/mp.c
index cf71cca60..8f07f9d40 100644
--- a/arch/sparc/prom/mp.c
+++ b/arch/sparc/prom/mp.c
@@ -1,4 +1,4 @@
-/* $Id: mp.c,v 1.7 1997/03/18 17:58:23 jj Exp $
+/* $Id: mp.c,v 1.9 1997/05/14 20:45:01 davem Exp $
* mp.c: OpenBoot Prom Multiprocessor support routines. Don't call
* these on a UP or else you will halt and catch fire. ;)
*
@@ -12,6 +12,9 @@
#include <asm/openprom.h>
#include <asm/oplib.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
+
/* Start cpu with prom-tree node 'cpunode' using context described
* by 'ctable_reg' in context 'ctx' at program counter 'pc'.
*
@@ -36,7 +39,7 @@ prom_startcpu(int cpunode, struct linux_prom_registers *ctable_reg, int ctx, cha
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
@@ -65,7 +68,7 @@ prom_stopcpu(int cpunode)
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
@@ -94,7 +97,7 @@ prom_idlecpu(int cpunode)
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
@@ -123,7 +126,7 @@ prom_restartcpu(int cpunode)
break;
};
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
diff --git a/arch/sparc/prom/segment.c b/arch/sparc/prom/segment.c
index cb1def0e1..96b543727 100644
--- a/arch/sparc/prom/segment.c
+++ b/arch/sparc/prom/segment.c
@@ -1,4 +1,4 @@
-/* $Id: segment.c,v 1.3 1996/09/19 20:27:28 davem Exp $
+/* $Id: segment.c,v 1.5 1997/05/14 20:45:02 davem Exp $
* segment.c: Prom routine to map segments in other contexts before
* a standalone is completely mapped. This is for sun4 and
* sun4c architectures only.
@@ -12,6 +12,9 @@
#include <asm/openprom.h>
#include <asm/oplib.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
+
/* Set physical segment 'segment' at virtual address 'vaddr' in
* context 'ctx'.
*/
@@ -22,7 +25,7 @@ prom_putsegment(int ctx, unsigned long vaddr, int segment)
save_flags(flags); cli();
(*(romvec->pv_setctxt))(ctx, (char *) vaddr, segment);
__asm__ __volatile__("ld [%0], %%g6\n\t" : :
- "r" (&current_set[smp_processor_id()]) :
+ "r" (&current_set[hard_smp_processor_id()]) :
"memory");
restore_flags(flags);
return;
diff --git a/arch/sparc/prom/tree.c b/arch/sparc/prom/tree.c
index e5e2ceb3d..251b2ee6a 100644
--- a/arch/sparc/prom/tree.c
+++ b/arch/sparc/prom/tree.c
@@ -1,4 +1,4 @@
-/* $Id: tree.c,v 1.16 1997/03/19 14:53:16 davem Exp $
+/* $Id: tree.c,v 1.18 1997/05/14 20:45:03 davem Exp $
* tree.c: Basic device tree traversal/scanning for the Linux
* prom library.
*
@@ -15,10 +15,12 @@
#include <asm/openprom.h>
#include <asm/oplib.h>
+/* XXX Let's get rid of this thing if we can... */
+extern struct task_struct *current_set[NR_CPUS];
/* Macro to restore "current" to the g6 register. */
#define restore_current() __asm__ __volatile__("ld [%0], %%g6\n\t" : : \
- "r" (&current_set[smp_processor_id()]) : \
+ "r" (&current_set[hard_smp_processor_id()]) : \
"memory")
static char promlib_buf[128];