OSDN Git Service

(none)
authorryuz <ryuz>
Wed, 31 Dec 2008 08:13:08 +0000 (08:13 +0000)
committerryuz <ryuz>
Wed, 31 Dec 2008 08:13:08 +0000 (08:13 +0000)
aplfw/sample/mips/jelly/boot.c
aplfw/sample/mips/jelly/gcc/gmake.mak
aplfw/sample/mips/jelly/ostimer.c
aplfw/sample/mips/jelly/system.cfg
aplfw/system/sysapi/systim_getsystemtime.c
kernel/source/arch/proc/mips/mips1/gcc/kexc_hdr.S
sample/mips/jelly/gcc/gmake.mak
sample/mips/jelly/main.c

index d9ab225..468aca2 100755 (executable)
 #include "application/example/hello/hello.h"
 #include "boot.h"
 #include "ostimer.h"
-#include "uart.h"
 
 
+#if 0
+
 long   g_SystemHeap[128 * 1024 / sizeof(long)];
+#define SYSTEM_HEAP_ADDR       ((void *)g_SystemHeap)
+#define SYSTEM_HEAP_SIZE       sizeof(g_SystemHeap)
+
+#else
+
+#define SYSTEM_HEAP_ADDR       ((void *)0x00200000)
+#define SYSTEM_HEAP_SIZE       0x00100000
+
+#endif
+
+
+extern SYSTIM_CPUTIME          SysTim_TimeCounter;             /* デフォルトのタイマカウンタ */
+
 
 
 int Boot_Process(VPARAM Param);
@@ -52,8 +66,8 @@ void Boot_Task(VP_INT exinf)
        
        /* システム初期化 */
        memset(&SysInf, 0, sizeof(SysInf));
-       SysInf.pSysMemBase     = g_SystemHeap;
-       SysInf.SysMemSize      = sizeof(g_SystemHeap);
+       SysInf.pSysMemBase     = SYSTEM_HEAP_ADDR;
+       SysInf.SysMemSize      = SYSTEM_HEAP_SIZE;
        SysInf.SysMemAlign     = 8;
        SysInf.pIoMemBase      = NULL;
        SysInf.SystemStackSize = 2048;
@@ -122,7 +136,6 @@ int Boot_Process(VPARAM Param)
        Command_AddCommand("hello",    Hello_Main);
        
        
-       
        /*************************/
        /*    起動メッセージ     */
        /*************************/
index 6457826..71d8cce 100755 (executable)
@@ -1,7 +1,7 @@
 # ----------------------------------------------------------------------------
 # Hyper Operating System V4 Advance
 #
-# Copyright (C) 1998-2007 by Project HOS
+# Copyright (C) 1998-2008 by Project HOS
 # http://sourceforge.jp/projects/hos/
 # ----------------------------------------------------------------------------
 
index 960a3e7..9fc0023 100755 (executable)
@@ -48,9 +48,26 @@ void OsTimer_Isr(VPARAM Param)
        SysInt_Clear(INTNO_TIMER0);
        
        /* %jp{タイムティック供給} */
-       SysTim_Signal(1000000); /* 1ms */
+       SysTim_Signal(1000000);         /* 1ms = 1,000,000 ns */
 }
 
 
+/** システム時刻をナノ秒に換算(システム用) */
+unsigned long SysTim_SysTimeToNanosecond(SYSTIM_SYSTIME SysTime)
+{
+       return (unsigned long)(SysTime % 1000000000);
+}
+
+/* システム時刻を秒に換算(システム用) */
+unsigned long  SysTim_SysTimeToSecond(SYSTIM_SYSTIME SysTime)
+{
+       return (unsigned long)(SysTime / 1000000000);
+}
+
+
+
+
+
 
 /* end of file */
+
index 26216d9..7650d00 100755 (executable)
@@ -10,7 +10,8 @@
 
 
 /* %jp{カーネル独自の設定}%en{kernel} */
-KERNEL_HEP_MEM(65536, NULL);
+/* KERNEL_HEP_MEM(65536, NULL); */
+KERNEL_HEP_MEM(0x100000, 0x100000);
 KERNEL_INT_STK(2048, NULL);
 KERNEL_SYS_STK(2048, NULL);
 KERNEL_MAX_TSKID(32);
index 1feda53..25cb69d 100755 (executable)
 /* システム時刻取得 */
 SYSTIM_SYSTIME SysTim_GetSystemTime(void)
 {
-/*
-       SYSTIM tim;
-       get_tim(&tim);  
-       return tim;
-*/
        return SysTim_TimeCounter;
 }
 
index ced2f5f..4803d5e 100755 (executable)
@@ -50,21 +50,43 @@ _kernel_exc_hdr:
                                mfc0    $10, $14                        /* EPC */ 
                                sw              $8, 72($sp)
                                sw              $9, 76($sp)
+                               la              $26, _kernel_ictxcb
+                               lbu             $27, 0($26)
                                sw              $10, 80($sp)
                                
-                               jal             _kernel_sta_inh         /* %jp{割込み開始処理} */
-                               sw              $10, 76($sp)
+                       /* %jp{多重割込み判定} */
+                               bne             $0, $27, multiple_int
+                               addiu   $27, 1
+                               sb              $27, 0($26)
+                               
+                       /* %jp{スタック入れ替え} */
+                               move    $27, $sp
+                               lw              $sp, 4($26)
+                               nop
+                               add             $sp, -4
+                               sw              $27, 0($sp)
                                
+                       /* %jp{割込み開始処理} */
+                               jal             _kernel_sta_inh
+                               sw              $10, 76($sp)
                                
+                       /* %jp{割込みハンドラ実行} */
                                la              $4, 0
-                               jal             _kernel_exe_inh         /* %jp{割込みハンドラ実行} */
+                               jal             _kernel_exe_inh
                                nop
                                
+                       /* %jp{スタック復帰} */
+                               lw              $sp, 0($sp)
+                               la              $26, _kernel_ictxcb
+                               sb              $0, 0($26)
+                               
                                
-                               jal             _kernel_end_inh         /* %jp{割込み終了処理} */
+                       /* %jp{割込み終了処理} */
+                               jal             _kernel_end_inh
                                nop
                                
                                
+ret_exc_hdr:
                                mfc0    $26, $12                        /* STATUS */ 
                                ori             $26, $26, 0x04
                                mtc0    $26, $12
@@ -95,6 +117,17 @@ _kernel_exc_hdr:
                                addiu   $sp, 84
                                jr              $26
                                rfe
+
+
+multiple_int:  
+                               sb              $27, 0($26)
+                               
+                       /* %jp{割込みハンドラ実行} */
+                               la              $4, 0
+                               jal             _kernel_exe_inh
+                               nop
+                               
+                               j               ret_exc_hdr
                                
                                
                                .end    _kernel_exc_hdr
index ff07510..8c5e339 100755 (executable)
@@ -107,6 +107,10 @@ CSRCS += ../ostimer.c
 .PHONY : all
 all: kernel_make makeexe_all $(TARGET_EXE) $(TARGET_MOT) $(TARGET_HEX) $(TARGET_BIN)
 
+.PHONY : run
+run: $(TARGET_BIN)
+       jelly_loader -r $(TARGET_BIN)
+
 # %jp{クリーン}%en{clean}
 .PHONY : clean
 clean: makeexe_clean
index be87588..57cd2b7 100755 (executable)
@@ -18,9 +18,6 @@
 /** %jp{メイン関数} */
 int main()
 {
-/*     Uart_PutString("---- start ----\r\n");  */
-       
-       
        /* %jp{カーネルの動作開始} */
        vsta_knl();