On 04/16/2014 12:43 PM, Stefan Kristiansson wrote:
>
> Since this is Non-Linux specific, could you use r10 that is pinned
> down as the thread_info pointer in Linux.
> (we should really document this as our ABI and call it something in
> line with "reserverd for kernel/OS use").
>
> Stefan
Unfortunately not:

1. I need to calculate pointers to the exception stack. In the following
example exception stack is an array of pointers (but calculating the
actual position also requires more than one register for
shifting/multiplying and subtracting):

l.movhi rx,hi(exception_stack)
l.ori rx,rx,lo(exception_stack)
l.mfspr ry,r0,SPR_COREID
l.slli ry,ry,2
l.add rx,rx,rx
l.lwz ry,0(rx)
l.sw 0(ry),r1
l.or r1, r0, ry

2. I hope that we will also port Linux than to support multiple cores.
What is the purpose of the thread_info pointer? I think we have
something similar in our runtime system:

struct tcb *core_current_thread; // <- one for each core, currently
scheduled thread

And then we use this in the exceptions (when everything is save to store
the context etc.) similar to the stack stuff above.

From the kernel code
(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/head.S?id=refs/tags/v3.15-rc1)
I see that exactly the EXCEPTION_T_STORE_GPRx macros require a private
scratch pad or need a extra registers for this.

Bye,
Stefan

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to