Main Page | Directories | File List | Globals

i8259a.c File Reference

#include <agnix/agnix.h>
#include <agnix/adi/adi.h>
#include <agnix/spinlock.h>
#include <asm/types.h>
#include <agnix/ioport.h>
#include <agnix/memory.h>
#include <agnix/irq.h>
#include <agnix/console.h>

Include dependency graph for i8259a.c:

Go to the source code of this file.

Defines

#define I8259A_CASCADE_IRQ   2

Functions

int i8259a_startup_irq (struct chip_s *chip, u8 irq)
int i8259a_shutdown_irq (struct chip_s *chip, u8 irq)
int i8259a_enable_irq (struct chip_s *chip, u8 irq)
int i8259a_disable_irq (struct chip_s *chip, u8 irq)
void i8259a_ack_irq (struct chip_s *chip, u8 irq)
void i8259a_mask_irq (struct chip_s *chip, u8 irq)
void i8259a_cascade_irq (u32 data)
int i8259a_chip_cascade_init (struct chip_s *chip)
int i8259a_chip_init (struct chip_s *chip)
int i8259a_chip_release (struct chip_s *chip)
int __init i8259a_init (void)

Variables

chip_pic_parm_s i8259a_pic_parm
chip_pic_ops_s i8259a_pic_ops
irq_routine_s i8259a_cascade_irq_routine
chip_ops_s i8259a_chip_ops
chip_s i8259a_chip


Define Documentation

#define I8259A_CASCADE_IRQ   2
 

Definition at line 23 of file i8259a.c.

Referenced by i8259a_ack_irq(), and i8259a_chip_cascade_init().


Function Documentation

void i8259a_ack_irq struct chip_s *  chip,
u8  irq
 

Definition at line 64 of file i8259a.c.

References I8259A_CASCADE_IRQ.

00065 {
00066     CHIP_LOCK;
00067 
00068     if (irq <= 7)
00069         outb(0x60 + (irq & 0x07), INT_CNTRL_1);
00070     else
00071     if (irq <= 15) {
00072         outb(0x60 + (irq & 0x07), INT_CNTRL_2);
00073         outb(0x60 + I8259A_CASCADE_IRQ, INT_CNTRL_1);
00074     }
00075 
00076     CHIP_UNLOCK;
00077 }

void i8259a_cascade_irq u32  data  ) 
 

Definition at line 95 of file i8259a.c.

References printk().

00096 {
00097     printk("cascade irq\n");
00098 }

Here is the call graph for this function:

int i8259a_chip_cascade_init struct chip_s *  chip  ) 
 

Definition at line 104 of file i8259a.c.

References I8259A_CASCADE_IRQ, i8259a_cascade_irq_routine, and install_irq().

Referenced by i8259a_chip_init().

00105 {
00106     install_irq(I8259A_CASCADE_IRQ, &i8259a_cascade_irq_routine);
00107     
00108     return 0;
00109 }

Here is the call graph for this function:

int i8259a_chip_init struct chip_s *  chip  ) 
 

Definition at line 111 of file i8259a.c.

References i8259a_chip_cascade_init(), and memset().

00112 {
00113     CHIP_LOCK;
00114 
00115     memset(pic_parm(chip)->irq_mask, 0xFF, PIC_MASK_BYTES);
00116 
00117     outb(0x11, INT_CNTRL_1);
00118     outb(0x20, INT_CNTRL_1 + 1);
00119     outb(0x04, INT_CNTRL_1 + 1);
00120     outb(0x01, INT_CNTRL_1 + 1);
00121     
00122     outb(0x11, INT_CNTRL_2);
00123     outb(0x28, INT_CNTRL_2 + 1);
00124     outb(0x02, INT_CNTRL_2 + 1);
00125     outb(0x01, INT_CNTRL_2 + 1);
00126     
00127     outb((u8)((pic_parm(chip)->irq_mask[0]) & 0xFF), INT_CNTRL_1 + 1);
00128     outb((u8)((pic_parm(chip)->irq_mask[0] >> 8) & 0xFF), INT_CNTRL_2 + 1);
00129 
00130     CHIP_UNLOCK;
00131 
00132     i8259a_chip_cascade_init(chip);
00133 
00134     return 0;
00135 }

