* asm code
@ 2004-04-20 15:56 Chris Friesen
2004-04-21 0:17 ` help with asm code? Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Chris Friesen @ 2004-04-20 15:56 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev
I'm trying to do an indirect address lookup in entry.S. I've added a
lookup table at the end of entry.S as follows:
hrt_ak_offsets:
.byte HRT_AK_USER_USER_SYNC
.byte HRT_AK_SIGM_USER_SYNC
.byte HRT_AK_SIGU_USER_SYNC
.byte HRT_AK_USER_SIG_SYNC
.byte HRT_AK_SIGM_SIG_SYNC
.byte HRT_AK_SIGU_SIG_SYNC
.byte HRT_AK_USER_USER_ASYN
.byte HRT_AK_SIGM_USER_ASYN
<etc...>
I then have some code that wants to load up one of these values and use
it as an offset into another struct. Coming into the following stretch
of code, r6 contains the entry number within hrt_ak_offsets, and r4
contains the base address of the other struct.
lis r5,hrt_ak_offsets@ha
addi r5,r5,hrt_ak_offsets@l
lbzx r6,r6,r5
add r10,r4,r6
I'm having a small problem, in that when I run this code it hangs my
kernel. Any ideas what's wrong? The values in r6 and r5 seem to match
what I expect, but when I do the lbzx it dies.
Thanks,
Chris
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: help with asm code?
2004-04-20 15:56 asm code Chris Friesen
@ 2004-04-21 0:17 ` Benjamin Herrenschmidt
2004-04-21 14:00 ` Chris Friesen
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2004-04-21 0:17 UTC (permalink / raw)
To: Chris Friesen; +Cc: linuxppc-dev list
> I then have some code that wants to load up one of these values and use
> it as an offset into another struct. Coming into the following stretch
> of code, r6 contains the entry number within hrt_ak_offsets, and r4
> contains the base address of the other struct.
>
>
> lis r5,hrt_ak_offsets@ha
> addi r5,r5,hrt_ak_offsets@l
> lbzx r6,r6,r5
> add r10,r4,r6
>
>
> I'm having a small problem, in that when I run this code it hangs my
> kernel. Any ideas what's wrong? The values in r6 and r5 seem to match
> what I expect, but when I do the lbzx it dies.
I don't know for sure, maybe you MMU context is wrong at the time ?
(Assuming a 32 bits kernel, a 64 bits kernel need more instructions
to load the address)
How do you know it dies there and not elsewhere ?
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: help with asm code?
2004-04-21 0:17 ` help with asm code? Benjamin Herrenschmidt
@ 2004-04-21 14:00 ` Chris Friesen
2004-04-21 23:02 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Chris Friesen @ 2004-04-21 14:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
Benjamin Herrenschmidt wrote:
>> lis r5,hrt_ak_offsets@ha
>> addi r5,r5,hrt_ak_offsets@l
>> lbzx r6,r6,r5
>> add r10,r4,r6
>>
>>
>>I'm having a small problem, in that when I run this code it hangs my
>>kernel. Any ideas what's wrong? The values in r6 and r5 seem to match
>>what I expect, but when I do the lbzx it dies.
>
>
> I don't know for sure, maybe you MMU context is wrong at the time ?
The code is being called from fast_exception_return, syscall_exit_cont,
and restore_user.
> How do you know it dies there and not elsewhere ?
If I remove the lbzx/add lines, everything works fine. With the lbzx
line it dies, even if r10 is overwritten right away.
Chris
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: help with asm code?
2004-04-21 14:00 ` Chris Friesen
@ 2004-04-21 23:02 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2004-04-21 23:02 UTC (permalink / raw)
To: Chris Friesen; +Cc: linuxppc-dev list
> The code is being called from fast_exception_return, syscall_exit_cont,
> and restore_user.
>
> > How do you know it dies there and not elsewhere ?
>
> If I remove the lbzx/add lines, everything works fine. With the lbzx
> line it dies, even if r10 is overwritten right away.
You'd have to send me the whole exception code path so I can figure
out what's up
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-04-21 23:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-20 15:56 asm code Chris Friesen
2004-04-21 0:17 ` help with asm code? Benjamin Herrenschmidt
2004-04-21 14:00 ` Chris Friesen
2004-04-21 23:02 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).