0.3.1
Registers

Data Structures

struct  cpu_registers
 Represent the register configuration. More...
 

Macros

#define CPU_SR_T_BIT_MASK   0x00000001
 CPU sr register T bit that indicates carry/borrow or overflow/underflow.
 
#define CPU_SR_S_BIT_MASK   0x00000002
 CPU sr register S bit is used by the multiply/accumulate instructions.
 
#define CPU_SR_I_BITS_MASK   0x000000F0
 CPU sr register I bits are used for the interrupt mask bits.
 
#define CPU_SR_Q_BIT_MASK   0x00000100
 CPU sr register Q bit used by div0u, divu0s, and div1 instructions.
 
#define CPU_SR_M_BIT_MASK   0x00000200
 CPU sr register M bit used by divu0, divu0s, and div1 instructions.
 

Typedefs

typedef struct cpu_registers cpu_registers_t
 Represent the register configuration.
 

Functions

static void cpu_reg_gbr_set (uint32_t reg_gbr)
 Set the gbr register.
 
static uint32_t cpu_reg_gbr_get (void)
 Obtain the 32-bit value of the gbr register.
 
static void cpu_reg_vbr_set (uint32_t reg_vbr)
 Set the vbr register.
 
static uint32_t cpu_reg_vbr_get (void)
 Obtain the 32-bit value of the vbr register.
 
static void cpu_reg_mach_set (uint32_t reg_mach)
 Set the mach register.
 
static uint32_t cpu_reg_mach_get (void)
 Obtain the 32-bit value of the mach register.
 
static void cpu_reg_macl_set (uint32_t reg_macl)
 Set the macl register.
 
static uint32_t cpu_reg_macl_get (void)
 Obtain the 32-bit value of the macl register.
 
static void cpu_reg_pr_set (uint32_t reg_pr)
 Set the pr register.
 
static uint32_t cpu_reg_pr_get (void)
 Obtain the 32-bit value of the pr register.
 
static void cpu_reg_sr_set (uint32_t reg_sr)
 Set the sr register.
 
static uint32_t cpu_reg_sr_get (void)
 Obtain the 32-bit value of the sr register.
 
static uint32_t cpu_reg_fp_get (void)
 Obtain the 32-bit value of the fp (or r14) register.
 
static uint32_t cpu_reg_sp_get (void)
 Obtain the 32-bit value of the sp register.
 

Detailed Description

Description goes here.


Data Structure Documentation

◆ cpu_registers

struct cpu_registers

Represent the register configuration.

Data Fields
uint32_t sp sp register (or r15).
uint32_t r[15] Registers r0..r14.
uint32_t macl macl register.
uint32_t mach mach register.
uint32_t vbr vbr register.
uint32_t gbr gbr register.
uint32_t pr pr register.
uint32_t pc pc register.
uint32_t sr sr register.

Function Documentation

◆ cpu_reg_gbr_set()

static void cpu_reg_gbr_set ( uint32_t  reg_gbr)
inlinestatic

Set the gbr register.

The appropriate gbr value will be set depending on which CPU you're executing this inlined function on.

Warning
Yaul may use this register at some point in the future.
Parameters
reg_gbrThe 32-bit value.

◆ cpu_reg_gbr_get()

static uint32_t cpu_reg_gbr_get ( void  )
inlinestatic

Obtain the 32-bit value of the gbr register.

The appropriate gbr value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the gbr register.

◆ cpu_reg_vbr_set()

static void cpu_reg_vbr_set ( uint32_t  reg_vbr)
inlinestatic

Set the vbr register.

The vbr register defaults to 0x0600000 for the master CPU, and 0x06000400 for the slave CPU.

The appropriate vbr value will be set depending on which CPU you're executing this inlined function on.

Parameters
reg_vbrThe 32-bit value.

◆ cpu_reg_vbr_get()

static uint32_t cpu_reg_vbr_get ( void  )
inlinestatic

Obtain the 32-bit value of the vbr register.

The appropriate vbr value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the vbr register.

◆ cpu_reg_mach_set()

static void cpu_reg_mach_set ( uint32_t  reg_mach)
inlinestatic

Set the mach register.

The appropriate mach value will be set depending on which CPU you're executing this inlined function on.

Parameters
reg_machThe 32-bit value.

◆ cpu_reg_mach_get()

static uint32_t cpu_reg_mach_get ( void  )
inlinestatic

Obtain the 32-bit value of the mach register.

The appropriate mach value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the mach register.

◆ cpu_reg_macl_set()

static void cpu_reg_macl_set ( uint32_t  reg_macl)
inlinestatic

Set the macl register.

The appropriate macl value will be set depending on which CPU you're executing this inlined function on.

Parameters
reg_maclThe 32-bit value.

◆ cpu_reg_macl_get()

static uint32_t cpu_reg_macl_get ( void  )
inlinestatic

Obtain the 32-bit value of the macl register.

The appropriate macl value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the macl register.

◆ cpu_reg_pr_set()

static void cpu_reg_pr_set ( uint32_t  reg_pr)
inlinestatic

Set the pr register.

The appropriate pr value will be set depending on which CPU you're executing this inlined function on.

Parameters
reg_prThe 32-bit value.

◆ cpu_reg_pr_get()

static uint32_t cpu_reg_pr_get ( void  )
inlinestatic

Obtain the 32-bit value of the pr register.

The appropriate pr value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the pr register.

◆ cpu_reg_sr_set()

static void cpu_reg_sr_set ( uint32_t  reg_sr)
inlinestatic

Set the sr register.

The appropriate sr value will be set depending on which CPU you're executing this inlined function on.

Parameters
reg_srThe 32-bit value.

◆ cpu_reg_sr_get()

static uint32_t cpu_reg_sr_get ( void  )
inlinestatic

Obtain the 32-bit value of the sr register.

The appropriate sr value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the sr register.

◆ cpu_reg_fp_get()

static uint32_t cpu_reg_fp_get ( void  )
inlinestatic

Obtain the 32-bit value of the fp (or r14) register.

The appropriate fp (or r14) value will be returned depending on which CPU you're executing this inlined function on.

Note
Yaul passes -fomit-frame-pointer to GCC, so the the frame pointer is not being tracked.
Returns
The 32-bit value of the fp (or r14) register.

◆ cpu_reg_sp_get()

static uint32_t cpu_reg_sp_get ( void  )
inlinestatic

Obtain the 32-bit value of the sp register.

The appropriate sp value will be returned depending on which CPU you're executing this inlined function on.

Returns
The 32-bit value of the sp register.