Tags

Tag structures store the details describing the hardware in the system.

Every tag structure stores information about a specific aspect of a hardware component on the system. Tags are grouped together into items, which provide complete descriptions of hardware components.

hwi_prefix

Every structure (or tag) in the hwinfo area starts the same way:

struct hwi_prefix {
    uint16_t        size;
    uint16_t        name;
};
size
The size, in multiples of four bytes, of the structure. This size includes hwi_prefix. For example, a value of 12 in size, means that the structure being examined is 48 bytes long.
name
An offset into the strings section of the system page, which holds a zero-terminated ASCII string name for the structure.
The use of ASCII strings for name allows you to add new structures without having to rely on QNX Software Systems to manage enumerated type values. Since the system page is typically allocated in 4 KB granularity, the extra storage required by ASCII string rather than enumerated types doesn't in fact cost anything.
When processing the hwinfo area of the system page, your code should ignore any tag that it doesn't recognize. Use the value in the structure's size field to know how many bytes to move forward to skip over the unrecognized structure.

location tag

The location tag (a simple tag, not an item) gives the location of the hardware device's registers. This register location can be memory-mapped, or in a separate I/O space (see addrspace below).

If the system being described has multiple register groupings, there may be multiple location tags in an item description: one tag for each register grouping.

#define HWI_TAG_NAME_location   "location"
#define HWI_TAG_ALIGN_location  (sizeof(uint64))
struct hwi_location {
    struct hwi_prefix   prefix;
    uint32_t            len;
    uint64_t            base;
    uint16_t            regshift;
    uint16_t            addrspace;
};
base
The physical address of the start of the registers.
len
The length, in bytes, of the registers.
regshift
Indicates the shift for each register access.
If a register is documented at offset of a device, then the driver should access offset offset2^regshift to get to that register.
addrspace
An offset, in bytes, from the start of the asinfo section.
This member should identify either the memory or io address space item to indicate if the the device registers are memory-mapped or in a separate I/O space.

irq tag

The irq tag (simple tag, not item) holds the logical interrupt vector number for a device.

#define HWI_TAG_NAME_irq        "irq"
#define HWI_TAG_ALIGN_irq       (sizeof(uint32))
struct hwi_irq {
    struct hwi_prefix   prefix;
    uint32_t            vector;
};
vector
The logical interrupt vector number for the device being described.

diskgeometry tag

The diskgeometry tag (simple tag, not item) is used to transfer information about rotating disk geometry from the BIOS or UEFI. It is used for x86 platforms only.

#define HWI_TAG_NAME_diskgeometry   "diskgeometry"
#define HWI_TAG_ALIGN_diskgeometry  (sizeof(uint32))
struct hwi_diskgeometry {
    struct hwi_prefix   prefix;
    uint8_t             disknumber;
    uint8_t             sectorsize;   /* as a power of two */
    uint16_t            heads;
    uint16_t            cyls;
    uint16_t            sectors;
    uint32_t            nblocks;
};
disknumber
The number of the disk in the system.
sectorsize
The size of the sectors on the disk, expressed as a power of two.
heads
The number of heads
cyls
The number of disk cylinders.
sectors
The number of sectors on the disk.
nblocks
The number of blocks, if specified. Otherwise, nblocks equals the number of heads multiplied by the number of cylinders, multiplied by the number of sectors (nblocks = heads * cycls * sectors).

pad tag

The pad tag (simple tag, not item) is used when padding must be inserted to meet the alignment constraints for the subsequent tag.

   
#define HWI_TAG_NAME_pad        "pad"
#define HWI_TAG_ALIGN_pad       (sizeof(uint32))
struct hwi_pad {
    struct hwi_prefix   prefix;
};