OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-or32/] [hardirq.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1276 phoenix
#ifdef __KERNEL__
2
#ifndef _OR32_HARDIRQ_H
3
#define _OR32_HARDIRQ_H
4
 
5
#include <linux/config.h>
6
#include <asm/smp.h>
7
 
8
/* entry.S is sensitive to the offsets of these fields */
9
/* The __last_jiffy_stamp field is needed to ensure that no decrementer
10
 * interrupt is lost on SMP machines. Since on most CPUs it is in the same
11
 * cache line as local_irq_count, it is cheap to access and is also used on UP
12
 * for uniformity.
13
 */
14
typedef struct {
15
        unsigned long __softirq_pending;        /* set_bit is used on this */
16
        unsigned int __local_irq_count;
17
        unsigned int __local_bh_count;
18
        unsigned int __syscall_count;
19
        struct task_struct * __ksoftirqd_task;
20
        unsigned int __last_jiffy_stamp;
21
        unsigned int __heartbeat_count;
22
        unsigned int __heartbeat_reset;
23
} ____cacheline_aligned irq_cpustat_t;
24
 
25
#include <linux/irq_cpustat.h>  /* Standard mappings for irq_cpustat_t above */
26
 
27
#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
28
#define heartbeat_count(cpu) __IRQ_STAT((cpu), __heartbeat_count)
29
#define heartbeat_reset(cpu) __IRQ_STAT((cpu), __heartbeat_reset)
30
/*
31
 * Are we in an interrupt context? Either doing bottom half
32
 * or hardware interrupt processing?
33
 */
34
#define in_interrupt() ({ int __cpu = smp_processor_id(); \
35
        (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
36
 
37
#define in_irq() (local_irq_count(smp_processor_id()) != 0)
38
 
39
 
40
#define hardirq_trylock(cpu)    (local_irq_count(cpu) == 0)
41
#define hardirq_endlock(cpu)    do { } while (0)
42
 
43
#define hardirq_enter(cpu)      (local_irq_count(cpu)++)
44
#define hardirq_exit(cpu)       (local_irq_count(cpu)--)
45
 
46
#define synchronize_irq()       do { } while (0)
47
 
48
#endif /* _OR32_HARDIRQ_H */
49
#endif /* __KERNEL__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.