From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugo 'NOx' Tyson To: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] ARM cpu modes Date: Wed, 05 Sep 2001 00:09:00 -0000 Message-ID: References: <852568B8.0037BA5A.00@kanmta01.software.mitel.com> X-SW-Source: 2001-09/msg00061.html Message-ID: <20010905000900.nx8pFX7WHYbCzIeewfaPc59bbvagTpMucwgrm_9V7h4@z> Colin_Helliwell@Mitel.COM writes: > Jesper said in a message yesterday that "[ARM] Application threads run in > supervisor mode in eCos". I've heard/seen it said somewhere that the ARM's > privileged Supervisor mode was intended for OS-type operations, whilst the > non-privileged User mode was intended for application-level code. I was curious > about the rationale behind the choice made in eCos, and whether it is felt that > there are actually any pros and/or cons of running application threads in > supervisor mode. Those distinctions are only pointful if you do stuff like memory protection (including of IO device) and therefore have a SWI interface to *all* system services. "Big" OS's with processes (=> memory protection and VM) would do this. "Small" OS's ie. eCos, with threads and one uniform memory space do not. eCos apps are fully linked, there is no SWI interface, and for performance reasons, we *want* appliction object files to contain "privilidged" operations from eCos macros or inline functions. Device driver code is not "special" in any way. For example, cache flushing or sync'ing is usually a coprocessor operation, which you can only do in a non-User mode. But it's only a couple of instructions, so there's no need to put in a clunking great function with mode changes surrounding it; just put it inline with the app code. So it all must run in Supervisor mode. Actually, we have considered moving to System mode (User mode reg set with SVC mode privilidges) but it's not available on all ARMs and there ain't much to gain... HTH, - Huge -- The 20th Century brought unprecedented increases in worldwide numeracy and literacy and incredible advances in technology, science and mathematics. It was also the only century in the past or in any reasonable predictable future apparently to contain only 99 years.