552 lines
26 KiB
C
Executable File
552 lines
26 KiB
C
Executable File
/* Copyright (c) 2003 - 2006 NVIDIA Corporation. All rights reserved.
|
|
*
|
|
* NVIDIA Corporation and its licensors retain all intellectual property
|
|
* and proprietary rights in and to this software, related documentation
|
|
* and any modifications thereto. Any use, reproduction, disclosure or
|
|
* distribution of this software and related documentation without an
|
|
* express license agreement from NVIDIA Corporation is strictly prohibited.
|
|
*/
|
|
|
|
/** @file GFRmOEM.h
|
|
|
|
GFSDK Resource Manager Platform (Public to OEM/System builders) header file.
|
|
*/
|
|
|
|
#ifndef __GFRMOEM_H__
|
|
#define __GFRMOEM_H__
|
|
|
|
#include "GF.h"
|
|
#include "GFRm.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif /* __cplusplus */
|
|
|
|
#define GF_HW_DRIVER 0
|
|
#define GF_NULL_DRIVER 1
|
|
|
|
#define GF_MAP_IO 0
|
|
#define GF_MAP_MEM 1
|
|
#define GF_MAP_EXTMEM 2
|
|
#define GF_MAP_MMIO 3
|
|
|
|
#define RM_ENV_INVALID_VOLTAGE 100000
|
|
|
|
#define RM_ENV_MAXLEN 128
|
|
|
|
/** RM SetupPlatform output variable structure. */
|
|
typedef struct _GFRMSETUPPLATFORM
|
|
{
|
|
void * pUserObject0; //Pointer to user specified object 0 to high layer function RmSetupPlatform
|
|
void * pUserObject1; //Pointer to user specified object 1 to high layer function RmSetupPlatform
|
|
NvU32 DriverType; //Driver type.
|
|
NvU32 cs_base_address; //cs base address.
|
|
}GFRMSETUPPLATFORM, *PGFRMSETUPPLATFORM;
|
|
|
|
/** RM Environment Variable Configuration. */
|
|
typedef struct _GFRMENVIRONMENTVARIABLES
|
|
{
|
|
NvU32 BusWidth; //!< Width of the Bus
|
|
char BusType; //!< Setting for Bus Type a/A/b/B/c/C
|
|
char AddrType; //!< Setting for Addr Type d/D/i/I
|
|
char CPUAddrType; //!< Setting for CPU Addr Type d/D/i/I
|
|
NvU32 Pll1Frequency; //!< PLL1 frequency in KHz
|
|
NvU32 Pll2Frequency; //!< PLL2 frequency in KHz
|
|
NvU32 Pll3Frequency; //!< PLL3 frequency in KHz
|
|
NvU32 RefClk0Frequency; //!< RefClk0 frequency in KHz
|
|
struct {
|
|
NvU32 GR2D; //!< 2D graphics engine clock frequency
|
|
NvU32 GR3D; //!< 3D graphics engine clock frequency
|
|
NvU32 MC; //!< Memory controller clock frequency
|
|
NvU32 EMC; //!< External memory clock frequency
|
|
NvU32 HOST1X; //!< Host1x controller clock frequency
|
|
} ModuleFrequencies;
|
|
NvU32 VCO1MaxFrequency; //!< Max frequency of VCO 1
|
|
NvU32 VCO2MaxFrequency; //!< Max frequency of VCO 2
|
|
char Term[RM_ENV_MAXLEN]; //!< Sets raw key input
|
|
NvU32 ScriptDebugger; //!< Script Debugger Enable
|
|
char ScriptSourcePath[RM_ENV_MAXLEN]; //!< Path to script source directory
|
|
char ExtDataPath[RM_ENV_MAXLEN]; //!< Path to external data directory
|
|
NvU32 ExtMemType; //!< Type of Extended memory (0=no EMC init, if
|
|
//!< non-zero it initializes the EMC with EMC entry
|
|
//!< (ExtMemType-1)
|
|
NvU32 ExtMemSize; //!< Size of Extended memory
|
|
NvU32 ExtMemOffsetMB; //!< Extended memory offset from the base.
|
|
|
|
NvU32 IntMemSize; //!< internal memory size
|
|
NvU32 IntMemOffset; //!< internal memory offset.
|
|
|
|
NvU32 IxInitBypassScripts;//!< Bypass reading RM.amx and initialization.amx
|
|
NvU32 CrystalOscBypass; //!< Runs COSC in bypass mode
|
|
NvU32 PushBufferSize; //!< Default push buffer size
|
|
char RMCTraceFileName[RM_ENV_MAXLEN]; //!< RMC trace file name.
|
|
char Sync; //!< Sync/async for bus mode s/S/a/A
|
|
char Handshake; //!< Hand shake for bus mode y/Y/n/N
|
|
char Ready; //!< Ready activehigh/low for bus mode l/L/h/H
|
|
NvU32 ASDBGREGb20; //!< Controls bit 20 in ASDBGREG
|
|
NvU32 MPanelIndex; //!< Index of main panel
|
|
NvU32 PanelIndex1; //!< Index of second panel (0 for no panel)
|
|
NvU32 AOCVDD; //!< AOCVDD
|
|
NvU32 VECVDD; //!< VECVDD
|
|
NvU32 MMCVDD; //!< MMCVDD
|
|
NvU32 TDCVDD; //!< TDCVDD
|
|
NvU32 VVDD; //!< VVDD
|
|
NvU32 EMVDD; //!< EMVDD
|
|
NvU32 ACVDD; //!< ACVDD
|
|
NvU32 LVDD; //!< LVDD
|
|
NvU32 SDVDD; //!< SDVDD
|
|
NvU32 HVDD; //!< HVDD
|
|
NvU32 AUXVDD; //!< AUXVDD
|
|
NvU32 R1CVDD; //!< R1CVDD
|
|
NvU32 PowerControl; //!< GFSDK_POWER_CONTROL_ENABLE
|
|
NvU32 UseDSP; //!< GFSDK_USE_DSP
|
|
NvU32 IspUseDSP; //!< GFSDK_ISP_USE_DSP, nonzero to run ISP on DSP
|
|
NvU32 COSCFreq; //!< COSC_FREQ
|
|
NvU32 PrimarySurfMemType; //!< Primary Surface in ext mem
|
|
NvU32 MemCheck; //!< GPU memory bufferoverflow checking in GFSDK debug builds, 0=off 1=on (default)
|
|
NvU32 MemLog; //!< Log GPU memory allocations on STDIO, 0=off (default) 1=on
|
|
NvU32 UseCameraScript; //!< Camera Script number
|
|
NvU32 DynamicDSPFreq; //!< 1 to enable dynamic DSP clock frequency, 0 to disable
|
|
|
|
NvU32 H264DecUseDSP; //!< GFSDK_H264_DEC_USE_DSP, nonzero to run H264 decode VLD on DSP
|
|
NvU32 MP4DecUseDSP; //!< GFSDK_MP4_DEC_USE_DSP, nonzero to run MP4 decode VLD on DSP
|
|
NvU32 VC1DecUseDSP; //!< GFSDK_VC1_DEC_USE_DSP, nonzero to run VC1 decode VLD on DSP
|
|
NvU32 RV9DecUseDSP; //!< GFSDK_RV9_DEC_USE_DSP, nonzero to run RV9 decode VLD on DSP
|
|
NvU32 JPGDecUseDSP; //!< GFSDK_JPG_DEC_USE_DSP, nonzero to run JPG decode VLD on DSP
|
|
NvU32 H264DecCodeMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, H264 dec DSP code, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
NvU32 H264DecDataMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, H264 dec DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
NvU32 MP4DecCodeMemType; //!< GFSDK_MP4DEC_CODE_MEMTYPE, MP4 dec DSP code, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
NvU32 MP4DecDataMemType; //!< GFSDK_MP4DEC_CODE_MEMTYPE, MP4 dec DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
NvU32 VC1DecCodeMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, VC1 dec DSP code, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
NvU32 VC1DecDataMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, VC1 dec DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
NvU32 H264EncCodeMemType; //!< GFSDK_H264ENC_CODE_MEMTYPE, H264 enc DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
|
|
|
NvU32 I2SCodecMasterMode; //!< GFSDK_I2SCODEC_MASTERMODE, I2SCODEC Master Mode, 0-I2S Slave, 1-I2S Master, 2-AC97 standard, 3-AC97 SMCLK, default 0
|
|
NvU32 I2SCodecFsyncDivider;//!< GFSDK_I2SCODEC_FSYNCDIV, I2SCODEC FSYNC Divider: valid value : 4,8,16,32,64,128, default 128
|
|
NvU32 I2SCodecFsyncPreDivider;//!< GFSDK_I2SCODEC_FSYNCPREDIV, I2SCODEC FSYNC Predivider: valid value : 1,2,3,5 default 2
|
|
NvU32 I2SCodecFrquency; //!< GFSDK_I2SCODEC_FREQUENCY, I2SCODEC Frequency, default : 12288
|
|
NvU32 I2SCodecSCLKDIV; //!< GFSDK_I2SCODEC_SCLK_DIV, I2SCODEC SCLK divider setting, default : 0
|
|
NvU32 AudioSampleRate; //!< GFSDK_AUDIO_SAMPLERATE, Output Audio Samplerate, default : 48000
|
|
NvU32 AudioRecordSampleRate; //!< GFSDK_AUDIO_REC_SAMPLERATE, Input Audio Samplerate, default : 0 (use output rate)
|
|
NvU32 AudioRequireInternalMemory;
|
|
/**< GFSDK_AUDIO_REQUIRE_INTERNAL_MEMORY, Controls audio memory allocation: <br>
|
|
<pre>
|
|
0 -> audio structs can be locate anywhere, dspcore will be allocated anywhere (default)
|
|
1 -> audio structs must be allocated in internal SRAM, dspcore will be allocated anywhere
|
|
0xMM -> MM is a 8 bit wide bitmask: b'10XXYYZZ (i.e. 0x80 | b'XXYYZZ)
|
|
|
|
XX controls allocation of dspcore DSP image (about 100 kB)
|
|
YY to control allocation of GfSgl (about 90 kB, not required for encoding=ADTSINTERNAL)
|
|
ZZ controls allocation of GfGlobalParameters struct (about 36 kB)
|
|
|
|
bitmask meaning:
|
|
b'00 no special requirement
|
|
b'01 force internal SRAM
|
|
b'10 force external SRAM
|
|
b'11 unused
|
|
</pre>
|
|
*/
|
|
|
|
NvU32 AudioRecordEnable; //!< GFSDK_AUDIO_REC_ENABLE, Enable SC15 I2S Record, default : 0
|
|
NvU32 AudioNoI2C; //!< Disable codec I2C access in GFAudioAPI
|
|
char I2SCodecInit[RM_ENV_MAXLEN]; //!< Codec init addr/data sequence comma delimited zero padded 32 bit hex values "xxxxxxxx,xxxxxxxx,..." up to 128 chars
|
|
char I2SCodecReset[RM_ENV_MAXLEN]; //!< Codec reset addr/data sequence comma delimited zero padded 32 bit hex values "xxxxxxxx,xxxxxxxx,..." up to 128 chars
|
|
//!< I2S "aaaaddrr" aaaa - i2s slave address, dd - 8 bit data, rr 7 bit i2s register
|
|
//!< AC97 "aaaadddd" aaaa - ac97 register address, dddd - 16 bit data value
|
|
NvU32 I2SCodecEnableSMCLK;
|
|
NvU32 SCInterfaceMode;
|
|
|
|
NvU32 perfMode3D; // 3D perf mode.
|
|
NvU32 DxInitBypass; // This is used to tell DxSetDisplay() to initialize the
|
|
// software state without touching the hardware
|
|
NvU32 noDCPreLoadCtx;
|
|
NvU32 nulldriver2D;
|
|
#if NVOS_IS_WINDOWS_CE
|
|
NvU32 BackupMemory;
|
|
#endif
|
|
NvU32 IndirectAddrSet;
|
|
} GFRMENVIRONMENTVARIABLES, *PGFRMENVIRONMENTVARIABLES;
|
|
|
|
/* Rm Public Services for platform only. May depend on GFPlat.h */
|
|
enum
|
|
{
|
|
RM_EXTDATA_INIT_TYPE = 0
|
|
};
|
|
|
|
enum
|
|
{
|
|
RM_EXTDATA_INIT_SCRIPT = 0,
|
|
RM_EXTDATA_RM_SCRIPT,
|
|
RM_EXTDATA_CAMERA_SCRIPT,
|
|
RM_EXTDATA_ENVVARS_SCRIPT,
|
|
RM_EXTDATA_DISPLAY_SCRIPT,
|
|
RM_EXTDATA_DISPLAY_SUB_SCRIPT,
|
|
RM_EXTDATA_AUTOCTRL_SCRIPT,
|
|
RM_EXTDATA_AVP_IMAGE_AUDIO_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_MP3_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_SBC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_AAC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_EAAC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_AACLPSBR_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_AMRNB_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_AMRWB_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_WMA_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_AUDIO_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_MP3_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_SBC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_AAC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_EAAC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_AACLPSBR_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_AMRNB_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_AMRWB_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_WMA_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_H264DEC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_H264DEC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_MP4DEC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_MP4DEC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_JPEGDEC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_JPEGDEC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_H264ENC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_H264ENC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_VC1DEC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_VC1DEC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_RV9DEC_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_RV9DEC_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_ISP3A_AE_AF_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_ISP3A_AWB_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_ISP3A_DVS_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_BEATNIK_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_BEATNIK_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_KERNEL_AVP1,
|
|
RM_EXTDATA_AVP_IMAGE_KERNEL_AVP2,
|
|
RM_EXTDATA_AVP_IMAGE_DSP_UNITTESTS,
|
|
RM_EXTDATA_AVP_IMAGE_TSDEM_AVP1, //!< SC15 version of GFMxDemTS DSP image
|
|
RM_EXTDATA_AVP_IMAGE_TSDEM_AVP2, //!< SC14 version of GFMxDemTS DSP image
|
|
RM_EXTDATA_AVP_IMAGE_ISP_AVP1
|
|
};
|
|
|
|
enum
|
|
{
|
|
RM_EXTDATA_FILE = 0,
|
|
RM_EXTDATA_FILE_WITH_SUBID,
|
|
};
|
|
|
|
#define DEFAULTSCRIPTNAME "default"
|
|
|
|
#define RM_EXTDATA_READ 1 // Read in data
|
|
#define RM_EXTDATA_USEBUFFER 4 // RmAccessExternalData shouldn't handle
|
|
// allocation of buffer, the data is to
|
|
// be placed at the orginal buffer address
|
|
#define RM_EXTDATA_SIZE 8 // Query the size of the data
|
|
#define RM_EXTDATA_FILENAME 0x10 // return script file name
|
|
#define RM_EXTDATA_NAME 0x20 // return name of script without prefix and sub ID
|
|
#define RM_EXTDATA_IDLIST 0x40 // return array of script sub ID
|
|
|
|
/* Fields in struct PGFRMEXTDATASTRUCT
|
|
* dataType : Type of the data
|
|
* dataID : ID of the data
|
|
* subID : Sub ID of script
|
|
* buffer : Pointer to pointer of the data address
|
|
* size : Address to store the resulting size. During a read operation if size
|
|
* is non-zero the amount of bytes read in will be stored there. If size
|
|
* or the value pointed to by size is zero all the data represented by
|
|
* dataID will be read in.
|
|
* option : flag that will change what is returned in buffer and size.
|
|
*/
|
|
typedef struct _GFRMEXTDATASTRUCT
|
|
{
|
|
NvU32 dataType; // type of data
|
|
NvU32 dataID; // ID of data
|
|
NvU32 subID; // sub ID of data
|
|
void ** buffer;
|
|
NvU32 * size;
|
|
NvU32 option;
|
|
} GFRMEXTDATASTRUCT, *PGFRMEXTDATASTRUCT;
|
|
|
|
|
|
/** This function is called to get value from curent environment.
|
|
|
|
@param envName environment name in env table
|
|
@param envType environment type
|
|
RM_ENV_DECIMAL // String should be parsed as a decimal
|
|
RM_ENV_HEX // String should be parsed as a hexadecimal
|
|
RM_ENV_CHAR // String should be parsed as a character
|
|
RM_ENV_STRING // String used as-is.
|
|
@param parsedval converted value. Only available while environment type is RM_ENV_DECIMAL or RM_ENV_HEX
|
|
@return a pointer to the environment table entry containing varname.
|
|
*/
|
|
// char * ReadEnvVars( const char *envName, int envType, NvU32 *parsedval);
|
|
GF_RETTYPE nvGetConfigUint32(const char *name, NvU32 *value);
|
|
|
|
GF_RETTYPE nvGetConfigString( const char *envName, char **value);
|
|
|
|
/** Retrieves the Process id of the current process.
|
|
|
|
@param RmGetProcessID Pointer to NvU32 for returning the prcess id,
|
|
|
|
@return GF_SUCCESS If the platforms support some sort of get process id API
|
|
@return GF_ERROR. if not support
|
|
*/
|
|
GF_RETTYPE RmGetProcessID( NvU32 *RmProcessID );
|
|
|
|
/* Thread, Mutex, Event and Semaphore opaque handles */
|
|
typedef struct GFMutex_t *GFMutex;
|
|
typedef struct GFSemaphore_t *GFSemaphore;
|
|
typedef struct GFEvent_t *GFEvent;
|
|
typedef struct GFThread_t *GFThread;
|
|
|
|
/* Rm platform functions for OS abstraction */
|
|
|
|
/** Create Mutex object.
|
|
|
|
@param id - Mutex identiifer. Used to cretate named objects. If the
|
|
id is 0, un named object is created.
|
|
|
|
@return Handle to the event object, or 0 on failure.
|
|
*/
|
|
GFMutex RmCreateMutex( NvU32 id );
|
|
|
|
/** Lock mutex object, blocks until mutex can be taken. Must always succeed if
|
|
given a valid mutex handle.
|
|
|
|
@param mutex Mutex handle
|
|
*/
|
|
void RmLockMutex(GFMutex mutex);
|
|
|
|
/** Unlock mutex object. Must always succeed if given a valid mutex handle.
|
|
|
|
@param mutex Mutex handle
|
|
*/
|
|
void RmUnlockMutex(GFMutex mutex);
|
|
|
|
/** Destroy mutex object. Must always succeed if given a valid mutex handle.
|
|
Must not crash (should do nothing) if given a NULL handle.
|
|
|
|
@param mutex Mutex handle.
|
|
*/
|
|
void RmDestroyMutex(GFMutex mutex );
|
|
|
|
/** Create semaphore object.
|
|
|
|
@param id - Semaphore identifer. Used to create named objects. If the
|
|
id is 0, unnamed object is created.
|
|
|
|
@param InitCount (NvU32) Initial count of semaphore. This value must be
|
|
greater than zero.
|
|
@param MaxCount (NvU32) Maximum count of semaphore. This value must be
|
|
greater than zero.
|
|
|
|
@return Handle to semaphore object, or 0 on failure
|
|
*/
|
|
GFSemaphore RmCreateSemaphore(NvU32 id, NvU32 InitCount, NvU32 MaxCount);
|
|
|
|
/** Destroy semaphore object. Must always succeed if given a valid semaphore
|
|
handle. Must not crash (should do nothing) if given a NULL handle.
|
|
|
|
@param sem Semaphore handle
|
|
*/
|
|
void RmDestroySemaphore(GFSemaphore sem);
|
|
|
|
/** Signal semaphore object. This function increments the semaphore's counter.
|
|
Must always succeed if given a valid semaphore handle.
|
|
|
|
@param sem Semaphore handle
|
|
*/
|
|
void RmSignalSemaphore(GFSemaphore sem);
|
|
|
|
/** Wait on semaphore.
|
|
Function blocks while semaphore's count is 0. Once the count is non-zero,
|
|
the count is decremented by one and function returns. If timeout is passed
|
|
as 0, the function does not block.
|
|
|
|
@param sem Semaphore handle
|
|
@param timeout Timeout in miliseconds, 0 for non-blocking, (NvU32)-1 for infinite wait.
|
|
@retutn GF_SUCCESS indicates that the semaphore was taken successfully, GF_WAIT_TIME_OUT
|
|
indicates timeout, any other return value indicates error.
|
|
*/
|
|
GF_RETTYPE RmWaitOnSemaphore(GFSemaphore sem, NvU32 timeout);
|
|
|
|
|
|
/** Create event object.
|
|
|
|
@return Handle to event object, or NULL on failure
|
|
*/
|
|
GFEvent RmCreateEvent(void);
|
|
|
|
/** Sets the event object to the signaled state. Must always succeed if given
|
|
a valid event handle.
|
|
|
|
@param event Event handle
|
|
*/
|
|
void RmSetEvent( GFEvent event );
|
|
|
|
/** Resets the event object to the nonsignaled state. Must always succeed if
|
|
given a valid event handle.
|
|
|
|
@param event Event handle
|
|
*/
|
|
void RmResetEvent( GFEvent event );
|
|
|
|
/** Function blocks until the event is signaled.
|
|
|
|
@param event Event handle.
|
|
@param msec Milli seconds to wait.
|
|
|
|
@retval GF_WAIT_GET_OBJECT Event was signaled, and the event object was acquired.
|
|
@retval GF_WAIT_TIME_OUT Timeout before event was signaled
|
|
@retval GF_WAIT_ERROR An error occured.
|
|
*/
|
|
GF_RETTYPE RmWaitForEvent(GFEvent event, NvU32 msec );
|
|
|
|
|
|
/** Destroys the event object. Must always succeed if given a valid event
|
|
handle. Must not crash (should do nothing) if given a NULL handle.
|
|
|
|
@param event Event Handle. This is the handler returned by
|
|
the call to RmCreateEvent function.
|
|
*/
|
|
void RmDestroyEvent( GFEvent event );
|
|
|
|
/** Creates a thread to execute within the calling process.
|
|
|
|
@param func (NvU32 (*)(void *)) Pointer to a function to be executed
|
|
by the thread.
|
|
@param data (void *) Pointer to variable to be passed to the thread
|
|
|
|
@return Handle to thread on success, otherwise 0 is returned.
|
|
*/
|
|
GFThread RmCreateThread(NvU32 (*StartFunction)(void *), void *data);
|
|
|
|
/** Blocks until the specified thread terminates, then frees system resources
|
|
associated with the thread. Must always succeed if given a valid thread
|
|
handle. Must not crash (should do nothing) if given a NULL handle.
|
|
|
|
@param ThreadHandle Thread handle retruned by RmCreateThread call
|
|
*/
|
|
void RmJoinThread(GFThread ThreadHandle);
|
|
|
|
/** Yield execution to other threads. This will be called inside spin loops
|
|
that are waiting for the hardware to finish something.
|
|
*/
|
|
void RmYield(void);
|
|
|
|
/** Get full path of extended script data. Assume the script data is at same directory as bootload module.
|
|
@param modulename (char *)Bootloader module name. If the script data is not at same directory as module, could be NULL.
|
|
@param fullpath (char *)Pointer to extened script data path.
|
|
|
|
@return GF_SUCCESS to signal success, or error code to signal failure
|
|
*/
|
|
GF_RETTYPE
|
|
RmGetExtDataPath(char *modulename, char *fullpath );
|
|
|
|
/* File and File Search opaque handles */
|
|
typedef struct GFFile_t *GFFile;
|
|
typedef struct GFFileSearch_t *GFFileSearch;
|
|
|
|
/** Searches a directory for a file whose name matches the specified file name.
|
|
It examines subdirectory names as well as file names
|
|
@param filePath (char *) Pointer to a null-terminated string that specifies a valid directory or path and file name,
|
|
which can contain wildcard characters (* and ?)
|
|
@param filename (char *) pointer to the full path file/dir which match this search.
|
|
|
|
@return If the function succeeds, the return value is a search handle used in a subsequent call to RmFindNextFile or RmFindClose,
|
|
NULL if the function failed.
|
|
*/
|
|
GFFileSearch RmFindFirstFile(const char *filePath, char *fileName);
|
|
|
|
/** Continues a file search from a previous call to the RmFindFirstFile function.
|
|
@param hFind (GFFileSearch ) Search handle returned by a previous call to the RmFindFirstFile function.
|
|
@param filename (char *) pointer to the filename with full path which match this search.
|
|
@return GF_SUCCESS to signal success, or error code to signal failure
|
|
*/
|
|
GF_RETTYPE RmFindNextFile(GFFileSearch hFind, char *fileName);
|
|
|
|
/** Closes the specified search handle. Must always succeed if given a valid
|
|
search handle. Must not crash (should do nothing) if given a NULL handle.
|
|
|
|
@param hFind (GFFileSearch) Search handle returned by a previous call to the RmFindFirstFile function.
|
|
*/
|
|
void RmFindClose(GFFileSearch hFind);
|
|
|
|
/** Open file.
|
|
@param filename (const char *) Filename
|
|
@param fileSpec (const char *) Type of access permitted
|
|
@return Handle to the open file. A NULL pointer value indicates an error.
|
|
*/
|
|
GFFile RmFileOpen(const char *fileName, const char *fileSpec);
|
|
|
|
/** Close file. Must always succeed if given a valid file handle. Must not
|
|
crash (should do nothing) if given a NULL handle.
|
|
|
|
@param fp Handle that RmFileOpen() returned
|
|
*/
|
|
void RmFileClose(GFFile fp);
|
|
|
|
/** Read data from file.
|
|
@param buffer (void *) Storage location for data
|
|
@param lSize (NvU32) Item size in bytes
|
|
@param lCount(NvU32) Maximum number of items to be read
|
|
@param fp (GFFile) Pointer that RmFileOpen() returned
|
|
@return Number of full items actually read, 0 if nothing is read out.
|
|
*/
|
|
GF_RETTYPE RmFileRead(void *buffer, NvU32 lSize, NvU32 lCount, GFFile fp);
|
|
|
|
/** Get file size.
|
|
@param fp(GFFile ) Pointer that RmFileOpen() returned
|
|
@return Current file size in bytes.
|
|
*/
|
|
GF_RETTYPE RmFileSize(GFFile fp);
|
|
|
|
/** Platform abstraction for millisecond sleep.
|
|
|
|
@param msec Milliseconds to sleep.
|
|
*/
|
|
void RmWaitMSec(NvU32 msec);
|
|
|
|
/** Waits for a keypress with a timeout, and returns the key.
|
|
|
|
@param timeOutMSec Milliseconds to wait for the keypress.
|
|
@retval The code for the key, or zero if we timed out.
|
|
*/
|
|
int RmWaitKey(NvU32 timeOutMSec);
|
|
|
|
/** Get the current OS tick counter.
|
|
@return Low 32 bits of millisecond counter.
|
|
*/
|
|
NvU32 RmGetTickCountMSec(void);
|
|
|
|
/** Get the current OS tick counter.
|
|
|
|
NOTE: This function is NOT guaranteed to exist on all
|
|
platforms. Drivers should NOT call this function; it's
|
|
meant only for benchmarking.
|
|
|
|
@return (NvU64) 64 bit microsecond counter.
|
|
*/
|
|
NvU64 RmGetTickCountUSec(void);
|
|
|
|
/** SetupPlatform - It is called by RmSetupPlatform to setup any platform specific stuff.
|
|
|
|
@param pOutput (PGFRMSETUPPLATFORM) output structure. Used to pass variables to high layer function RmSetupPlatform
|
|
@param penv (PGFRMENVIRONMENTVARIABLES) pass Environment Variable Configuration structure
|
|
|
|
@return GF_SUCCESS to signal success, or error code to signal failure
|
|
|
|
*/
|
|
GF_RETTYPE SetupPlatform( PGFRMSETUPPLATFORM pOutput, PGFRMENVIRONMENTVARIABLES penv );
|
|
|
|
/** Called by RmExitPlatform to exit and clean-up any platform specific stuff, if any
|
|
|
|
@param pUserObject0 (void *) Pointer to user specified object 0 from high layer function RmExitPlatform
|
|
|
|
@return GF_SUCCESS to signal success, or error code to signal failure
|
|
*/
|
|
GF_RETTYPE ExitPlatform( void *pUserObject0);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __GFRMOEM_H__ */
|