Readme for ARM THUMB U/COS II port v2.03
----------------------------------
by Lee Dunbar



Background
----------
Do you want to get more performance out of your ARM7 processor and, at the
same time, save code space.  If you are using a 16-bit data base architecture,
you should be using THUMB mode.  It's great.

The roots of this port came from David Rushling's V1.00 port to the ARM7TDMI
for 32 bit mode.  Changes have been made to this port to make it support both
32 bit as well as 16 bit (THUMB) mode.

These changes are well tested using the Metaware tool chain.  You should
compile the "C" files with THUMB mode as the default.  The "S" assembly
files should be assembled with ARM mode as the default.


Introduction
------------
The extent of the changes to uCOS are in the platform specific area.
These include the following three files (and their header files):

os_arm.c 
	OSTaskStkInit()
		Stacks grow towards 0 in ARM architecture
		Assume each task starts in THUMB mode.  Though, during
		its execution, it can go between THUMB and ARM modes.
	OSIrqCtxSw()
		Sets flag to do context swap.  Actual context
		swap is deferred until scheduler runs (out of IRQ)
	OSIrqStart()
		Initial function called out of IRQ interrupt to
		register IRQ with OS.
	OSIrqFinish()
		Final function called out of IRQ interrupt to
		allow scheduler to run (if necessary).
	OSIrqTick()
		Scheduler tick function called out of IRQ interrupt
		at a periodic rate.  Nominal about 5/10 msec.


os_armaux.s
	OSIrqContextSwap()
		Context swap routine called out of interrupt (IRQ)
		mode to start highest priority task.
        OS_TASK_SW()
		Task switch routine called out of background (SVC)
		mode during normal operation to do context swap with
                highest priority task.
	OS_ENTER_CRITICAL()
		Method to disable interrupts
	OS_EXIT_CRITICAL()
		Method to enable interrupts
	OSStartHighRdy()
		This is how the first task gets started out of the
		scheduler.

irq.s
	irq()
		IRQ Interrupt handler that calls OSIrqStart() as well
		as OSIrqFinish() and OSIrqContextSwap().



Summary
-------
The port to the ARM THUMB mode has givin us a 30 percent increase in speed
(on a 16-bit data bus architecture) and has cut our code space down by
30 percent as well.  We have found it worth the investment.  Hopefully,
you will too.

Good luck.
