1234567891011121314151617181920212223242526272829 |
- #include <glue/mklinux.h>
- #include <linux/sched.h>
- #include <linux/printk.h>
- #define NCPUS 1
- #include <kern/thread.h>
- #define current get_current()
- void gnumach_thread_update(void)
- {
- if(current->gnumach_thread==NULL)
- {
- /* task create */
- current->gnumach_thread = gnumach_thread_create(gnumach_task_create());
- struct thread* t = (struct thread*) current->gnumach_thread;
- t->linux_task = current;
- }
- else
- {
- struct thread* t = (struct thread*) current->gnumach_thread;
- if(current != t->linux_task)
- {
- current->gnumach_thread = gnumach_thread_create(t->task);
- struct thread* t2 = (struct thread*) current->gnumach_thread;
- t2->linux_task = current;
- }
- }
- }
|