1 #ifndef __M68K_SOFTIRQ_H
2 #define __M68K_SOFTIRQ_H
5 * Software interrupts.. no SMP here either.
8 #include <asm/atomic.h>
10 #define get_active_bhs() (bh_mask & bh_active)
11 #define clear_active_bhs(x) atomic_clear_mask((x),&bh_active)
13 extern inline void init_bh(int nr
, void (*routine
)(void))
15 bh_base
[nr
] = routine
;
16 bh_mask_count
[nr
] = 0;
20 extern inline void mark_bh(int nr
)
22 set_bit(nr
, &bh_active
);
26 * These use a mask count to correctly handle
27 * nested disable/enable calls
29 extern inline void disable_bh(int nr
)
31 bh_mask
&= ~(1 << nr
);
35 extern inline void enable_bh(int nr
)
37 if (!--bh_mask_count
[nr
])
41 extern inline void remove_bh(int nr
)
44 bh_mask
&= ~(1 << nr
);
47 extern unsigned int local_bh_count
[NR_CPUS
];
49 extern inline void start_bh_atomic(void)
51 local_bh_count
[smp_processor_id()]++;
55 extern inline void end_bh_atomic(void)
58 local_bh_count
[smp_processor_id()]--;
61 /* These are for the irq's testing the lock */
62 #define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
63 #define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
64 #define synchronize_bh() do { } while (0)