coastline 0.0.4
Loading...
Searching...
No Matches
R4300.h File Reference

Address segments, coprocessor 0 registers, and status bits of the VR4300. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define KUSEG   0x00000000
#define K0BASE   0x80000000
#define K1BASE   0xA0000000
#define K2BASE   0xC0000000
#define IS_KSEG0(x)
 Whether address x lies in the cached unmapped segment.
#define IS_KSEG1(x)
 Whether address x lies in the uncached unmapped segment.
#define K0_TO_K1(x)
#define K1_TO_K0(x)
#define K0_TO_PHYS(x)
#define K1_TO_PHYS(x)
#define KDM_TO_PHYS(x)
#define PHYS_TO_K0(x)
#define PHYS_TO_K1(x)
#define ICACHE_SIZE   0x4000
#define ICACHE_LINESIZE   32
#define DCACHE_SIZE   0x2000
#define DCACHE_LINESIZE   16
#define SR_IE   0x00000001
#define SR_EXL   0x00000002
#define SR_ERL   0x00000004
#define SR_KSU_USR   0x00000010
#define SR_IMASK   0x0000FF00
#define SR_IBIT1   0x00000100
#define SR_IBIT2   0x00000200
#define SR_IBIT3   0x00000400
#define SR_IBIT4   0x00000800
#define SR_IBIT5   0x00001000
#define SR_IBIT6   0x00002000
#define SR_IBIT7   0x00004000
#define SR_IBIT8   0x00008000
#define SR_IMASK0   0x0000FF00
#define SR_IMASK1   0x0000FE00
#define SR_IMASK2   0x0000FC00
#define SR_IMASK3   0x0000F800
#define SR_IMASK4   0x0000F000
#define SR_IMASK5   0x0000E000
#define SR_IMASK6   0x0000C000
#define SR_IMASK7   0x00008000
#define SR_IMASK8   0x00000000
#define SR_DE   0x00010000
#define SR_CE   0x00020000
#define SR_CH   0x00040000
#define SR_SR   0x00100000
#define SR_TS   0x00200000
#define SR_BEV   0x00400000
#define SR_ITS   0x01000000
#define SR_RE   0x02000000
#define SR_FR   0x04000000
#define SR_RP   0x08000000
#define SR_CU0   0x10000000
#define SR_CU1   0x20000000
#define CAUSE_BD   0x80000000
#define CAUSE_IP8   0x00008000
#define CAUSE_IP7   0x00004000
#define CAUSE_IP6   0x00002000
#define CAUSE_IP5   0x00001000
#define CAUSE_IP4   0x00000800
#define CAUSE_IP3   0x00000400
#define CAUSE_SW2   0x00000200
#define CAUSE_SW1   0x00000100
#define CAUSE_EXCMASK   0x0000007C
#define FPCSR_FS   0x01000000
#define FPCSR_C   0x00800000
#define FPCSR_EV   0x00000800
#define FPCSR_EZ   0x00000400
#define FPCSR_EO   0x00000200
#define FPCSR_EU   0x00000100
#define FPCSR_EI   0x00000080
#define FPCSR_RM_RN   0x00000000
#define TLBPGMASK_4K   0x00000000
#define TLBPGMASK_16K   0x00006000
#define TLBPGMASK_64K   0x0001E000
#define TLBPGMASK_256K   0x0007E000
#define TLBPGMASK_1M   0x001FE000
#define TLBPGMASK_4M   0x007FE000
#define TLBPGMASK_16M   0x01FFE000

Detailed Description

Address segments, coprocessor 0 registers, and status bits of the VR4300.

Macro Definition Documentation

◆ KUSEG

#define KUSEG   0x00000000

The user segment, mapped through the TLB.

◆ K0BASE

#define K0BASE   0x80000000

The kernel segment, unmapped and cached.

◆ K1BASE

#define K1BASE   0xA0000000

The kernel segment, unmapped and uncached.

◆ K2BASE

#define K2BASE   0xC0000000

The supervisor segment, mapped through the TLB.

◆ IS_KSEG0

#define IS_KSEG0 ( x)
Value:
((u32)(x) >= K0BASE && (u32)(x) < K1BASE)
#define K0BASE
Definition R4300.h:15
#define K1BASE
Definition R4300.h:16
unsigned int u32
Definition ultratypes.h:20

