Changes

Jump to navigation Jump to search
100 bytes added ,  02:11, 8 December 2016
no edit summary
Line 1: Line 1: −
[[Category:Kernel objects]]
+
[[Category:Kernel interrupt events]]
 +
 
 +
class [[KScheduler]] extends [[KSchedulableInterruptEvent]];
    
Size : 0x228 bytes  
 
Size : 0x228 bytes  
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 11: Line 12:  
|-
 
|-
 
| 0x0
 
| 0x0
| u32
+
| void **
 
| Pointer to  vtable
 
| Pointer to  vtable
 
|-
 
|-
 
| 0x4
 
| 0x4
| u32
+
| [[KSynchronizationObject]] *
| Unused, may have been for reference count
+
| Inherited field. Unused.
 
|-
 
|-
 
| 0x8
 
| 0x8
Line 56: Line 57:  
| 0x1C
 
| 0x1C
 
| KThread*
 
| KThread*
| Scheduler thread
+
| Scheduler's idle thread (runs when no other runnable thread is available)
 
|-
 
|-
 
| 0x20
 
| 0x20
| u32
+
| [[KThread|KThreadLinkedList]]
| Unknown
+
| Linked list of threads managed by this KScheduler instance
|-
  −
| 0x24
  −
| u32
  −
| Unknown/unused
   
|-
 
|-
 
| 0x28
 
| 0x28
Line 70: Line 67:  
| List of KThread pair structs by priority
 
| List of KThread pair structs by priority
 
|}
 
|}
  −
  −
  −
ThreadSchedulePrioList struct:
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Offset
  −
!  Type
  −
!  Description
  −
|-
  −
| 0x0
  −
| KThread*
  −
| First
  −
|-
  −
| 0x4
  −
| KThread*
  −
| Last
  −
|}
  −
      
There is 1 KScheduler object per core.
 
There is 1 KScheduler object per core.
    +
KScheduler instances are mapped to SGI #8. The interrupt handler/callback returns 1, which triggers a post-interrupt rescheduling and context switch (like all the other handlers not returning NULL), but does nothing else in particular.
 +
The second virtual method is stubbed.
   −
ThreadSchedulePrioList info:
+
Each priority of KThread has an associated linked list of KThreads object pointers below the KScheduler object. Each pair of pointers makes up 1 entry in that core's Scheduler for their priority.
 
  −
Each priority of KThread has a pair of KThread object pointers below the KScheduler object. Each pair of pointers makes up 1 entry in that core's Scheduler for their priority. The first KThread in the entry is the first KThread in the linked list and the second is the last KThread in the linked list of KThreads in the scheduler that have the same priority.
  −
 
      
Priority bit fields:
 
Priority bit fields:
    
Each bit field goes from the most significant bit to the least significant bit, high priority to low priority.  This means, for example, that bit 31 in the high priority bit field is for priority 0 and bit 0 is for priority 31.  These fields are set when a KThread with the corresponding priority is added for scheduling and are cleared when the last KThread in the linked list for a given priority is removed from the scheduler.
 
Each bit field goes from the most significant bit to the least significant bit, high priority to low priority.  This means, for example, that bit 31 in the high priority bit field is for priority 0 and bit 0 is for priority 31.  These fields are set when a KThread with the corresponding priority is added for scheduling and are cleared when the last KThread in the linked list for a given priority is removed from the scheduler.
516

edits

Navigation menu