Re: [RFC] [PATCH] task_pt_regs for powerpc systems
On Monday 14 July 2008 11:06:47 pm Andreas Schwab wrote: Timur Tabi [EMAIL PROTECTED] writes: Srinivasa D S wrote: +#define task_pt_regs(tsk) (tsk)-thread.regs Shouldn't this be: #define task_pt_regs(tsk) ((tsk)-thread.regs) just to be safe? Both - and . have already highest precedence as postfix operators. Thanks for the comments, For safer side I have used () and sent the updated patch. Thanks Srinivasa DS ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [RFC] [PATCH] task_pt_regs for powerpc systems
On Monday 14 July 2008 04:02:41 am Paul Mackerras wrote: Below attached patch defines this macro for powerpc arch. Please let me know your comments on this. +#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)-thread.regs) The cast is unnecessary since tsk-thread.regs is already a struct pt_regs *. True. Also note that tsk-thread.regs will be NULL for a kernel thread. Yes, users of task_pt_regs will verify for NULL. Updated patch attached below. Signed-off-by: Srinivasa DS [EMAIL PROTECTED] --- include/asm-powerpc/processor.h |2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6.26-rc9/include/asm-powerpc/processor.h === --- linux-2.6.26-rc9.orig/include/asm-powerpc/processor.h +++ linux-2.6.26-rc9/include/asm-powerpc/processor.h @@ -214,6 +214,8 @@ struct thread_struct { #define thread_saved_pc(tsk)\ ((tsk)-thread.regs? (tsk)-thread.regs-nip: 0) +#define task_pt_regs(tsk) (tsk)-thread.regs + unsigned long get_wchan(struct task_struct *p); #define KSTK_EIP(tsk) ((tsk)-thread.regs? (tsk)-thread.regs-nip: 0) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[RFC] [PATCH] task_pt_regs for powerpc systems
Hi task_pt_regs() macro defines pt_regs for the given task, this macro is currently not defined for powerpc arch. We need this macro for upcoming utrace features. Below attached patch defines this macro for powerpc arch. Please let me know your comments on this. Signed-off-by: Srinivasa DS [EMAIL PROTECTED] --- include/asm-powerpc/processor.h |2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6.26-rc9/include/asm-powerpc/processor.h === --- linux-2.6.26-rc9.orig/include/asm-powerpc/processor.h +++ linux-2.6.26-rc9/include/asm-powerpc/processor.h @@ -214,6 +214,8 @@ struct thread_struct { #define thread_saved_pc(tsk)\ ((tsk)-thread.regs? (tsk)-thread.regs-nip: 0) +#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)-thread.regs) + unsigned long get_wchan(struct task_struct *p); #define KSTK_EIP(tsk) ((tsk)-thread.regs? (tsk)-thread.regs-nip: 0) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev