/[rtmk]/rtmk/processor.c
ViewVC logotype

Diff of /rtmk/processor.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by jrydberg, Fri Dec 7 02:05:49 2001 UTC revision 1.2 by jrydberg, Thu Jan 3 01:32:43 2002 UTC
# Line 41  processor_init (void) Line 41  processor_init (void)
41     ??? should we use continuations?  */     ??? should we use continuations?  */
42  static void idle_thread_fn (void *arg)  static void idle_thread_fn (void *arg)
43  {  {
44      struct processor *processor = PROCESSOR_CURRENT ();
45    trace_printf ("starting idle thread for CPU %d", CPU_CURRENT ());    trace_printf ("starting idle thread for CPU %d", CPU_CURRENT ());
46    
47    for (;;)    for (;;)
48      ;      {
49          while (processor->state == PROCESSOR_STATE_IDLE)
50            ; /* ??? machine halt insn or such thing.  */
51    
52          /* When we break into this we should have a thread in the NEXT_THREAD
53             field of our processor structure.  */
54    
55          ASSERT (processor->next_thread);
56        }
57  }  }
58    
59  /* Initailize all idle threads.  */  /* Initailize all idle threads.  */
# Line 75  processor_init_idle_threads (void) Line 84  processor_init_idle_threads (void)
84        /* Set idle bit in scheduling state and hardwire the priority        /* Set idle bit in scheduling state and hardwire the priority
85           to zero.  Bind the thread to PROCESSOR and start the thread.  */           to zero.  Bind the thread to PROCESSOR and start the thread.  */
86    
87          thread->scratch_area[3] = 666;
88    
89        thread->sched_state |= THREAD_STATE_IDLE;        thread->sched_state |= THREAD_STATE_IDLE;
90        thread->sched_priority = 0;        thread_set_priority (thread, THREAD_POLICY_TIMESHARE, 0);
       thread_bind (thread, processor);  
91        thread_start (thread, idle_thread_fn, processor);        thread_start (thread, idle_thread_fn, processor);
       thread_setrun (thread, false);  
92      }      }
93  }  }
94    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26