Commit 1371ea20 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Make non-StoreInHAL variant look for both $.CMOS and $.!Boot.CMOS

Detail:
  s/sdcmos - Reworked initialisation a bit to allow the code to look for CMOS files in multiple places.
  Specifically, non-StoreInHAL variants now look for both $.CMOS and $.!Boot.CMOS.
  This allows the special FAT+FileCore partitioned SD cards to be used with more than just the Raspberry Pi; specifically Pandora+TouchBook, where not requiring USB or a 2nd SD card for a FileCore partition is desireable
Admin:
  Tested on Pandora


Version 0.06. Tagged as 'SDCMOS-0_06'
parent 08277dbd
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.05"
Module_Version SETA 5
Module_MajorVersion SETS "0.06"
Module_Version SETA 6
Module_MinorVersion SETS ""
Module_Date SETS "16 Sep 2012"
Module_ApplicationDate SETS "16-Sep-12"
Module_Date SETS "27 Sep 2012"
Module_ApplicationDate SETS "27-Sep-12"
Module_ComponentName SETS "SDCMOS"
Module_ComponentPath SETS "cddl/RiscOS/Sources/HWSupport/SD/SDCMOS"
Module_FullVersion SETS "0.05"
Module_HelpVersion SETS "0.05 (16 Sep 2012)"
Module_FullVersion SETS "0.06"
Module_HelpVersion SETS "0.06 (27 Sep 2012)"
END
/* (0.05)
/* (0.06)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.05
#define Module_MajorVersion_CMHG 0.06
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Sep 2012
#define Module_Date_CMHG 27 Sep 2012
#define Module_MajorVersion "0.05"
#define Module_Version 5
#define Module_MajorVersion "0.06"
#define Module_Version 6
#define Module_MinorVersion ""
#define Module_Date "16 Sep 2012"
#define Module_Date "27 Sep 2012"
#define Module_ApplicationDate "16-Sep-12"
#define Module_ApplicationDate "27-Sep-12"
#define Module_ComponentName "SDCMOS"
#define Module_ComponentPath "cddl/RiscOS/Sources/HWSupport/SD/SDCMOS"
#define Module_FullVersion "0.05"
#define Module_HelpVersion "0.05 (16 Sep 2012)"
#define Module_LibraryVersionInfo "0:5"
#define Module_FullVersion "0.06"
#define Module_HelpVersion "0.06 (27 Sep 2012)"
#define Module_LibraryVersionInfo "0:6"
......@@ -74,6 +74,8 @@ OSIm = "OSIm"
NonCanonicalisedPath
= "SDFS::0.$.CMOS", 0
NonCanonicalisedPath2
= "SDFS::0.$.!Boot.Loader.CMOS", 0
ALIGN
SaveCMOS
......@@ -104,9 +106,53 @@ CallBackFromInit ROUT
; assume that it could have been used to initialise the kernel's CMOS
; RAM cache, and therefore needs updating whenever someone writes CMOS.
ADR r1, NonCanonicalisedPath
BL TryInit
[ :LNOT: StoreInHAL
; Also try !Boot.Loader.CMOS, to allow the special FAT-in-Filecore
; partition formats to be used on machines other than the Raspberry Pi
ADRVS r1, NonCanonicalisedPath2
BLVS TryInit
]
; All good - get on ByteV
MOV r0, #ByteV
ADR r1, MyByteV
MOV r2, r12
SWI XOS_Claim
BVS %F90
Pull "r0-r6, lr" ; separate instructions to reduce warnings
Pull "pc"
90 ; Error detected during callback - kill the module and exit
ASSERT %F99-%F98 = 8
ADR r0, %F98
LDMIA r0, {r1-r2}
Push "r1-r2"
MOV r0, #1
MOV r1, sp
ADD r2, sp, #%F99-%F98-1
SWI XOS_SynchroniseCodeAreas
MOV r0, #ModHandReason_Delete
ADR r1, Title
ADD r2, sp, #%F99-%F98 ; point r2 at stack frame
MOV pc, sp
; This last bit is executed after the module is killed so can't safely
; be executed in place - do it from the stack instead
98 SWI XOS_Module
LDMIA r2, {r0-r6, sp, pc} ; atomic update of sp (which makes this code volatile) with pc
99
; In: r1 = filename
; Out: Regs corrupt
; V set on failure
; No error pointer returned
TryInit ROUT
Entry
; Find how long the canonicalised name is
MOV r0, #FSControl_CanonicalisePath
ADR r1, NonCanonicalisedPath
MOV r2, #0
MOV r3, #0
MOV r4, #0
......@@ -164,34 +210,21 @@ CallBackFromInit ROUT
TEQNE r6, r0
BNE %F90
]
; All good
CLRV
EXIT
; All good - get on ByteV
MOV r0, #ByteV
ADR r1, MyByteV
MOV r2, r12
SWI XOS_Claim
BVS %F90
Pull "r0-r6, lr" ; separate instructions to reduce warnings
Pull "pc"
90 ; Error detected during callback - kill the module and exit
ASSERT %F99-%F98 = 8
ADR r0, %F98
LDMIA r0, {r1-r2}
Push "r1-r2"
MOV r0, #1
MOV r1, sp
ADD r2, sp, #%F99-%F98-1
SWI XOS_SynchroniseCodeAreas
MOV r0, #ModHandReason_Delete
ADR r1, Title
ADD r2, sp, #%F99-%F98 ; point r2 at stack frame
MOV pc, sp
; This last bit is executed after the module is killed so can't safely
; be executed in place - do it from the stack instead
98 SWI XOS_Module
LDMIA r2, {r0-r6, sp, pc} ; atomic update of sp (which makes this code volatile) with pc
99
90
; Something went wrong
; Free our workspace to avoid potential leak if TryInit called multiple times
LDR r2, [r12]
CMP r2, #0
MOVNE r0, #ModHandReason_Free
SWINE XOS_Module
MOV r2, #0
STR r2, [r12]
SETV
EXIT
MyByteV ROUT
TEQ r0, #OsByte_WriteCMOS
......
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