Return an entry from the system page


#include <sys/syspage.h>

#define SYSPAGE_ENTRY( entry )...


The entry to get; see below.



Use the -l c option to qcc to link against this library. This library is usually included automatically.


The SYSPAGE_ENTRY() macro returns a pointer to the specified entry in the system page.

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_ENTRY() instead of referencing the _syspage_ptr variable directly. For information in the CPU-specific part of the syspage_entry structure, use SYSPAGE_CPU_ENTRY() .

The entries you're likely to access with SYSPAGE_ENTRY() include:

Information that's specific to the CPU. For example, to determine if the processor supports NEON technology, a 128-bit SIMD (Single Instruction, Multiple Data) architecture extension to the ARM Cortex-A series processor, do the following:
if (SYSPAGE_ENTRY(cpuinfo)->flags & ARM_CPU_FLAG_NEON)
QNX-specific time information. The qtime_entry structure contains at least the following members:
  • unsigned long boot_time — the time, in seconds, since the Unix Epoch (00:00:00 January 1, 1970 Coordinated Universal Time (UTC)) when this system was booted.

    If you call ClockTime() to set the time of day, the kernel checks to see if this field is zero. If it is, the kernel sets it to the appropriate value. There's a -T option for all startup programs that prevents the setting of this field, so that the kernel will set it the first time you call ClockTime() to change the time of day. This is useful if the RTC hardware isn't in UTC.

  • uint64_t cycles_per_sec — the number of CPU clock cycles per second for this system. For more information, see ClockCycles() .


A pointer to the structure for the given entry.


#include <sys/neutrino.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/syspage.h>

int main( void )
    uint64_t cps, cycle1, cycle2, ncycles;
    double sec;

    /* snap the time */
    cycle1=ClockCycles( );

    /* do something */

    /* snap the time again */
    cycle2=ClockCycles( );
    printf("%lld cycles elapsed.\n", ncycles);
    /* find out how many cycles per second */
    cps = SYSPAGE_ENTRY(qtime)->cycles_per_sec;
    printf( "This system has %lld cycles/sec.\n",cps );
    printf("The cycles in seconds is %f.\n",sec);

    return EXIT_SUCCESS;


QNX Neutrino

Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes


SYSPAGE_ENTRY() is a macro.

Last modified: 2013-12-23

comments powered by Disqus