Showing changes from revision #3 to #4:
Added | Removed | Changed
Entry | |
---|---|
R0 | Minimum address |
R1 | Maximum address |
Exit | |
---|---|
R0 | Preserved |
R1 | Preserved |
C flag is clear if the range is OK, else set |
The purpose of this call is to check that a given address range is valid, i.e. that it maps to some kind of RAM.
This call does not check that the memory actually exists, only that it ought to exist. If you have used OS_SetMemMapEntries, then this call will not work as expected. This call also does not report any access information – no guarantee is made that you will be able to read or write to the memory in your current CPU mode.
The behaviour of OS_ValidateAddress has changed significantly between different OS versions.
Prior to RISC OS 3.5, the following areas were considered valid:
From RISC OS 3.5, the following areas were considered valid:
However note that this version of Service_ValidateAddress does not correctly detect valid regions of Sparse Dynamic Areas. Additionally, not all special regions are reported – e.g. the CAM, page tables, kernel buffers used with long command lines, RISC OS 5 HAL workspace, etc.
Under RISC OS Select the call was reimplemented as a call to OS_Memory 24. Physically mapped regions will not be reported as valid, however Service_ValidateAddress can be used to override this. The LegacyScreen module uses this technique to mark screen memory as valid. All other regions reported by OS_Memory 24 are considered valid, e.g. system dynamic areas such as the ROM dynamic area. Special code also exists to mark zero page as valid.
In RISC OS 5.21 the call was also changed to be implemented via OS_Memory 24. The OS considers the following locations as valid:
Under RISC OS 5 no special code is required to mark zero page as valid, as zero page is one of the areas which OS_Memory 24 will report on.