<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>struct user_regset</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="The utrace User Debugging Infrastructure" /><link rel="up" href="machine.html#regset" title="struct user_regset" /><link rel="prev" href="API-user-regset-writeback-fn.html" title="user_regset_writeback_fn" /><link rel="next" href="API-struct-user-regset-view.html" title="struct user_regset_view" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>struct user_regset</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-user-regset-writeback-fn.html">Prev</a> </td><th width="60%" align="center"><span class="structname">struct user_regset</span></th><td width="20%" align="right"> <a accesskey="n" href="API-struct-user-regset-view.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="struct user_regset"><a id="API-struct-user-regset"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct user_regset — accessible thread CPU state </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><pre class="programlisting"> struct user_regset { user_regset_get_fn * get; user_regset_set_fn * set; user_regset_active_fn * active; user_regset_writeback_fn * writeback; unsigned int n; unsigned int size; unsigned int align; unsigned int bias; unsigned int core_note_type; }; </pre></div><div class="refsect1" title="Members"><a id="id2770687"></a><h2>Members</h2><div class="variablelist"><dl><dt><span class="term">get</span></dt><dd><p> Function to fetch values. </p></dd><dt><span class="term">set</span></dt><dd><p> Function to store values. </p></dd><dt><span class="term">active</span></dt><dd><p> Function to report if regset is active, or <code class="constant">NULL</code>. </p></dd><dt><span class="term">writeback</span></dt><dd><p> Function to write data back to user memory, or <code class="constant">NULL</code>. </p></dd><dt><span class="term">n</span></dt><dd><p> Number of slots (registers). </p></dd><dt><span class="term">size</span></dt><dd><p> Size in bytes of a slot (register). </p></dd><dt><span class="term">align</span></dt><dd><p> Required alignment, in bytes. </p></dd><dt><span class="term">bias</span></dt><dd><p> Bias from natural indexing. </p></dd><dt><span class="term">core_note_type</span></dt><dd><p> ELF note <em class="parameter"><code>n_type</code></em> value used in core dumps. </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2770811"></a><h2>Description</h2><p> This data structure describes a machine resource we call a register set. This is part of the state of an individual thread, not necessarily actual CPU registers per se. A register set consists of a number of similar slots, given by <em class="parameter"><code>n</code></em>. Each slot is <em class="parameter"><code>size</code></em> bytes, and aligned to <em class="parameter"><code>align</code></em> bytes (which is at least <em class="parameter"><code>size</code></em>). </p><p> These functions must be called only on the current thread or on a thread that is in <code class="constant">TASK_STOPPED</code> or <code class="constant">TASK_TRACED</code> state, that we are guaranteed will not be woken up and return to user mode, and that we have called <code class="function">wait_task_inactive</code> on. (The target thread always might wake up for SIGKILL while these functions are working, in which case that thread's user_regset state might be scrambled.) </p><p> The <em class="parameter"><code>pos</code></em> argument must be aligned according to <em class="parameter"><code>align</code></em>; the <em class="parameter"><code>count</code></em> argument must be a multiple of <em class="parameter"><code>size</code></em>. These functions are not responsible for checking for invalid arguments. </p><p> When there is a natural value to use as an index, <em class="parameter"><code>bias</code></em> gives the difference between the natural index and the slot index for the register set. For example, x86 GDT segment descriptors form a regset; the segment selector produces a natural index, but only a subset of that index space is available as a regset (the TLS slots); subtracting <em class="parameter"><code>bias</code></em> from a segment selector index value computes the regset slot. </p><p> If nonzero, <em class="parameter"><code>core_note_type</code></em> gives the n_type field (NT_* value) of the core file note in which this regset's data appears. NT_PRSTATUS is a special case in that the regset data starts at offsetof(struct elf_prstatus, pr_reg) into the note data; that is part of the per-machine ELF formats userland knows about. In other cases, the core file note contains exactly the whole regset (<em class="parameter"><code>n</code></em> * <em class="parameter"><code>size</code></em>) and nothing else. The core file note is normally omitted when there is an <em class="parameter"><code>active</code></em> function and it returns zero. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-user-regset-writeback-fn.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="machine.html#regset">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-user-regset-view.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>user_regset_writeback_fn</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>struct user_regset_view</span></td></tr></table></div></body></html>