Commit 3a1ef8f7 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Minor improvements

Detail:
  hdr/mymacros, s/ScsiFs05 - Remove some unused 26bit-only macros. Use REV instruction in RevBytes macro when possible. Replace most manual PSR manipulation with common macros.
  s/Hdr_fst, s/ScsiFs15 - Use Portable_Idle within 1s wait loop, to avoid thrashing the CPU
Admin:
  Tested on Raspberry Pi


Version 1.31. Tagged as 'SCSIFS-1_31'
parent 09740560
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.30"
Module_Version SETA 130
Module_MajorVersion SETS "1.31"
Module_Version SETA 131
Module_MinorVersion SETS ""
Module_Date SETS "09 Sep 2017"
Module_ApplicationDate SETS "09-Sep-17"
Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.30"
Module_HelpVersion SETS "1.30 (09 Sep 2017)"
Module_FullVersion SETS "1.31"
Module_HelpVersion SETS "1.31 (09 Sep 2017)"
END
/* (1.30)
/* (1.31)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.30
#define Module_MajorVersion_CMHG 1.31
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Sep 2017
#define Module_MajorVersion "1.30"
#define Module_Version 130
#define Module_MajorVersion "1.31"
#define Module_Version 131
#define Module_MinorVersion ""
#define Module_Date "09 Sep 2017"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.30"
#define Module_HelpVersion "1.30 (09 Sep 2017)"
#define Module_LibraryVersionInfo "1:30"
#define Module_FullVersion "1.31"
#define Module_HelpVersion "1.31 (09 Sep 2017)"
#define Module_LibraryVersionInfo "1:31"
......@@ -14,51 +14,6 @@
;
; >AdfsMacros
MACRO
SetBorder $r,$g,$b,$cond
Push "R0,R1",$cond
LDR$cond R0, =VIDC
MOV$cond R1, #bit30
ORR$cond R1, R1, #$g * 16 + $r
ORR$cond R1, R1, #$b * 256
STR$cond R1, [R0]
Pull "R0,R1",$cond
MEND
MACRO ;set some PSR bits
$lab setpsr $bits,$tempreg,$cond
$lab MOV$cond $tempreg,#$bits
ORR$cond $tempreg,$tempreg,PC
TEQ$cond.P PC,$tempreg
MEND
MACRO ;clear some PSR bits
$lab clrpsr $bits,$tempreg,$cond
$lab MVN$cond $tempreg,#$bits
TST$cond.P $tempreg,PC
MEND
MACRO ;toggle some PSR bits
$lab togpsr $bits,$tempreg,$cond
$lab MOV$cond $tempreg,#$bits
TEQ$cond.P $tempreg,PC
MEND
MACRO
$lab retfiq $cc
$lab SUB$cc.S PC, LR, #4
MEND
MACRO
nop
MOVNV R0,R0
MEND
;do an operation with 16 bit width const as an 8 bit width if possible
MACRO
......@@ -126,10 +81,14 @@ $lab * 1 :SHL: ($bitnum)
;
MACRO
$label RevBytes $arm, $t1,$t2
[ NoARMv6
$label MVN $t1,#&FF00 ;a3=&FFFF00FF
EOR $t2,$arm,$arm,ROR #16
AND $t2,$t1,$t2,LSR #8
EOR $arm,$t2,$arm,ROR #8
|
$label REV $arm,$arm
]
MEND
;------------------------------------------------------------------------------
......@@ -206,12 +165,7 @@ $label BL SCSIOp_HandlingAtn
]
Pull "LR"
15
[ No32bitCode
TEQP PC, R0 ;restore PSR
nop ;delay in case mode change
|
MSR CPSR_cf, R0
]
RestPSR R0,,cf
Pull "R0,R1,LR"
21
]
......
......@@ -34,6 +34,7 @@
GET Hdr:SCSI
GET Hdr:SCSIErr
GET Hdr:OSRSI6
GET Hdr:Portable
GET VersionASM
......
......@@ -41,15 +41,11 @@ PHEX
BNE PHEXIT1 ; return if IRQ thread
]
MOV R3, LR
; Switch to SVC mode, preserving flags (+ disabling IRQs?)
[ No32bitCode
ASSERT SVC_mode=3
ORR R0, LR, #SVC_mode
TEQP PC, R0 ; go to SVC mode preserving flags
nop
SetMode SVC_mode, R0
|
MRS R0, CPSR
ORR R0, R0, #SVC26_mode :OR: I32_bit
MSR CPSR_c, R0
SetModeSEI SVC32_mode, R0
]
Push "LR"
[ SpoolOff
......@@ -111,9 +107,9 @@ Mess1 ;R0,R1,LR stacked
[ No32bitCode
ORR LR, LR, #SVC_mode :OR: Z_bit
TEQP PC, LR ; go to supervisor mode, preserve FI, set EQ
nop ; delay for mode change
MOV R0, R0 ; delay for mode change
|
ORR LR, LR, #Z_bit
ORR LR, R0, #Z_bit
ORR LR, LR, #SVC26_mode :OR: I32_bit
MSR CPSR_cf, LR
]
......
......@@ -501,6 +501,7 @@ WaitOneSecond
SWI XOS_ReadMonotonicTime
ADD R1,R0,#100
Wait_10
SWI XPortable_Idle
SWI XOS_ReadMonotonicTime
CMP R0,R1
BLO Wait_10
......
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