Commit d5aad823 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Don't flag FileCore disc error error numbers as being invalid

Detail:
  s/Kernel - FileCore breaks the usual error number rules for disc errors and uses numbers of the form &XX01YYC7, which was tripping up the sanity checks due to making use of the reserved bits 24-30. Add an extra rule to allow that form of errors through.
Admin:
  Tested on Raspberry Pi
  Fixes issue reported on forums:
  https://www.riscosopen.org/forum/forums/3/topics/3540#posts-58635


Version 5.63. Tagged as 'Kernel-5_63'
parent d7299988
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.62"
Module_Version SETA 562
Module_MajorVersion SETS "5.63"
Module_Version SETA 563
Module_MinorVersion SETS ""
Module_Date SETS "17 Oct 2016"
Module_ApplicationDate SETS "17-Oct-16"
Module_Date SETS "26 Oct 2016"
Module_ApplicationDate SETS "26-Oct-16"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.62"
Module_HelpVersion SETS "5.62 (17 Oct 2016)"
Module_FullVersion SETS "5.63"
Module_HelpVersion SETS "5.63 (26 Oct 2016)"
END
/* (5.62)
/* (5.63)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.62
#define Module_MajorVersion_CMHG 5.63
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 17 Oct 2016
#define Module_Date_CMHG 26 Oct 2016
#define Module_MajorVersion "5.62"
#define Module_Version 562
#define Module_MajorVersion "5.63"
#define Module_Version 563
#define Module_MinorVersion ""
#define Module_Date "17 Oct 2016"
#define Module_Date "26 Oct 2016"
#define Module_ApplicationDate "17-Oct-16"
#define Module_ApplicationDate "26-Oct-16"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.62"
#define Module_HelpVersion "5.62 (17 Oct 2016)"
#define Module_LibraryVersionInfo "5:62"
#define Module_FullVersion "5.63"
#define Module_HelpVersion "5.63 (26 Oct 2016)"
#define Module_LibraryVersionInfo "5:63"
......@@ -682,6 +682,20 @@ VSet_GenerateError ROUT
B SWIReturnWithCallBackFlag
BadErrPtr2
TST r0, #3 ; Repeat pointer validity check; if this is OK we know we've arrived here because of a bad error number
BNE BadErrPtr
; The PRM describes FileCore as returning errors in the form &0001XXYY,
; where XX = filesystem number and YY = error code. However for disc
; errors it breaks this rule and uses error numbers of the form
; &ZZ01XXC7, where ZZ = disc error code and &C7 = "disc error". The
; obvious problem with this is that makes use of the reserved bits in
; the error number, so do an extra check here to detect that format of
; error number and allow it through.
BIC r10, r10, #&FF000000
BIC r10, r10, #&0000FF00
EOR r10, r10, #&00010000
TEQ r10, #&C7
BEQ BadErrPtrReturn
; Some types of error lookup code work by passing a bogus error number
; into MessageTrans_ErrorLookup and then fixing it up afterwards. To
; avoid breaking such code, and to maintain compatibility with
......@@ -692,14 +706,13 @@ BadErrPtr2
;
; [1] - The NVRAM module has a reserved bit set in its error numbers so
; that it knows it needs to translate them; after translation the bit is
; cleared. This does assume that the code in PortMan will never see a
; cleared. This does assume that the code in NVRAM will never see a
; translated error that has that reserved bit set - so is perhaps not
; entirely kosher (although the kernel now requires reserved bits to be
; clear too) - but it does avoid a redundant copy of the error token to
; the stack.
TST r0, #3 ; Repeat pointer validity check; if this is OK we know we've arrived here because of a bad error number
LDREQ r10, =XMessageTrans_ErrorLookup
TEQEQ r10, r12
LDR r10, =XMessageTrans_ErrorLookup
TEQ r10, r12
BEQ BadErrPtrReturn
; In: r10-r12 stacked
; r12 = SWI number
......
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