mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
threadデモのosSleep時間表示。
MG20EMUではCPUクロックを302MHzに。 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@156 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
parent
ce723f55c9
commit
0dd1bd2ad0
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -307,7 +307,7 @@ void osStopTimer64( void )
|
||||
#ifdef SDK_ARM11
|
||||
#include <brom/code32.h>
|
||||
/*---------------------------------------------------------------------------*
|
||||
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)
|
||||
|
||||
@ -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<<OS_TICK_HI_SHIFT)
|
||||
#define OS_TICK_LO_MASK ((u32)(OS_TICK_HI_LSB-1))
|
||||
#define OS_TICK_LO_MSB ((u32)(OS_TICK_HI_LSB>>1))
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user