Commit 189b92c1 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Rationalise some old switches.

Export less in hdr:RISCOS.
Delete unused GetDecimalPair routine.
Move CheckYear with other RTC stuff out of PMF/osword.
Hide DebugROMInit and DebugROMErrors in release (even numbered) versions.

Version 5.35, 4.79.2.127. Tagged as 'Kernel-5_35-4_79_2_127'
parent 191ae197
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.126"
Module_MinorVersion SETS "4.79.2.127"
Module_Date SETS "27 Nov 2011"
Module_ApplicationDate SETS "27-Nov-11"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.126)"
Module_HelpVersion SETS "5.35 (27 Nov 2011) 4.79.2.126"
Module_FullVersion SETS "5.35 (4.79.2.127)"
Module_HelpVersion SETS "5.35 (27 Nov 2011) 4.79.2.127"
END
......@@ -5,12 +5,12 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.126
#define Module_MinorVersion_CMHG 4.79.2.127
#define Module_Date_CMHG 27 Nov 2011
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.126"
#define Module_MinorVersion "4.79.2.127"
#define Module_Date "27 Nov 2011"
#define Module_ApplicationDate "27-Nov-11"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.126)"
#define Module_HelpVersion "5.35 (27 Nov 2011) 4.79.2.126"
#define Module_FullVersion "5.35 (4.79.2.127)"
#define Module_HelpVersion "5.35 (27 Nov 2011) 4.79.2.127"
#define Module_LibraryVersionInfo "5:35"
......@@ -12,20 +12,6 @@
; See the License for the specific language governing permissions and
; limitations under the License.
;
; amg 7/12/96 Renaissance
; Forcibly ensure that options only intended for one class of platform
; stay there. Generally this involves combining switches with the STB
; switch. The exception is processor architectural stuff. 7500FE is
; included always, and StrongARM has an independed switch.
;
; When you want to migrate features from one platform to another you'll
; find that every occurence of feature switches has been qualified with
; the appropriate sense of the STB switch. This is to remind you to think
; about what you're about to do! Check whether the code actually will work
; at all on something that is or is not a STB class product.
;
; Using the STB switch this aggressively also help ensure that there's
; no unexpected code crossover in the initial merge.
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; now the conditional flags for the version we want
......@@ -62,14 +48,15 @@ TubeType SETA Tube_Simulator
UserMemStart * &8000
GBLL ExceptionsAreErrors
ExceptionsAreErrors SETL 1=1
AssemblingArthur SETL {TRUE}
; defined in hdr.system to allow conditionals in macros
GBLL ShowWS
ShowWS SETL {TRUE} ; Make KernelWS be verbose
GBLL DoingVdu
DoingVdu SETL {FALSE} ; so can get KeyWS!
GBLL Module
Module SETL {FALSE}
......@@ -84,6 +71,9 @@ IncludeTestSrc SETL :LNOT: HAL
GBLL RO371Timings
RO371Timings SETL :LNOT: STB
GBLL VCOstartfix ;code in early kernel to fix VCO start problem on A7000 (esp. 7500FE)
VCOstartfix SETL {TRUE}
; For development on Customer M hardware only
GBLL ParallelFlashUpgrade
ParallelFlashUpgrade SETL {FALSE}
......@@ -125,9 +115,6 @@ Select16BitSound SETL {TRUE}
GBLL Japanese16BitSound
Japanese16BitSound SETL {TRUE} :LAND: STB
GBLL ChopOffTheGoolies
ChopOffTheGoolies SETL {FALSE}
GBLL ChecksumCMOS
ChecksumCMOS SETL {TRUE}
......@@ -158,9 +145,18 @@ AlwaysClearRAM SETL {TRUE}
GBLL CacheCMOSRAM ; Whether to keep a RAM copy of CMOS RAM for faster access
CacheCMOSRAM SETL {TRUE}
GBLL CheckProtectionLink ; if true, disallow CMOS RAM changes if link in protected position
CheckProtectionLink SETL {TRUE} ; NB affects Delete/Copy/R/T and 0-9/.
GBLL ValidateCMOS ; Apply special CMOS-corruption detection code,
ValidateCMOS SETL {TRUE} ; and do minimal default settings.
GBLL LCDInvert
LCDInvert SETL {TRUE} :LAND: :LNOT: STB
GBLL LCDSupport ; Whether LCD Support is assembled in or not
LCDSupport SETL {TRUE} :LAND: :LNOT: STB
GBLL ModeSelectors ; whether mode selectors are understood
ModeSelectors SETL {TRUE}
......@@ -179,16 +175,17 @@ LateAborts SETL {TRUE}
GBLL ShrinkableDAs ; if true, support Shrinkable Dynamic Areas (eg. CacheFS)
ShrinkableDAs SETL {TRUE}
GBLL DA_Batman ; Holey dynamic areas Batman!
DA_Batman SETL {TRUE} ; concept of sparsely mapped dynamic areas introduced for Ursula
GBLL ShadowROM ; if true, the ROM is mirrored above
ShadowROM SETL {FALSE} ; &FF800000
GBLL Interruptible32bitModes
Interruptible32bitModes SETL {TRUE} ;if true, limited 32-bit mode code support (interrupt handler does not assume
; 26-bit foreground), also allows faster, 32-bit APCS version of FPEmulator
GBLL GSWorkspaceInKernelBuffers ; Move gstrans workspace into the kernel buffers area to fix redirection
GSWorkspaceInKernelBuffers SETL {TRUE} ; and everything else that suffers from the dodgy use of scratch space.
GBLL Interruptible32bitModes ; if true, limited 32-bit mode code support (interrupt handler does not assume
Interruptible32bitModes SETL {TRUE} ; 26-bit foreground), also allows faster, 32-bit APCS version of FPEmulator
GBLL GSWorkspaceInKernelBuffers ; Move gstrans workspace into the kernel buffers area to fix redirection
GSWorkspaceInKernelBuffers SETL {TRUE} ; and everything else that suffers from the dodgy use of scratch space.
GBLL EarlierReentrancyInDAShrink
EarlierReentrancyInDAShrink SETL {TRUE} ; fix for RAMFS and new FileCore (causes reentrant DA shrink/remove)
......@@ -205,33 +202,25 @@ LongCLISize * 1024 ; buffer size for long commands
]
GBLL StrongARM
GBLL SAcleanflushbroken ;whether StrongARM single MCR for DC clean+flush broken (is always for SA110)
GBLL SASTMhatbroken ;whether ROM must support SA110's with broken STM^ (revision 3 should fix this)
GBLL StrongARM_POST ;whether to run POST for StrongARM (and possibly ARM8)
GBLL SAcleanflushbroken ; whether StrongARM single MCR for DC clean+flush broken (is always for SA110)
GBLL SASTMhatbroken ; whether ROM must support SA110's with broken STM^ (revision 3 should fix this)
GBLL StrongARM_POST ; whether to run POST for StrongARM (and possibly ARM8)
GBLL ARM6support
GBLL XScaleMiniCache ;is the XScale mini data-cache used (at all)
GBLL XScaleMiniCache ; is the XScale mini data-cache used (at all)
GBLL XScaleJTAGDebug
GBLL ECC ;use ECC on XScale. May compromise other ARM compatibility
GBLL ECC ; use ECC on XScale. May compromise other ARM compatibility
StrongARM SETL {TRUE}
SAcleanflushbroken SETL {TRUE} :LAND: StrongARM
SASTMhatbroken SETL {TRUE} :LAND: StrongARM
StrongARM_POST SETL {TRUE} :LAND: StrongARM
ARM6support SETL (MEMM_Type = "ARM600") ; Needs updating for VMSAv6 compatability
ARM6support SETL (MEMM_Type = "ARM600") ; Needs updating for VMSAv6 compatability
XScaleMiniCache SETL {FALSE}
XScaleJTAGDebug SETL {TRUE}
ECC SETL {FALSE}
;mjs
;concept of sparsely mapped dynamic areas introduced for Ursula
GBLL DA_Batman ;Holey dynamic areas Batman!
;mjs
;Chocolate flavours implemented for Ursula, but they are generally useful performance enhancements
;(not all Ursula performance improvements are flagged with Chocolate - eg. simple changes such as slicker SWI
......@@ -246,13 +235,8 @@ ECC SETL {FALSE}
GBLL ChocolateOscli ;whether to do performance improvements in Oscli command stuff
GBLL ChocolateService ;whether to implement fast module service call distribution (uses table introduced
;into module format by Ursula API)
;possibly enabled at run time for some ARMs only
;
GBLL ChocolateAMB ;whether to compile support for Lazy task swapping
DA_Batman SETL {TRUE}
;possibly enabled at run time for some ARMs only
ChocolateSysHeap SETL {TRUE}
ChocolateOSMod SETL {TRUE}
ChocolateSysVars SETL {TRUE}
......@@ -279,11 +263,6 @@ MaxChocolateMSBlocks SETA 150
Oscli_QuickAliases SETL {TRUE} :LAND: ChocolateOscli ;try to do a better job of checking for aliases
Oscli_HashedCommands SETL {TRUE} :LAND: ChocolateOscli ;try to do a better job of finding commands
GBLL VCOstartfix ;code in early kernel to fix VCO start problem on A7000 (esp. 7500FE)
VCOstartfix SETL {TRUE}
GBLL mjsServiceTrace ;for statistics gathering on service calls only
mjsServiceTrace SETL {FALSE}
GBLL mjsSysHeapNodesTrace ;for statistics gathering on some SysHeap nodes only
......@@ -292,9 +271,6 @@ mjsSysHeapNodesTrace SETL {FALSE}
GBLL NoSPSRcorruption ;set to true if IRQ dispatcher
NoSPSRcorruption SETL {FALSE} ;preserves SPSR_SVC
GBLL CheckProtectionLink ; if true, disallow CMOS RAM changes if link in protected position
CheckProtectionLink SETL {TRUE} ; NB affects Delete/Copy/R/T and 0-9/.
GBLL RMTidyDoesNowt ; if true, RMTidy does nothing
RMTidyDoesNowt SETL {TRUE} ; should really be "machine has FSLock in ROM"
......@@ -302,41 +278,33 @@ RMTidyDoesNowt SETL {TRUE} ; should really be "machine has
RogerEXEY SETL {FALSE} ; Marketing don't like it!
GBLL DebugROMInit
DebugROMInit SETL {TRUE}
DebugROMInit SETL (Version :AND: 1) = 1 ; Yes for odd numbered development
GBLL DebugROMPostInit ; Displays when the PostInit service call is sent to each ROM module (currently works on vanilla service call handling only)
DebugROMPostInit SETL (:LNOT: ChocolateService) :LAND: {FALSE}
GBLL DebugROMErrors
DebugROMErrors SETL {TRUE}
DebugROMErrors SETL (Version :AND: 1) = 1 ; Yes for odd numbered development
GBLL DebugTerminal ; default WRCH and RDCH through HAL
DebugTerminal SETL {FALSE}
GBLL DebugHALTX
DebugHALTX SETL {TRUE}
DebugHALTX SETL (Version :AND: 1) = 1 ; Yes for odd numbered development
GBLL DebugHeaps ; initialise claimed and freed blocks
DebugHeaps SETL {FALSE} ; (may slow things down unacceptably)
[ DebugHeaps
! 0, "*** WARNING *** Heap debugging assembled in"
]
; ChangeDynamicArea and related options
GBLL DebugCDA
DebugCDA SETL {FALSE}
GBLL DebugCDA2
GBLL DebugCDA2 ; ChangeDynamicArea and related options
DebugCDA2 SETL {FALSE}
[ DebugHeaps :LOR: DebugROMInit :LOR: DebugROMPostInit :LOR: DebugROMErrors :LOR: DebugCDA2
! 0, "*** WARNING *** Debugging assembled in"
]
GBLL StorkPowerSave ;True => power saving for Stork AND A4
StorkPowerSave SETL MorrisSupport ;False=> older A4 code only
GBLL LCDSupport ;Whether LCD Support is assembled in or not
LCDSupport SETL {TRUE} :LAND: :LNOT: STB
;(First intro'd for Stork)
GBLL FixR9CorruptionInExtensionSWI ; whether R9 corruption by ExtensionSWI handler is fixed
FixR9CorruptionInExtensionSWI SETL No26bitCode ; currently FALSE as CC's !SpellMod (possibly others) rely on it being broken
......@@ -344,17 +312,7 @@ FixR9CorruptionInExtensionSWI SETL No26bitCode ; currently FALSE as CC'
FixCallBacks SETL {TRUE} ; also addresses some atomicity problems
GBLL InterlacedPointer
InterlacedPointer SETL {TRUE} :LAND: STB ; enable code to do proper interlaced pointer
GBLL ValidateCMOS ; Apply special CMOS-corruption detection code,
ValidateCMOS SETL {TRUE} ; and do minimal default settings.
GBLS GetMessages
[ International
GetMessages SETS "GET s.MsgCode"
|
GetMessages SETS ""
]
InterlacedPointer SETL {TRUE} :LAND: STB ; enable code to do proper interlaced pointer
GBLL HiProcVecs ; Relocate processor vectors and first 16K of workspace to &FFFF0000
HiProcVecs SETL {FALSE} ; Leave off for now
......@@ -383,21 +341,27 @@ Reset_DeviceVectorCorrupt * 8
Reset_PoduleOrCallBackCorrupt * 9
]
; Flags for RISC OS Blue changes
;
GBLL AssembleKEYV
AssembleKEYV SETL {TRUE} ; Use KEYV.
GBLL AssemblePointerV
AssemblePointerV SETL {TRUE} ; Use PointerV.
GBLL PollMouse
PollMouse SETL {FALSE} ; Poll mouse.
GBLL AssembleKEYV
AssembleKEYV SETL {TRUE} ; Use KEYV.
GBLL AssemblePointerV
AssemblePointerV SETL {TRUE} ; Use PointerV.
GBLL ProcessorVectors
ProcessorVectors SETL {TRUE} ; Processor vectors indirected through 0 page.
GBLL PollMouse
PollMouse SETL {FALSE} ; Poll mouse.
GBLL UseNewFX0Error
UseNewFX0Error SETL (:LNOT: Embedded_UI) :LAND: ((Version :AND: 1) = 1) ; Whether *FX 0 should show the ROM link date instead of the UtilityModule date
GBLL ProcessorVectors
ProcessorVectors SETL {TRUE} ; Processor vectors indirected through 0 page.
GBLL UseNewFX0Error
UseNewFX0Error SETL (:LNOT: Embedded_UI) :LAND: ((Version :AND: 1) = 1) ; Whether *FX 0 should show the ROM link date instead of the UtilityModule date
GBLS GetMessages
[ International
GetMessages SETS "GET s.MsgCode"
|
GetMessages SETS ""
]
GBLS GetUnsqueeze
[ SqueezeMods
GetUnsqueeze SETS "GET s.Unsqueeze"
......@@ -423,15 +387,12 @@ GetHAL SETS "GET s.HAL"
|
GetHAL SETS ""
]
GBLS GetKbdDrA1
[ Keyboard_Type = "A1A500"
GetKbdDrA1 SETS "GET s.PMF.KbdDrA1"
|
GetKbdDrA1 SETS ""
]
GBLS GetKbdRes
[ :LNOT: HAL
[ Keyboard_Type = "A1A500"
......@@ -448,43 +409,17 @@ GetKbdRes SETS "GET s.KbdRes" :CC: Keyboard_Type
; try to acheive the latter by growing the rma if possible.
; _twowords Use two word entries in the queue. This overcomes the limitation
; of the original packed word format.
; _debug Store the queue start, end and 'amount to change the rma dynamic
; area by' in the first three words of OldIRQ1VSpace
GBLL med_00001_userma
GBLL med_00001_twowords
GBLL med_00001_debug
med_00001_userma SETL {TRUE}
med_00001_twowords SETL {TRUE}
;med_00001_debug SETL {TRUE}
;med_00001_userma SETL {FALSE}
;med_00001_twowords SETL {FALSE}
med_00001_debug SETL {FALSE}
[ med_00001_userma
smallest_rma_size * (48*1024) ; define the low threshold for rma use
largest_rma_size * (128*1024) ; and the ceiling for rma use
]
[ med_00001_debug
! 0,""
! 0,",-----------------------------------------------------------------,"
! 0,"| **** WARNING **** |"
! 0,"| |"
! 0,"| Audit trail debugging for MED-00001 is enabled. This reuses the |"
! 0,"| first three words of OldIRQ1Vspace. This should be turned off |"
! 0,"| once MED-00001 has been tested and marked 'fixed'. |"
! 0,"| |"
! 0,"| Usage: |"
! 0,"| +0 start of area used by flood fill |"
! 0,"| +4 end+1 of area used by flood fill |"
! 0,"| +8 amount the rma was grown by |"
! 0,"'-----------------------------------------------------------------'"
! 0,""
]
; Ickle macros. We want to be able to turn IRQs on and off fast in the
; code in various places. To do this easily, have a name for the
; SVC26/32 mode we run in.
......@@ -497,6 +432,4 @@ USR2632 * USR26_mode
SVC2632 * SVC26_mode
]
MaxSwi * OS_HeapSort32+1
END
......@@ -161,6 +161,8 @@ SWIClass SETS RISCOS_Kernel_1SWI_Name
AddSWI SubstituteArgs32 ; &7E
AddSWI HeapSort32 ; &7F
NCORESWIS * OS_HeapSort32 + 1 ; There are this many kernel SWIs, 0..NCORESWIS-1
ASSERT @ <= &C0
SWIClass SETS RISCOS_StringConversionSWI_Name
......@@ -277,15 +279,7 @@ SpareVector3 * &2D
SpareVector2 * &2E
SpareVector1 * &2F
; LowPriorityEventV
; R0 - flags
; R1 - event class
; R2 - event type
; Event Classes
; 0 - System
; 1 - Window
NVECTORS * &30 ; There are this many vectors, 0..NVECTORS-1
NVECTORS * SpareVector1 + 1 ; There are this many vectors, 0..NVECTORS-1
; Buffer indices
......@@ -372,25 +366,19 @@ MosVer * 6 ; As returned by OS_Byte 0
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; From here on, due for retirement
GBLL True
True SETL {TRUE}
GBLL False
False SETL {FALSE}
NIL * &80000000 ; An interesting value
MaxLengthDateLo * &33EA0000 ; Wednesday, 28th September 1988
MaxLengthDateHi * &00000041 ; 11:34:36.80 am
GBLL AssemblingArthur
AssemblingArthur SETL False
GBLL True
True SETL {TRUE}
GBLL False
False SETL {FALSE}
; Tells Switcher it's being built on a system with OS_DynamicArea 6 and 7
; available - activated by Kernel's internal DynArea_QuickHandles switch.
; Actually: is just used by Switcher
GBLL OSD6and7Kernel
OSD6and7Kernel SETL True
GBLL AssemblingArthur
AssemblingArthur SETL {FALSE}
OPT OldOpt
END
......@@ -34,8 +34,6 @@
; now get the headers
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GBLL ShowWS
ShowWS SETL {TRUE} ; Make KernelWS be verbose
GET Hdr:CMOS
GET Hdr:Heap
......@@ -79,8 +77,6 @@ ShowWS SETL {TRUE} ; Make KernelWS be verbose
; now the main parts of the MOS
; IMPORT EndOfKernel
GET hdr.Copro15ops ; some macros
GET hdr.ARMops
......@@ -182,26 +178,7 @@ EndOfAMB
! 0, "AMB section size = &" :CC: :STR: (EndOfAMB - StartOfAMB)
; ALIGN 65536
EndOfKernel
DCD 0
[ med_00001_debug
! 0,""
! 0,",-----------------------------------------------------------------,"
! 0,"| **** WARNING **** |"
! 0,"| |"
! 0,"| Audit trail debugging for MED-00001 is enabled. This reuses the |"
! 0,"| first three words of OldIRQ1Vspace. This should be turned off |"
! 0,"| once MED-00001 has been tested and marked 'fixed'. |"
! 0,"| |"
! 0,"| Usage: |"
! 0,"| +0 start of area used by flood fill |"
! 0,"| +4 end+1 of area used by flood fill |"
! 0,"| +8 amount the rma was grown by |"
! 0,"'-----------------------------------------------------------------'"
! 0,""
]
END
......@@ -65,6 +65,9 @@ hs_l RN r10
hs_r RN r11
;wp RN r12
GBLL DebugHeapSort
DebugHeapSort SETL {FALSE}
; User sort procedure entered in SVC mode, interrupts enabled
; r0 = contents of array(1)
; r1 = contents of array(2)
......@@ -85,7 +88,7 @@ HeapSortRoutine32 ROUT
CLRPSR I_bit, r14 ; Enable interrupts (may take ages)
[ False
[ DebugHeapSort
STR r0, ndump ; For debugging porpoises
]
TST r7, #1 :SHL: 30 ; Are we to build the pointer array?
......@@ -137,7 +140,7 @@ h2 CMP hs_l, #1
CMP hs_r, #1 ; IF r=1 THEN R(1) = R
STREQ hs_R, [hs_array, #4]
20
[ False
[ DebugHeapSort
BL DoDebug
]
......@@ -151,7 +154,7 @@ h3 MOV hs_j, hs_l
h4 MOV hs_i, hs_j
MOV hs_j, hs_j, LSL #1
[ False
[ DebugHeapSort
DREG hs_i," i ",cc
DREG hs_j," j "
]
......@@ -199,7 +202,7 @@ h8 STR hs_R, [hs_array, hs_i, LSL #2] ; R(i) = R
ADD r1, sp, #4*4
LDMIA r1, {r1, r8, r9} ; r4,r5,r6in
; r1 -> list of blocks
[ False
[ DebugHeapSort
DREG r2, "pointer array "
DREG r1, "base of blocks "
DREG r8, "sizeof(element) "
......@@ -212,7 +215,7 @@ h8 STR hs_R, [hs_array, hs_i, LSL #2] ; R(i) = R
CMP r8, #ScratchSpaceSize
LDRLS r9, =ScratchSpace ; r9 -> temp slot (normally ScratchSpc)
94
[ False
[ DebugHeapSort
DREG r9, "temp slot "
]
......@@ -230,7 +233,7 @@ h8 STR hs_R, [hs_array, hs_i, LSL #2] ; R(i) = R
SUB r5, r7, r1 ; r14 := index of next item (r8 pres.)
DivRem r14, r5, r8, r0 ; r5,r0 corrupt
ADD r5, r2, r14, LSL #2 ; r5 -> next item
[ False
[ DebugHeapSort
DREG r7, " next block "
DREG r5, " next item "
]
......
......@@ -66,21 +66,13 @@
; handy macros:
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MACRO
$l CheckSpaceOnStack $space, $faildest, $tmp
[ True ; SKS
MACRO
$l CheckSpaceOnStack $space, $faildest, $tmp
$l MOV $tmp, sp, LSR #15 ; Stack base on 32K boundary
SUB $tmp, sp, $tmp, LSL #15 ; Amount of stack left
CMP $tmp, #$space ; Must have at least this much left
BMI $faildest
|
$l MOV $tmp, #32*1024 ; assume stack ends at next 32K boundary
SUB $tmp, $tmp, #1
AND $tmp, $tmp, stack
CMP $tmp, #$space
BLT $faildest
]
MEND
MEND
MACRO
assert $condition
......@@ -830,8 +822,8 @@ JTABLE & SWIWriteC
& HeapSortRoutine32
ASSERT (.-JTABLE)/4 = MaxSwi
ASSERT MaxSwi < OS_ConvertStandardDateAndTime
ASSERT (.-JTABLE)/4 = NCORESWIS
ASSERT NCORESWIS < OS_ConvertStandardDateAndTime
; SWIs for time/date conversion are poked in specially
......
......@@ -1058,7 +1058,7 @@ AdjustOurSet
CMP R0, #MaxEnvNumber
BHI AOS_Silly
[ False
[ {FALSE}
CMP r0, #CallBackHandler
BLEQ testcallbackpending
]
......@@ -1109,7 +1109,7 @@ exit_AOS
]
MakeErrorBlock BadEnvNumber
[ False
[ {FALSE}
testcallbackpending
CMP r1, #0 ; OK if only reading
......
......@@ -887,7 +887,7 @@ AddCallBack_Code ROUT
LDR r10, =ZeroPage
WritePSRc SVC_mode+I_bit, r3 ; IRQs off while holding context.
LDR r3, [r10, #CallBack_Vector]
[ True
[ {TRUE}
STR r3, [r2, #0]
STMIB r2, {r0, r1}
STR r2, [r10, #CallBack_Vector]
......
......@@ -1242,16 +1242,6 @@ PoduleChainRelease
IRQ ROUT
Push "r10, lr"
[ False
ASSERT VIDC_Type <> "VIDC20"
MOV r14, #11
MUL r14, r0, r14
MOV r14, r14, LSR #5
ADR r10, irq_vtable
LDR r14, [r10, r14, LSL #2]
MOV r10, #VIDC
STR r14, [r10]
]
MOV r10, #IrqV
BL CallVector
......@@ -1262,29 +1252,6 @@ IRQ ROUT
Pull "r10, pc" ; return: someone will always claim it.
]
[ False
irq_vtable
DCD &40000000 + &444
DCD &40000000 + &008
DCD &40000000 + &080
DCD &40000000 + &088
DCD &40000000 + &800
DCD &40000000 + &808
DCD &40000000 + &880
DCD &40000000 + &FA8
DCD &40000000 + &8AF
DCD &40000000 + &00F
DCD &40000000 + &0F0
DCD &40000000 + &0FF
DCD &40000000 + &F00
DCD &40000000 + &F0F
DCD &40000000 + &FF0
DCD &40000000 + &FFF
]
; *****************************************************************************
; Default IRQ2V:
[ HAL
......@@ -1301,16 +1268,6 @@ irq_vtable
NOIRQ ROUT
[ False
ASSERT VIDC_Type <> "VIDC20"
MOV r14, #11
MUL r14, r0, r14
MOV r14, r14, LSR #5
ADR r10, irq_vtable
LDR r14, [r10, r14, LSL #2]
MOV r10, #VIDC
STR r14, [r10]
]
[ HAL
TEQ r0, #0
Pull pc, MI
......
......@@ -531,34 +531,10 @@ OSWord0Eerror
Pull "R5-R8, R14"
WordReturnV
; *****************************************************************************
;
; GetDecimalPair - Get pair of decimal digits from [R4+R1+0..1]
;
; in: R1 is offset from R4 to find 1st digit
;
; out: if valid, R1=value of pair of digits, C=0
; if invalid, R1=undefined, C=1
; R10 is corrupted
;
GetDecimalPair ROUT
LDRB R10, [R1, R4]! ; get hi-digit
SUB R10, R10, #"0" ; put in range 0..9
CMP R10, #10 ; C=1 if bad digit
ADD R10, R10, R10, LSL #2 ; R10 = 5*hi
LDRB R1, [R1, #1] ; get lo-digit
SUB R1, R1, #"0" ; put in range 0..9
CMPCC R1, #10 ; C=1 if bad digit
ADD R1, R1, R10, LSL #1 ; R1 = lo + 2*(5*hi)
MOV PC, R14
; *****************************************************************************
; Osword 15 (&0F) Write the Real Time Clock.
; Three different calls
; Four different calls
OsWord0F ROUT
CLRPSR I_bit, R0 ; this may take some time
......@@ -723,119 +699,6 @@ OsWord0F_5byte
MOV R10, #0 ; no string on stack
B %BT10 ; nip back in to the main handler
; *****************************************************************************
;
; CheckYear - Check for year wrap (year in RTC <> year "YearCMOS")
; and for leap year fudging
;
CheckYear ROUT
Push "R0,R1,R2,R14"
LDR R0, =ZeroPage
LDR R0, [R0, #RTCFitted]
[ HAL
CMP R0, #2048
[ RTCSupport
BLO %FT8
|
BLO %FT15
]
; Ask the RTC what it thinks the year is
Push "R3,R10,R12"
MOV R10, R0
SUB R13, R13, #RTCTimeStruct_BCD_Size
MOV R1, R13
ADRL R2, HALRTC_IICOp
MOV LR, PC
LDR PC, [R0, #HALDevice_RTCReadTime]
; Did we succeed?
CMP R0, #RTCRetCode_OK
LDRB R0, [R13, #RTCTimeStruct_BCD_YearLO]
LDRB R1, [R13, #RTCTimeStruct_BCD_YearHI]
ADD R13, R13, #RTCTimeStruct_BCD_Size
LDRB R2, [R10, #HALDevice_RTCFormatFlags]
Pull "R3,R10,R12"
BNE %FT15
ASSERT RTCFormatFlags_BCD_NeedsYearHelp = 1 :SHL: 2
ASSERT RTCFormatFlags_BCD_YearLOIsGood = 1 :SHL: 3
AND LR, R2, #RTCFormatFlags_BCD_NeedsYearHelp + RTCFormatFlags_BCD_YearLOIsGood
MOVS LR, LR, ROR #3 ; CC = good, CS+EQ = 2 bit, CS+NE = BCD
ADDCS R1, LR, #RTCAddressPHI+1 ; 2 bit=RTCAddressPHI+1, BCD!=RTCAddressPHI+1
BCS %FT9
; Year is reliable; convert R0 & R1 to ints and update CMOS if necessary.
BL BCDToHex
MOV R2, R1
MOV R1, R0 ; YearLO
MOV R0, #YearCMOS
BL Read
CMP R0, R1
MOVNE R0, #YearCMOS
BLNE Write
MOV R0, R2
BL BCDToHex
MOV R1, R0 ; YearHI
MOV R0, #YearCMOS+1
BL Read
CMP R0, R1
MOVNE R0, #YearCMOS+1
BLNE Write
B %FT15
8
] ; HAL
[ RTCSupport :LOR: :LNOT: HAL
TEQ R0, #RTCAddressPHI
MOVEQ R1, #5
MOVNE R1, #6 ; year address (dependant on RTC)
STRB R1, [R13, #-4]!
MOV R1, R13
ORR R0, R0, #1:SHL:29
MOV R2, #1
BL IIC_Op
ORR R0, R0, #1
BL IIC_Op
AND R1, R0, #&FF
LDRB R0, [R13], #4
TEQ R1, #RTCAddressPHI+1
] ; RTCSupport :LOR: :LNOT: HAL
9
MOVEQ R0, R0, LSR #6 ; R0= year MOD 4.
BLNE BCDToHex
MOV R2, R0 ; remember RTC value
MOV R0, #YearCMOS
BL Read
TEQ R1, #RTCAddressPHI+1
ANDEQ R1, R0, #3
MOVNE R1, R0
MOVEQ R14,#4
MOVNE R14,#100
SUBS R2, R2, R1 ; same year ?
Pull "R0,R1,R2,PC", EQ ; [yes, so no bother]
ADDCC R2, R2, R14 ; if lower, then must be carry
ADD R2, R0, R2 ; new year value
CMP R2, #100
BCC %FT10 ; no carry thru to next century
SUB R2, R2, #100
MOV R0, #YearCMOS +1
BL Read
ADD R1, R0, #1
TEQ R1, #100
MOVEQ R1, #0 ; wrap century
MOV R0, #YearCMOS +1
BL Write
10
MOV R1, R2
MOV R0, #YearCMOS
BL Write
15
BL RTCToRealTime
Pull "R0,R1,R2,PC"
; *****************************************************************************
; Define hardware cursor size, shape and active point
......
......@@ -14,6 +14,116 @@
;
; > $.Source.PMF.realtime
; *****************************************************************************
;
; CheckYear - Check for year wrap (year in RTC <> year "YearCMOS")
; and for leap year fudging
;
CheckYear ROUT
Push "R0,R1,R2,R14"
LDR R0, =ZeroPage
LDR R0, [R0, #RTCFitted]
[ HAL
CMP R0, #2048
[ RTCSupport
BLO %FT8
|
BLO %FT15
]
; Ask the RTC what it thinks the year is
Push "R3,R10,R12"
MOV R10, R0
SUB R13, R13, #RTCTimeStruct_BCD_Size
MOV R1, R13
ADRL R2, HALRTC_IICOp
MOV LR, PC
LDR PC, [R0, #HALDevice_RTCReadTime]
; Did we succeed?
CMP R0, #RTCRetCode_OK
LDRB R0, [R13, #RTCTimeStruct_BCD_YearLO]
LDRB R1, [R13, #RTCTimeStruct_BCD_YearHI]
ADD R13, R13, #RTCTimeStruct_BCD_Size
LDRB R2, [R10, #HALDevice_RTCFormatFlags]
Pull "R3,R10,R12"
BNE %FT15
ASSERT RTCFormatFlags_BCD_NeedsYearHelp = 1 :SHL: 2
ASSERT RTCFormatFlags_BCD_YearLOIsGood = 1 :SHL: 3
AND LR, R2, #RTCFormatFlags_BCD_NeedsYearHelp + RTCFormatFlags_BCD_YearLOIsGood
MOVS LR, LR, ROR #3 ; CC = good, CS+EQ = 2 bit, CS+NE = BCD
ADDCS R1, LR, #RTCAddressPHI+1 ; 2 bit=RTCAddressPHI+1, BCD!=RTCAddressPHI+1
BCS %FT9
; Year is reliable; convert R0 & R1 to ints and update CMOS if necessary.
BL BCDToHex
MOV R2, R1
MOV R1, R0 ; YearLO
MOV R0, #YearCMOS
BL Read
CMP R0, R1
MOVNE R0, #YearCMOS
BLNE Write
MOV R0, R2
BL BCDToHex
MOV R1, R0 ; YearHI
MOV R0, #YearCMOS+1
BL Read
CMP R0, R1
MOVNE R0, #YearCMOS+1
BLNE Write
B %FT15
8
] ; HAL
[ RTCSupport :LOR: :LNOT: HAL
TEQ R0, #RTCAddressPHI
MOVEQ R1, #5
MOVNE R1, #6 ; year address (dependant on RTC)
STRB R1, [R13, #-4]!
MOV R1, R13
ORR R0, R0, #1:SHL:29
MOV R2, #1
BL IIC_Op
ORR R0, R0, #1
BL IIC_Op
AND R1, R0, #&FF
LDRB R0, [R13], #4
TEQ R1, #RTCAddressPHI+1
] ; RTCSupport :LOR: :LNOT: HAL
9
MOVEQ R0, R0, LSR #6 ; R0= year MOD 4.
BLNE BCDToHex
MOV R2, R0 ; remember RTC value
MOV R0, #YearCMOS
BL Read
TEQ R1, #RTCAddressPHI+1
ANDEQ R1, R0, #3
MOVNE R1, R0
MOVEQ R14,#4
MOVNE R14,#100
SUBS R2, R2, R1 ; same year ?
Pull "R0,R1,R2,PC", EQ ; [yes, so no bother]
ADDCC R2, R2, R14 ; if lower, then must be carry
ADD R2, R0, R2 ; new year value
CMP R2, #100
BCC %FT10 ; no carry thru to next century
SUB R2, R2, #100
MOV R0, #YearCMOS +1
BL Read
ADD R1, R0, #1
TEQ R1, #100
MOVEQ R1, #0 ; wrap century
MOV R0, #YearCMOS +1
BL Write
10
MOV R1, R2
MOV R0, #YearCMOS
BL Write
15
BL RTCToRealTime
Pull "R0,R1,R2,PC"
; *****************************************************************************
;
; RTCToRealTime - Set RealTime from actual RTC
......
......@@ -55,7 +55,7 @@ SWINumberToString_Code ROUT
CMP r0, #256
BCS Swi_Is_WriteI ; TMD 11-May-89: changed from GE
CMP r0, #MaxSwi
CMP r0, #NCORESWIS
BCS SWINotInTable ; TMD 11-May-89: changed from GE
ADR r11, System_Swi_Names
......@@ -210,7 +210,7 @@ System_Swi_Names
AddSwiNameToDecodeTab HeapSort32
= 0
[ SwisInSystemTable+1 <> MaxSwi
[ SwisInSystemTable+1 <> NCORESWIS
! 1, :CHR:10:CC::CHR:13:CC::CHR:7:CC::CHR:7:CC:"Swi Disassembly table not consistent with despatch table":CC::CHR:10:CC::CHR:13
]
......
......@@ -303,15 +303,7 @@ ScrollLeftByte
LDR R9, [WsPtr, #Log2BPP]
LDR R10, [WsPtr, #ModeFlags]
TST R10, #Flag_BBCGapMode ; if in BBC gap mode
[ True
; TMD 23-May-89: BBC gap modes were done wrong here - it scrolled by 1/2 a
; BBC byte instead of 1
SUBNE R9, R9, #1 ; then 1 BBC byte = 2 ARM bytes
|
MOVNE R9, #1 ; then 1 BBC byte = 2 ARM bytes
]
ScrollLeft
LDR R10, [WsPtr, #Log2BPC]
......@@ -461,16 +453,7 @@ ScrollRightByte
LDR R9, [WsPtr, #Log2BPP]
LDR R10, [WsPtr, #ModeFlags]
TST R10, #Flag_BBCGapMode ; if in BBC gap mode
[ True
; TMD 23-May-89: BBC gap modes were done wrong here - it scrolled by 1/2 a
; BBC byte instead of 1
SUBNE R9, R9, #1 ; then 1 BBC byte = 2 ARM bytes
|
MOVNE R9, #1 ; then 1 BBC byte = 2 ARM bytes
]
ScrollRight
LDR R10, [WsPtr, #Log2BPC]
......
......@@ -961,14 +961,6 @@ release_memory
ADD R0, WsPtr, #QueuePtrs
LDMIA R0, {R0-R3}
[ med_00001_debug
LDR R0, =med_00001_debug_start
STR R3, [R0], #4
STR R2, [R0], #4
LDR R5, [WsPtr, #flood_cda_rma]
STR R5, [R0]
]
LDR R5, =FldQueueStart
CMP R3, R5 ; did we use scratchspace ?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment