⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fhinit.c

📁 flashfx pro for vxworks based arm9260
💻 C
字号:
/*---------------------------------------------------------------------------
               ----> DO NOT REMOVE THE FOLLOWING NOTICE <----

      Copyright (c) 1993 - 2006 Datalight, Inc.  All Rights Reserved.

  Datalight, Incorporated is a Washington State corporation located at:

        21520 30th Dr SE, Suite 110,      Tel:  425-951-8086
        Bothell, WA  98021                Fax:  425-951-8094
        USA                               Http://www.datalight.com

  This software, including without limitation, all source code and documen-
  tation, is the confidential, trade secret property of Datalight, Inc., and
  is protected under the copyright laws of the United States and other juris-
  dictions.  Portions of the software may also be subject to one or more the
  following US patents: US#5860082, US#6260156.

  In addition to civil penalties for infringement of copyright under applic-
  able U.S. law, 17 U.S.C. 1204 provides criminal penalties for violation of
  (a) the restrictions on circumvention of copyright protection systems found
  in 17 U.S.C. 1201 and (b) the protections for the integrity of copyright
  management information found in 17 U.S.C. 1202.

  U.S. Government Restricted Rights:  Use, duplication, reproduction, or
  transfer of this commercial product and accompanying documentation is
  restricted in accordance with FAR 12.212 and DFARS 227.7202 and by a
  License Agreement.

  IN ADDITION TO COPYRIGHT AND PATENT LAW, THIS SOFTWARE IS PROTECTED UNDER A
  SOURCE CODE AGREEMENT, NON-DISCLOSURE AGREEMENT (NDA), OR SIMILAR BINDING
  CONTRACT BETWEEN DATALIGHT, INC. AND THE LICENSEE ("BINDING AGREEMENT").
  YOUR RIGHT, IF ANY, TO COPY, PUBLISH, MODIFY OR OTHERWISE USE THE SOFTWARE,
  IS SUBJECT TO THE TERMS AND CONDITIONS OF THE BINDING AGREEMENT.  BY USING
  THE SOFTWARE IN ANY MANNER, IN WHOLE OR IN PART, YOU AGREE TO BE BOUND BY
  THE TERMS OF THE BINDING AGREEMENT.  CONTACT DATALIGHT, INC. AT THE ADDRESS
  SET FORTH ABOVE IF YOU OBTAINED THIS SOFTWARE IN ERROR.
---------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------
                                Description

    This module contains the VxWorks OESL default implementations for:

       FfxHookDriverCreate()
       FfxHookDriverDestroy()

    Should these routines need customization for your project, copy this
    module into your project directory, make your changes, and modify
    ffxproj.mak to build the new module.
---------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------
                                Revision History
    $Log: fhinit.c $
    Revision 1.4  2006/09/07 00:24:35Z  Pauli
    Updated condition to enable calling FfxDelayCalibrate if Sibley
    support is enabled.
    Revision 1.3  2006/06/22 22:08:51Z  Garyp
    Updated to use the newly renamed DCLCONF_USEVXWORKSTIMESTAMP
    setting.
    Revision 1.2  2006/02/12 01:15:09Z  Garyp
    Continuing updates to the new Device and Disk model.
    Revision 1.1  2005/10/06 05:44:06Z  Pauli
    Initial revision
    Revision 1.3  2005/09/17 23:51:22Z  garyp
    Modified so that _sysdelay() and related code is only built if
    FFXCONF_NORSUPPORT is TRUE.
    Revision 1.2  2005/08/21 11:32:48Z  garyp
    Documentation update.
    Revision 1.1  2005/05/08 19:11:48Z  pauli
    Initial revision
---------------------------------------------------------------------------*/

#include <vxworks.h>
#include <kernelLib.h>
#include <sysLib.h>

#include <flashfx.h>


/*  Some VxWorks BSPs contain functions to enable access to the
    flash for those platforms that allow this.

    These prototypes may be enabled with caution.  If in doubt
    please examine the BSP for more information.
*/
IMPORT void sysFlashWriteEnable(void);
IMPORT void sysFlashWriteDisable(void);


/*-------------------------------------------------------------------
    FfxHookDriverCreate()

    Description
        This function is called once at driver initialization time
        from the Driver Framework, prior to any access to the media.

        If this function returns FALSE, the driver initialization
        process will fail.

    Parameters
        pFDI    - A pointer to the FFXDRIVERINFO structure.

    Return Value
        Returns TRUE if successful, otherwise FALSE.
-------------------------------------------------------------------*/
D_BOOL FfxHookDriverCreate(
    FFXDRIVERINFO  *pFDI)
{
    (void)pFDI;

#if !DCLCONF_USEVXWORKSTIMESTAMP

    /*  If there is no timestamp functionality in this VxWorks BSP
        use our own internal delay function which we must calibrate
        here.
    */
  #if FFXCONF_NORSUPPORT || FFXCONF_ISWFSUPPORT
    /*  Calibrate the _sysdelay() timing loop.
    */
    FfxDelayCalibrate(0, 0);
  #endif

#endif

#if 1
    /*  Enable the ability to write to the flash.  See the comment
        above before enabling this function.
    */
    sysFlashWriteEnable();
#endif

#if 0

    /*  For the Multithreaded VBF Stress Test to do any useful
        testing, time-slicing must be enabled.  However we don't
        want to do this by default since it will affect everything
        in the system.
    */
    DBGPRINTF(1, ("FFX: Enabling time slicing\n"));

    kernelTimeSlice(1000);
#endif

    return TRUE;
}


/*-------------------------------------------------------------------
    FfxHookDriverDestroy()

    Description
        This function is called once at driver instance destruction
        time, after all devices and disks have been destroyed.

    Parameters
        pFDI    - A pointer to the FFXDRIVERINFO structure.

    Return Value
        None
-------------------------------------------------------------------*/
void FfxHookDriverDestroy(
    FFXDRIVERINFO  *pFDI)
{
    (void)pFDI;

#if 1
    /*  Disable the ability to write to the flash.  See the comment
        above before enabling this function.
    */
    sysFlashWriteDisable();
#endif

    return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -