Return a CPU-specific entry from the system page
#include <sys/syspage.h> #define SYSPAGE_CPU_ENTRY( cpu, entry )...
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The SYSPAGE_CPU_ENTRY() macro returns a pointer to the specified entry from the part of the system page that's specific to the given cpu.
The best way to reference the system page is via the kernel calls and POSIX cover functions. If there isn't a function to access the information you need, use SYSPAGE_CPU_ENTRY() instead of referencing the _syspage_ptr variable directly. For information in the rest of the syspage_entry structure, use SYSPAGE_ENTRY().
The only entry you might currently need to use is:
A pointer to the structure for the given entry.
#include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <sys/syspage.h> int main( void ) { printf ("We're pretending to be a type %ld PPC\n", SYSPAGE_CPU_ENTRY(ppc,kerinfo)->pretend_cpu); return EXIT_SUCCESS; }
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |
SYSPAGE_CPU_ENTRY() is a macro.
ClockCycles(), SYSPAGE_ENTRY(), _syspage_ptr
Customizing Image Startup Programs chapter of the Building Embedded Systems guide