[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47775062.4070300@redhat.com>
Date: Sun, 30 Dec 2007 03:01:38 -0500
From: Masami Hiramatsu <mhiramat@...hat.com>
To: "H. Peter Anvin" <hpa@...or.com>
CC: Harvey Harrison <harvey.harrison@...il.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Jim Keniston <jkenisto@...ibm.com>,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86: Introduce REX prefix helper for kprobes
Hi,
H. Peter Anvin wrote:
>> Could you use a macro same as the stack_addr() macro, like as below?
>>
>> #defile is_REX_prefix(insn) ((insn & 0xf0) == 0x40))
>>
>> This is just a bit checker, so I think a macro is better to do that.
>>
>
> Why is a macro better than an inline, and why the odd mIXed case?
I thought we can use macro because it just check a bit mask.
And if we use this as a macro, it will be defined in #ifdef block at
the top of kprobes.c. It is simple in this case.
I know the inline is better than the macro, it can check the type of
arguments.
If you would like to use inline, how about this?
---
(in case of CONFIG_X86_64)
static inline int is_rex_prefix(int op)
{
return ((op & 0xf0) == 0x40);
}
(in case of CONFIG_X86_32)
#define is_rex_prefix(op) (0)
---
About the name, I just used the previous inline function name.
Thank you,
>
> -hpa
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@...hat.com, masami.hiramatsu.pt@...achi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists