lkml.org 
[lkml]   [2022]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/3] powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and PPC_RAW_TW()
Date
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com> writes:
> Christophe Leroy wrote:
>> Add and use PPC_RAW_TRAP() instead of opencoding.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>> arch/powerpc/include/asm/ppc-opcode.h | 2 ++
>> arch/powerpc/include/asm/probes.h | 3 ++-
>> arch/powerpc/xmon/xmon.c | 2 +-
>> 3 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
>> index 89beabf5325c..5527a955fb4a 100644
>> --- a/arch/powerpc/include/asm/ppc-opcode.h
>> +++ b/arch/powerpc/include/asm/ppc-opcode.h
>> @@ -581,6 +581,8 @@
>>
>> #define PPC_RAW_BRANCH(offset) (0x48000000 | PPC_LI(offset))
>> #define PPC_RAW_BL(offset) (0x48000001 | PPC_LI(offset))
>> +#define PPC_RAW_TW(t0, a, b) (0x7f000008 | ___PPC_RS(t0) | ___PPC_RA(a) | ___PPC_RB(b))
>
> Shouldn't that be 0x7c000008 ?

Yes, my script agrees.

https://github.com/mpe/misc-scripts/blob/master/ppc/ppc-instruction-encode

$ ./ppc-instruction-encode 0:31 6:t0 11:ra 16:rb 21:4 31:
.long 0x7c000008
t0 << 21
ra << 16
rb << 11


I guess the only user is PPC_RAW_TRAP() which passes t0 = 31, so that's
why nothing has broken.

Send a fixup? :)

cheers

\
 
 \ /
  Last update: 2022-08-03 12:39    [W:0.057 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site