access memory mapped registers

Kenneth Johansson ken at kieraypc01.tn.sw.ericsson.se
Tue Jan 14 02:14:27 EST 2003


On Fri, 2003-01-10 at 01:46, Muaddi, Cecilia wrote:
>
> I can see if I mmap the internal 860 CPU registers, and screw up that, I
> will
> definitely screw up the system, and require it to be reboot.  BUt if the
> hardware we are mapping is outside the CPU internal memory and outside the
> RAM,
> shouldn't the failure be limited to the user application only then?
>
> for example, an ethernet switch chip in a layer 2 router is controlled
> by the PPC 860.  THe 860 is only used for configuration (not in the
> datapath)
> if I mmap
> only the memory regions that is mapped to the ethernet switching chip,
> even if I screw up on the hardware setup, shouldn't my kernel still be
> protected?  At most, the application faults and I should be able to restart
> the application without rebooting the system?
>

Yes you are safe. There is nothing wrong with doing things in userspace
if you can. I have designed our system like this and have a very simple
IRQ driver that signals to userspace that an interrupt is pending to get
response time down and avoid polling but that is the only part I have in
the kernel.

The only reason to put anything into the kernel is speed and protection
so the first option should be to try to do it in userspace failing that
move it or parts to the kernel.


--
Kenneth Johansson
Ericsson AB                       Tel: +46 8 404 71 83
Tellusborgsvägen  94              Fax: +46 8 404 72 72
126 25 Stockholm                  ken at switchboard.ericsson.se


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list