From 375b11c2faeaa4cad6b12d9428bb41ba5123af8d Mon Sep 17 00:00:00 2001 From: nakasima Date: Thu, 18 Dec 2008 11:32:09 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=91=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=A2=E3=83=8B=E3=82=BF=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=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@126 b871894f-2f95-9b40-918c-086798483c85 --- .../build/libraries/os/common/os_timer.c | 59 +++++++++++++++++++ trunk/bootrom/include/brom/os/common/timer.h | 33 +++++++++++ 2 files changed, 92 insertions(+) diff --git a/trunk/bootrom/build/libraries/os/common/os_timer.c b/trunk/bootrom/build/libraries/os/common/os_timer.c index 0e2daf7..a6a037e 100644 --- a/trunk/bootrom/build/libraries/os/common/os_timer.c +++ b/trunk/bootrom/build/libraries/os/common/os_timer.c @@ -305,6 +305,65 @@ void osStopTimer64( void ) #endif // SDK_ARM9 #ifdef SDK_ARM11 +#include +/*---------------------------------------------------------------------------* + Name: osGetPerformanceMonitor + + Description: Get Performance Monitor + + Arguments: monitorNum : monitorNo (0-2) + + Returns: count + *---------------------------------------------------------------------------*/ +ASM u32 osGetPerformanceMonitor( OSMoniter mon ) +{ + cmp r0, #__cpp(OS_MONITOR_1) + beq FSYM(1) + cmp r0, #__cpp(OS_MONITOR_2) + beq FSYM(2) + mrc p15, 0, r0, c15, c12, 1 + b FSYM(3) +LSYM(1) + mrc p15, 0, r0, c15, c12, 2 + b FSYM(3) +LSYM(2) + mrc p15, 0, r0, c15, c12, 3 +LSYM(3) + bx lr +} + +/*---------------------------------------------------------------------------* + Name: osSetPerformanceMonitor + + Description: Set Performance Monitor + + Arguments: monitorNum : monitorNo (0-2) + count + + Returns: previous count + *---------------------------------------------------------------------------*/ +ASM u32 osSetPerformanceMonitor( OSMoniter mon, u32 count ) +{ + cmp r0, #__cpp(OS_MONITOR_1) + beq FSYM(1) + cmp r0, #__cpp(OS_MONITOR_2) + beq FSYM(2) + mrc p15, 0, r0, c15, c12, 1 + mcr p15, 0, r1, c15, c12, 1 + b FSYM(3) +LSYM(1) + mrc p15, 0, r0, c15, c12, 1 + mcr p15, 0, r1, c15, c12, 1 + b FSYM(3) +LSYM(2) + mrc p15, 0, r0, c15, c12, 1 + mcr p15, 0, r1, c15, c12, 1 +LSYM(3) + bx lr +} + +#include + /*---------------------------------------------------------------------------* Name: osIsEnableTimerReload diff --git a/trunk/bootrom/include/brom/os/common/timer.h b/trunk/bootrom/include/brom/os/common/timer.h index 32bbcaf..aeaa8e3 100644 --- a/trunk/bootrom/include/brom/os/common/timer.h +++ b/trunk/bootrom/include/brom/os/common/timer.h @@ -54,6 +54,16 @@ typedef enum } OSTimer; +//---- monitor number +typedef enum +{ + OS_MONITOR_0 = 0, + OS_MONITOR_1 = 1, + OS_MONITOR_2 = 2, + OS_MONITOR_NUM +} +OSMoniter; + #else // SDK_ARM9 //---- control typedef u16 OSTimerControl; @@ -258,6 +268,29 @@ void osStopTimer64( void ); #endif // SDK_ARM9 #ifdef SDK_ARM11 +/*---------------------------------------------------------------------------* + Name: osGetPerformanceMonitor + + Description: Get Performance Monitor + + Arguments: monitorNum : monitorNo (0-2) + + Returns: count + *---------------------------------------------------------------------------*/ +u32 osGetPerformanceMonitor( OSMoniter id ); + +/*---------------------------------------------------------------------------* + Name: osSetPerformanceMonitor + + Description: Set Performance Monitor + + Arguments: monitorNum : monitorNo (0-2) + count + + Returns: previous count + *---------------------------------------------------------------------------*/ +u32 osSetPerformanceMonitor( OSMoniter id, u32 count ); + /*---------------------------------------------------------------------------* Name: osIsEnableTimerReload