[En-Nut-Discussion] arm port (RFC: Changing ARM mode)

Rocendo Bracamontes del toro rocendob at gmail.com
Tue Jan 13 18:45:49 CET 2009


Hi,

If we take as an example the NutSleep, it does not execute machine specific
code, instead it relays in lower lever functions that talks to the specific
hardware or execute machine dependent instructions.

If we want to switch to a different execution mode, this is my initial
proposal:

.- Create a machine-dependent macro, this macro could be added just after
the calling to a kernel function from a user thread. for example:

  void NutSleep (uint32_t ms)
   {
       ENTRY_KERNEL_MODE(); // change mode to supervisor when applicable

      ..... code execute at kernel level here ....

       EXIT_KERNEL_MODE(); exit supervisor mode, enter user mode when
applicable
  }

 In case of avr-8bit, the ENTRY_KERNEL_MODE and EXIT_KERNEL_MODE would be
empty, since AVR-8 bit architecture does not support it, however they will
need to be defined somewhere in the AVR-8 bit files, otherwise there will be
compilation errors.

Also for ISR's, would be great if we enhance the IRQ_ENTRY and IRQ_EXIT to
swicth to "user mode", so all the ISR code will be execute under "user
mode",  this implies to initilize the user stack on the cstartup.

Let me know your thoughs?

Thanks
Rocendo


On Tue, Jan 13, 2009 at 9:28 AM, Harald Kipp <harald.kipp at egnite.de> wrote:

> Rocendo Bracamontes del toro wrote:
>
> >  we could plan to do so for a release after 4.8 ?
>
> Depends, please see my other post. We will definitely not release 4.8
> running in supervisor mode, whatever the final solution might be.
>
>
> >> Furthermore, will there be any influence on other platforms like the
> AVR?
> >   Currently working with Thiago, porting the AVR32.  On this architecture
> we
> > have similar needs as the ARM.  I do not think the 8-Bit AVR would
> require
> > this level of management, since it does not support multiple execution
> > modes.
>
> Ah, I see. So you are also interested in a soon release of 4.8. As soon
> as the branch had been created, we can move CVS HEAD to a subversion
> trunk and add your current AVR32 porting efforts, which will then
> hopefully attract more people.
>
> I do not think either, that the 8-bit AVR needs this level of
> management. My question was (or was intended to be): Would the code
> changes have any impact on the 8-bit AVR?
>
> Right now it works this way:
> 1. Application calls NutSleep()
> 2. Linker sees reference to NutSleep() and adds os/timer.o to the binary
> 3. Application calls NutSleep() like any other library function
>
> Where would be the optimal place to add the privileged mode switch?
>
> Harald
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



More information about the En-Nut-Discussion mailing list