Main Page | Directories | File List | Globals

idle.c

Go to the documentation of this file.
00001 /*
00002  * kernel_super/sched/idle.c
00003  *
00004  * Copyright (c) 2003-2005 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2005/05
00008  * Author:      Lukasz Dembinski
00009  * Info:        idle.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 #include <agnix/agnix.h>
00015 #include <agnix/tasks.h>
00016 #include <agnix/bios/bios.h>
00017 #include <agnix/irq.h>
00018 
00019 #if CONFIG_BIOS_APM
00020 #define CPU_IDLE_LOOPS  10
00021 #endif
00022 
00023 extern int apm_enabled;
00024 
00025 void idle_state_enter(void)
00026 {
00027 
00028 #if CONFIG_BIOS_APM
00029     int i;
00030     u32 flags;
00031 
00032     if (apm_enabled) {
00033         
00034         save_flags(flags); __cli();
00035     
00036         for (i = 0; i < CPU_IDLE_LOOPS; i++)
00037             apm_cpu_idle();
00038 
00039         apm_cpu_busy();
00040     
00041         restore_flags(flags);
00042 
00043     } else {
00044         while(!(current_task->t_resched))
00045             __asm__ __volatile__ ("hlt");
00046     }
00047     
00048 #else
00049 
00050     while(!(current_task->t_resched))
00051         __asm__ __volatile__ ("hlt");
00052     
00053 #endif    
00054 }
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix