Difference between revisions of "Unit PlatformARM"

From Ultibo.org
Jump to: navigation, search
(Created page with "Return to Unit Reference === Description === ---- ''To be documented'' === Constants === ---- ''To be documented'' === Type definitions === ---- ''To...")
 
 
(25 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
''To be documented''
+
'''Ultibo Platform Interface unit for ARM'''
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''ARM mode''' <code> ARM_MODE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Bits 4..0 in the ARM program status register 
 +
|-
 +
|colspan="2"|See: A2.2 Processor Modes of the ARM Architecture Reference Manual and also A2.5.7 The mode bits
 +
|-
 +
|colspan="2"|See also: B1.3.1 ARM processor modes of the ARM Architecture Reference Manual (ARMv7-A and ARMv7-R edition)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ARM_MODE_USR = $10;</code>
 +
| Normal User Mode
 +
|-
 +
| <code>ARM_MODE_FIQ = $11;</code>
 +
| FIQ Processing Fast Interrupts Mode
 +
|-
 +
| <code>ARM_MODE_IRQ = $12;</code>
 +
| IRQ Processing Standard Interrupts Mode
 +
|-
 +
| <code>ARM_MODE_SVC = $13;</code>
 +
| Supervisor Processing Software Interrupts Mode
 +
|-
 +
| <code>ARM_MODE_MON = $16;</code>
 +
| Secure Monitor Mode (For Secure/Non Secure Switching)
 +
|-
 +
| <code>ARM_MODE_MON = $16;</code>
 +
| Secure Monitor Mode (For Secure/Non Secure Switching)
 +
|-
 +
| <code>ARM_MODE_ABT = $17;</code>
 +
| Abort Processing memory Faults Mode
 +
|-
 +
| <code>ARM_MODE_HYP = $1A;</code>
 +
| Hypervisor Mode
 +
|-
 +
| <code>ARM_MODE_UND = $1B;</code>
 +
| Undefined Processing Undefined Instructions Mode
 +
|-
 +
| <code>ARM_MODE_SYS = $1F;</code>
 +
| System Running Priviledged Operating System Tasks Mode
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ARM_MODE_BITS = $0000001F;</code>
 +
| Mask of the mode bits in the program status register
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''ARM interrupt disable''' <code> ARM_I_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Bits 7 and 6 in the ARM program status register
 +
|-
 +
|colspan="2"|See: A2.5.6 "The interrupt disable bits" of the ARM Architecture Reference Manual
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ARM_I_BIT = $00000080;</code>
 +
| IRQs disabled when set to 1
 +
|-
 +
| <code>ARM_F_BIT = $00000040;</code>
 +
| FIQs disabled when set to 1
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''ARM thumb and jazelle''' <code> ARM_*_BIT </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Bits 24 and 5 in the ARM program status register
 +
|-
 +
|colspan="2"|See: A2.5.8 "The T and J bits" of the ARM Architecture Reference Manual
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ARM_T_BIT = $00000020;</code>
 +
| Thumb mode enabled when set to 1
 +
|-
 +
| <code>ARM_J_BIT = $01000000;</code>
 +
| Jazelle mode enabled when set to 1
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''ARM abort''' <code> ARM_A_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Bit 8 in the ARM program status register
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ARM_A_BIT = $00000100;</code>
 +
| Data Abort masked when set to 1
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''ARM boot tag''' <code> ATAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>ATAG_NONE = $00000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>ATAG_CORE = $54410001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_MEM = $54410002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_VIDEOTEXT = $54410003;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_RAMDISK = $54410004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_INITRD = $54410005;</code>
 +
| Deprecated
 +
|-
 +
| <code>ATAG_INITRD2 = $54420005;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_SERIAL = $54410006;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_REVISION = $54410007;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_VIDEOLFB = $54410008;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ATAG_CMDLINE = $54410009;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ARMTAGS_INITIAL = $FFFFFFFF;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Device tree blob''' <code> DTB_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>DTB_SIGNATURE = $d00dfeed;</code>
 +
| style="width: 50%;"|See: https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''ARM machine type''' <code> ARM_MACHINE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>ARM_MACHINE_VERSATILE_PB = $00000183;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ARM_MACHINE_BCM2708 = $00000C42;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ARM_MACHINE_BCM2709 = $00000C42;</code>
 +
| BCM2709 uses the same Machine Type as BCM2708
 +
|-
 +
| <code>ARM_MACHINE_BCM2710 = $00000C42;</code>
 +
| BCM2710 uses the same Machine Type as BCM2708
 +
|-
 +
| <code>ARM_MACHINE_BCM2711 = $00000C42;</code>
 +
| BCM2711 uses the same Machine Type as BCM2708
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''ARM boot tag header'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagHeader = ^TARMTagHeader;</code>
 +
 
 +
<code>TARMTagHeader = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: ARM Boot Tag Structure Definitions
 +
|-
 +
| <code>Size:LongWord;</code>
 +
| Size of tag, in words (32bit), including the header
 +
|-
 +
| <code>Tag:LongWord;</code>
 +
| One of the ATAG_* values from above
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''ARM tag core''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagCore = ^TARMTagCore;</code>
 +
 
 +
<code>TARMTagCore = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Core parameters (ATAG_CORE)
 +
|-
 +
| <code>Flags:LongWord;</code>
 +
| Bit 0 = read-only
 +
|-
 +
| <code>PageSize:LongWord;</code>
 +
| Systems page size (usually 4k)
 +
|-
 +
| <code>RootDev:LongWord;</code>
 +
| Root device number
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''ARM tag memory'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagMemory = ^TARMTagMemory;</code>
 +
 
 +
<code>TARMTagMemory = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Description of memory region (ATAG_MEM)
 +
|-
 +
| <code>Size:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Start:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''ARM tag video text'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagVideoText = ^TARMTagVideoText;</code>
 +
 
 +
<code>TARMTagVideoText = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Description of VGA text type displays (ATAG_VIDEOTEXT)
 +
|-
 +
| <code>X:Byte;</code>
 +
| Width of display
 +
|-
 +
| <code>Y:Byte;</code>
 +
| Height of display
 +
|-
 +
| <code>Video_page:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Video_mode:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Video_cols:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Video_ega_bx:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Video_lines:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Video_isvga:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Video_points:Word;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''ARM tag ramdisk''' 
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagRamdisk = ^TARMTagRamdisk;</code>
 +
 
 +
<code>TARMTagRamdisk = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Description of how the ramdisk will be used by the kernel (ATAG_RAMDISK)
 +
|-
 +
| <code>Flags:LongWord;</code>
 +
| Bit 0 = load, Bit 1 = prompt
 +
|-
 +
| <code>Size:LongWord;</code>
 +
| Decompressed ramdisk size in _kilo_ bytes
 +
|-
 +
| <code>Start:LongWord;</code>
 +
| Starting block of floppy-based RAM disk image
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''Tag initialize RD'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagInitRdCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM INITRD Tags found during parse (Deprecated)
 +
|-
 +
|}
 +
 +
'''Tag initialize RD2'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagInitRd2Count:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM INITRD2 Tags found during parse
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagInitRd2Start:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagInitRd2Size:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|} 
 +
 
 +
'''ARM tag serial'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagSerial = ^TARMTagSerial;</code>
 +
 
 +
<code>TARMTagSerial = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Board serial number (ATAG_SERIAL)
 +
|-
 +
| <code>Low:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>High:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''ARM tag revision'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagRevision = ^TARMTagRevision;</code>
 +
 
 +
<code>TARMTagRevision = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Board revision (ATAG_REVISION)
 +
|-
 +
| <code>Revision:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''ARM tag video framebuffer'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagVideoFB = ^TARMTagVideoFB;</code>
 +
 
 +
<code>TARMTagVideoFB = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Description of the parameters for a linear framebuffer type display (ATAG_VIDEOLFB)
 +
|-
 +
| <code>Lfb_width:Word;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Lfb_height:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Lfb_depth:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Lfb_linelength:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Lfb_base:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Lfb_size:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Red_size:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Red_pos:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Green_size:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Green_pos:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Blue_size:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Blue_pos:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Rsvd_size:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Rsvd_pos:Byte;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''ARM tag command'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTagCommand = ^TARMTagCommand;</code>
 +
 
 +
<code>TARMTagCommand = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Commandline for the kernel (ATAG_CMDLINE)
 +
|-
 +
| <code>Cmdline:array[0..0] of AnsiChar;</code>
 +
| This is the minimum size
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''ARM boot tag'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PARMTag = ^TARMTag;</code>
 +
 
 +
<code>TARMTag = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Format of ARM Boot Tag
 +
|-
 +
| <code>Header:TARMTagHeader;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>case Integer of</code>
 +
| &nbsp;
 +
|-
 +
| <code>0:(Core:TARMTagCore);</code>
 +
| &nbsp;
 +
|-
 +
| <code>1:(Memory:TARMTagMemory);</code>
 +
| &nbsp;
 +
|-
 +
| <code>2:(VideoText:TARMTagVideoText);</code>
 +
| &nbsp;
 +
|-
 +
| <code>3:(Ramdisk:TARMTagRamdisk);</code>
 +
| &nbsp;
 +
|-
 +
| <code>4:(InitRd2:TARMTagInitRd2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>5:(Serial:TARMTagSerial);</code>
 +
| &nbsp;
 +
|-
 +
| <code>6:(Revision:TARMTagRevision);</code>
 +
| &nbsp;
 +
|-
 +
| <code>7:(VideoFB:TARMTagVideoFB);</code>
 +
| &nbsp;
 +
|-
 +
| <code>8:(Command:TARMTagCommand)</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Device tree blob header'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDTBHeader = ^TDTBHeader;</code>
 +
 
 +
<code>TDTBHeader = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Magic:LongWord;</code>
 +
| The value 0xd00dfeed (big-endian)
 +
|-
 +
| <code>TotalSize:LongWord;</code>
 +
| The total size in bytes of the devicetree data structure (big-endian)
 +
|-
 +
| <code>StructureOffset:LongWord;</code>
 +
| The offset in bytes of the structure block from the beginning of the header (big-endian)
 +
|-
 +
| <code>StringsOffset:LongWord;</code>
 +
| The offset in bytes of the strings block from the beginning of the header (big-endian)
 +
|-
 +
| <code>ReservationOffset:LongWord;</code>
 +
| The offset in bytes of the memory reservation block from the beginning of the header (big-endian)
 +
|-
 +
| <code>Version:LongWord;</code>
 +
| The version of the devicetree data structure (big-endian)
 +
|-
 +
| <code>CompatibleVersion:LongWord;</code>
 +
| The lowest version of the devicetree data structure with which the version used is backwards compatible (big-endian)
 +
|-
 +
| <code>BootCPUID:LongWord;</code>
 +
| The physical ID of the system’s boot CPU (big-endian)
 +
|-
 +
| <code>StringsSize:LongWord;</code>
 +
| The length in bytes of the strings block section of the devicetree blob (big-endian)
 +
|-
 +
| <code>StructureSize:LongWord;</code>
 +
| The length in bytes of the structure block section of the devicetree blob (big-endian)
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''ARM wait'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TARMWait = procedure;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''ARM long wait'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TARMLongWait = procedure;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''ARM short wait'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TARMShortWait = procedure;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''ARM slow blink'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TARMSlowBlink = procedure;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''ARM fast blink'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TARMFastBlink = procedure;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
 
 +
'''ARM specific variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMInitialized:Boolean;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMBootMode:LongWord = 0;</code>
 +
| style="width: 40%;"|The ARM Mode that the processor was in at boot time (Set by Startup)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMBootVectors:LongWord = 0;</code>
 +
| style="width: 40%;"|The Vector Base Address that was current at boot time (Set by Startup)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMTagsAddress:PtrUInt = ARMTAGS_INITIAL;</code>
 +
| style="width: 40%;"|Pointer to the ARM TAGS provided by the bootloader at startup (Set by Startup)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMMachineType:LongWord = 0;</code>
 +
| style="width: 40%;"|ARM Machine Type provided by the bootloader at startup (Set by Startup)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMSecureBoot:LongWord = 1;</code>
 +
| style="width: 40%;"|If 1 then startup will attempt to switch back to secure world during boot process (If supported by the ARM boot stub)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMEmulatorMode:LongWord = 0;</code>
 +
| style="width: 40%;"|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'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMTagsCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM Tags found during parse
 +
|-
 +
|}
 +
 +
'''Tag none variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagNoneCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM NONE Tags found during parse
 +
|-
 +
|}
 +
 +
