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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-or32/] [hardirq.h] - Rev 1765

Compare with Previous | Blame | View Log

#ifdef __KERNEL__
#ifndef _OR32_HARDIRQ_H
#define _OR32_HARDIRQ_H
 
#include <linux/config.h>
#include <asm/smp.h>
 
/* entry.S is sensitive to the offsets of these fields */
/* The __last_jiffy_stamp field is needed to ensure that no decrementer 
 * interrupt is lost on SMP machines. Since on most CPUs it is in the same 
 * cache line as local_irq_count, it is cheap to access and is also used on UP 
 * for uniformity.
 */
typedef struct {
	unsigned long __softirq_pending;	/* set_bit is used on this */
	unsigned int __local_irq_count;
	unsigned int __local_bh_count;
	unsigned int __syscall_count;
	struct task_struct * __ksoftirqd_task;
	unsigned int __last_jiffy_stamp;
	unsigned int __heartbeat_count;
	unsigned int __heartbeat_reset;
} ____cacheline_aligned irq_cpustat_t;
 
#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
 
#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
#define heartbeat_count(cpu) __IRQ_STAT((cpu), __heartbeat_count)
#define heartbeat_reset(cpu) __IRQ_STAT((cpu), __heartbeat_reset)
/*
 * Are we in an interrupt context? Either doing bottom half
 * or hardware interrupt processing?
 */
#define in_interrupt() ({ int __cpu = smp_processor_id(); \
	(local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
 
#define in_irq() (local_irq_count(smp_processor_id()) != 0)
 
 
#define hardirq_trylock(cpu)	(local_irq_count(cpu) == 0)
#define hardirq_endlock(cpu)	do { } while (0)
 
#define hardirq_enter(cpu)	(local_irq_count(cpu)++)
#define hardirq_exit(cpu)	(local_irq_count(cpu)--)
 
#define synchronize_irq()	do { } while (0)
 
#endif /* _OR32_HARDIRQ_H */
#endif /* __KERNEL__ */
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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