Showing changes from revision #2 to #3:
Added | Removed | Changed
uint bool HAL_PhysInfo(void HAL_PhysInfo(enum *table,uint op, *rammax) void *table, physinfo_range_t *range)
Entry | |
---|---|
range | As required by the operation |
Exit | |
---|---|
- | Returns |
This call is used to the physical memory arrangement table of the machine, as per SWI OS_Memory reason codes 6 6, 7, and 7. 8. User software should always use theOS_Memory SWI instead of making this call directly.
If Where required, physinfo_range_t is a structure defined as:table is NULL, OS_Memory 6 behaviour is taken: rammax should be ignored, and the size (in bytes) required to store the physical memory arrangement table is returned.
If table is non-NULL, then it should be 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 return value of the function must be the lowest address which physical RAM can exist, and rammax must be filled with the highest address (inclusive) in which physical RAM can exist. The kernel will then update the relevant areas of the table to indicate how much RAM is actually available.
typedef struct physinfo_range_t { uintptr_t start; /* Start physical address (inclusive) */ uintptr_t end; /* End physical address (exclusive) */ }
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.