Unit PlatformAARCH64

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo Platform Interface unit for AARCH64 (ARM64)

Constants



[Expand]
ARM boot tag ATAG_*



[Expand]
ARM machine type ARM_MACHINE_*


Type definitions



ARM boot tag header

[Expand]

PARMTagHeader = ^TARMTagHeader;

TARMTagHeader = record

ARM tag core

[Expand]

PARMTagCore = ^TARMTagCore;

TARMTagCore = record

ARM tag memory

[Expand]

PARMTagMemory = ^TARMTagMemory;

TARMTagMemory = record

ARM tag video text

[Expand]

PARMTagVideoText = ^TARMTagVideoText;

TARMTagVideoText = record

ARM tag ramdisk

[Expand]

PARMTagRamdisk = ^TARMTagRamdisk;

TARMTagRamdisk = record

ARM tag initialize ramdisk

[Expand]

PARMTagInitRd2 = ^TARMTagInitRd2;

TARMTagInitRd2 = record

ARM tag serial

[Expand]

PARMTagSerial = ^TARMTagSerial;

TARMTagSerial = record

ARM tag revision

[Expand]

PARMTagRevision = ^TARMTagRevision;

TARMTagRevision = record

ARM tag video framebuffer

[Expand]

PARMTagVideoFB = ^TARMTagVideoFB;

TARMTagVideoFB = record

ARM tag command

[Expand]

PARMTagCommand = ^TARMTagCommand;

TARMTagCommand = record

ARM boot tag

[Expand]

PARMTag = ^TARMTag;

TARMTag = record

Device tree blob header

[Expand]

PDTBHeader = ^TDTBHeader;

TDTBHeader = packed record

AARCH64 wait

TAARCH64Wait = procedure;

AARCH64 long wait

TAARCH64LongWait = procedure;

AARCH64 short wait

TAARCH64ShortWait = procedure;

AARCH64 slow blink

TAARCH64SlowBlink = procedure;

AARCH64 fast blink

TAARCH64FastBlink = procedure;


Public variables



AARCH64 specific variables

AARCH64Initialized:Boolean;
AARCH64BootMode:LongWord = 0; The ARM Mode that the processor was in at boot time (Set by Startup)
AARCH64BootVectors:LongWord = 0; The Vector Base Address that was current at boot time (Set by Startup)
AARCH64TagsAddress:PtrUInt = ARMTAGS_INITIAL Pointer to the ARM TAGS provided by the bootloader at startup (Set by Startup)
AARCH64MachineType:LongWord = 0; ARM Machine Type provided by the bootloader at startup (Set by Startup)
AARCH64SecureBoot:LongWord = 1; If 1 then startup will attempt to switch back to secure world during boot process (If supported by the AARCH64 boot stub)
AARCH64EmulatorMode:LongWord = 0; If 1 then startup detected that the machine is running in an emulator (If applicable)

Note: These variables must be initialized to remain in .data or else they are rewritten to zero with .bss

ARM tags

ARMTagsCount:LongWord; Number of ARM Tags found during parse

Tag none

TagNoneCount:LongWord; Number of ARM NONE Tags found during parse

Tag core

TagCoreCount:LongWord; Number of ARM CORE Tags found during parse
TagCoreFlags:LongWord;
TagCorePageSize:LongWord;
TagCoreRootDevice:LongWord;

Tag memory

TagMemoryCount:LongWord; Number of ARM MEM Tags found during parse
TagMemorySize:LongWord; Size of the last block reported by ARM Tags
TagMemoryStart:PtrUInt; Start of the last block reported by ARM Tags
TagMemoryLength:LongWord; Adjusted Size of the last block reported by ARM Tags
TagMemoryAddress:PtrUInt; Adjusted Address of the last block reported by ARM Tags

Tag video text

TagVideoTextCount:LongWord; Number of ARM VIDEOTEXT Tags found during parse

Tag ramdisk

TagRamdiskCount:LongWord; Number of ARM RAMDISK Tags found during parse

Tag initialize RD

TagInitRdCount:LongWord; Number of ARM INITRD Tags found during parse (Deprecated)

Tag initialize RD2

TagInitRd2Count:LongWord; Number of ARM INITRD2 Tags found during parse
TagInitRd2Start:LongWord;
TagInitRd2Size:LongWord;

Tag serial

TagSerialCount:LongWord; Number of ARM SERIAL Tags found during parse
TagSerialNoLow:LongWord;
TagSerialNoHigh:LongWord;

Tag revision

TagRevisionCount:LongWord; Number of ARM REVISION Tags found during parse
TagRevisionNo:LongWord;

Tag video framebuffer

TagVideoFBCount:LongWord; Number of ARM VIDEOLFB Tags found during parse

Tag command

TagCmdCount:LongWord; Number of ARM CMDLINE Tags found during parse
TagCommandSize:LongWord; Length of the command line in characters (Including null terminator)
TagCommandCount:LongInt; Count of parameters (space delimited) in the command line
TagCommandAddress:PAnsiChar; Pointer to the start of the command line

Wait handlers

AARCH64WaitHandler:TAARCH64Wait;
AARCH64LongWaitHandler:TAARCH64LongWait;
AARCH64ShortWaitHandler:TAARCH64ShortWait;

Blink handlers

AARCH64SlowBlinkHandler:TAARCH64SlowBlink;
AARCH64FastBlinkHandler:TAARCH64FastBlink;


Function declarations



Initialization functions

[Expand]
procedure AARCH64Init;
Description: To be documented


AARCH64 platform functions

[Expand]
procedure AARCH64ParseBootTags;
Description: Extract some information from the ARM boot tag list and use it to load the memory manager, some other information is stored in variables for future use


[Expand]
function ExtractCommandLine(Value:PAnsiChar):Boolean;
Description: To be documented


[Expand]
function ExtractMemoryBlock(Address,Size:LongWord):Boolean;
Description: To be documented


[Expand]
function ExtractInitialRamdisk(Address,Size:LongWord):Boolean;
Description: To be documented


[Expand]
procedure AARCH64ParseCommandLine;
Description: Setup argc, argv and cmdline and process known command line options


[Expand]
procedure AARCH64ParseEnvironment;
Description: Setup envp and process known environment options


[Expand]
function AARCH64GetSP:PtrUInt; assembler; nostackframe;
Description: Get the current stack pointer (SP)


[Expand]
function AARCH64GetPC:PtrUInt; assembler; nostackframe;
Description: Get the current program counter (PC)


[Expand]
function AARCH64GetIRQ:Boolean; assembler; nostackframe;
Description: Get Interrupts (IRQ) state


[Expand]
procedure AARCH64EnableIRQ; assembler; nostackframe;
Description: Enable Interrupts (IRQ) unconditionally


[Expand]
procedure AARCH64DisableIRQ; assembler; nostackframe;
Description: Disable Interrupts (IRQ) unconditionally


[Expand]
function AARCH64SaveIRQ:TIRQMask; assembler; nostackframe;
Description: Disable Interrupts (IRQ) and return the previous state


[Expand]
function AARCH64RestoreIRQ(IRQMask:TIRQMask):TIRQMask; assembler; nostackframe;
Description: Restore Interrupts (IRQ) to a previous state


[Expand]
function AARCH64GetFIQ:Boolean; assembler; nostackframe;
Description: Get Fast Interrupts (FIQ) state


[Expand]
procedure AARCH64EnableFIQ; assembler; nostackframe;
Description: Enable Fast Interrupts (FIQ) unconditionally


[Expand]
procedure AARCH64DisableFIQ; assembler; nostackframe;
Description: Disable Fast Interrupts (FIQ) unconditionally


[Expand]
function AARCH64SaveFIQ:TFIQMask; assembler; nostackframe;
Description: Disable Fast Interrupts (FIQ) and return the previous state


[Expand]
function AARCH64RestoreFIQ(FIQMask:TFIQMask):TFIQMask; assembler; nostackframe;
Description: Restore Fast Interrupts (FIQ) to a previous state


[Expand]
procedure AARCH64EnableIRQFIQ; assembler; nostackframe;
Description: Enable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally


[Expand]
procedure AARCH64DisableIRQFIQ; assembler; nostackframe;
Description: Disable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally


[Expand]
function AARCH64SaveIRQFIQ:TIRQFIQMask; assembler; nostackframe;
Description: Disable Interrupts and Fast Interrupts (IRQ/FIQ) and return the previous state


[Expand]
function AARCH64RestoreIRQFIQ(IRQFIQMask:TIRQFIQMask):TIRQFIQMask; assembler; nostackframe;
Description: Restore Interrupts and Fast Interrupts (IRQ/FIQ) to a previous state


[Expand]
function AARCH64GetAbort:Boolean; assembler; nostackframe;
Description: Get Abort state


[Expand]
procedure AARCH64EnableAbort; assembler; nostackframe;
Description: Enable Aborts unconditionally


[Expand]
procedure AARCH64DisableAbort; assembler; nostackframe;
Description: Disable Aborts unconditionally


[Expand]
function AARCH64SaveAbort:TAbortMask; assembler; nostackframe;
Description: Disable Aborts and return the previous state


[Expand]
function AARCH64RestoreAbort(AbortMask:TAbortMask):TAbortMask; assembler; nostackframe;
Description: Restore Aborts to a previous state


AARCH64 helper functions

[Expand]
procedure AARCH64Wait; inline;
Description: To be documented


[Expand]
procedure AARCH64LongWait; inline;
Description: To be documented


[Expand]
procedure AARCH64ShortWait; inline;
Description: To be documented


[Expand]
procedure AARCH64SlowBlink; inline;
Description: To be documented


[Expand]
procedure AARCH64FastBlink; inline;
Description: To be documented


[Expand]
function AARCH64ModeToString(AARCH64Mode:LongWord):String;
Description: To be documented


Return to Unit Reference