Linux Audio

Check our new training course

Loading...
v3.5.6
 1/*
 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>
 8#include <linux/init.h>
 9#include <linux/sched.h>
10#include <linux/smp.h>
11#include <linux/string.h>
12#include <linux/spinlock.h>
 
13
14#include <asm/openprom.h>
15#include <asm/oplib.h>
16#include <asm/spitfire.h>
17#include <asm/pstate.h>
18#include <asm/ldc.h>
19
20struct {
21	long prom_callback;			/* 0x00 */
22	void (*prom_cif_handler)(long *);	/* 0x08 */
23	unsigned long prom_cif_stack;		/* 0x10 */
24} p1275buf;
25
26extern void prom_world(int);
27
28extern void prom_cif_direct(unsigned long *args);
29extern void prom_cif_callback(void);
30
31/*
32 * This provides SMP safety on the p1275buf.
33 */
34DEFINE_RAW_SPINLOCK(prom_entry_lock);
35
36void p1275_cmd_direct(unsigned long *args)
37{
38	unsigned long flags;
39
40	raw_local_save_flags(flags);
41	raw_local_irq_restore((unsigned long)PIL_NMI);
42	raw_spin_lock(&prom_entry_lock);
43
44	prom_world(1);
45	prom_cif_direct(args);
46	prom_world(0);
47
48	raw_spin_unlock(&prom_entry_lock);
49	raw_local_irq_restore(flags);
50}
51
52void prom_cif_init(void *cif_handler, void *cif_stack)
53{
54	p1275buf.prom_cif_handler = (void (*)(long *))cif_handler;
55	p1275buf.prom_cif_stack = (unsigned long)cif_stack;
56}
v4.10.11
 1/*
 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>
 
 8#include <linux/sched.h>
 9#include <linux/smp.h>
10#include <linux/string.h>
11#include <linux/spinlock.h>
12#include <linux/irqflags.h>
13
14#include <asm/openprom.h>
15#include <asm/oplib.h>
16#include <asm/spitfire.h>
17#include <asm/pstate.h>
18#include <asm/ldc.h>
19
20struct {
21	long prom_callback;			/* 0x00 */
22	void (*prom_cif_handler)(long *);	/* 0x08 */
 
23} p1275buf;
24
25extern void prom_world(int);
26
27extern void prom_cif_direct(unsigned long *args);
28extern void prom_cif_callback(void);
29
30/*
31 * This provides SMP safety on the p1275buf.
32 */
33DEFINE_RAW_SPINLOCK(prom_entry_lock);
34
35void p1275_cmd_direct(unsigned long *args)
36{
37	unsigned long flags;
38
39	local_save_flags(flags);
40	local_irq_restore((unsigned long)PIL_NMI);
41	raw_spin_lock(&prom_entry_lock);
42
43	prom_world(1);
44	prom_cif_direct(args);
45	prom_world(0);
46
47	raw_spin_unlock(&prom_entry_lock);
48	local_irq_restore(flags);
49}
50
51void prom_cif_init(void *cif_handler, void *cif_stack)
52{
53	p1275buf.prom_cif_handler = (void (*)(long *))cif_handler;
 
54}