1. 04 Mar, 2012 1 commit
    • Paul Gortmaker's avatar
      BUG: headers with BUG/BUG_ON etc. need linux/bug.h · 187f1882
      Paul Gortmaker authored
      If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
      other BUG variant in a static inline (i.e. not in a #define) then
      that header really should be including <linux/bug.h> and not just
      expecting it to be implicitly present.
      
      We can make this change risk-free, since if the files using these
      headers didn't have exposure to linux/bug.h already, they would have
      been causing compile failures/warnings.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      187f1882
  2. 02 Mar, 2012 2 commits
  3. 30 Jan, 2008 3 commits
    • Roland McGrath's avatar
      x86: user_regset user-copy helpers · 5bde4d18
      Roland McGrath authored
      This defines two new inlines in linux/regset.h, for use in arch_ptrace
      implementations and the like.  These provide simplified wrappers for using
      the user_regset interfaces to copy thread regset data into the caller's
      user-space memory.  The inlines are trivial, but make the common uses in
      places such as ptrace implementation much more concise, easier to read, and
      less prone to code-copying errors.
      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>
      5bde4d18
    • Roland McGrath's avatar
      x86: user_regset helpers · bae3f7c3
      Roland McGrath authored
      This adds some inlines to linux/regset.h intended for arch code to use in
      its user_regset get and set functions.  These make it pretty easy to deal
      with the interface's optional kernel-space or user-space pointers and its
      generalized access to a part of the register data at a time.
      
      In simple cases where the internal data structure matches the exported
      layout (core dump format), a get function can be nothing but a call to
      user_regset_copyout, and a set function a call to user_regset_copyin.
      
      In other cases the exported layout is usually made up of a few pieces each
      stored contiguously in a different internal data structure.  These helpers
      make it straightforward to write a get or set function by processing each
      contiguous chunk of the data in order.  The start_pos and end_pos arguments
      are always constants, so these inlines collapse to a small amount of code.
      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>
      bae3f7c3
    • 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>
      bdf88217