Showing changes from revision #4 to #5:
Added | Removed | Changed
void *RISCOS_AddRAM(unsigned int flags, void *start, void *end, uintptr_t sigbits, void *ref)
Entry | |
---|---|
flags | Bit 0: video memory (only first contiguous range will be used) |
Bit 1: video memory is not suitable for general use | |
Bit 7: memory can’t be used for DMA | |
Bits 8-11: speed indicator (arbitrary, higher => faster) | |
Bit 12: start, end, sigbits are shifted right 12 bits (for supporting large physical addresses) | |
Other bits reserved (SBZ) | |
start | Start address of RAM (inclusive) (no alignment requirements) |
end | End address of RAM (exclusive) (no alignment requirements, but must be >= start) |
sigbits | Significant address bit mask (1 => this bit of addr decoded, 0 => this bit ignored) |
ref | reference handle (NULL for first call) |
SVC32 mode | |
MMU and data caches off | |
IRQs and FIQs disabled |
Exit | |
---|---|
- | Returns ref for next call |
This call is used to describe describe to the OS the area(s) of RAM that are present in the system. It should only be called during the early stage of system initialisation, prior to RISCOS_Start, and should be called as many times as necessary to enumerate all RAM that is available for general purpose use. It should only be called to declare video memory if the video memory may be used as normal RAM when in small video modes.
The OS will attempt to coalesce adjacent blocks if they share the same attributes – however this only works well if RAM banks are added in ascending address order.
RISCRequirements/restrictions: OS will use RAM at the start of the first block as initial workspace, to store the list of RAM blocks. Max usage is 16 bytes per block + 32 (currently 8 per block + 4). This limits the number of discontiguous blocks – the first block must be large enough to store the full list.
At least one of the blocks must be at least 256K in size and at least 16K aligned.
This call must not be made after RISCOS_Start.