[ECOS] Scheduler Lock without Kernel

Daniel Helgason dhelgason@shaw.ca
Tue Mar 1 16:42:00 GMT 2011


On Tue, 2011-03-01 at 13:25 +0100, Martin Laabs wrote:
> Hi,
> 
> I currently improve the Ethernet driver for the at91sam9 family of CPUs. 
> However - Since this CPU has a cache and is using DMA for data exchange 
> with the MAC I have to lock the scheduler while manipulating these memory 
> structures. (This is to ensure, that the cache is coherent while doing this 
> manipulations)
> Since the code should run with the kernel as well without it I'd like to 
> know whether it's save to call the cyg_scheduler_lock without being in 
> kernel mode.
> But I fear I have to write a macro that distinguish between "with kernel" 
> and "hal only". Am I right? Which symbol is best to distinguish between 
> thees two possibilities?
> ...

Martin!

Attached is my work-in-progress on a AT91 ethernet driver. It works well
with the AT91SAM9 devices, both with a eCos kernel and with Redboot. It
needs the MMU to create a shadow of RAM that is uncached. Anyway, there
might be something useful here for you. There are some private changes
marked "Exegin" that you can remove.

-- 
+------------------------------------
| Daniel Helgason <dhelgason@shaw.ca>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: if_at91.c
Type: text/x-csrc
Size: 40185 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20110301/2d52871e/attachment.bin>
-------------- next part --------------
-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


More information about the Ecos-discuss mailing list