📄 init.c
字号:
//**********************************************************************
//
// Filename: init.c
//
// Description: Performs the initialization on the PCMCIA card.
//
// 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.
//
// Use of this source code is subject to the terms of the Cirrus 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.
//
// Copyright(c) Cirrus Logic Corporation 2002, All Rights Reserved
//
//**********************************************************************
#include <windows.h>
#include <types.h>
#include <cardserv.h>
#include <sockserv.h>
#include <sockpd.h>
#include <ceddk.h>
#include <hwdefs.h>
#include <nkintr.h>
#include <oalintr.h>
DWORD gIntrPcmciaState = SYSINTR_PCMCIA_STATE;
DWORD gIntrPcmciaLevel = SYSINTR_PCMCIA_LEVEL;;
volatile PUCHAR g_PCICIndex;
volatile PUCHAR g_PCICData;
CRITICAL_SECTION g_PCIC_Crit;
//
// This is a hack. You should have to set a global variable to figure
// out that there is no I/O access in the EP9312 like in a PC.
//
extern DWORD g_IORM_ID[];
//
// The PCMCIA MDD calls PDCardInitServices to initialize the PDD layer.
//
STATUS PDCardInitServices(DWORD dwInfo)
{
DEBUGMSG (1,(TEXT("++PDCardInitServices\n\r")));
InitializeCriticalSection(&g_PCIC_Crit);
// dpCurSettings.ulZoneMask =0xFFFF;
g_IORM_ID[0] = 0;
//
// Power off the card in case that power is already being supplied to the
// card.
//
PowerPCCardWrite(0, 0);
//
// TODO TODO TODO - Initialize the PCMCIA memory space.
//
DEBUGMSG(1, (TEXT("InitSocketNoCard(0) is called\r\n")));
InitSocketNoCard();
DEBUGMSG (1,(TEXT("--PDCardInitServices\n\r")));
return CERR_SUCCESS;
}
//****************************************************************************
// DumpSocketRegisters
//****************************************************************************
// Dumps the socket registers.
//
//
VOID DumpSocketRegisters
(
UINT socket
)
{
#ifdef DEBUG
DEBUGMSG
(
1,
(
TEXT("SMC_PCCONFIG_ATT1 = 0x%08x\r\n"),
*SMC_PCCONFIG_ATT1
)
);
DEBUGMSG
(
1,
(
TEXT("SMC_PCCONFIG_MEM1 = 0x%08x\r\n"),
*SMC_PCCONFIG_MEM1
)
);
DEBUGMSG
(
1,
(
TEXT("SMC_PCCONFIG_IO1 = 0x%08x\r\n"),
*SMC_PCCONFIG_IO1
)
);
DEBUGMSG
(
1,
(
TEXT("SMC_PCCONT = 0x%08x\r\n"),
*SMC_PCCONT
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_PFDR = 0x%08x\r\n"),
*GPIO_PFDR
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_PFDDR = 0x%08x\r\n"),
*GPIO_PFDDR
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_FINTTYPE1 = 0x%08x\r\n"),
*GPIO_FINTTYPE1
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_FINTTYPE2 = 0x%08x\r\n"),
*GPIO_FINTTYPE2
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_INTENF = 0x%08x\r\n"),
*GPIO_INTENF
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_INTSTATUSF = 0x%08x\r\n"),
*GPIO_INTSTATUSF
)
);
DEBUGMSG
(
1,
(
TEXT("GPIO_RAWINTSTATUSF= 0x%08x\r\n"),
*GPIO_RAWINTSTATUSF
)
);
DEBUGMSG
(
1,
(
TEXT("VIC1_RAWINTR = 0x%08x\r\n"),
*VIC1_RAWINTR
)
);
DEBUGMSG
(
1,
(
TEXT("VIC2_RAWINTR = 0x%08x\r\n"),
*VIC2_RAWINTR
)
);
#endif // DEBUG
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -