[Select]

Dynamic Areas


Index

 

Physical Mapping of Dynamic Areas

New API

OS_DynamicArea 0 (Create Area) has been extended to support dynamic areas which contain a physical mapping of memory. This facility is required for certain hardware drivers to be able to access their hardware. The interface is similar to that for dynamic areas with handlers for 'specific' pages, but with a number of minor changes.

A Physically Mapped Area can be created by setting bit 15 in the Area Flags on creation. The area may be :

  • Sparse
  • Doubly mapped
  • Cacheable
  • Bufferable
  • Any access level

It may not be :

  • Heap
  • Require specific pages (this is implicit)
  • Shrinkable
  • Locked
  • Application bound
  • User draggable

The PreGrow handler will be called for any changes to the area. The page block supplied to the handler should be filled in a similar manner to the original handler :

  • The Page Number field may be given a standard value. If this is the number of a physical page (as used by all other RISC OS interfaces), the mapped page will be a reference to the RAM at with that page number. Care should be used when using this form of mapping as cache coherency may be an issue if the page is accessed from multiple logical mappings.
  • The Page Number field may be given an extended physical address value. This is a physical address space page number (ie physical address >> 12) with bit 30 set. This form of addressing is intended to allow clients to access the new physical mappings through the legacy RISC OS interfaces.
  • The Physical Address field may be given a physical address value. This is the recommended interface.

It is recommended that clients do not map RAM using this interface. It is recommended that clients disable cacheing and buffering when using this interface.

No limit is placed on the size of the Physically Mapped Dynamic Area. The dynamic area may be larger than the memory fitted to the machine.

Legacy interfaces

Where possible it is expected that older clients will function correctly in the light of the possibility of physically mapped memory.

The OS_FindMemMapEntries interface has been updated to return details about the page mapping, using the above extended physical address space page number (bit 30 set with the page number).

The OS_Memory 0 interface has limited capabilities for operating on the extended page numbers.


This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.

HTML document version 1.03 3rd November 2015