[ECOS] PCI Address Mapping

Robert Cragie rcc@jennic.com
Tue Jan 22 04:02:00 GMT 2002

> The PC is somewhat rare in that the mapping between the PCI address
> space and the CPU physical address space is 1-1 and not windowed. This
> means that you can give a PCI device any address in memory, and it can
> access that memory directly. Any peculiarities you may see in the
> i82559 driver are there to cope with targets where this is not the
> case. So, your assumptions above are largely true.
> One important point to make, however, is that device drivers should
> not use malloc(). If you look at the i82559 you will see that it has a
> memory region reserved for it in the .ldi file and uses that for
> allocating buffers.

As the earlier correspondent noticed, all of __pci_window is used by the
i82559 driver, and the allocator for this window is wholly contained inside
the driver. What is the preferred method of adding another section? Can this
be done via the configuration file for the target build? I don't
particularly want to have to hack the mlt_i386_pc_xxx.ldi/.h files in the
repository. Perhaps it would be an idea to start to split out the PCI window
allocator as already suggested after all, but I can imagine this would be
quite a lot of work.

Would using malloc() work in this case? I can't see any reasons why it
shouldn't, i.e. are you saying it shouldn't be used purely because it would
limit the portability of the driver or because it's generally not a good
idea to mix application and driver heap usage etc.?

Robert Cragie, Design Engineer

Direct: +44 (0) 114 281 4512
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
www.jennic.com  Tel: +44 (0) 114 281 2655

More information about the Ecos-discuss mailing list