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, ®set, 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 *)®set.buf[0] = regval; devctl( fd, DCMD_PROC_SETREGSET, ®set, sizeof(uint32_t) + sizeof(uint64_t), &returned_length );
To get the given register set, use DCMD_PROC_GETREGSET.