PSDHLP SET IRQ

From EDM2
Jump to: navigation, search

Setup IRQ information.

This function is used to setup IRQ information.

The PSD can use this help to register an interrupt handler at any given IRQ level between IRQ 0-IRQ 1F. These interrupt handler's are guaranteed to be called before any device driver's interrupt handler. If the PSD's interrupt handler returns NO_ERROR, the interrupt manager will assume the interrupt has been handled, and it will end the interrupt. If a -1 is returned, the interrupt manager will assume that the interrupt has not been handled, and will call each device driver which has a registered interrupt handler for that particular level, until one claims the interrupt. If the interrupt is unclaimed, the IRQ level will be masked off.

All PSDs must use the SET_IRQ PSD help to indicate which IRQ level it will be using for its inter-processor interrupts (IPI). If the PSD's IPI IRQ level is shared, it must register a handler which detects if the IRQ is an IPI or another interrupt. The handler must return NO_ERROR if the interrupt was caused by an IPI, otherwise, it returns a -1. If the IPI IRQ level is unique, an interrupt handler need not be installed, but SET_IRQ must still be used to indicate the IPI IRQ level.

This function can also be used to set, or remap what interrupt vector a particular IRQ level will use.

Mode 
Callable in Init mode only.

Syntax

PSDHLP SET IRQ <keywords>

Parameters

Pointer to a SET_IRQ structure.

  ushort_t irq;
  ushort_t flags;
  ulong_t  vector;
  P_F_2    handler;
irq 
specifies which IRQ level this operation is to be performed on.
flags 
indicate what is the type of the specified IRQ. If no flag is used, a regular IRQ level is assumed.
IRQf_IPI indicates that the specified IRQ level is to be used for inter- processor interrupts.
IRQf_LSI indicates that the specified IRQ level is to be used as a local software interrupt.
IRQf_SPI indicates that the specfied IRQ level is to be used as a system priority interrupt.
vector 
is used to specify what interrupt vector the IRQ level will use.
handler contains the address of an interrupt handler. If the PSD is just specifying that a specific IRQ level is of a special type (e.g. IPI IRQ), it does not need a handler (the handler variable must be NULL).

Return Code

Return code.

Remarks

The function can not call a PSD help that may block.

Notes: IRQf_LSI, and IRQf_SPI, are currently not being used.

Structure

typedef struct set_irq_s {
   ushort_t irq;
   ushort_t flags;
   ulong_t  vector;
   P_F_2    handler;
} SET_IRQ;