sys/src/vmsirq.c File Reference

#include <linux/config.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/kernel_stat.h>
#include <linux/irq.h>
#include <linux/proc_fs.h>
#include <asm/atomic.h>
#include <asm/io.h>
#include <asm/smp.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/delay.h>
#include <asm/desc.h>
#include <asm/irq.h>
#include <idbdef.h>
#include <ucbdef.h>
#include <crbdef.h>
#include <vecdef.h>

Go to the source code of this file.

Defines

#define shutdown_none   disable_none
#define end_none   enable_none
#define HEX_DIGITS   8
#define MAX_NAMELEN   10

Functions

void vms_no_action (int cpl, void *dev_id, struct pt_regs *regs)
int vms_get_irq_list (char *buf)
int vms_handle_IRQ_event (struct _idb *idb, unsigned int irq, struct pt_regs *regs, struct irqaction *action)
void vms_disable_irq_nosync (unsigned int irq)
void vms_disable_irq (unsigned int irq)
void vms_enable_irq (unsigned int irq)
asmlinkage unsigned int vms_do_IRQ (struct pt_regs regs)
int vms_request_irq (struct _idb *idb, unsigned int irq, void(*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char *devname, void *dev_id)
void vms_free_irq (unsigned int irq, void *dev_id)
unsigned long vms_probe_irq_on (void)
unsigned int vms_probe_irq_mask (unsigned long val)
int vms_probe_irq_off (unsigned long val)
int vms_setup_irq (unsigned int irq, struct irqaction *new)
void vms_init_irq_proc (void)

Variables

irq_desc_t vms_irq_desc[NR_IRQS] __cacheline_aligned
struct hw_interrupt_type vms_no_irq_type
atomic_t vms_irq_err_count
unsigned long vms_prof_cpu_mask = -1


Define Documentation

#define end_none   enable_none

Definition at line 119 of file vmsirq.c.

#define HEX_DIGITS   8

Definition at line 1051 of file vmsirq.c.

#define MAX_NAMELEN   10

Definition at line 1153 of file vmsirq.c.

#define shutdown_none   disable_none

Definition at line 118 of file vmsirq.c.


Function Documentation

void vms_disable_irq ( unsigned int  irq  ) 

disable_irq - disable an irq and wait for completion : Interrupt to disable

Disable the selected interrupt line. Enables and Disables are nested. This function waits for any pending IRQ handlers for this interrupt to complete before returning. If you use this function while holding a resource the IRQ handler may need you will deadlock.

This function may be called - with care - from IRQ context.

Definition at line 518 of file vmsirq.c.

void vms_disable_irq_nosync ( unsigned int  irq  )  [inline]

disable_irq_nosync - disable an irq without waiting : Interrupt to disable

Disable the selected interrupt line. Disables and Enables are nested. Unlike disable_irq(), this function does not ensure existing instances of the IRQ handler have completed before returning.

This function may be called from IRQ context.

Definition at line 492 of file vmsirq.c.

asmlinkage unsigned int vms_do_IRQ ( struct pt_regs  regs  ) 

Definition at line 573 of file vmsirq.c.

References kstat, and vms_handle_IRQ_event().

void vms_enable_irq ( unsigned int  irq  ) 

enable_irq - enable handling of an irq : Interrupt to enable

Undoes the effect of one call to disable_irq(). If this matches the last disable, processing of interrupts on this IRQ line is re-enabled.

This function may be called from IRQ context.

Definition at line 541 of file vmsirq.c.

void vms_free_irq ( unsigned int  irq,
void *  dev_id 
)

free_irq - free an interrupt : Interrupt line to free : Device identity to free

Remove an interrupt handler. The handler is removed and if the interrupt line is no longer in use by any driver it is disabled. On a shared IRQ the caller must ensure the interrupt is disabled on the card it drives before calling this function. The function does not return until any executing interrupts for this IRQ have completed.

This function may be called from interrupt context.

Bugs: Attempting to free an irq in a handler for the same irq hangs the machine.

Definition at line 755 of file vmsirq.c.

References kfree().

int vms_get_irq_list ( char *  buf  ) 

Definition at line 142 of file vmsirq.c.

References kstat.

int vms_handle_IRQ_event ( struct _idb idb,
unsigned int  irq,
struct pt_regs *  regs,
struct irqaction *  action 
)

Definition at line 445 of file vmsirq.c.

References _idb::idb_ps_owner.

Referenced by vms_do_IRQ().

void vms_init_irq_proc ( void   ) 

Definition at line 1190 of file vmsirq.c.

void vms_no_action ( int  cpl,
void *  dev_id,
struct pt_regs *  regs 
)

Definition at line 85 of file vmsirq.c.

unsigned int vms_probe_irq_mask ( unsigned long  val  ) 

probe_irq_mask - scan a bitmap of interrupt lines : mask of interrupts to consider

Scan the ISA bus interrupt lines and return a bitmap of active interrupts. The interrupt probe logic state is then returned to its previous value.

Note: we need to scan all the irq's even though we will only return ISA irq numbers - just so that we reset them all to a known state.

Definition at line 909 of file vmsirq.c.

int vms_probe_irq_off ( unsigned long  val  ) 

probe_irq_off - end an interrupt autodetect : mask of potential interrupts (unused)

Scans the unused interrupt lines and returns the line which appears to have triggered the interrupt. If no interrupt was found then zero is returned. If more than one interrupt is found then minus the first candidate is returned to indicate their is doubt.

The interrupt probe logic state is returned to its previous value.

BUGS: When used in a module (which arguably shouldnt happen) nothing prevents two IRQ probe callers from overlapping. The results of this are non-optimal.

Definition at line 959 of file vmsirq.c.

unsigned long vms_probe_irq_on ( void   ) 

probe_irq_on - begin an interrupt autodetect

Commence probing for an interrupt. The interrupts are scanned and a mask of potential interrupt lines is returned.

Definition at line 818 of file vmsirq.c.

int vms_request_irq ( struct _idb idb,
unsigned int  irq,
void(*)(int, void *, struct pt_regs *)  handler,
unsigned long  irqflags,
const char *  devname,
void *  dev_id 
)

request_irq - allocate an interrupt line : Interrupt line to allocate : Function to be called when the IRQ occurs : Interrupt type flags : An ascii name for the claiming device : A cookie passed back to the handler function

This call allocates interrupt resources and enables the interrupt line and IRQ handling. From the point this call is made your handler function may be invoked. Since your handler function must clear any interrupt the board raises, you must take care both to initialise your hardware and to set up the interrupt handler in the right order.

Dev_id must be globally unique. Normally the address of the device data structure is used as the cookie. Since the handler receives this value it makes sense to use it.

If your interrupt is shared you must pass a non NULL dev_id as this is required when freeing the interrupt.

Flags:

SA_SHIRQ Interrupt is shared

SA_INTERRUPT Disable local interrupts while processing

SA_SAMPLE_RANDOM The interrupt can be used for entropy

Definition at line 690 of file vmsirq.c.

References kfree(), and kmalloc().

int vms_setup_irq ( unsigned int  irq,
struct irqaction *  new 
)

Definition at line 991 of file vmsirq.c.


Variable Documentation

irq_desc_t vms_irq_desc [NR_IRQS] __cacheline_aligned

Initial value:

        { [0 ... NR_IRQS-1] = { 0, &no_irq_type, NULL, 0, SPIN_LOCK_UNLOCKED}}

Definition at line 76 of file vmsirq.c.

Definition at line 131 of file vmsirq.c.

struct hw_interrupt_type vms_no_irq_type

Initial value:

 {
        "none",
        startup_none,
        shutdown_none,
        enable_none,
        disable_none,
        ack_none,
        end_none
}

Definition at line 121 of file vmsirq.c.

unsigned long vms_prof_cpu_mask = -1

Definition at line 1188 of file vmsirq.c.


Generated on Fri Oct 9 10:26:05 2009 for FreeVMS by  doxygen 1.5.5