Main Page | Directories | File List | Globals

fastirq.c File Reference

#include <agnix/agnix.h>
#include <agnix/list.h>
#include <agnix/irq.h>
#include <agnix/queues.h>
#include <agnix/tasks.h>
#include <agnix/threads.h>
#include <agnix/sched.h>
#include <agnix/memory.h>
#include <agnix/ioport.h>
#include <agnix/fastrand.h>
#include <agnix/console.h>

Include dependency graph for fastirq.c:

Go to the source code of this file.

Defines

#define MOD_NAME   "FASTIRQS: "

Functions

int fastirq_queue (u8 irq)
void fastirq_run_irq (u8 irq)
void fastirq_thread (void *data)
int fastirq_init (void)

Variables

int fastirq_queue_desc
task_s * fastirq_task
int fastirq_started = 0
u32 fastirq_count [IRQ_MAX]
irq_s irq_info [IRQ_MAX]
u32 random_val


Define Documentation

#define MOD_NAME   "FASTIRQS: "
 

Definition at line 26 of file fastirq.c.


Function Documentation

int fastirq_init void   ) 
 

Definition at line 105 of file fastirq.c.

References create_kernel_thread(), fastirq_thread(), MOD_NAME, and printk().

Referenced by start_kernel().

00106 {       
00107     printk(MOD_NAME "Initializing fastirqs\n");
00108 
00109     create_kernel_thread("fastirq", fastirq_thread, NULL);
00110 
00111     return 0;
00112 }

Here is the call graph for this function:

int fastirq_queue u8  irq  ) 
 

Definition at line 36 of file fastirq.c.

References fastirq_count, fastirq_task, and sched_activate_task().

Referenced by execute_irq().

00037 {
00038     fastirq_count[irq]++;
00039     sched_activate_task(fastirq_task);
00040 
00041     return 0;
00042 }

Here is the call graph for this function:

void fastirq_run_irq u8  irq  ) 
 

Definition at line 44 of file fastirq.c.

References _fastrand(), flags, irq_info, and random_val.

Referenced by execute_irq(), and fastirq_thread().

00045 {
00046     struct irq_s *irq_struct = &irq_info[irq];
00047     struct irq_routine_s *irq_proc;
00048     struct list_head *tmp;
00049     void (*proc)(u32);
00050     int  (*check)(void);
00051     int  irq_check_ok;
00052     u32 data;
00053     u32 flags;
00054 
00055     spin_lock_irqsave(&irq_struct->lock, flags);
00056 
00057     if (!list_empty(&irq_struct->head)) {
00058         list_for_each(tmp, &irq_struct->head) {
00059             irq_proc = list_entry(tmp, struct irq_routine_s, list);
00060             proc  = irq_proc->proc;
00061             data  = irq_proc->data;
00062             check = irq_proc->check; 
00063             irq_check_ok = 1;
00064             
00065             if (check)
00066                 irq_check_ok = check();
00067             
00068             if (!irq_check_ok)
00069                 continue;
00070             
00071             if (proc) {
00072                 proc(data);
00073             }
00074 
00075             if (irq_proc->flags & IRQ_FLAG_RANDOM)
00076                 random_val = _fastrand(random_val);
00077         }
00078     }
00079 
00080     spin_unlock_irqrestore(&irq_struct->lock, flags);
00081 }

Here is the call graph for this function:

void fastirq_thread void *  data  ) 
 

Definition at line 83 of file fastirq.c.

References fastirq_count, fastirq_run_irq(), fastirq_started, fastirq_task, sched_deactivate_task(), and schedule_task().

Referenced by fastirq_init().

00084 {
00085     int i;
00086 
00087     fastirq_task    = current_task;
00088     fastirq_started = 1;
00089 
00090     __cli();
00091     
00092     for (;;) {
00093         for (i = 0; i < IRQ_MAX; i++) { 
00094             if (fastirq_count[i] > 0) {
00095                 fastirq_run_irq((u8)i);
00096                 fastirq_count[i] = 0;
00097             }
00098         }
00099 
00100         sched_deactivate_task(current_task);
00101         schedule_task();
00102     }
00103 }

Here is the call graph for this function:


Variable Documentation

u32 fastirq_count[IRQ_MAX]
 

Definition at line 31 of file fastirq.c.

Referenced by fastirq_queue(), and fastirq_thread().

int fastirq_queue_desc
 

Definition at line 28 of file fastirq.c.

int fastirq_started = 0
 

Definition at line 30 of file fastirq.c.

Referenced by execute_irq(), and fastirq_thread().

struct task_s* fastirq_task
 

Definition at line 29 of file fastirq.c.

Referenced by fastirq_queue(), and fastirq_thread().

struct irq_s irq_info[IRQ_MAX]
 

Definition at line 79 of file irq.c.

Referenced by fastirq_run_irq(), free_irq(), install_irq(), and irqs_init().

u32 random_val
 

Definition at line 18 of file fastrand.c.

Referenced by fastirq_run_irq(), and fastrand().

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix