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

📄 pcmciawin.h

📁 freescale i.mx31 BSP CE5.0全部源码
💻 H
字号:
/*
 *
 * Copyright (C) 2003-2004, MOTOROLA, INC. All Rights Reserved
 * THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
 * BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
 * MOTOROLA, INC.
 *
 * Copyright (C) 2004, Freescale Semiconductor, Inc. All Rights Reserved
 * THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
 * BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
 * FREESCALE SEMICONDUCTOR, INC.
 *
 * Copyright (C) 2006, Freescale Semiconductor, Inc. All Rights Reserved
 * THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
 * BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
 * FREESCALE SEMICONDUCTOR, INC.
 //
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
//
//
 *
 * 	File:			DRIVERS\PCCARD\pcmciawin.h
 * 	Purpose:		PCMCIA Controller Codes 
 *
 * 	Notes:		
 *
 * 	Author:	    	Kok Choon Kiat
 * 	Date:			10/01/2004
 *
 * 	Modifications:
 *  MM/DD/YYYY      Initials     	Change description
 *	03/30/2005		SNT				Update for TO3 changes and cleanup	
 *    02/20/2006        ASH             Modifications done for MX31 BSP
 */
 
#ifndef __PCMCIAWIN_H_
#define __PCMCIAWIN_H_

/*+Public include files******************************************************
 Include any files to export any inherited data type *necessary* needed by 
 client to use the services of this module.  Files which are included for
 internal use within this module should be done in a later section, and should
 *not* be exported un-necessarily.
**************************************************************************-*/
#include <windows.h>
#include <types.h>
#include <socksv2.h>
#include <memory.h>
#include <ceddk.h>
#include <resmgr.h>

#include "socket.h"
#include "pcmciasock.h"

/*+Public Macro definitions**************************************************
 Define all public macros or macros to be used only within the module for 
 bootstapping the definitions of other items
**************************************************************************-*/

/*+Public Type definitions***************************************************
 Define all types which will be exported from this module.  Type definitions
 to be used within the module should be defined in the later section.
**************************************************************************-*/

class CPcmciaMemWindows : public CPcmciaMemWindowImpl<CPcmciaSocket>
{
public:
                    CPcmciaMemWindows( CPcmciaSocket* pPcmSocket,
                                       DWORD dwWinIndex,
                                       const SS_WINDOW_STATE* pcWindowState,
                                       const SS_WINDOW_INFO* pcWindowInfo );
                    ~CPcmciaMemWindows();

protected:
    virtual void    FreeResources();
    virtual void    DisableWindow();
    virtual void    ProgramWindow();
    virtual DWORD   GetNewOffset( PSS_WINDOW_STATE pWindowState );
    virtual DWORD   GetNewLength( PSS_WINDOW_STATE pWindowState,
                                  DWORD dwNewOffset );
    virtual BOOL    GetBaseAddress( PSS_WINDOW_STATE pWindowState,
                                    DWORD dwNewOffset,
                                    DWORD dwNewLength,
                                    DWORD& dwNewBaseAddress );

    BYTE            m_uEnableBit;
    WORD            m_wWinBaseOffset;
    WORD            m_wWinPageOffset;
    DWORD           m_dwBaseAddress;
};


////////////////////////////////////////////////////////////////////////////////

class CPcmciaIoWindows : public CPcmciaIoWindowImpl<CPcmciaSocket>
{
public:
                    CPcmciaIoWindows( CPcmciaSocket* pPcmSocket,
                                      DWORD dwWinIndex,
                                      const SS_WINDOW_STATE* pcWindowState,
                                      const SS_WINDOW_INFO* pcWindowInfo );
                    ~CPcmciaIoWindows();

protected:
    virtual void    FreeResources();
    virtual void    DisableWindow();
    virtual void    ProgramWindow();
    virtual DWORD   GetNewOffset( PSS_WINDOW_STATE pWindowState );
    virtual DWORD   GetNewLength( PSS_WINDOW_STATE pWindowState,
                                  DWORD dwNewOffset );
    virtual BOOL    GetBaseAddress( PSS_WINDOW_STATE pWindowState,
                                    DWORD dwNewOffset,
                                    DWORD dwNewLength,
                                    DWORD& dwNewBaseAddress );

    BYTE            m_uEnableBit;
    BYTE            m_uIoCtrlBitOffset;
    WORD            m_wIoStatEndOffset;
    WORD            m_wIoOffsetOffset;
	   DWORD           m_dwBaseAddress;
    DWORD           m_dwOffset;
};


/*+Local include files*******************************************************
 Include all files that will be used only within this module here. 
**************************************************************************-*/
#ifdef __PCMCIAWIN_CPP__
/*-------------------------- Local context - START ---------------------------*/
#define VISIBLE             /* Mark as LOCAL context */

/*+Local Macro definitions***************************************************
 Define all macros that will only be used within the module here.
**************************************************************************-*/
#define PCMCIA_MEM_WINDIOWS_BLOCK 0x1000 // PCMCIA require 4 k Alignment for this controller.
#define PCMCIA_MEM_BLOCK_ADDR_MASK (~(PCMCIA_MEM_WINDIOWS_BLOCK-1))


/*+Local function prototypes*************************************************
 Declare all proto-types for functions/procedures only used within the module.
**************************************************************************-*/

/*+Local data declarations***************************************************
 Define all data objects that will used within the module here.
**************************************************************************-*/
// Bank size value
int g_bankSizeValue[] = {
    // For TO1.x, valid bank size: 1B - 64MB     
    PCMCIA_BANKSIZE_0, PCMCIA_BANKSIZE_1, PCMCIA_BANKSIZE_2,
    PCMCIA_BANKSIZE_3, PCMCIA_BANKSIZE_4, PCMCIA_BANKSIZE_5,
    PCMCIA_BANKSIZE_6, PCMCIA_BANKSIZE_7, PCMCIA_BANKSIZE_8,
    PCMCIA_BANKSIZE_9, PCMCIA_BANKSIZE_10, PCMCIA_BANKSIZE_11,
    PCMCIA_BANKSIZE_12, PCMCIA_BANKSIZE_13, PCMCIA_BANKSIZE_14,
    PCMCIA_BANKSIZE_15, PCMCIA_BANKSIZE_16, PCMCIA_BANKSIZE_17,
    PCMCIA_BANKSIZE_18, PCMCIA_BANKSIZE_19, PCMCIA_BANKSIZE_20,
    PCMCIA_BANKSIZE_21, PCMCIA_BANKSIZE_22, PCMCIA_BANKSIZE_23,
    PCMCIA_BANKSIZE_24, PCMCIA_BANKSIZE_25, PCMCIA_BANKSIZE_26
};



/*-------------------------- Local context - END ---------------------------*/
#else // !__PCMCIAWIN_CPP__
#define VISIBLE extern      /* Mark as GLOBAL context */
#endif //__PCMCIAWIN_CPP__

/*------------------------- Global context - START -------------------------*/

/*+Public data declarations**************************************************
 Define all data objects that will be exported here.
**************************************************************************-*/


/*+Public function prototypes************************************************
 Define all proto-types for public functions/procedures here.
**************************************************************************-*/

/*-------------------------- Global context - END --------------------------*/
#undef VISIBLE
	
#endif //__PCMCIAWIN_H_

⌨️ 快捷键说明

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