• Roland McGrath's avatar
    x86: user_regset header · bdf88217
    Roland McGrath authored
    The new header <linux/regset.h> defines the types struct user_regset and
    struct user_regset_view, with some associated declarations.  This new set
    of interfaces will become the standard way for arch code to expose
    user-mode machine-specific state.  A single set of entry points into arch
    code can do all the low-level work in one place to fill the needs of core
    dumps, ptrace, and any other user-mode debugging facilities that might come
    along in the future.
    For existing arch code to adapt to the user_regset interfaces, each arch
    can work from the code it already has to support core files and ptrace.
    The formats you want for user_regset are the core file formats.  The only
    wrinkle in adapting old ptrace implementation code as user_regset get and
    set functions is that these functions can be called on current as well as
    on another task_struct that is stopped and switched out as for ptrace.
    For some kinds of machine state, you may have to load it directly from CPU
    registers or otherwise differently for current than for another thread.
    (Your core dump support already handles this in elf_core_copy_regs for
    current and elf_core_copy_task_regs for other tasks, so just check there.)
    The set function should also be made to work on current in case that
    entails some special cases, though this was never required before for
    ptrace.  Adding this flexibility covers the arch needs to open the door to
    more sophisticated new debugging facilities that don't always need to
    context-switch to do every little thing.
    The copyin/copyout helper functions (in a later patch) relieve the arch
    code of most of the cumbersome details of the flexible get/set interfaces.
    Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
regset.h 8.41 KB