Whether address x lies in the cached unmapped segment.

◆ IS_KSEG1

#define IS_KSEG1 ( x)
Value:
((u32)(x) >= K1BASE && (u32)(x) < K2BASE)
#define K2BASE
Definition R4300.h:17

Whether address x lies in the uncached unmapped segment.

◆ K0_TO_K1

#define K0_TO_K1 ( x)
Value:
((u32)(x) | 0xA0000000)

The uncached alias of a cached address.

◆ K1_TO_K0

#define K1_TO_K0 ( x)
Value:
((u32)(x) & 0x9FFFFFFF)

The cached alias of an uncached address.

◆ K0_TO_PHYS

#define K0_TO_PHYS ( x)
Value:
((u32)(x) & 0x1FFFFFFF)

The physical address of a cached address.

◆ K1_TO_PHYS

#define K1_TO_PHYS ( x)
Value:
((u32)(x) & 0x1FFFFFFF)

The physical address of an uncached address.

◆ KDM_TO_PHYS

#define KDM_TO_PHYS ( x)
Value:
((u32)(x) & 0x1FFFFFFF)

The physical address of a kernel address.

◆ PHYS_TO_K0

#define PHYS_TO_K0 ( x)
Value:
((u32)(x) | 0x80000000)

The cached address of a physical address.

◆ PHYS_TO_K1

#define PHYS_TO_K1 ( x)
Value:
((u32)(x) | 0xA0000000)

The uncached address of a physical address.

◆ ICACHE_SIZE

#define ICACHE_SIZE   0x4000

The size of the instruction cache in bytes.

◆ ICACHE_LINESIZE

#define ICACHE_LINESIZE   32

The size of an instruction cache line in bytes.

◆ DCACHE_SIZE

#define DCACHE_SIZE   0x2000

The size of the data cache in bytes.

◆ DCACHE_LINESIZE

#define DCACHE_LINESIZE   16

The size of a data cache line in bytes.

◆ SR_IE

#define SR_IE   0x00000001

Interrupts are enabled.

◆ SR_EXL

#define SR_EXL   0x00000002

The exception level.

◆ SR_ERL

#define SR_ERL   0x00000004

The error level.

◆ SR_KSU_USR

#define SR_KSU_USR   0x00000010

User mode.

◆ SR_IMASK

#define SR_IMASK   0x0000FF00

The bits of the interrupt mask.

◆ SR_IBIT1

#define SR_IBIT1   0x00000100

Software interrupt 0 is enabled.

◆ SR_IBIT2

#define SR_IBIT2   0x00000200

Software interrupt 1 is enabled.

◆ SR_IBIT3

#define SR_IBIT3   0x00000400

Interrupt 0, the RCP, is enabled.

◆ SR_IBIT4

#define SR_IBIT4   0x00000800

Interrupt 1, the cartridge, is enabled.

◆ SR_IBIT5

#define SR_IBIT5   0x00001000

Interrupt 2, the pre-NMI, is enabled.

◆ SR_IBIT6

#define SR_IBIT6   0x00002000

Interrupt 3 is enabled.

◆ SR_IBIT7

#define SR_IBIT7   0x00004000

Interrupt 4 is enabled.

◆ SR_IBIT8

#define SR_IBIT8   0x00008000

Interrupt 5, the timer, is enabled.

◆ SR_IMASK0

#define SR_IMASK0   0x0000FF00

The mask enabling every interrupt.

◆ SR_IMASK1

#define SR_IMASK1   0x0000FE00

The mask enabling interrupts above level 1.

◆ SR_IMASK2

#define SR_IMASK2   0x0000FC00

The mask enabling interrupts above level 2.

◆ SR_IMASK3

#define SR_IMASK3   0x0000F800

The mask enabling interrupts above level 3.

◆ SR_IMASK4

#define SR_IMASK4   0x0000F000

The mask enabling interrupts above level 4.

◆ SR_IMASK5

#define SR_IMASK5   0x0000E000

The mask enabling interrupts above level 5.

◆ SR_IMASK6

#define SR_IMASK6   0x0000C000

The mask enabling interrupts above level 6.

◆ SR_IMASK7

