%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

uC/OS port to
    The Mitsubishi M16C microcontroller family

Port made using
    uC/OS version           1.09
    Compiler                iccm16c  (IAR M16C C-Compiler V1.01B/386)
    Assembler               am16c    (IAR M16C Assembler V1.00D/DOS)

Ported by
    Fredrik Dessen          fd@isp.no
    ISP AS
    Pirsenteret
    N-7005 Trondheim
    Norway

Date
    6 June 1998


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In this port the three files

    m16c.h
    m16c_a.s34
    m16c_c.c
    
respectively replace the microprocessor-specific files 80186s.h,
80186s_a.asm and 80186s_c.c of

    Jean J. Labrosse, 1992. uC/OS The Real-Time Kernel
    

To keep this a clean port, only the interrupt stack pointer of
the M16C is in use. For this reason, remove the following two
lines from file cstartup.s34, which IAR supplies...

    fset    u                       ; select user stack
    ldc     #sfe(CSTACK),sp         ; set up C stack

These are part of the "init_C" procedure and would have
enabled the user stack.

I am planning to take a closer look at the possibility of making
use of both the user and the interrupt stack pointer, and at the
same time make use of the alternate register set. This will probably
reduce latency, and certainly reduce the stack space required.
From what I can see, it cannot be done while keeping the port
by-the-book. I hope somebody can prove me wrong.


Just before submitting this, I added 3 lines of code to m16c_c.c,
according to Release note 4 of uC/OS version 1.11. This fix has
not been tested. With or without it, I assume that my port works
with v1.11 as it did with v1.09.


