?? pseudovfl.c
字號:
/*****************************************************************************/
/* */
/* PROJECT : PocketStoreII v1.0.0_build001 */
/* MODULE : Pseudo VFL */
/* NAME : Pseudo VFL */
/* FILE : PseudoVFL.c */
/* PURPOSE : This file contains the exported routine for interfacing with */
/* the upper layer of VFL. */
/* */
/*---------------------------------------------------------------------------*/
/* */
/* COPYRIGHT 2003-2004 SAMSUNG ELECTRONICS CO., LTD. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Samsung Electronics */
/* Co., Ltd. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Samsung */
/* Electronics Co., Ltd. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in whole, */
/* are granted. */
/* */
/* Samsung Electronics Co., Ltd. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------------*/
/* */
/* REVISION HISTORY */
/* */
/* 17-OCT-2006 [Seungkyu Kim]: first writing */
/* */
/*****************************************************************************/
/*****************************************************************************/
/* Headerfile Include */
/*****************************************************************************/
#include <windows.h>
#include <bldver.h>
#include <windev.h>
#include <types.h>
#include <excpt.h>
#include <tchar.h>
#include <devload.h>
#include <diskio.h>
#include <VFLBuffer.h>
#include <WMRTypes.h>
#include <VFL.h>
#include <HALWrapper.h>
#include <storemgr.h>
#include <pm.h>
#include <config.h>
#include <WMRConfig.h>
#include <FIL.h>
#include <bibdrvinfo.h>
/*****************************************************************************/
/* Debug Definitions */
/*****************************************************************************/
#define VFLP_RTL_PRINT(x) PSII_RTL_PRINT(x)
#if VFLP_ERR_MSG_ON
#define VFLP_ERR_PRINT(x) PSII_RTL_PRINT(x)
#else
#define VFLP_ERR_PRINT(x)
#endif /* #if VFLP_ERR_MSG_ON */
#if VFLP_LOG_MSG_ON
#define VFLP_LOG_PRINT(x) PSII_RTL_PRINT(x)
#else
#define VFLP_LOG_PRINT(x)
#endif /* #if VFLP_LOG_MSG_ON */
#if VFLP_INF_MSG_ON
#define VFLP_INF_PRINT(x) PSII_RTL_PRINT(x)
#else
#define VFLP_INF_PRINT(x)
#endif /* #if VFLP_INF_MSG_ON */
/*****************************************************************************/
/* Global Variables */
/*****************************************************************************/
/*****************************************************************************/
/* Imported variable declarations */
/*****************************************************************************/
/*****************************************************************************/
/* Imported function declarations */
/*****************************************************************************/
/*****************************************************************************/
/* Local #define */
/*****************************************************************************/
/*****************************************************************************/
// Local constant definitions
/*****************************************************************************/
/*****************************************************************************/
// Local typedefs
/*****************************************************************************/
/*****************************************************************************/
/* */
/* NAME */
/* VFL_Init */
/* DESCRIPTION */
/* This function initializes VFL layer. */
/* PARAMETERS */
/* none */
/* RETURN VALUES */
/* VFL_SUCCESS */
/* VFL_Init is completed. */
/* VFL_CRITICAL_ERROR */
/* VFL_Init is failed. */
/* NOTES */
/* Before all of other functions of VFL is called, VFL_Init() should be */
/* called. */
/* */
/*****************************************************************************/
INT32
VFL_Init(VOID)
{
VFLPacket stPacket;
UINT32 nResult;
VFLP_LOG_PRINT((TEXT("[VFLP: IN] ++VFL_Init()\r\n")));
do {
/* VFL Init */
stPacket.nCtrlCode = PM_HAL_VFL_INIT;
stPacket.nVbn = 0; // Not used
stPacket.nVpn = 0; // Not used
stPacket.pBuf = NULL;
stPacket.nSrcVpn = 0; // Not used
stPacket.nDesVpn = 0; // Not used
stPacket.bCleanCheck= 0;
KernelIoControl(IOCTL_POCKETSTOREII_CMD, /* Io Control Code */
&stPacket, /* Input buffer (Additional Control Code) */
sizeof(VFLPacket), /* Size of Input buffer */
NULL, /* Output buffer */
0, /* Size of Output buffer */
&nResult); /* Error Return */
if ((nResult != VFL_SUCCESS) && (nResult != VFL_CRITICAL_ERROR))
{
VFLP_ERR_PRINT((TEXT("[VFLP:ERR] VFL_Init() failure. ERR Code=%x\r\n"), nResult));
break;
}
} while(0);
VFLP_LOG_PRINT((TEXT("[VFLP:OUT] --VFL_Init()\r\n")));
return (INT32)nResult;
}
/*****************************************************************************/
/* */
/* NAME */
/* VFL_Open */
/* DESCRIPTION */
/* This function opens VFL layer. */
/* PARAMETERS */
/* none */
/* RETURN VALUES */
/* VFL_SUCCESS */
/* VFL_Open is completed. */
/* VFL_CRITICAL_ERROR */
/* VFL_Open is failed. */
/* NOTES */
/* Before VFL_Open() is called, VFL_Init() should be called. */
/* */
/*****************************************************************************/
INT32
VFL_Open(VOID)
{
VFLPacket stPacket;
UINT32 nResult;
VFLP_LOG_PRINT((TEXT("[VFLP: IN] ++VFL_Open()\r\n")));
do {
/* VFL_Open */
stPacket.nCtrlCode = PM_HAL_VFL_OPEN;
stPacket.nVbn = 0; // Not used
stPacket.nVpn = 0; // Not used
stPacket.pBuf = NULL;
stPacket.nSrcVpn = 0; // Not used
stPacket.nDesVpn = 0; // Not used
stPacket.bCleanCheck= 0;
KernelIoControl(IOCTL_POCKETSTOREII_CMD, /* Io Control Code */
&stPacket, /* Input buffer (Additional Control Code) */
sizeof(VFLPacket), /* Size of Input buffer */
NULL, /* Output buffer */
0, /* Size of Output buffer */
&nResult); /* Error Return */
if (nResult != VFL_SUCCESS)
{
VFLP_ERR_PRINT((TEXT("[VFLP:ERR] VFL_Open() failure. ERR Code=%x\r\n"), nResult));
break;
}
} while(0);
VFLP_LOG_PRINT((TEXT("[VFLP:OUT] --VFL_Open()\r\n")));
return (INT32)nResult;
}
/*****************************************************************************/
/* */
/* NAME */
/* VFL_Format */
/* DESCRIPTION */
/* This function formats VFL. */
/* PARAMETERS */
/* none */
/* RETURN VALUES */
/* VFL_SUCCESS */
/* VFL_Format is completed. */
/* VFL_CRITICAL_ERROR */
/* VFL_Format is failed. */
/* NOTES */
/* Before VFL_Format() is called, VFL_Init() should be called. */
/* When this function is called, AC power must be connected. */
/* */
/*****************************************************************************/
INT32
VFL_Format(VOID)
{
VFLPacket stPacket;
UINT32 nResult;
VFLP_LOG_PRINT((TEXT("[VFLP: IN] ++VFL_Format()\r\n")));
do {
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -