DCMD_PROC_SETGREG

Updated: April 19, 2023

Set the CPU registers with the values provided for the process associated with the file descriptor.

#include <sys/procfs.h>

#define DCMD_PROC_SETGREG   __DIOT(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 11, procfs_greg)

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_SETGREG
dev_data_ptr A pointer to a procfs_greg structure
n_bytes sizeof(procfs_greg)
dev_info_ptr NULL

The argument is a pointer to a procfs_greg structure (see debug_greg_t in <sys/debug.h>) that specifies the values to assign to the CPU registers. For example:

procfs_greg my_greg;

/* Set the members of my_greg as required. */
devctl( fd, DCMD_PROC_SETGREG, my_greg, sizeof(procfs_greg),
        NULL);

To get the CPU registers, use DCMD_PROC_GETGREG.