Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
[deliverable/linux.git] / arch / sparc / prom / p1275.c
CommitLineData
b00dc837 1/*
1da177e4
LT
2 * p1275.c: Sun IEEE 1275 PROM low level interface routines
3 *
4 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 */
6
7#include <linux/kernel.h>
1da177e4
LT
8#include <linux/sched.h>
9#include <linux/smp.h>
10#include <linux/string.h>
11#include <linux/spinlock.h>
bdcf81b6 12#include <linux/irqflags.h>
1da177e4
LT
13
14#include <asm/openprom.h>
15#include <asm/oplib.h>
1da177e4
LT
16#include <asm/spitfire.h>
17#include <asm/pstate.h>
4f0234f4 18#include <asm/ldc.h>
1da177e4
LT
19
20struct {
21 long prom_callback; /* 0x00 */
22 void (*prom_cif_handler)(long *); /* 0x08 */
1da177e4
LT
23} p1275buf;
24
25extern void prom_world(int);
26
25edd694 27extern void prom_cif_direct(unsigned long *args);
1da177e4
LT
28extern void prom_cif_callback(void);
29
1da177e4 30/*
8a4fd1e4 31 * This provides SMP safety on the p1275buf.
1da177e4 32 */
8a4fd1e4 33DEFINE_RAW_SPINLOCK(prom_entry_lock);
1da177e4 34
25edd694 35void p1275_cmd_direct(unsigned long *args)
1da177e4 36{
1da177e4 37 unsigned long flags;
1da177e4 38
bdcf81b6
DM
39 local_save_flags(flags);
40 local_irq_restore((unsigned long)PIL_NMI);
8a4fd1e4 41 raw_spin_lock(&prom_entry_lock);
1da177e4 42
1da177e4 43 prom_world(1);
25edd694 44 prom_cif_direct(args);
1da177e4
LT
45 prom_world(0);
46
8a4fd1e4 47 raw_spin_unlock(&prom_entry_lock);
bdcf81b6 48 local_irq_restore(flags);
1da177e4
LT
49}
50
51void prom_cif_init(void *cif_handler, void *cif_stack)
52{
53 p1275buf.prom_cif_handler = (void (*)(long *))cif_handler;
1da177e4 54}
This page took 0.703086 seconds and 5 git commands to generate.