]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/kern/scheduler.cpp
update
[l4.git] / kernel / fiasco / src / kern / scheduler.cpp
index 6985fd7fc98341f2e613b6c0a90c4030c5b7b1d3..dd81be8a661b333b9e313faa0cce9d8568bf915e 100644 (file)
@@ -4,7 +4,7 @@ INTERFACE:
 #include "kobject_helper.h"
 #include "types.h"
 
-class Scheduler : public Kobject_h<Scheduler>, public Kobject
+class Scheduler : public Kobject_h<Scheduler>
 {
   FIASCO_DECLARE_KOBJ();
 
@@ -42,12 +42,27 @@ public:
 // ----------------------------------------------------------------------------
 IMPLEMENTATION:
 
-#include "thread.h"
+#include "thread_object.h"
 #include "l4_buf_iter.h"
 #include "entry_frame.h"
 
 FIASCO_DEFINE_KOBJ(Scheduler);
 
+static Scheduler scheduler;
+
+PUBLIC void
+Scheduler::operator delete (void *)
+{
+  printf("WARNING: tried to delete kernel scheduler object.\n"
+         "         The system is now useless\n");
+}
+
+PUBLIC inline
+Scheduler::Scheduler()
+{
+  initial_kobjects.register_obj(this, 7);
+}
+
 PRIVATE static
 Mword
 Scheduler::first_online(Cpu_set const *cpus, Mword bm)
@@ -93,7 +108,7 @@ Scheduler::sys_run(unsigned char /*rights*/, Syscall_frame *f, Utcb const *utcb)
   if (EXPECT_FALSE(!_thread.is_objpage()))
     return commit_result(-L4_err::EInval);
 
-  Thread *thread = Kobject::dcast<Thread*>(s->lookup_local(_thread.obj_index()));
+  Thread *thread = Kobject::dcast<Thread_object*>(s->lookup_local(_thread.obj_index()));
   if (!thread)
     return commit_result(-L4_err::EInval);