Here is the call graph for this function:

int i8259a_chip_release struct chip_s *  chip  ) 
 

Definition at line 137 of file i8259a.c.

00138 {
00139     return 0;
00140 }

int i8259a_disable_irq struct chip_s *  chip,
u8  irq
 

Definition at line 50 of file i8259a.c.

00051 {
00052     CHIP_LOCK;
00053 
00054     pic_parm(chip)->irq_mask[0] |= 1 << irq;
00055     outb((pic_parm(chip)->irq_mask[0]) & 0xFF, INT_CNTRL_1 + 1);
00056     outb((pic_parm(chip)->irq_mask[0] >> 8) & 0xFF, INT_CNTRL_2 + 1);
00057 
00058     CHIP_UNLOCK;
00059 
00060 
00061     return 0;
00062 }

int i8259a_enable_irq struct chip_s *  chip,
u8  irq
 

Definition at line 37 of file i8259a.c.

00038 {
00039     CHIP_LOCK;
00040 
00041     pic_parm(chip)->irq_mask[0] &= ~(1 << irq);
00042     outb((pic_parm(chip)->irq_mask[0]) & 0xFF, INT_CNTRL_1 + 1);
00043     outb((pic_parm(chip)->irq_mask[0] >> 8) & 0xFF, INT_CNTRL_2 + 1);
00044 
00045     CHIP_UNLOCK;
00046 
00047     return 0;
00048 }

int __init i8259a_init void   ) 
 

Definition at line 158 of file i8259a.c.

References adi_register_chip(), and i8259a_chip.

Referenced by adi_chips_init().

00159 {
00160     adi_register_chip(&i8259a_chip);
00161 
00162     return 0;    
00163 }

Here is the call graph for this function:

void i8259a_mask_irq struct chip_s *  chip,
u8  irq
 

Definition at line 79 of file i8259a.c.

00080 {
00081     CHIP_LOCK;
00082     CHIP_UNLOCK;
00083 }

int i8259a_shutdown_irq struct chip_s *  chip,
u8  irq
 

Definition at line 32 of file i8259a.c.

00033 {
00034     return 0;
00035 }

int i8259a_startup_irq struct chip_s *  chip,
u8  irq
 

Definition at line 27 of file i8259a.c.

00028 {
00029     return 0;
00030 }


Variable Documentation

struct irq_routine_s i8259a_cascade_irq_routine
 

Initial value:

 {
    .proc               = i8259a_cascade_irq,
}

Definition at line 100 of file i8259a.c.

Referenced by i8259a_chip_cascade_init().

struct chip_s i8259a_chip
 

Initial value:

 {
    .chip_name          = "i8259a",
    .chip_class         = CHIP_CLASS_PIC,
    .chip_vendor        = 0x8086,
    .chip_priority      = 90,
    .chip_ops           = &i8259a_chip_ops,
    .chip_pm_ops        = NULL,
    .internal_ops       = &i8259a_pic_ops,
    .internal_parm      = &i8259a_pic_parm
}

Definition at line 147 of file i8259a.c.

Referenced by execute_irq(), free_irq(), i8259a_init(), and install_irq().

struct chip_ops_s i8259a_chip_ops
 

Initial value:

 {
    .init               = i8259a_chip_init,
    .release            = i8259a_chip_release
}

Definition at line 142 of file i8259a.c.

struct chip_pic_ops_s i8259a_pic_ops
 

Initial value:

 
{
    .startup_irq        = i8259a_startup_irq,
    .shutdown_irq       = i8259a_shutdown_irq,
    .enable_irq         = i8259a_enable_irq,
    .disable_irq        = i8259a_disable_irq,
    .ack_irq            = i8259a_ack_irq,
    .mask_irq           = i8259a_mask_irq
}

Definition at line 85 of file i8259a.c.

struct chip_pic_parm_s i8259a_pic_parm
 

Definition at line 25 of file i8259a.c.

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix