orcus
Functions | Variables
arm940.h File Reference

ARM940. More...

#include <stdint.h>

Functions

void arm940ClockOff ()
 Pause execution on the ARM940T. More...
 
void arm940ClockOn ()
 Resume execution on the ARM940T. More...
 
void arm940Halt ()
 Halt the ARM940T. More...
 
bool arm940HasClock ()
 Check if the ARM940T has a clock signal. More...
 
int arm940Init (int memoryBank)
 Initialise ARM940T. More...
 
bool arm940IsThis ()
 Check if executing on the ARM940T. More...
 
void arm940Run ()
 Start execution on the ARM940T. More...
 
bool arm940Running ()
 Check if the ARM940T is running. More...
 
uint32_t exportPointer (void *ptr)
 Export a pointer to the other CPU. More...
 
void * importPointer (uint32_t addr)
 Import a pointer from the other CPU. More...
 

Variables

volatile uint16_t * arm920Data
 Pointer to start of 16x 16-bit shared data registers. More...
 
volatile uint16_t * arm940Data
 Pointer to start of 16x 16-bit shared data registers. More...
 

Function Documentation

◆ arm940ClockOff()

void arm940ClockOff ( )

Pause execution on the ARM940T by disabling its clock.

Note
You can call this from the ARM940T but you won't get control back until the ARM920 calls arm940ClockOn()
See also
arm940ClockOn

◆ arm940ClockOn()

void arm940ClockOn ( )

Enable the clock on the ARM940T to resume execution at the same point it was at when the clock was disabled.

Note
It makes no sense to call this from the ARM940T.
See also
arm940ClockOff

◆ arm940Halt()

void arm940Halt ( )

Halt the ARM940T and hold it in RESET state.

Note
You can call this from the ARM940T but you won't get control back afterwards.

◆ arm940HasClock()

bool arm940HasClock ( )

Check if the ARM940T has a clock signal, to see if execution is paused.

Returns
true if the ARM940T has a clock signal, false otherwise (i.e. it is paused)

◆ arm940Init()

int arm940Init ( int  memoryBank)

Initialise the ARM940T second CPU and configure the base address (in 16M increments) in physical memory which will appear as 0x0 from the perspective of the ARM940T.

This leaves the ARM940T in RESET state, and enables the clock.

Valid base addresses are 16M, 32M and 48M (banks 1, 2 and 3 respectively) to prevent overlapping with the ARM920T vector table (always stored at 0x0 in physical memory). It is possible to set both CPUs to start at 0x0 physical but in this case they will share a RESET vector and will execute the same code so it is highly discouraged unless you have an unusual use case in mind, and is not supported with this function.

Further documentation can be found on the Orcus wiki regarding using the ARM940T.

Note
This should only be called from the ARM920T.
Parameters
memoryBankMemory bank to use as start of ARM940T address range (1 - 3)
Returns
0 if successful, non-zero otherwise

◆ arm940IsThis()

bool arm940IsThis ( )

Check if this call is being executed on the ARM940T.

Returns
true if this is called from the ARM940T, false if called from the ARM920T

◆ arm940Run()

void arm940Run ( )

Start execution on the ARM940T from its RESET vector entry (0x0) by releasing it from RESET state.

Note
It makes no sense to call this from the ARM940T.

◆ arm940Running()

bool arm940Running ( )

Check if the ARM940T is running.

Note
It makes no sense to call this from the ARM940T.
Returns
true if the ARM940T is running, false if it is being held in RESET state

◆ exportPointer()

uint32_t exportPointer ( void *  ptr)

Export a pointer to the address space of the other CPU.

Warning
It may not be possible to export a pointer from memory which is only viewable from the ARM920T to the ARM940T. It is always possible to export from the ARM940T to the ARM920T however.
Parameters
ptrPointer to export
Returns
Address of ptr within the address space of the other CPU

◆ importPointer()

void * importPointer ( uint32_t  addr)

Import a pointer from the other CPU into the address space of the CPU we are running on.

Warning
It may not be possible to import a pointer from memory which is only viewable from the ARM920T when on the ARM940T. It is always possible to import from the ARM940T to the ARM920T however.
Parameters
addrAddress to import from other CPU
Returns
Pointer to the given address within the address space of the current CPU

Variable Documentation

◆ arm920Data

arm920Data
extern

Pointer to start of 16x 16-bit shared data registers. These can be written to from either CPU, but can only trigger an interrupt on the ARM920T.

◆ arm940Data

arm940Data
extern

Pointer to start of 16x 16-bit shared data registers. These can be written to from either CPU, but can only trigger an interrupt on the ARM940T.