walk_asinfo()
Walk the asinfo area of the system page and process any entries matching the given name
Synopsis:
#include <sys/asinfo.h>
int walk_asinfo(const char* const name,
int (* const func)(struct asinfo_entry* as, char* name, void* p),
void* data);
Arguments:
- name
- A string containing the name of the asinfo entries to be processed. This argument can be NULL to match and process all entries.
- func
- The function to run to process matching asinfo entries. This function accepts three arguments: the first is a pointer to the current asinfo entry being processed, the second is a string with the entry's name (which matched name), and the third is a pointer to any required data. This function returns zero (0) to tell walk_asinfo() to stop walking the asinfo area or non-zero to tell it to keep walking.
- data
- Data to pass as the third argument to func.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The walk_asinfo() function walks the list of asinfo structures in the Address Space Information (asinfo) area of the System Page and for any list entries with names that match name, this function calls the given processing function func.
Parsing the asinfo area allows a utility or application to find much essential information, including the GIC, the root ACPI table, the maximum supported physical address, and the FDT.
For more information about accessing system page entries, go to the SYSPAGE_ENTRY() reference in this guide.
Returns:
0 if a matching entry was found and the processing function (func) indicated there's no need to keep walking.
- no entry that matches name was found
- for all matching entries, the processing function indicated that walk_asinfo() should keep walking, and then the end of the asinfo list was reached. This could mean there was an error in processing an entry or the appropriate asinfo information was not found; it depends on the design of func.
Errors:
The walk_asinfo() function doesn't set errno itself, but the provided entry-processing function func may set this variable.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |