blob: 22312ba421eefa031167a6058ca4999c1ad7a0ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef _HACK_INTERRUPT_H_
#define _HACK_INTERRUPT_H_
#include <linux/netdevice.h>
#include "pfinet.h"
#define in_interrupt() (0)
#define synchronize_irq() ((void) 0)
#define synchronize_bh() ((void) 0) /* XXX ? */
/* The code that can call these are already entered holding
global_lock, which locks out the net_bh worker thread. */
#define start_bh_atomic() ((void) 0)
#define end_bh_atomic() ((void) 0)
/*
extern pthread_mutex_t net_bh_lock;
#define start_bh_atomic() pthread_mutex_lock (&net_bh_lock)
#define end_bh_atomic() pthread_mutex_unlock (&net_bh_lock)
*/
/* See sched.c::net_bh_worker comments. */
extern pthread_cond_t net_bh_wakeup;
extern int net_bh_raised;
#define NET_BH 0xb00bee51
/* The only call to this ever reached is in net/core/dev.c::netif_rx,
to announce having enqueued a packet on `backlog'. */
static inline void
mark_bh (int bh)
{
assert (bh == NET_BH);
net_bh_raised = 1;
pthread_cond_broadcast (&net_bh_wakeup);
}
void net_bh (void);
static inline void
init_bh (int bh, void (*fn) (void))
{
assert (bh == NET_BH);
assert (fn == &net_bh);
}
#endif
|