Changes

1,440 bytes added ,  09:11, 1 April 2015
Added information on OSThread which I could deduce quickly from OSDumpContext. I'm sure there are many other 'obvious' fields in places like OSGetThreadAffinity.
Line 75: Line 75:  
|<code>void OSYieldThread(void);</code>
 
|<code>void OSYieldThread(void);</code>
 
|Yield control of the CPU, allowing another thread to run
 
|Yield control of the CPU, allowing another thread to run
 +
|}
 +
 +
== Structures ==
 +
=== Threads ===
 +
 +
{| class="wikitable"
 +
!Name
 +
!Prototype
 +
|-
 +
|OSThread
 +
|
 +
<syntaxhighlight lang="C">
 +
typedef struct {
 +
    char tag[8];                    /* 0x000 "OSContxt" */
 +
    int32_t gpr[32];                /* 0x008 from OSDumpContext */
 +
    uint32_t cr;                    /* 0x088 from OSDumpContext */
 +
    uint32_t lr;                    /* 0x08c from OSDumpContext */
 +
    uint32_t ctr;                    /* 0x090 from context switch code */
 +
    uint32_t xer;                    /* 0x094 from context switch code */
 +
    uint32_t srr0;                  /* 0x098 from OSDumpContext */
 +
    uint32_t srr1;                  /* 0x09c from OSDumpContext */
 +
    char _unknowna0[0xb8 - 0xa0];
 +
    uint64_t fpr[32];                /* 0x0b8 from OSDumpContext */
 +
    int16_t spinLockCount;          /* 0x1b8 from OSDumpContext */
 +
    char _unknown1ba[0x1bc - 0x1ba]; /* 0x1ba could genuinely be padding? */
 +
    uint32_t gqr[8];                /* 0x1bc from OSDumpContext */
 +
    char _unknown1dc[0x1e0 - 0x1dc];
 +
    uint64_t psf[32];                /* 0x1e0 from OSDumpContext */
 +
    int64_t coretime[3];            /* 0x2e0 from OSDumpContext */
 +
    int64_t starttime;              /* 0x2f8 from OSDumpContext */
 +
    int32_t error;                  /* 0x300 from OSDumpContext */
 +
    char _unknown304[0x6a0 - 0x304];
 +
} OSThread;                          /* 0x6a0 total length from RAM dumps */
 +
</syntaxhighlight>
 
|}
 
|}
10

edits