diff options
| author | dzzxzz <[email protected]> | 2011-02-16 13:29:09 +0000 |
|---|---|---|
| committer | dzzxzz <[email protected]> | 2011-02-16 13:29:09 +0000 |
| commit | 29db3e32951945a0cca21f4a188092fca59c5e53 (patch) | |
| tree | c5a05852633c948d2a0a41f4b1ebf875c5d08f2d /libcpu/m16c/stack.c | |
| parent | efc32994d4a3de61da953542c6dc9aa9115c01a5 (diff) | |
get ready for SCONS
change the m16c assembly extension from s34 to asm
move the m16c porting files to m16c62p directory
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1270 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'libcpu/m16c/stack.c')
| -rw-r--r-- | libcpu/m16c/stack.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/libcpu/m16c/stack.c b/libcpu/m16c/stack.c deleted file mode 100644 index ae6bc8aa40..0000000000 --- a/libcpu/m16c/stack.c +++ /dev/null @@ -1,59 +0,0 @@ -/*
- * File : stack.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2009, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2010-04-09 fify the first version
- *
- * For : Renesas M16C
- * Toolchain : IAR's EW for M16C v3.401
-*/
-
-#include <rtthread.h>
-
-/**
- * This function will initialize thread stack
- *
- * @param tentry the entry of thread
- * @param parameter the parameter of entry
- * @param stack_addr the beginning stack address
- * @param texit the function will be called when thread exit
- *
- * @return stack address
- */
-rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
- rt_uint8_t *stack_addr, void *texit)
-{
- rt_uint16_t *pstk16;
- rt_uint16_t flag;
-
-
- flag = 0x0040;
- pstk16 = (rt_uint16_t *)stack_addr;
- pstk16--;
-
- /* Simulate ISR entry */
- *pstk16-- = (flag & 0x00FF) /* ... The lowest byte of the FLAG register */
- | (((rt_uint32_t)tentry >> 8) & 0x00000F00) /* ... The highest nibble of the PC register */
- | ((flag << 4) & 0xF000); /* ... The highest nibble of the FLAG register */
- *pstk16-- = (((rt_uint32_t)tentry ) & 0x0000FFFF); /* ... The lowest bytes of the PC register */
-
- /* Save registers onto stack frame */
- *pstk16-- = (rt_uint16_t)0xFBFB; /* ... FB register */
- *pstk16-- = (rt_uint16_t)0x3B3B; /* ... SB register */
- *pstk16-- = (rt_uint16_t)0xA1A1; /* ... A1 register */
- *pstk16-- = (rt_uint16_t)0xA0A0; /* ... A0 register */
- *pstk16-- = (rt_uint16_t)0x3333; /* ... R3 register */
- *pstk16-- = (rt_uint32_t)parameter >> 16L; /* ... Pass argument in R2 register */
- *pstk16-- = (rt_uint32_t)parameter & 0x0000FFFFL; /* ... Pass argument in R1 register */
- *pstk16 = (rt_uint16_t)0x0000; /* ... R0 register */
-
- /* return task's current stack address */
- return (rt_uint8_t *)pstk16;
-}
|
