DCMD_PROC_GETREGSET
QNX SDP8.0Programmer's GuideDeveloper
Read the given register set.
#include <sys/procfs.h>
#define DCMD_PROC_GETREGSET __DIOTF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 25, procfs_regset)
The arguments to devctl() are:
Argument | Value |
---|---|
filedes | A file descriptor for the process. |
dcmd | DCMD_PROC_GETREGSET |
dev_data_ptr | A pointer to a procfs_regset structure |
n_bytes | The number of bytes that you want to get |
dev_info_ptr | A pointer to an int where the number of bytes retrieved can be stored |
The argument is a pointer to a procfs_regset structure where the required information can be stored:
typedef struct _procfs_regset {
uint32_t id;
char buf[8192];
} procfs_regset;
Set the id member to indicate the registers you want to get:
- REGSET_ALTREGS
- Alternate registers. You can also get and set these registers with the DCMD_PROC_GETALTREG and DCMD_PROC_SETALTREG commands.
- REGSET_FPREGS
- Floating Point Data registers. You can also get and set these registers with the DCMD_PROC_GETFPREG and DCMD_PROC_SETFPREG commands.
- REGSET_GPREGS
- CPU registers. You can also get and set these registers with the DCMD_PROC_GETGREG and DCMD_PROC_SETGREG commands.
- REGSET_PERFREGS
- Performance registers.
For example:
procfs_regset regset;
int returned_length;
regset.id = REGSET_PERFREGS;
devctl( fd, DCMD_PROC_GETREGSET, ®set, sizeof(regset), &returned_length );
The register sets defined in <sys/debug.h> include some special values, REGSET_STARTCPU and REGSET_STARTPRIV:
- The range from REGSET_STARTCPU up to but not including REGSET_STARTPRIV is for CPU-specific registers.
- The range from REGSET_STARTPRIV and up is for privileged registers.
- The range from REGSET_STARTPRIV + REGSET_STARTCPU and up is for privileged CPU-specific registers.
In order to get or set registers in the range from REGSET_STARTPRIV and up, your process needs the PROCMGR_AID_PRIVREG ability enabled. See 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: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.For example:
procfs_regset regset; int returned_length; regset.id = AARCH64_REGSET_ACTLR; *(uint64_t *)®set.buf[0] = 0; devctl( fd, DCMD_PROC_GETREGSET, ®set, sizeof(uint32_t) + sizeof(uint64_t), &returned_length ); printf ("The value is %llx.\n", *(uint64_t *)®set.buf[0]);
To set a given register set, use DCMD_PROC_SETREGSET.
Page updated: