Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

kernel_thread.h

Go to the documentation of this file.
00001 // AUTOMATICALLY GENERATED -- DO NOT EDIT!         -*- c++ -*-
00002 
00003 #ifndef kernel_thread_h
00004 #define kernel_thread_h
00005 
00006 #include "thread.h"
00007 
00008 //
00009 // INTERFACE definition follows 
00010 //
00011 
00012 
00013 class Kernel_thread : public Thread
00014 {
00015 private:
00024   void  free_initcall_section();
00025   void  bootstrap()             asm ("call_bootstrap") FIASCO_FASTCALL;
00026   void  bootstrap_arch();
00027   void  run();
00028 
00029 protected:
00030   void  init_workload();
00031 
00032 public:  
00033   // overload allocator -- we cannot allocate by page fault during
00034   // bootstrapping
00035   void * operator new (size_t s, L4_uid id);
00036   
00037   inline Mword * init_stack();
00038   
00039   inline void idle();
00040   
00041   inline Kernel_thread();
00042 
00043 private:  
00044   inline Address init_workload_s0_stack();
00045 };
00046 
00047 //
00048 // IMPLEMENTATION includes follow (for use by inline functions)
00049 //
00050 
00051 #include "processor.h"
00052 #include "task.h"
00053 #include "mem_layout.h"
00054 
00055 //
00056 // IMPLEMENTATION of inline functions (and needed classes)
00057 //
00058 
00059 
00060 
00061 
00062 inline Mword *
00063 Kernel_thread::init_stack()
00064 {
00065   return _kernel_sp; 
00066 }
00067 
00068 
00069 
00070 inline void
00071 Kernel_thread::idle()
00072 {
00073   if (Config::hlt_works_ok)
00074     Proc::halt();                       // stop the CPU, waiting for an int
00075   else
00076     Proc::pause();
00077 }
00078 
00079 
00080 
00081 inline Kernel_thread::Kernel_thread()
00082              : Thread (current_task(), Config::kernel_id)
00083 {}
00084 
00085 
00086 
00087 inline void
00088 Kernel_thread::free_initcall_section()
00089 {
00090   // just fill up with invalid opcodes
00091   for (unsigned short *i = (unsigned short *) &Mem_layout::initcall_start;   
00092                        i < (unsigned short *) &Mem_layout::initcall_end; i++)
00093     *i = 0x0b0f;        // UD2 opcode
00094 }
00095 
00096 #endif // kernel_thread_h

Generated on Mon Sep 26 14:20:11 2005 for Fiasco by  doxygen 1.4.2