libnx  v4.6.0
Data Structures | Enumerations | Functions
thread_context.h File Reference

AArch64 register dump format and related definitions. More...

#include "../types.h"

Go to the source code of this file.

Data Structures

union  CpuRegister
 Armv8 CPU register. More...
 
union  FpuRegister
 Armv8 NEON register. More...
 
struct  ThreadContext
 Thread context structure (register dump) More...
 
struct  ThreadExceptionDump
 Thread exception dump structure. More...
 
struct  ThreadExceptionFrameA64
 
struct  ThreadExceptionFrameA32
 

Enumerations

enum  RegisterGroup {
  RegisterGroup_CpuGprs = (1U<<( 0 )) ,
  RegisterGroup_CpuSprs = (1U<<( 1 )) ,
  RegisterGroup_FpuGprs = (1U<<( 2 )) ,
  RegisterGroup_FpuSprs = (1U<<( 3 )) ,
  RegisterGroup_CpuAll = RegisterGroup_CpuGprs | RegisterGroup_CpuSprs ,
  RegisterGroup_FpuAll = RegisterGroup_FpuGprs | RegisterGroup_FpuSprs ,
  RegisterGroup_All = RegisterGroup_CpuAll | RegisterGroup_FpuAll
}
 Armv8 register group. svcGetThreadContext3 uses RegisterGroup_All. More...
 
enum  ThreadExceptionDesc {
  ThreadExceptionDesc_InstructionAbort = 0x100 ,
  ThreadExceptionDesc_MisalignedPC = 0x102 ,
  ThreadExceptionDesc_MisalignedSP = 0x103 ,
  ThreadExceptionDesc_SError = 0x106 ,
  ThreadExceptionDesc_BadSVC = 0x301 ,
  ThreadExceptionDesc_Trap = 0x104 ,
  ThreadExceptionDesc_Other = 0x101
}
 This is for ThreadExceptionDump error_desc. More...
 

Functions

static bool threadContextIsAArch64 (const ThreadContext *ctx)
 Determines whether a thread context belong to an AArch64 process based on the PSR. More...
 
static bool threadExceptionIsAArch64 (const ThreadExceptionDump *ctx)
 Determines whether a ThreadExceptionDump belongs to an AArch64 process based on the PSTATE. More...
 

Detailed Description

AArch64 register dump format and related definitions.

Author
TuxSH

Enumeration Type Documentation

◆ RegisterGroup

Armv8 register group. svcGetThreadContext3 uses RegisterGroup_All.

Enumerator
RegisterGroup_CpuGprs 

General-purpose CPU registers (x0..x28 or r0..r10,r12).

RegisterGroup_CpuSprs 

Special-purpose CPU registers (fp, lr, sp, pc, PSTATE or cpsr, TPIDR_EL0).

RegisterGroup_FpuGprs 

General-purpose NEON registers.

RegisterGroup_FpuSprs 

Special-purpose NEON registers.

RegisterGroup_CpuAll 

All CPU registers.

RegisterGroup_FpuAll 

All NEON registers.

RegisterGroup_All 

All registers.

◆ ThreadExceptionDesc

This is for ThreadExceptionDump error_desc.

Enumerator
ThreadExceptionDesc_InstructionAbort 

Instruction abort.

ThreadExceptionDesc_MisalignedPC 

Misaligned PC.

ThreadExceptionDesc_MisalignedSP 

Misaligned SP.

ThreadExceptionDesc_SError 

SError [not in 1.0.0?].

ThreadExceptionDesc_BadSVC 

Bad SVC.

ThreadExceptionDesc_Trap 

Uncategorized, CP15RTTrap, CP15RRTTrap, CP14RTTrap, CP14RRTTrap, IllegalState, SystemRegisterTrap.

ThreadExceptionDesc_Other 

None of the above, EC <= 0x34 and not a breakpoint.

Function Documentation

◆ threadContextIsAArch64()

static bool threadContextIsAArch64 ( const ThreadContext ctx)
inlinestatic

Determines whether a thread context belong to an AArch64 process based on the PSR.

Parameters
[in]ctxThread context to which PSTATE/cspr has been dumped to.
Returns
true if and only if the thread context belongs to an AArch64 process.

◆ threadExceptionIsAArch64()

static bool threadExceptionIsAArch64 ( const ThreadExceptionDump ctx)
inlinestatic

Determines whether a ThreadExceptionDump belongs to an AArch64 process based on the PSTATE.

Parameters
[in]ctxThreadExceptionDump.
Returns
true if and only if the ThreadExceptionDump belongs to an AArch64 process.