OSDN Git Service

debug cortex-m3 cre_ctx
authorryuz <ryuz@users.sourceforge.jp>
Wed, 23 Mar 2011 15:46:25 +0000 (00:46 +0900)
committerryuz <ryuz@users.sourceforge.jp>
Wed, 23 Mar 2011 15:46:25 +0000 (00:46 +0900)
kernel/source/arch/proc/arm/arm_v7m/gcc/kcre_ctx.S
sample/arm/stm32f103/uart.c

index cd41ea7..95df685 100644 (file)
@@ -1,4 +1,4 @@
-/** 
+/**
  *  Hyper Operating System V4 Advance
  *
  * Copyright (C) 1998-2011 by Project HOS
@@ -29,9 +29,9 @@ _kernel_cre_ctx:
                                str             r3, [r1, #4]                            /* r5 部分にpar1を設定 */
                                ldr             r2, [sp, #0]                            /* par2を取り出し */
                                str             r2, [r1, #8]                            /* r6 部分にpar2を設定 */
-                               movw    r2, #:lower16:ctx_entry
-                               movt    r2, #:upper16:ctx_entry
-                               str             r2, [r1, #32]                           /* lr 部分にエントリーアドレスを設定 */
+                               movw    r2, #:lower16:(ctx_entry+1)
+                               movt    r2, #:upper16:(ctx_entry+1)
+                               str             r2, [r1, #16]                           /* lr 部分にエントリーアドレスを設定 */
                                str             r1, [r0]                                        /* ctxcb に新 sp を保存 */
                                bx              lr                                                      /* リターン */
 
index 590774b..253df95 100644 (file)
@@ -4,46 +4,23 @@
  * @file  uart.c
  * @brief %jp{UARTへの出力}%en{UART device driver}
  *
- * Copyright (C) 1998-2006 by Project HOS
+ * Copyright (C) 1998-2011 by Project HOS
  * http://sourceforge.jp/projects/hos/
  */
 
 
 #include "kernel.h"
 
-#define PINSEL0                ((volatile UW *)0xe002c000)
-
-#define U0RBR          ((volatile UB *)0xe000c000)
-#define U0THR          ((volatile UB *)0xe000c000)
-#define U0LCR          ((volatile UB *)0xe000c00c)
-#define U0LSR          ((volatile UB *)0xe000c014)
-#define U0DLL          ((volatile UB *)0xe000c000)
-#define U0DLM          ((volatile UB *)0xe000c004)
-
-
-#define VPB_CLK                (14700000/4)
-#define UART_BPS       38400
-
 
 /* %jp{UARTの初期化} */
 void Uart_Initialize(void)
 {
-       *PINSEL0 = (*PINSEL0 & 0xfffffff0) | 0x05;
-
-       *U0LCR = 0x80;
-       *U0DLL = (VPB_CLK / 16.0) / UART_BPS + 0.5;
-       *U0DLM = 0x00;
-       *U0LCR = 0x03;
 }
 
 
 /* %jp{1文字出力} */
 void Uart_PutChar(int c)
 {
-       while ( !(*U0LSR & 0x20) )
-               ;
-
-       *U0THR = c;
 }
 
 
@@ -83,6 +60,7 @@ void Uart_PutHexByte(char c)
        Uart_PutChar(Uart_hex2asc((c >> 0) & 0xf));
 }
 
+
 void Uart_PutHexWord(int i)
 {
        Uart_PutHexByte((i >> 8) & 0xff);