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