System Page

QNX SDP8.0Building Embedded SystemsConfigurationDeveloper

The system page contains essential information about the system, including the system page's size, information about the hardware platform (including IRQs and the CPUs), the cache size, and the location of kernel callouts in memory.

The system page is implemented by a data structure containing constants, references to other data structures, and a union shared by the different processor architectures that QNX OS supports.

One of the startup program's main tasks is to initialize the system page with the information that the OS needs to run on the current hardware (see Startup tasks in the Startup Programs chapter). After the startup program initializes the system page, it populates this data structure with data that describes the current system and OS, allowing applications to retrieve the information they need.

System page location

The standard location for header files, including sys/syspage.h, is on your host system in ${QNX_TARGET}/usr/include, where ${QNX_TARGET} is the directory that holds the target-related components. Architecture-specific header files are kept in ${QNX_TARGET}/usr/include/arch, where arch is the architecture of the target system. For example, ${QNX_TARGET}/usr/include/x86_64/syspage.h contains the architecture-specific definitions for x86 64-bit. Note, however, that the correct header file to include is the general one that contains definitions for all architectures and is stored in the standard header file location (e.g., /my_qnx_sdp/target/qnx/usr/include/sys/syspage.h).

A QNX SDP product patch or OS update can replace this and other header files (and other components such as binaries and libraries) with newer versions.

However, because QNX regularly updates header files between patches and updates, a specific BSP component often requires a newer version of a header file. When an updated header file is required, it is included with the BSP; the version in the QNX SDP exists independently. When you build the BSP, the build process automatically uses the version shipped with it. Any other coding operations you do outside of that specific BSP use the QNX SDP version of the header file.

System page contents

The sys/syspage.h header file defines the system page structure. Although the contents of this structure vary with the platform, it always has the following members:
struct syspage_entry {
    _Uint16t            size;        /* size of syspage_entry */
    _Uint16t            total_size;  /* size of system page */
    _Uint16t            type;
    _Uint16t            num_cpu;
    syspage_entry_info  system_private;
    struct {
        _Uint16t    major;
        _Uint16t    minor;
    } version;
    syspage_entry_info    hwinfo;
    syspage_entry_info    qtime;
    syspage_entry_info    callout;
    syspage_entry_info    typed_strings;
    syspage_entry_info    strings;
    syspage_entry_info    smp;
    union {
#if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_X86_64)
        struct x86_64_syspage_entry    x86_64;
#endif
#if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_AARCH64)
        struct aarch64_syspage_entry    aarch64;
#endif
        _Uint64t                    filler[20];
    } un;
    syspage_array_info  asinfo;
    syspage_array_info  cpuinfo;
    syspage_array_info  cacheattr;
    syspage_array_info  intrinfo;
    syspage_entry_info  hypinfo;
    syspage_array_info  cluster;
};
Note:
The startup library code initializes some of the system page fields. Depending on the amount of customization you require, you may need to initialize some fields as well.
The members of the syspage_entry data structure are:
size
The size of the system page entry. The startup library sets this member automatically.
total_size

The size of the system page entry plus the referenced substructures; effectively the size of the entire system page database.

The startup library sets this member automatically, but other library calls may adjust (grow) it later as required.

type

The CPU family for determining which union member in the un element to use. It can be SYSPAGE_X86_64 or SYSPAGE_AARCH64, for the supported 64-bit architectures.

The library sets this member automatically.

num_cpu
The number of CPUs on the system. The startup library initializes it to the default value of 1. If additional CPUs are detected during startup, the startup program should call init_smp() to set this member to the correct value.
system_private
See system_private.
version
The major and minor versions of the system page. In this release, the major version is 2 and the minor version is 0.
hwinfo
See hwinfo.
qtime
See qtime.
callout
See callout.
typed_strings

A literal pool used for typed strings. Each entry consists of a four-byte number and a NULL-terminated string. The number represents the string type and corresponds to a specific constant from the system header file <confname.h> (see the C library function confstr()).

Usually, the init_*() library functions populate the typed strings literal pool. However, if you need to add something, you can call the add_typed_string() function from the startup library.

strings

A literal pool used for non-typed strings. To use one of these strings, specify the appropriate index in strings (e.g., cpuinfo's name member).

Usually, the init_*() library functions populate the non-typed strings literal pool. However, if you need to add something, you can call the add_string() function from the startup library.

smp
See smp.
un
See un.
asinfo
See asinfo.
cpuinfo
See cpuinfo.
cacheattr
See cacheattr.
intrinfo
See intrinfo.
hypinfo
See hypinfo.
cluster
See cluster.

Supported platforms

QNX SDP supports 64-bit processing on x86 and ARM platforms. This support is defined by the following system page types:
/*
 *    System page types
 */
enum {
    SYSPAGE_64BIT = 0x100,
    SYSPAGE_VERSIONED = 0x1000,
    SYSPAGE_X86_64 = (_Uint16t)SYSPAGE_VERSIONED | (_Uint16t)SYSPAGE_64BIT,
    SYSPAGE_AARCH64,
};
Note:
32-bit architectures are no longer supported.
Page updated: