Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs
regset.h File Reference
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/bug.h>
#include <linux/uaccess.h>

Go to the source code of this file.

Data Structures

struct  user_regset
 
struct  user_regset_view
 

Typedefs

typedef int user_regset_active_fn (struct task_struct *target, const struct user_regset *regset)
 
typedef int user_regset_get_fn (struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)
 
typedef int user_regset_set_fn (struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf)
 
typedef int user_regset_writeback_fn (struct task_struct *target, const struct user_regset *regset, int immediate)
 

Functions

: Identifier, e.g. UTS_MACHINE string.

struct user_regset_view - available regsets

: Array of
regsets available in this view.
: Number of elements in . : ELF header EM_* value written in core dumps. : ELF header value written in core dumps. : ELF header [EI_OSABI] value written in core dumps.

A regset view is a collection of regsets (&struct user_regset, above). This describes all the state of a thread that can be seen from a given architecture/ABI environment. More than one view might refer to the same &struct user_regset, or more than one regset might refer to the same machine-specific state in the thread. For example, a 32-bit thread's state could be examined from the 32-bit view or from the 64-bit view. Either method reaches the same thread register state, doing appropriate widening or truncation.

struct user_regset_viewtask_user_regset_view (struct task_struct *tsk)
 

Typedef Documentation

typedef int user_regset_active_fn(struct task_struct *target, const struct user_regset *regset)

user_regset_active_fn - type of function in &struct user_regset : thread being examined : regset being examined

Return -ENODEV if not available on the hardware found. Return %0 if no interesting state in this thread. Return >%0 number of units of interesting state. Any get call fetching state beyond that number will see the default initialization state for this data, so a caller that knows what the default state is need not copy it all out. This call is optional; the pointer is NULL if there is no inexpensive check to yield a value <
.

Definition at line 39 of file regset.h.

typedef int user_regset_get_fn(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf)

user_regset_get_fn - type of function in &struct user_regset : thread being examined : regset being examined : offset into the regset data to access, in bytes : amount of data to copy, in bytes : if not NULL, a kernel-space pointer to copy into : if is NULL, a user-space pointer to copy into

Fetch register values. Return %0 on success; -EIO or -ENODEV are usual failure returns. The and values are in bytes, but must be properly aligned. If is non-null, that buffer is used and is ignored. If is NULL, then ubuf gives a userland pointer to access directly, and an -EFAULT return value is possible.

Definition at line 58 of file regset.h.

typedef int user_regset_set_fn(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf)

user_regset_set_fn - type of function in &struct user_regset : thread being examined : regset being examined : offset into the regset data to access, in bytes : amount of data to copy, in bytes : if not NULL, a kernel-space pointer to copy from : if is NULL, a user-space pointer to copy from

Store register values. Return %0 on success; -EIO or -ENODEV are usual failure returns. The and values are in bytes, but must be properly aligned. If is non-null, that buffer is used and is ignored. If is NULL, then ubuf gives a userland pointer to access directly, and an -EFAULT return value is possible.

Definition at line 79 of file regset.h.

typedef int user_regset_writeback_fn(struct task_struct *target, const struct user_regset *regset, int immediate)

user_regset_writeback_fn - type of function in &struct user_regset : thread being examined : regset being examined : zero if writeback at completion of next context switch is OK

This call is optional; usually the pointer is NULL. When provided, there is some user memory associated with this regset's hardware, such as memory backing cached register data on register window machines; the regset's data controls what user memory is used (e.g. via the stack pointer value).

Write register data back to user memory. If the flag is nonzero, it must be written to the user memory so uaccess or access_process_vm() can see it when this call returns; if zero, then it must be written back by the time the task completes a context switch (as synchronized with wait_task_inactive()). Return %0 on success or if there was nothing to do, -EFAULT for a memory problem (bad stack pointer or whatever), or -EIO for a hardware problem.

Definition at line 105 of file regset.h.

Function Documentation

struct user_regset_view* task_user_regset_view ( struct task_struct tsk)
read

task_user_regset_view - Return the process's native regset view. : a thread of the process in question

Return the &struct user_regset_view that is native for the given process. For example, what it would access when it called ptrace(). Throughout the life of the process, this only changes at exec.

Definition at line 793 of file ptrace.c.