Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/syspage_cpu_entry.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/syspage_cpu_entry.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/syspage_cpu_entry.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/syspage_cpu_entry.html on line 8
Return a CPU-specific entry from the system page
#include <sys/syspage.h>
#define SYSPAGE_CPU_ENTRY( cpu, entry )...
- cpu
- The CPU to get the entry for.
- entry
- The entry to get; see below.
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:
- ppc, kerinfo
- This structure, defined in <ppc/syspage.h>,
contains at least the following members:
- unsigned long pretend_cpu — we can
pretend the chip is this Processor Version Register.
- unsigned long init_msr — the initial
Machine Status Register for thread creation.
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;
}
QNX Neutrino
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
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/syspage_cpu_entry.html on line 177
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/syspage_cpu_entry.html on line 177