DCMD_PROC_SETREGSET

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 );

(QNX Neutrino 7.0.4 or later) To set the Auxiliary Control Register on AArch64:

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 );
Note: Because AARCH64_REGSET_ACTLR is a privileged register, your process needs the PROCMGR_AID_PRIVREG ability enabled; see procmgr_ability() in the C Library Reference. In order for you 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.

To get the given register set, use DCMD_PROC_GETREGSET.