[uClinux-dev] Still: kernel and thumb code

Thierry Durand tdurand at atmel.fr
Tue Nov 6 03:09:12 EST 2001

Erwin Authried a écrit :
> Thierry Durand[SMTP:tdurand at atmel.fr] wrote:
> > Adrian,
> >
> > I have worked on the kernel in thumb some time ago. My intent was to get
> > a full thumb code (kernel + libs + apps). Most of the work was not
> > really in the syscalls which can be easily used in thumb since there are
> > less than 256 of them and the thumb swi can still be used. The big part
> > was the port of many small bits of asm code using arm-only instructions.
> > Most of them are macros defined in include/asm.
> > Instead of porting each and every bit using arm-only into similar thumb
> > code I have created a new swi code (not used by the syscalls) to emulate
> > arm instructions in an exception routine. The instruction to be emulated
> > was stored in a register prior to the swi ARM_EMULATE call. This was not
> > done in the same file as the syscalls to avoid confusions between a
> > normal syscall and the arm emulation. It is true that there is a small
> > overhead in doing so (more instructions, but they are 16-bit instead of
> > 32). An advantage is that it still works in arm.
> >
> > I have not tried interworking. My conception is that you are almost
> > always in one of the two following situations:
> > - your priority is system performance. You use 32-bit memories and code
> > everything in arm to take advantage of performance.
> > - your priority is system cost. You use 16-bit memories and code
> > everything (except startup and exceptions entry) in thumb to take
> > advantage of compactness.
> > As you can see there is few room for interworking. But I understand that
> > specific situations may require it (e.g. processors with a 16-bit bus
> > interface, but some amount of internal 32-bit memory).
> > A common compromise today is to use 16-bit memories together with arm
> > code leading to a dramatic 50% drop in system performance. The existence
> > of a thumb linux would be really a great thing.
> >
> > Please comment !
> > --
> > Thierry-
> >
> That sounds pretty interesting, especially with Atmel's AT91 that has only
> a 16-bit interface. I have not yet thought about using thumb mode, but I have
> experimented with moving parts of the code into the internal 32-bit RAM. If you
> do that for the i/o instructions, for example, there is a huge performance win.
> It can be done in the same way as the init functions are moved into a special
> segment. Is the work that you have done available for review?

Unfortunately it's not. However, if there is a volunteer out there to
coordinate the effort I can give a hand.
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/

More information about the uClinux-dev mailing list