-------- Original Message --------
Subject: Re: PATCH: Fusion PPC thread switching
Date: Sun, 20 Mar 2005 23:02:28 +0100
From: Philippe Gerum <[EMAIL PROTECTED]>
Organization: Xenomai
To: Heikki Lindholm <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

Heikki Lindholm wrote:
Philippe Gerum kirjoitti:

Heikki Lindholm wrote:

Hello,
There is a problem in Fusion (PPC) that enabling ALTIVEC triggers. The problem is that fusion uses _switch from Linux, which expects to have "current" task (r2) in valid state. If I'm not horribly mistaken --- also an option, I know next to nothing about Fusion --- "current" is not valid when in other domains than root(=Linux). The attached patch should fix the problem.



Ah. Ok, I definitely thought that r2 would not be altered while switching domains. I'm going to test this patch asap (likely tomorrow) and let you know of the outcome here. Thanks.


I didn't care trace exactly where r2 gets toasted, I'd guess the first domain switch. I thought of this more generally: in a domain other than Linux, r2 could be anything, so don't trust it there. One could, of course, copy _switch function over to fusion and take out r2 references, but that doesn't seem like worth the effort.

Ack. Seeing r2 set in _switch for the incoming thread made me think that
unless somebody trashes it, it should always point to "current" as Linux
defined it, but I was wrong. Indeed, assuming that no code from non-root
domains would reuse r2 for its own purpose sounds rather optimistic to
me now...


-- Heikki Lindholm


--

Philippe.


--

Philippe.

Reply via email to