Difference between revisions of "Unit PlatformARMv7"
Line 1,126: | Line 1,126: | ||
! '''Note''' | ! '''Note''' | ||
| ARM arm states that CLZ is supported for ARMv5 and above | | ARM arm states that CLZ is supported for ARMv5 and above | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''ARMv7 thread functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ARMv7PrimaryInit; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinLock(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinUnlock(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinLockIRQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable IRQ and save the previous IRQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinUnlockIRQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous IRQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinLockFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable FIQ and save the previous FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinUnlockFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinLockIRQFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable IRQ and FIQ and save the previous IRQ/FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinUnlockIRQFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous IRQ/FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Spin''' | ||
+ | | Pointer to the Spin entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinCheckIRQ(Spin:PSpinEntry):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if the mask would enable IRQ on restore, False if it would not | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinCheckFIQ(Spin:PSpinEntry):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if the mask would enable FIQ on restore, False if it would not | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinExchangeIRQ(Spin1,Spin2:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7SpinExchangeFIQ(Spin1,Spin2:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7MutexLock(Mutex:PMutexEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Mutex''' | ||
+ | | Pointer to the Mutex entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7MutexUnlock(Mutex:PMutexEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Mutex''' | ||
+ | | Pointer to the Mutex entry to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7MutexTryLock(Mutex:PMutexEntry):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Try to lock an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Mutex''' | ||
+ | | Pointer to the Mutex entry to try to lock (Passed in R0) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed, ERROR_LOCKED if already locked or another error code on failure (Returned in R0) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7ThreadGetCurrent:TThreadHandle; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current thread id from the c13 (Thread and process ID) register of system control coprocessor CP15</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | See page ??? | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7ThreadSetCurrent(Thread:TThreadHandle):LongWord; assembler; nostackframe;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current thread id in the c13 (Thread and process ID) register of system control coprocessor CP15</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | See page ??? | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ARMv7ThreadSetupStack(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set up the context record and arguments on the stack for a new thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''StackBase''' | ||
+ | | Pointer to the base (highest address) of the allocated stack (as returned by ThreadAllocateStack | ||
+ | |- | ||
+ | ! '''StartProc''' | ||
+ | | The procedure the thread will start executing when resumed | ||
+ | |- | ||
+ | ! '''ReturnProc''' | ||
+ | | The procedure the thread will return to on exit | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | Pointer to the starting address of the stack, which will be the Stack Pointer on the first context switch | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | At the point of a context switch the thread stack will look like this: | ||
+ | <br />(Base "Highest Address" of Stack) | ||
+ | <br />. | ||
+ | <br />. | ||
+ | <br />. | ||
+ | <br />. | ||
+ | <br />cpsr <- The current program status register value to load on return from the context switch | ||
+ | <br />(On Interrupt: Includes the flags and control bits for the interrupted thread) | ||
+ | <br />(On Yield: Includes the control bits only for the yielded thread) | ||
+ | <br />(On Create: Includes the control bits only for the new thread) | ||
+ | <br />lr/pc <- The address to return to from the context switch | ||
+ | <br />(On Interrupt: The location the thread was at before interrupt) | ||
+ | <br />(On Yield: The location to return to in SchedulerReschedule) | ||
+ | <br />(On Create: The location of StartProc for the new thread) | ||
+ | <br /> | ||
+ | <br />lr <- The lr value prior to the context switch | ||
+ | <br />(On Interrupt: The value of lr before the thread was interrupted) | ||
+ | <br />(On Yield: The location to return to in SchedulerReschedule) | ||
+ | <br />(On Create: The location of ReturnProc for the new thread) | ||
+ | <br /> | ||
+ | <br />r12 <- | ||
+ | <br />r11 <- | ||
+ | <br />r10 <- | ||
+ | <br />r9 <- | ||
+ | <br />r8 <- | ||
+ | <br />r7 <- | ||
+ | <br />r6 <- The value of these registers prior to the context switch | ||
+ | <br />r5 <- (On Interrupt: The values before the thread was interrupted) | ||
+ | <br />r4 <- (On Yield: The values on return to SchedulerReschedule) | ||
+ | <br />r3 <- (On Create: The values on entry to StartProc as set by ThreadSetupStack) | ||
+ | <br />r2 <- | ||
+ | <br />r1 <- | ||
+ | <br />r0 <- | ||
+ | <br /> | ||
+ | <br />d15 <- | ||
+ | <br />d14 <- | ||
+ | <br />d13 <- | ||
+ | <br />d12 <- | ||
+ | <br />d11 <- | ||
+ | <br />d10 <- | ||
+ | <br />d9 <- | ||
+ | <br />d8 <- The value of these floating point registers prior to the context switch | ||
+ | <br />d7 <- (On Interrupt: The values before the thread was interrupted) | ||
+ | <br />d6 <- (On Yield: The values on return to SchedulerReschedule) | ||
+ | <br />d5 <- (On Create: The values on entry to StartProc as set by ThreadSetupStack) | ||
+ | <br />d4 <- | ||
+ | <br />d3 <- | ||
+ | <br />d2 <- | ||
+ | <br />d1 <- | ||
+ | <br />d0 <- | ||
+ | <br /> | ||
+ | <br />fpscr <- The floating point FPSCR register | ||
+ | <br />fpexc <- The floating point FPEXC register (Current StackPointer points to here) | ||
+ | <br />. | ||
+ | <br />. | ||
+ | <br />. | ||
+ | <br />. | ||
+ | <br />(Top "Lowest Address" of Stack) | ||
+ | <br /> | ||
+ | <br />On exit from a standard context switch as performed by SchedulerReschedule the first value (Highest Address) of lr is used by the RFE (Return From Exception) instruction to load the pc which also loads the saved cpsr value. | ||
+ | <br /> | ||
+ | <br />On exit from an IRQ or FIQ context switch as performed by SchedulerSwitch the first value (Highest Address) of lr is used by the interrupt handler to return from the interrupt. | ||
+ | <br /> | ||
+ | <br />A standard context switch uses r12 to save the cpsr value (and RFE to restore it). Because the standard context switch is called from a routine which will have saved the value of r12 (which is caller save in the ARM ABI) then we do not need to save the original value of r12. | ||
+ | <br /> | ||
+ | <br />An IRQ or FIQ context switch uses the SRS (Store Return State) and RFE (Return From Exception) instructions to save and restore the cpsr value from the spsr value of either IRQ or FIQ mode. | ||
|- | |- | ||
|} | |} |
Revision as of 05:47, 21 October 2016
Return to Unit Reference
Description
The ARMv7 does not support the SWP/SWPB instructions for syncronisation (Lock/Mutex/Semaphore etc) unless enabled.
On ARMv7 Unaligned memory access is always enabled.
On ARMv7 the Extended Page Table format is always enabled.
For usage of barriers (DMB/DSB/ISB) after cache maintenance operations see: ARM.Reference_Manual_1.pdf - Appendix G Barrier Litmus Tests
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure ARMv7Init;
Note | None documented |
---|
ARMv7 platform functions
procedure ARMv7CPUInit; assembler; nostackframe;
Note | None documented |
---|
procedure ARMv7FPUInit; assembler; nostackframe;
Note | None documented |
---|
procedure ARMv7MMUInit;
Note | None documented |
---|
procedure ARMv7CacheInit; assembler; nostackframe;
Note | None documented |
---|
procedure ARMv7TimerInit(Frequency:LongWord); assembler; nostackframe;
Note | None documented |
---|
procedure ARMv7PageTableInit;
Note | See page ??? |
---|
procedure ARMv7SystemCall(Number:LongWord; Param1,Param2,Param3:LongWord); assembler; nostackframe;
Note | None documented |
---|
function ARMv7CPUGetMode:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7CPUGetState:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7CPUGetCurrent:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7CPUGetMainID:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7CPUGetMultiprocessorID:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7CPUGetModel:LongWord;
Note | None documented |
---|
function ARMv7CPUGetRevision:LongWord;
Note | None documented |
---|
function ARMv7CPUGetDescription:String;
Note | None documented |
---|
function ARMv7FPUGetState:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L1CacheGetType:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L1DataCacheGetSize:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L1DataCacheGetLineSize:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L1InstructionCacheGetSize:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L1InstructionCacheGetLineSize:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L2CacheGetType:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L2CacheGetSize:LongWord; assembler; nostackframe;
Note | None documented |
---|
function ARMv7L2CacheGetLineSize:LongWord; assembler; nostackframe;
Note | None documented |
---|
procedure ARMv7Halt; assembler; nostackframe; public name'_haltproc';
Note | See Standby mode on page A8-810 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7Pause; assembler; nostackframe;
Note | See Standby mode on page A8-810 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7SendEvent; assembler; nostackframe;
Note | See Page A8-316 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7WaitForEvent; assembler; nostackframe;
Note | See Page A8-808 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7WaitForInterrupt; assembler; nostackframe;
Note | See Standby mode on page A8-810 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7DataMemoryBarrier; assembler; nostackframe;
Note | See page A8-90 of the ARMv7 Architecture Reference Manual
Note that this is also available in the FPC RTL as ReadBarrier/WriteBarrier See: \source\rtl\arm\arm.inc
|
---|
procedure ARMv7DataSynchronizationBarrier; assembler; nostackframe;
Note | See page A8-92 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InstructionMemoryBarrier; assembler; nostackframe;
Note | See page A8-102 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateTLB; assembler; nostackframe;
Note | See page B3-138 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateDataTLB; assembler; nostackframe;
Note | See page B3-138 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateInstructionTLB; assembler; nostackframe;
Note | See page B3-138 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7CleanDataCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateDataCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateL1DataCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7CleanAndInvalidateDataCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateInstructionCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7CleanDataCacheRange(Address,Size:LongWord); assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateDataCacheRange(Address,Size:LongWord); assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7CleanAndInvalidateDataCacheRange(Address,Size:LongWord); assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7InvalidateInstructionCacheRange(Address,Size:LongWord); assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7CleanDataCacheSetWay(SetWay:LongWord); assembler; nostackframe;
SetWay | Set/Way/Level will be passed in r0 |
---|---|
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
procedure ARMv7InvalidateDataCacheSetWay(SetWay:LongWord); assembler; nostackframe;
SetWay | Set/Way/Level will be passed in r0 |
---|---|
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
procedure ARMv7CleanAndInvalidateDataCacheSetWay(SetWay:LongWord); assembler; nostackframe;
SetWay | Set/Way/Level will be passed in r0 |
---|---|
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
procedure ARMv7FlushPrefetchBuffer; assembler; nostackframe;
Note | See page A8-102 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7FlushBranchTargetCache; assembler; nostackframe;
Note | See page B3-127 of the ARMv7 Architecture Reference Manual |
---|
procedure ARMv7ContextSwitch(OldStack,NewStack:Pointer; NewThread:TThreadHandle); assembler; nostackframe;
OldStack | The address to save the stack pointer to for the current thread (Passed in r0) |
---|---|
NewStack | The address to restore the stack pointer from for the new thread (Passed in r1) |
NewThread | The handle of the new thread to switch to (Passed in r2) |
Note | At the point of the actual context switch (str sp / ldr sp) the thread stacks will look like this:
|
procedure ARMv7ContextSwitchIRQ(OldStack,NewStack:Pointer; NewThread:TThreadHandle); assembler; nostackframe;
OldStack | The address to save the stack pointer to for the current thread (Passed in r0) |
---|---|
NewStack | The address to restore the stack pointer from for the new thread (Passed in r1) |
NewThread | The handle of the new thread to switch to (Passed in r2) |
Note | At the point of the actual context switch (str sp / ldr sp) the thread stacks will look like this:
|
procedure ARMv7ContextSwitchFIQ(OldStack,NewStack:Pointer; NewThread:TThreadHandle); assembler; nostackframe;
OldStack | The address to save the stack pointer to for the current thread (Passed in r0) |
---|---|
NewStack | The address to restore the stack pointer from for the new thread (Passed in r1) |
NewThread | The handle of the new thread to switch to (Passed in r2) |
Note | At the point of the actual context switch (str sp / ldr sp) the thread stacks will look like this:
|
procedure ARMv7ContextSwitchSWI(OldStack,NewStack:Pointer; NewThread:TThreadHandle); assembler; nostackframe;
OldStack | The address to save the stack pointer to for the current thread (Passed in r0) |
---|---|
NewStack | The address to restore the stack pointer from for the new thread (Passed in r1) |
NewThread | The handle of the new thread to switch to (Passed in r2) |
Note | At the point of the actual context switch (str sp / ldr sp) the thread stacks will look like this:
|
function ARMv7InterlockedOr(var Target:LongInt; Value:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedXor(var Target:LongInt; Value:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedAnd(var Target:LongInt; Value:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedDecrement(var Target:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedIncrement(var Target:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedExchange(var Target:LongInt; Source:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedAddExchange(var Target:LongInt; Source:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7InterlockedCompareExchange(var Target:LongInt; Source,Compare:LongInt):LongInt; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7PageTableGetEntry(Address:PtrUInt):TPageTableEntry;
Note | None documented |
---|
function ARMv7PageTableSetEntry(const Entry:TPageTableEntry):LongWord;
Note | None documented |
---|
function ARMv7VectorTableGetEntry(Number:LongWord):PtrUInt;
Note | None documented |
---|
function ARMv7VectorTableSetEntry(Number:LongWord; Address:PtrUInt):LongWord;
Note | None documented |
---|
function ARMv7FirstBitSet(Value:LongWord):LongWord; assembler; nostackframe;
Note | ARM arm states that CLZ is supported for ARMv5 and above |
---|
function ARMv7CountLeadingZeros(Value:LongWord):LongWord; assembler; nostackframe;
Note | ARM arm states that CLZ is supported for ARMv5 and above |
---|
ARMv7 thread functions
procedure ARMv7PrimaryInit; assembler; nostackframe;
Note | None documented |
---|
function ARMv7SpinLock(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinUnlock(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinLockIRQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinUnlockIRQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinLockFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinUnlockFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinLockIRQFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinUnlockIRQFIQ(Spin:PSpinEntry):LongWord; assembler; nostackframe;
Spin | Pointer to the Spin entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7SpinCheckIRQ(Spin:PSpinEntry):Boolean;
Return | True if the mask would enable IRQ on restore, False if it would not |
---|
function ARMv7SpinCheckFIQ(Spin:PSpinEntry):Boolean;
Return | True if the mask would enable FIQ on restore, False if it would not |
---|
function ARMv7SpinExchangeIRQ(Spin1,Spin2:PSpinEntry):LongWord;
Note | None documented |
---|
function ARMv7SpinExchangeFIQ(Spin1,Spin2:PSpinEntry):LongWord;
Note | None documented |
---|
function ARMv7MutexLock(Mutex:PMutexEntry):LongWord; assembler; nostackframe;
Mutex | Pointer to the Mutex entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7MutexUnlock(Mutex:PMutexEntry):LongWord; assembler; nostackframe;
Mutex | Pointer to the Mutex entry to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure (Returned in R0) |
function ARMv7MutexTryLock(Mutex:PMutexEntry):LongWord; assembler; nostackframe;
Mutex | Pointer to the Mutex entry to try to lock (Passed in R0) |
---|---|
Return | ERROR_SUCCESS if completed, ERROR_LOCKED if already locked or another error code on failure (Returned in R0) |
function ARMv7ThreadGetCurrent:TThreadHandle; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7ThreadSetCurrent(Thread:TThreadHandle):LongWord; assembler; nostackframe;
Note | See page ??? |
---|
function ARMv7ThreadSetupStack(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;
StackBase | Pointer to the base (highest address) of the allocated stack (as returned by ThreadAllocateStack |
---|---|
StartProc | The procedure the thread will start executing when resumed |
ReturnProc | The procedure the thread will return to on exit |
Return | Pointer to the starting address of the stack, which will be the Stack Pointer on the first context switch |
Note | At the point of a context switch the thread stack will look like this:
|
Return to Unit Reference