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

📄 register.c

📁 Windows CE 6.0 BSP for VOIPAC Board (PXA270) Version 2b.
💻 C
字号:
//
// 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.
//
//------------------------------------------------------------------------------
//
//  File:  register.c
//
#include <windows.h>
#include <ceddk.h>
#include <pcireg.h>
#include <oal.h>

//------------------------------------------------------------------------------
//
//  Function:  OALPCIRegisterAsUsed
//
BOOL OALPCIRegisterAsUsed(UINT32 busId, OAL_PCI_LOCATION pciLoc)
{
    BOOL rc = FALSE;
    PCI_COMMON_CONFIG pciCfg;
    PCI_REG_INFO pciInfo;

    OALMSG(OAL_KITL&&OAL_FUNC, (
        L"+OALPCIRegisterAsUsed(%d, %d/%d/%d)\r\n", busId, pciLoc.bus,
        pciLoc.dev, pciLoc.fnc
    ));

    // First read all device configuration space
    if (OALPCICfgRead(
        busId, pciLoc, 0, sizeof(pciCfg), &pciCfg) != sizeof(pciCfg)
    ) {
        OALMSG(OAL_ERROR, (
            L"ERROR:OALPCIRegisterAsUsed: Device config space read failed\r\n"
        ));            
        goto cleanUp;
    }  

    // Fill info structure
    PCIInitInfo(
       L"Drivers\\BuiltIn\\PCI\\Instance\\KITL", pciLoc.bus, pciLoc.dev, 
       pciLoc.fnc, pciCfg.u.type0.InterruptLine, &pciCfg, &pciInfo
    );

    // And write it to registry
    PCIReg(&pciInfo);

    // We are done
    rc = TRUE;

cleanUp:
    OALMSG(OAL_KITL&&OAL_FUNC, (L"-OALPCIRegisterAsUsed(rc = %d)\r\n", rc));
    return rc;
}

//------------------------------------------------------------------------------

⌨️ 快捷键说明

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