Showing changes from revision #3 to #4:
Added | Removed | Changed
bool HAL_PhysInfo(enum op, void *table, physinfo_range_t *range)
Entry | |
---|---|
op | Operation to perform |
table | As required by the operation |
range | As required by the operation |
Exit | |
---|---|
- | Returns TRUE if supported, otherwise FALSE |
This call is used to the physical memory arrangement table of the machine, as per SWI OS_Memory reason codes 6, 7, and 8. User software should always use the OS_Memory SWI instead of making this call directly.
Where required, physinfo_range_t is a structure defined as:
typedef struct physinfo_range_t { uintptr_t start; /* Start physical address (inclusive) */ uintptr_t end; /* End physical address (exclusive) (inclusive) */ }
If op is 0, table is taken to point to a size_t variable and is filled with the size of the physical arrangement table in bytes. The range parameter is unused.
If op is 1, table is table to point to an array of uint8_t at least as big as reported by operation 0. It is filled with the physical memory arrangement table, as per OS_Memory 7. However, it is the kernel’s responsibility to fill in information about the available RAM, so all RAM pages should be marked as (NotPresent OR NotAvailable). To aid the kernel in filling in the RAM map, the range structure is populated with the region of the physical memory map which might contain RAM. The kernel will then update the relevant areas of the table to indicate how much RAM is actually available.
If op is 2, the range structure is populated with the region containing hard ROM as required by OS_Memory 8. The table parameter is unused.