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

Make DeviceFS NoUnaligned-safe

Detail:
  deregisterdev and CallDevice now take care not to load from an unaligned address if the NoUnaligned option is turned on.
Admin:
  Tested on rev C2 beagleboard


Version 0.68. Tagged as 'DeviceFS-0_68'
parent 09e89ad5
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.67"
Module_Version SETA 67
Module_MajorVersion SETS "0.68"
Module_Version SETA 68
Module_MinorVersion SETS ""
Module_Date SETS "11 Jun 2009"
Module_ApplicationDate SETS "11-Jun-09"
Module_Date SETS "06 Nov 2009"
Module_ApplicationDate SETS "06-Nov-09"
Module_ComponentName SETS "DeviceFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/HWSupport/DeviceFS"
Module_FullVersion SETS "0.67"
Module_HelpVersion SETS "0.67 (11 Jun 2009)"
Module_FullVersion SETS "0.68"
Module_HelpVersion SETS "0.68 (06 Nov 2009)"
END
/* (0.67)
/* (0.68)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.67
#define Module_MajorVersion_CMHG 0.68
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jun 2009
#define Module_Date_CMHG 06 Nov 2009
#define Module_MajorVersion "0.67"
#define Module_Version 67
#define Module_MajorVersion "0.68"
#define Module_Version 68
#define Module_MinorVersion ""
#define Module_Date "11 Jun 2009"
#define Module_Date "06 Nov 2009"
#define Module_ApplicationDate "11-Jun-09"
#define Module_ApplicationDate "06-Nov-09"
#define Module_ComponentName "DeviceFS"
#define Module_ComponentPath "castle/RiscOS/Sources/HWSupport/DeviceFS"
#define Module_FullVersion "0.67"
#define Module_HelpVersion "0.67 (11 Jun 2009)"
#define Module_LibraryVersionInfo "0:67"
#define Module_FullVersion "0.68"
#define Module_HelpVersion "0.68 (06 Nov 2009)"
#define Module_LibraryVersionInfo "0:68"
......@@ -1278,9 +1278,19 @@ deregisterdev Entry "r0, r2-r5, pr"
Debug deregister, "device to be deregister", r1
Debug deregister, "parent is", pr
[ NoUnaligned
; If r1 is a pointer to a string there's no guarantee it will be word aligned
ASSERT (device_ValidationWord :AND: 3) = 0
ASSERT (device_Parent :AND: 3) = 0
TST r1, #3
LDREQ r0, [r1, #device_ValidationWord]
ADREQL r2, registerdev ; is it a valid block pointer (ie. validation word valid)
TEQEQ r0, r2
|
LDR r0, [r1, #device_ValidationWord]
ADRL r2, registerdev ; is it a valid block pointer (ie. validation word valid)
TEQ r0, r2
]
LDREQ r0, [r1, #device_Parent] ; is it owned by the correct parent?
TEQEQ r0, pr
MOVEQ dr, r1 ; it was valid so setup the pointer to the device record
......@@ -1439,9 +1449,18 @@ CallDevice ROUT
LDR r1, [r1, #parent_Next] ; assuming it worked get the next parent pointer
B %10 ; and loop again
20
[ NoUnaligned
; If r1 is a pointer to a string there's no guarantee it will be word aligned
ASSERT (parent_ValidationWord :AND: 3) = 0
TST r1, #3
LDREQ r8, [r1, #parent_ValidationWord]
ADREQL r9, Register ; -> validation word
TEQEQ r8, r9 ; are they the same?
|
LDR r8, [r1, #parent_ValidationWord]
ADRL r9, Register ; -> validation word
TEQ r8, r9 ; are they the same?
]
MOVEQ pr, r1
BEQ %40 ; yes, so issue call to this doofer!
......
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