DCMD_PROC_SETREGSET

QNX SDP8.0Programmer's GuideDeveloper

Set the given register set.

#include <sys/procfs.h>

#define DCMD_PROC_SETREGSET   __DIOTF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 26, procfs_regset)

The arguments to devctl() are:

Argument Value
filedes A file descriptor for the process. You must have opened the file descriptor for writing.
dcmd DCMD_PROC_SETREGSET
dev_data_ptr A pointer to a procfs_regset structure
n_bytes The number of bytes that you want to set
dev_info_ptr A pointer to an int where the number of bytes set can be stored

The argument is a pointer to a procfs_regset structure that specifies the values to assign to the register set. For more information, see DCMD_PROC_GETREGSET. For example, to set the performance registers:

procfs_regset regset;
int           returned_length;

regset.id = REGSET_PERFREGS;

/* Set the buf member as appropriate. */
...
devctl( fd, DCMD_PROC_SETREGSET, &regset, sizeof(regset), &returned_length );

To get or set registers in the range from REGSET_STARTPRIV and up, your process needs the PROCMGR_AID_PRIVREG ability enabled. Refer to procmgr_ability() in the C Library Reference.

The target-specific registers include the following:

AARCH64_REGSET_ACTLR
(AArch 64 targets only) Auxiliary Control Register, a privileged 64-bit register that provides implementation-defined configuration and control options for execution at EL1 and EL0.
Note:
To use this register, your startup program needs to set the AARCH64_CPU_ACTLR flag in cpuinfo.flags in the system page. For more information, see the System Page chapter of Building Embedded Systems.

For example:

procfs_regset regset;
int           returned_length;

regset.id = AARCH64_REGSET_ACTLR;
*(uint64_t *)&regset.buf[0] = regval;

devctl( fd, DCMD_PROC_SETREGSET, &regset, sizeof(uint32_t) + sizeof(uint64_t),
        &returned_length );
AARCH64_REGSET_PAUTH
(AArch 64 targets only) A ProcFS register-set that allows a debugged process to have its PAC keys retrieved and set. The process treats the buf member of procfs_regset as an aarch64_pauth_keyset_t, which is used as the input when setting the keys.
Note:
To use this register, your startup program needs to set the AARCH64_CPU_PAUTH flag in cpuinfo.flags in the system page. For more information, see the System Page chapter of Building Embedded Systems.

To get the given register set, use DCMD_PROC_GETREGSET.

Page updated: