Changes

820 bytes added ,  15:49, 20 December 2016
no edit summary
Line 1,148: Line 1,148:  
| MemoryState
 
| MemoryState
 
|}
 
|}
 +
 +
== struct ThreadContext ==
 +
 +
Size: 0xCC bytes
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
! Type
 +
!  Description
 +
|-
 +
| 0x0
 +
| ThreadCpuRegisters
 +
| Saved CPU registers (r0-r12, sp, lr, pc, cpsr)
 +
|-
 +
| 0x44
 +
| ThreadFpuRegisters
 +
| Saved FPU registers (d0-d15, fpscr, fpexc)
 +
|}
 +
 +
The user needs to adjust pc for exceptions that occured while in Thumb mode.
 +
 +
'''Flags for svcGetDebugThreadContext/svcSetDebugThreadContext''':
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Bit
 +
! Description
 +
|-
 +
| 0
 +
| Get/set CPU GPRs (r0-r12)
 +
|-
 +
| 1
 +
| Get/set CPU SPRs (sp, lr, pc, cpsr)
 +
|-
 +
| 2
 +
| Get/set FPU GPRs (d0-d15)
 +
|-
 +
| 3
 +
| Get/set FPU SPRs (fpscr, fpexc)
 +
|}
 +
 +
When setting CPSR, the following assignment is done: <code>ctx->cpsr = ctx->cpsr & 0x7F0FDFF | userCtx->cpuRegisters.cpsr & 0xF80F0200;</code>. This is to avoid obvious security issues.
    
== enum DebugThreadParam ==
 
== enum DebugThreadParam ==