📄 dochstub.c
字号:
/****************************************************************************** * * * Project: DOC Driver for Linux 2.4 Block device driver for mDOC H3 family * * of devices under Linux kernel 2.4. * * * * Version: 1.0 * * Email questions to: oemsupport@sandisk.com * * Copyright (C) SanDisk IL Ltd. 1995 - 2007 * * SanDisk IL Ltd., 7 Atir Yeda Street, Kfar Saba 44425, Israel * * * ****************************************************************************** * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or any later version.* * This program is distributed in the hope that it will be useful, but WITHOUT* * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * * more details, which is set forth in the readme.txt file. * * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * * * This License does not grant you any right to use the trademarks, service * * marks or logos of SanDisk IL Ltd. or SanDisk Corporation. * * Subject to the foregoing, SanDisk IL Ltd., for itself and on behalf of its * * licensors, hereby reserves all intellectual property rights in the program,* * except for the rights expressly granted in this License. * * * ******************************************************************************/
/*This file holds necessary routines for integrating sureFS over DOCH SDK*/
/*
* $Log: V:/PVCSDB/DiskOnChip/archives/version 7.0/TrueFFS FS/src/h3/dochstub.c-arc $
*
* Rev 1.11 Sep 11 2006 13:45:16 yaniv.iarovici
* Legal header added
*
* Rev 1.10 Aug 09 2006 17:26:54 Polina.Marimont
* initial for DOC Driver 1.0
*
* Rev 1.9.1.0 Aug 08 2006 15:55:26 Polina.Marimont
* DOC Driver 1.0 initial
*/
#include "flbase.h"
#include "flstruct.h"
#ifdef FL_MIGRATION_VERSION
#include "bddefs.h"
#else /*FL_MIGRATION_VERSION*/
#include "fsdefs.h"
#endif /*FL_MIGRATION_VERSION*/
#include "dochtl.h"
#include "doch_sys.h"
#include "doch_api.h"
FLMutex busy[DOCH_MAX_SOCKETS];
FLBoolean dochStubInitialized = 0;
/*===========================*/
FLStatus dochSetBusy(FLByte socket, FLBoolean state, FLByte partition)
{
FLStatus status = flOK;
if (state == FL_ON) /* Set busy to ON */
{
if (!flTakeMutex(&busy[socket]))
{
DBG_PRINT_FLOW_PRM(FLZONE_ATA, (FLTXT("\r\ndochSetMutex Failed to set mutex\r\n")));
return flDriveNotAvailable;
}
}
else /* Set busy to OFF */
{
flFreeMutex(&busy[socket]);
}
return status;
}
void setTL(FLByte socket, FLByte partition, TL * tl)
{
FLNative i;
if (dochStubInitialized != TRUE)
{
dochStubInitialized = TRUE;
for (i = 0; i < DOCH_MAX_SOCKETS ; i ++)
flCreateMutex(&busy[i]);
}
getDochTL(tl, partition);
}
#ifndef FL_MIGRATION_VERSION
/* ----------------------------------------------------------------------------------- */
FLStatus lockForIO(FLByte socket, FLByte partition, FLBoolean onOff) {
checkStatus(dochSetBusy(socket, onOff, partition)); /* take BD mutex */
return flOK;
}
#endif /*FL_MIGRATION_VERSION*/
/* ----------------------------------------------------------------------------------- */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -