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_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_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_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_entry.html on line 8

SYSPAGE_ENTRY()

Return an entry from the system page

Synopsis:

#include <sys/syspage.h>

#define SYSPAGE_ENTRY( entry )...

Arguments:

entry
The entry to get; see below.

Library:

libc

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

Description:

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().

Currently, the only entry you're likely to access with SYSPAGE_ENTRY() is:

qtime
QNX-specific time information. The qtime_entry structure contains at least the following members:

Returns:

A pointer to the structure for the given entry.

Examples:

#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 */
    printf("Hello!\n");

    /* snap the time again */
    cycle2=ClockCycles( );
    ncycles=cycle2-cycle1;
    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 );
    sec=(double)ncycles/cps;
    printf("The cycles in seconds is %f.\n",sec);

    return EXIT_SUCCESS;
}

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

Caveats:

SYSPAGE_ENTRY() is a macro.

See also:

ClockCycles(), SYSPAGE_CPU_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_entry.html on line 200

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_entry.html on line 200