/*
 *  Copyright 2001-2008 Texas Instruments - http://www.ti.com/
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
 
/*
 * Qosti.h
 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
 */


#ifndef _RQOSTI_H
#define _RQOSTI_H
#include <dbapi.h>
#include <qosti_dspdecl.h>
#include <stdio.h>
/* This must match QOS_TI_GetMemStatArg1::ALLHEAPS */
#define KAllHeaps 0x100
/* This must match QOS_TI_GetSharedScratchMsgArg2::ALL_SCRATCHGROUPS */
#define KAllScratchGroups 0
/*
 *  ======== QOS_TI_GetDynLoaderMemStatArg1 ========
 *  The enumeration defines the memory heap resources available for querying.
 */
typedef enum QOS_TI_GetDynLoaderMemStatArg1 {
	EDynloadDaram = 0,
	EDynloadSaram = 1,
	EDynloadExternal = 2,
	EDynloadSram = 3
} QOS_TI_GetDynLoaderMemStatArg1;

/*
 *  ======== QOS_TI_GetSharedScratchMsgArg1 ========
 *  The enumeration defines the control command selector for *arg1*
 *  of the QOS_TI_GETSHAREDSCRATCH message.
 */
typedef enum QOS_TI_GetSharedScratchMsgArg1 {

	ESharedScratchAllHeaps,

	ESharedScratchDaram,

	ESharedScratchSaram
} QOS_TI_GetSharedScratchMsgArg1;

void DbgMsg(DWORD dwZone, char *szFormat, ...);

/*  ============================================================================
  func   MsgToDsp
  desc   Send Message to DSP
  ret    DSP_SOK if Message was transferred to DSP successfully.
 ============================================================================*/

DSP_STATUS QosTI_DspMsg(DWORD dwCmd, DWORD dwArg1, DWORD dwArg2, DWORD *dwOut1,
																DWORD *dwOut2);

/*  ========================================================================
  func   Create
  desc   Create the Qos service.
  ret    DSP_SOK if successfully created.
  ========================================================================*/

DSP_STATUS QosTI_Create();

/* ========================================================================
  func   Delete
  desc   Delete Qos service.
  ========================================================================*/

void QosTI_Delete();

/*  ========================================================================
  func   GetDynLoaderMemStat
  desc   Get the current memory utilization for heaps used in dynamic loading.
  arg   IN heapDesc:  value in range 0..4 => Heap Identifier
                  Valid values:
                        EDynloadDaram    = DYN_DARAM heap (internal)
                        EDynloadSaram    = DYN_SARAM heap (internal)
                        EDynloadExternal = DYN_EXTERNAL heap (external)
                        EDynloadSram     = DYN_SRAM heap (internal)
  arg   OUT memInitSize:             initially configured size of heap
  arg   OUT memUsed:                 size of heap in use (not free)
  arg   OUT memLargestFreeBlockSize: size of largest contiguous free memory
  arg   OUT memFreeBlocks:           number of free blocks in heap
  arg   OUT memAllocBlocks:          number of allocated blocks in heap
  ret   DSP_SOK if successful.
  ========================================================================*/

DSP_STATUS QosTI_GetDynLoaderMemStat(UINT heapDesc, UINT *memInitSize, 
								UINT *memUsed, UINT *memLargestFreeBlockSize,
								UINT *memFreeBlocks, UINT *memAllocBlocks);

#endif				/* _RQOSTI_H*/