[Linux-Xtensa] Re: Audio Driver - applied your git patch, I'm looking into buildingyourconfig on an LX200...

Piet Delaney pdelaney at tensilica.com
Fri Sep 17 15:35:59 PDT 2010

Marc Gauthier wrote:
> linux-xtensa-bounces at linux-xtensa.org wrote:
>> Marc was wondering about were we stand with the current
>> code with the kernel setting CPENABLE on the first usage
>> and it being associate with the task. If you access the
> I'm not wondering, IMO the current code's broken  ;-)
> Having the kernel access an I/O port should not imply the
> user task can do so as well.  Even more true of interrupt
> handlers, which have no relation to the currently running
> task.

I worked out the remaining bits of the solution I mentioned
last evening after I got home as was roasting my knee. It's
only about 20 more lines of asm code to support kernel and
user contexts. It corrects both of your concerns and provides
kernel support for TIE registers.

Entry.S changes the CPENABLE to the current task's copy
on entry and restores the CPENABLE to the users version
on return to user space. On entry to fast_coprocessor.S
we have the new context, kernel/use. We save the current
registers in the old context, likely a bit field like
CPENABLE in task. We restore the registers for the new
context (kernel/user) for the current task. Makes the
lazy coprocessor save available for kernel and user,
as well as I/O ports. It's a piece of cake.


> -Marc
> PS.  I/O ports and SMP is a whole other topic.  I/O port
> X on processor A is a different port than X on processor B;
> they may or may not be connected symmetrically, depending
> on system design.  There may or may not be such a thing
> as migration, depending on the I/O port.  So, don't worry
> about SMP + I/O ports, best to see how actual usage drives it.

More information about the linux-xtensa mailing list