summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ti/framework/dce/dce.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/src/ti/framework/dce/dce.c b/src/ti/framework/dce/dce.c
index 875b33e..957bf69 100644
--- a/src/ti/framework/dce/dce.c
+++ b/src/ti/framework/dce/dce.c
@@ -60,6 +60,7 @@
60#include <xdc/runtime/IHeap.h> 60#include <xdc/runtime/IHeap.h>
61#include <xdc/runtime/knl/Thread.h> 61#include <xdc/runtime/knl/Thread.h>
62#include <xdc/std.h> 62#include <xdc/std.h>
63#include <ti/sysbios/utils/Load.h>
63 64
64#include "dce_priv.h" 65#include "dce_priv.h"
65#include "dce_rpc.h" 66#include "dce_rpc.h"
@@ -98,6 +99,7 @@ typedef void (*DeleteFxn)(void *);
98/* DCE Server static function declarations */ 99/* DCE Server static function declarations */
99static Int32 engine_open(UInt32 size, UInt32 *data); 100static Int32 engine_open(UInt32 size, UInt32 *data);
100static Int32 engine_close(UInt32 size, UInt32 *data); 101static Int32 engine_close(UInt32 size, UInt32 *data);
102static Int32 get_rproc_info(UInt32 size, UInt32 *data);
101 103
102/* VIDDEC2 Decoder Server static function declarations */ 104/* VIDDEC2 Decoder Server static function declarations */
103static VIDDEC2_Handle viddec2_create(Engine_Handle engine, String name, VIDDEC2_Params *params); 105static VIDDEC2_Handle viddec2_create(Engine_Handle engine, String name, VIDDEC2_Params *params);
@@ -400,6 +402,42 @@ static Int32 engine_close(UInt32 size, UInt32 *data)
400 return (0); 402 return (0);
401} 403}
402 404
405#define INFO_TYPE_CPU_LOAD 0
406#define INFO_TYPE_TOTAL_HEAP_SIZE 1
407#define INFO_TYPE_AVAILABLE_HEAP_SIZE 2
408
409static Int32 get_rproc_info(UInt32 size, UInt32 *data)
410{
411 MmType_Param *payload = (MmType_Param *)data;
412 Uint32 info_type = (Uint32)payload[0].data;
413 Uint32 output = 0;
414 Memory_Stats stats;
415
416 switch(info_type)
417 {
418 case INFO_TYPE_CPU_LOAD:
419 output = Load_getCPULoad();
420 break;
421
422 case INFO_TYPE_TOTAL_HEAP_SIZE:
423 Memory_getStats(NULL, &stats);
424 output = stats.totalSize;
425 break;
426
427 case INFO_TYPE_AVAILABLE_HEAP_SIZE:
428 Memory_getStats(NULL, &stats);
429 output = stats.totalFreeSize;
430 break;
431
432 default:
433 System_printf("\n ERROR: Invalid INFO TYPE chosen \n");
434 break;
435 }
436
437 return output;
438}
439
440
403/* 441/*
404 * codec_create 442 * codec_create
405 */ 443 */
@@ -699,7 +737,8 @@ static RcmServer_FxnDesc DCEServerFxnAry[] =
699 { "codec_control", (RcmServer_MsgFxn) codec_control }, 737 { "codec_control", (RcmServer_MsgFxn) codec_control },
700 { "codec_get_version", (RcmServer_MsgFxn) codec_get_version }, 738 { "codec_get_version", (RcmServer_MsgFxn) codec_get_version },
701 { "codec_process", (RcmServer_MsgFxn) codec_process }, 739 { "codec_process", (RcmServer_MsgFxn) codec_process },
702 { "codec_delete", (RcmServer_MsgFxn) codec_delete } 740 { "codec_delete", (RcmServer_MsgFxn) codec_delete },
741 { "get_rproc_info", (RcmServer_MsgFxn) get_rproc_info }
703}; 742};
704 743
705/* DCE Server skel function table */ 744/* DCE Server skel function table */
@@ -767,7 +806,12 @@ static MmType_FxnSig DCEServer_sigAry[] =
767 { MmType_Dir_Out, MmType_Param_S32, 1 }, // return 806 { MmType_Dir_Out, MmType_Param_S32, 1 }, // return
768 { MmType_Dir_In, MmType_Param_U32, 1 }, 807 { MmType_Dir_In, MmType_Param_U32, 1 },
769 { MmType_Dir_In, MmType_Param_U32, 1 } 808 { MmType_Dir_In, MmType_Param_U32, 1 }
770 } } 809 } },
810 { "get_rproc_info", 2,
811 {
812 { MmType_Dir_Out, MmType_Param_S32, 1 }, // return
813 { MmType_Dir_In, MmType_Param_U32, 1 }
814 } }
771}; 815};
772 816
773static MmType_FxnSigTab dce_fxnSigTab = 817static MmType_FxnSigTab dce_fxnSigTab =