#define SR_IMASK7   0x00008000

The mask enabling the timer interrupt only.

◆ SR_IMASK8

#define SR_IMASK8   0x00000000

The mask disabling every interrupt.

◆ SR_DE

#define SR_DE   0x00010000

Cache parity errors raise no exception.

◆ SR_CE

#define SR_CE   0x00020000

The ECC register replaces the cache check bits.

◆ SR_CH

#define SR_CH   0x00040000

A cache instruction hit.

◆ SR_SR

#define SR_SR   0x00100000

A soft reset or NMI occurred.

◆ SR_TS

#define SR_TS   0x00200000

A TLB shutdown occurred.

◆ SR_BEV

#define SR_BEV   0x00400000

Exceptions use the bootstrap vectors.

◆ SR_ITS

#define SR_ITS   0x01000000

Instruction trace support is enabled.

◆ SR_RE

#define SR_RE   0x02000000

User mode runs with reversed endianness.

◆ SR_FR

#define SR_FR   0x04000000

Thirty-two 64-bit floating-point registers are enabled.

◆ SR_RP

#define SR_RP   0x08000000

Reduced power mode.

◆ SR_CU0

#define SR_CU0   0x10000000

Coprocessor 0 is usable in user mode.

◆ SR_CU1

#define SR_CU1   0x20000000

Coprocessor 1, the floating-point unit, is usable.

◆ CAUSE_BD

#define CAUSE_BD   0x80000000

The exception occurred in a branch delay slot.

◆ CAUSE_IP8

#define CAUSE_IP8   0x00008000

Interrupt 5, the timer, is pending.

◆ CAUSE_IP7

#define CAUSE_IP7   0x00004000

Interrupt 4 is pending.

◆ CAUSE_IP6

#define CAUSE_IP6   0x00002000

Interrupt 3 is pending.

◆ CAUSE_IP5

#define CAUSE_IP5   0x00001000

Interrupt 2, the pre-NMI, is pending.

◆ CAUSE_IP4

#define CAUSE_IP4   0x00000800

Interrupt 1, the cartridge, is pending.

◆ CAUSE_IP3

#define CAUSE_IP3   0x00000400

Interrupt 0, the RCP, is pending.

◆ CAUSE_SW2

#define CAUSE_SW2   0x00000200

Software interrupt 1 is pending.

◆ CAUSE_SW1

#define CAUSE_SW1   0x00000100

Software interrupt 0 is pending.

◆ CAUSE_EXCMASK

#define CAUSE_EXCMASK   0x0000007C

The bits of the exception code.

◆ FPCSR_FS

#define FPCSR_FS   0x01000000

Denormalised results flush to zero.

◆ FPCSR_C

#define FPCSR_C   0x00800000

The condition bit of a comparison.

◆ FPCSR_EV

#define FPCSR_EV   0x00000800

An invalid operation raises an exception.

◆ FPCSR_EZ

#define FPCSR_EZ   0x00000400

A division by zero raises an exception.

◆ FPCSR_EO

#define FPCSR_EO   0x00000200

An overflow raises an exception.

◆ FPCSR_EU

#define FPCSR_EU   0x00000100

An underflow raises an exception.

◆ FPCSR_EI

#define FPCSR_EI   0x00000080

An inexact result raises an exception.

◆ FPCSR_RM_RN

#define FPCSR_RM_RN   0x00000000

Round to the nearest value.

◆ TLBPGMASK_4K

#define TLBPGMASK_4K   0x00000000

The mask of a 4 KB page.

◆ TLBPGMASK_16K

#define TLBPGMASK_16K   0x00006000

The mask of a 16 KB page.

◆ TLBPGMASK_64K

#define TLBPGMASK_64K   0x0001E000

The mask of a 64 KB page.

◆ TLBPGMASK_256K

#define TLBPGMASK_256K   0x0007E000

The mask of a 256 KB page.

◆ TLBPGMASK_1M

#define TLBPGMASK_1M   0x001FE000

The mask of a 1 MB page.

◆ TLBPGMASK_4M

#define TLBPGMASK_4M   0x007FE000

The mask of a 4 MB page.

◆ TLBPGMASK_16M

#define TLBPGMASK_16M   0x01FFE000

The mask of a 16 MB page.