Get the information stored in the CPU registers based on the current thread of the process associated with the file descriptor.
#include <sys/procfs.h> #define DCMD_PROC_GETGREG __DIOF(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 10, procfs_greg)
The arguments to devctl() are:
Argument | Value |
---|---|
filedes | A file descriptor for the process. |
dcmd | DCMD_PROC_GETGREG |
dev_data_ptr | A pointer to a procfs_greg structure |
n_bytes | sizeof(procfs_greg) |
dev_info_ptr | NULL, or a pointer to an integer where the size of the data can be stored |
The argument is a pointer to a procfs_greg structure (see debug_greg_t in <sys/debug.h>) that's filled in with the required information on return. If you provide a non-NULL extra argument, it's filled with the size of the data. For example:
procfs_greg my_greg; devctl( fd, DCMD_PROC_GETGREG, my_greg, sizeof(procfs_greg), &size);
To set the CPU registers, use DCMD_PROC_SETGREG.