'''Tag core'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCoreCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM CORE Tags found during parse
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCoreFlags:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCorePageSize:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCoreRootDevice:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Tag memory'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagMemoryCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM MEM Tags found during parse
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagMemorySize:LongWord;</code>
 +
| style="width: 40%;"|Size of the last block reported by ARM Tags
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagMemoryStart:PtrUInt;</code>
 +
| style="width: 40%;"|Start of the last block reported by ARM Tags
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagMemoryLength:LongWord;</code>
 +
| style="width: 40%;"|Adjusted Size of the last block reported by ARM Tags
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagMemoryAddress:PtrUInt;</code>
 +
| style="width: 40%;"|Adjusted Address of the last block reported by ARM Tags
 +
|-
 +
|}
 +
 +
'''Tag video text'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagVideoTextCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM VIDEOTEXT Tags found during parse
 +
|-
 +
|}
 +
 +
'''Tag ramdisk'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagRamdiskCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM RAMDISK Tags found during parse
 +
|-
 +
|}
 +
 +
'''Tag initialize RD2'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagInitRd2Count:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM INITRD2 Tags found during parse
 +
|-
 +
|}
 +
 +
'''Tag serial'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagSerialCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM SERIAL Tags found during parse
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagSerialNoLow:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagSerialNoHigh:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Tag revision'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagRevisionCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM REVISION Tags found during parse
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagRevisionNo:LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Tag video framebuffer'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagVideoFBCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM VIDEOLFB Tags found during parse
 +
|-
 +
|}
 +
 +
'''Tag command'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCmdCount:LongWord;</code>
 +
| style="width: 40%;"|Number of ARM CMDLINE Tags found during parse
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCommandSize:LongWord;</code>
 +
| style="width: 40%;"|Length of the command line in characters (Including null terminator)
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCommandCount:LongInt;</code>
 +
| style="width: 40%;"|Count of parameters (space delimited) in the command line
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TagCommandAddress:PAnsiChar;</code>
 +
| style="width: 40%;"|Pointer to the start of the command line
 +
|-
 +
|}
 +
 +
'''Wait handlers'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMWaitHandler:TARMWait;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMLongWaitHandler:TARMLongWait;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMShortWaitHandler:TARMShortWait;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Blink handlers'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMSlowBlinkHandler:TARMSlowBlink;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>ARMFastBlinkHandler:TARMFastBlink;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
  
''To be documented''
 
  
 +
'''Initialization 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 ARMInit;</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 />
 +
 +
'''ARM platform 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 ARMParseBootTags;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''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</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 ExtractCommandLine(Value:PAnsiChar):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;"
 +
|-
 +
! 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 ExtractMemoryBlock(Address,Size:LongWord):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;"
 +
|-
 +
! 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 ExtractInitialRamdisk(Address,Size:LongWord):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;"
 +
|-
 +
! 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;">procedure ARMParseCommandLine;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Setup argc, argv and cmdline and process known command line options</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;">procedure ARMParseEnvironment;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Setup envp and process known environment options</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 ARMGetSP:PtrUInt; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current stack pointer (SP)</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 ARMGetPC:PtrUInt; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current program counter (PC)</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 ARMGetIRQ:Boolean; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get Interrupts (IRQ) state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| True is enabled, False if disabled (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;">procedure ARMEnableIRQ; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable Interrupts (IRQ) unconditionally</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;">procedure ARMDisableIRQ; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Interrupts (IRQ) unconditionally</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 ARMSaveIRQ:TIRQMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Interrupts (IRQ) and return the previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| IRQ state when called (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 ARMRestoreIRQ(IRQMask:TIRQMask):TIRQMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Restore Interrupts (IRQ) to a previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! IRQMask
 +
| IRQ state to restore (Passed in R0)
 +
|-
 +
! Return
 +
| IRQ state when called (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 ARMGetFIQ:Boolean; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get Fast Interrupts (FIQ) state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| True is enabled, False if disabled (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;">procedure ARMEnableFIQ; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable Fast Interrupts (FIQ) unconditionally</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;">procedure ARMDisableFIQ; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Fast Interrupts (FIQ) unconditionally</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 ARMSaveFIQ:TFIQMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Fast Interrupts (FIQ) and return the previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| FIQ state when called (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 ARMRestoreFIQ(FIQMask:TFIQMask):TFIQMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Restore Fast Interrupts (FIQ) to a previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! FIQMask
 +
| FIQ state to restore (Passed in R0)
 +
|-
 +
! Return
 +
| FIQ state when called (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;">procedure ARMEnableIRQFIQ; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally</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;">procedure ARMDisableIRQFIQ; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Interrupts and Fast Interrupts (IRQ/FIQ) unconditionally</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 ARMSaveIRQFIQ:TIRQFIQMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Interrupts and Fast Interrupts (IRQ/FIQ) and return the previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| IRQ/FIQ state when called (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 ARMRestoreIRQFIQ(IRQFIQMask:TIRQFIQMask):TIRQFIQMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Restore Interrupts and Fast Interrupts (IRQ/FIQ) to a previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! IRQFIQMask
 +
| IRQ/FIQ state to restore (Passed in R0)
 +
|-
 +
! Return
 +
| IRQ/FIQ state when called (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 ARMGetAbort:Boolean; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get Abort state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| True is enabled, False if disabled (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;">procedure ARMEnableAbort; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable Aborts unconditionally</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;">procedure ARMDisableAbort; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Aborts unconditionally</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 ARMSaveAbort:TAbortMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable Aborts and return the previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| Abort state when called (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 ARMRestoreAbort(AbortMask:TAbortMask):TAbortMask; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Restore Aborts to a previous state</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! AbortMask
 +
| Abort state to restore (Passed in R0)
 +
|-
 +
! Return
 +
| Abort state when called (Returned in R0)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''ARM helper 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 ARMWait; inline;</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;">procedure ARMLongWait; inline;</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;">procedure ARMShortWait; inline;</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;">procedure ARMSlowBlink; inline;</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;">procedure ARMFastBlink; inline;</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 ARMModeToString(ARMMode:LongWord):String;</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 />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 06:17, 6 September 2024

Return to Unit Reference


Description


Ultibo Platform Interface unit for ARM

Constants



[Expand]
ARM mode ARM_MODE_*


[Expand]
ARM interrupt disable ARM_I_*


[Expand]
ARM thumb and jazelle ARM_*_BIT


[Expand]
ARM abort ARM_A_*


[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

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;

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

ARM wait

TARMWait = procedure;

ARM long wait

TARMLongWait = procedure;

ARM short wait

TARMShortWait = procedure;

ARM slow blink

TARMSlowBlink = procedure;

ARM fast blink

TARMFastBlink = procedure;


Public variables



ARM specific variables

ARMInitialized:Boolean;
ARMBootMode:LongWord = 0; The ARM Mode that the processor was in at boot time (Set by Startup)
ARMBootVectors:LongWord = 0; The Vector Base Address that was current at boot time (Set by Startup)
ARMTagsAddress:PtrUInt = ARMTAGS_INITIAL; Pointer to the ARM TAGS provided by the bootloader at startup (Set by Startup)
ARMMachineType:LongWord = 0; ARM Machine Type provided by the bootloader at startup (Set by Startup)
ARMSecureBoot:LongWord = 1; If 1 then startup will attempt to switch back to secure world during boot process (If supported by the ARM boot stub)
ARMEmulatorMode: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 variables

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 RD2

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

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

ARMWaitHandler:TARMWait;
ARMLongWaitHandler:TARMLongWait;
ARMShortWaitHandler:TARMShortWait;

Blink handlers

ARMSlowBlinkHandler:TARMSlowBlink;
ARMFastBlinkHandler:TARMFastBlink;


Function declarations



Initialization functions

[Expand]
procedure ARMInit;
Description: To be documented


ARM platform functions

[Expand]
procedure ARMParseBootTags;
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 ARMParseCommandLine;
Description: Setup argc, argv and cmdline and process known command line options


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


ARM helper functions

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


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


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


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


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


[Expand]
function ARMModeToString(ARMMode:LongWord):String;
Description: To be documented


Return to Unit Reference