From 0dd1bd2ad01ddbfd12d3d74ad9b79750af40d690 Mon Sep 17 00:00:00 2001 From: nakasima Date: Tue, 6 Jan 2009 12:02:19 +0000 Subject: [PATCH] =?UTF-8?q?thread=E3=83=87=E3=83=A2=E3=81=AEosSleep?= =?UTF-8?q?=E6=99=82=E9=96=93=E8=A1=A8=E7=A4=BA=E3=80=82=20MG20EMU?= =?UTF-8?q?=E3=81=A7=E3=81=AFCPU=E3=82=AF=E3=83=AD=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=92302MH=EF=BD=9A=E3=81=AB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@156 b871894f-2f95-9b40-918c-086798483c85 --- trunk/bootrom/build/bootrom/thread/ARM11/main.c | 8 +++++++- trunk/bootrom/build/libraries/os/common/os_timer.c | 8 ++++---- trunk/bootrom/include/brom/os/common/tick.h | 2 +- trunk/bootrom/include/brom/os/common/timer.h | 8 ++++---- trunk/include/ctr/hw/ARM11/arm11_reg.h | 4 ++++ 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/trunk/bootrom/build/bootrom/thread/ARM11/main.c b/trunk/bootrom/build/bootrom/thread/ARM11/main.c index 8aad0b0..22c97b0 100644 --- a/trunk/bootrom/build/bootrom/thread/ARM11/main.c +++ b/trunk/bootrom/build/bootrom/thread/ARM11/main.c @@ -26,7 +26,13 @@ void BromMain( void ) osInitThread(); while (1) { - osSleep(1); + OSTick tick = osGetTick(); + u32 mon = osGetPerfMonitor(OS_MONITOR_1); + osSleep(1000); + mon = osGetPerfMonitor(OS_MONITOR_1) - mon; + tick = osGetTick() - tick; + osTPrintf( "sleep mon = %llu msec\n", OS_TICK_TO_MSEC(mon)); // MG20ではパフォーマンスモニタのクロックが違う + osTPrintf( "sleep tick = %llu msec\n", OS_TICK_TO_MSEC(tick)); } } diff --git a/trunk/bootrom/build/libraries/os/common/os_timer.c b/trunk/bootrom/build/libraries/os/common/os_timer.c index a6a037e..fe26202 100644 --- a/trunk/bootrom/build/libraries/os/common/os_timer.c +++ b/trunk/bootrom/build/libraries/os/common/os_timer.c @@ -307,7 +307,7 @@ void osStopTimer64( void ) #ifdef SDK_ARM11 #include /*---------------------------------------------------------------------------* - Name: osGetPerformanceMonitor + Name: osGetPerfMonitor Description: Get Performance Monitor @@ -315,7 +315,7 @@ void osStopTimer64( void ) Returns: count *---------------------------------------------------------------------------*/ -ASM u32 osGetPerformanceMonitor( OSMoniter mon ) +ASM u32 osGetPerfMonitor( OSMoniter mon ) { cmp r0, #__cpp(OS_MONITOR_1) beq FSYM(1) @@ -333,7 +333,7 @@ LSYM(3) } /*---------------------------------------------------------------------------* - Name: osSetPerformanceMonitor + Name: osSetPerfMonitor Description: Set Performance Monitor @@ -342,7 +342,7 @@ LSYM(3) Returns: previous count *---------------------------------------------------------------------------*/ -ASM u32 osSetPerformanceMonitor( OSMoniter mon, u32 count ) +ASM u32 osSetPerfMonitor( OSMoniter mon, u32 count ) { cmp r0, #__cpp(OS_MONITOR_1) beq FSYM(1) diff --git a/trunk/bootrom/include/brom/os/common/tick.h b/trunk/bootrom/include/brom/os/common/tick.h index fa1747f..0149ac3 100644 --- a/trunk/bootrom/include/brom/os/common/tick.h +++ b/trunk/bootrom/include/brom/os/common/tick.h @@ -53,7 +53,7 @@ extern void i_osSetTick( u64 ); #ifdef SDK_ARM11 #define OS_TICK_CLOCK HW_CPU_CLOCK #define OS_TICK_PRESCALE 1 -#define OS_TICK_HI_SHIFT 24 // 2の累乗単位でチック管理するのであれば32は指定できない(ロード値0では割り込みが発生しないため) +#define OS_TICK_HI_SHIFT 24 // 2の累乗単位でチック管理するのであれば32は指定できない(ロード値0では割り込みが発生しないため。最大31) #define OS_TICK_HI_LSB (1ULL<>1)) diff --git a/trunk/bootrom/include/brom/os/common/timer.h b/trunk/bootrom/include/brom/os/common/timer.h index 7146db6..0678d99 100644 --- a/trunk/bootrom/include/brom/os/common/timer.h +++ b/trunk/bootrom/include/brom/os/common/timer.h @@ -267,7 +267,7 @@ void osStopTimer64( void ); #ifdef SDK_ARM11 /*---------------------------------------------------------------------------* - Name: osGetPerformanceMonitor + Name: osGetPerfMonitor Description: Get Performance Monitor @@ -275,10 +275,10 @@ void osStopTimer64( void ); Returns: count *---------------------------------------------------------------------------*/ -u32 osGetPerformanceMonitor( OSMoniter id ); +u32 osGetPerfMonitor( OSMoniter id ); /*---------------------------------------------------------------------------* - Name: osSetPerformanceMonitor + Name: osSetPerfMonitor Description: Set Performance Monitor @@ -287,7 +287,7 @@ u32 osGetPerformanceMonitor( OSMoniter id ); Returns: previous count *---------------------------------------------------------------------------*/ -u32 osSetPerformanceMonitor( OSMoniter id, u32 count ); +u32 osSetPerfMonitor( OSMoniter id, u32 count ); /*---------------------------------------------------------------------------* Name: osIsEnableTimerReload diff --git a/trunk/include/ctr/hw/ARM11/arm11_reg.h b/trunk/include/ctr/hw/ARM11/arm11_reg.h index 782eb6b..caa460d 100644 --- a/trunk/include/ctr/hw/ARM11/arm11_reg.h +++ b/trunk/include/ctr/hw/ARM11/arm11_reg.h @@ -26,7 +26,11 @@ extern "C" { #endif +#ifndef SDK_MG20EMU #define HW_CPU_CLOCK_ARM11 (67027964 * 4) +#else // SDK_MG20EMU +#define HW_CPU_CLOCK_ARM11 (302 * 1024 * 1024) +#endif // SDK_MG20EMU #define HW_CPU_CLOCK HW_CPU_CLOCK_ARM11 #ifndef SDK_MG20EMU