2 * p1275.c: Sun IEEE 1275 PROM low level interface routines
4 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
7 #include <linux/kernel.h>
8 #include <linux/sched.h>
10 #include <linux/string.h>
11 #include <linux/spinlock.h>
12 #include <linux/irqflags.h>
14 #include <asm/openprom.h>
15 #include <asm/oplib.h>
16 #include <asm/spitfire.h>
17 #include <asm/pstate.h>
21 long prom_callback; /* 0x00 */
22 void (*prom_cif_handler)(long *); /* 0x08 */
25 extern void prom_world(int);
27 extern void prom_cif_direct(unsigned long *args);
28 extern void prom_cif_callback(void);
31 * This provides SMP safety on the p1275buf.
33 DEFINE_RAW_SPINLOCK(prom_entry_lock);
35 void p1275_cmd_direct(unsigned long *args)
39 local_save_flags(flags);
40 local_irq_restore((unsigned long)PIL_NMI);
41 raw_spin_lock(&prom_entry_lock);
44 prom_cif_direct(args);
47 raw_spin_unlock(&prom_entry_lock);
48 local_irq_restore(flags);
51 void prom_cif_init(void *cif_handler, void *cif_stack)
53 p1275buf.prom_cif_handler = (void (*)(long *))cif_handler;