• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ KernelIoControl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中KernelIoControl函数的典型用法代码示例。如果您正苦于以下问题:C++ KernelIoControl函数的具体用法?C++ KernelIoControl怎么用?C++ KernelIoControl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了KernelIoControl函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TWS_CKC_SetDDIBUS

void TWS_CKC_SetDDIBUS(int ddibusname, unsigned char mode)
{
#ifdef __TCC89XX_WINCE__
	int retVal = -1;
	stckcioctl pCKCIOCTL;
	stckcinfo pCKCINFO;
	unsigned long	returnedbyte;

	if((ddibusname < DDIPWDN_CIF) || (ddibusname >= DDIPWDN_STEPMAX))
	{
		printf("[TWS_CKC_SetDDIBUS] Invalid DDI BUS : %d\n", ddibusname);
		return;
	}

	/* mode : 0(ddi bus disable), 1(ddi bus enable) */
	pCKCIOCTL.ioctlcode = IOCTL_CKC_SET_DDIPWDN;
	pCKCIOCTL.ddipdname = ddibusname;	
	pCKCIOCTL.mode = (mode>0)?1:0;

	KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);

	pCKCIOCTL.ioctlcode = IOCTL_CKC_GET_DDIPWDN;	
	KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);
	if(pCKCINFO.retVal == 0) // Enable
		printf("[TWS_CKC_SetDDIBUS]DDIBUS  : %d - Enable\n", pCKCIOCTL.ddipdname);
	else  // Disable 
		printf("[TWS_CKC_SetDDIBUS]DDIBUS  : %d - Disable\n", pCKCIOCTL.ddipdname);
#endif
}
开发者ID:bgtwoigu,项目名称:tcc8900,代码行数:29,代码来源:vpu_clk_ctrl.c


示例2: TWS_CKC_SetIOBUS

void TWS_CKC_SetIOBUS(int iobusname, unsigned char mode)
{
#ifdef __TCC89XX_WINCE__
	int retVal = -1;
	stckcioctl pCKCIOCTL;
	stckcinfo pCKCINFO;
	unsigned long	returnedbyte;

	if((iobusname < RB_USB11H) || (iobusname >= RB_ALLPERIPERALS))
	{
		printf("[TWS_CKC_SetIOBUS] Invalid IO BUS : %d\n", iobusname);
		return;
	}

	/* mode : 0(io bus disable), 1(io bus enable) */
	pCKCIOCTL.ioctlcode = IOCTL_CKC_SET_PERIBUS;
	pCKCIOCTL.prbname = iobusname;
	pCKCIOCTL.mode = (mode>0)?1:0;

	KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);

	pCKCIOCTL.ioctlcode = IOCTL_CKC_GET_PERIBUS;
	KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);
	if(pCKCINFO.retVal == 0)
		printf("[TWS_CKC_SetIOBUS]IOBUS: %d - Disable\n", pCKCIOCTL.prbname);
	else 
		printf("[TWS_CKC_SetIOBUS]IOBUS: %d - Enable\n", pCKCIOCTL.prbname);
#endif
}
开发者ID:bgtwoigu,项目名称:tcc8900,代码行数:29,代码来源:vpu_clk_ctrl.c


示例3: switch

SD_API_STATUS
CSDHCBase::SetControllerPowerState(
                                   CEDEVICE_POWER_STATE cpsNew
                                   )
{
    if (cpsNew != m_cpsCurrent) {
        switch (cpsNew) {
        case D0:
        case D4:
            KernelIoControl(IOCTL_HAL_DISABLE_WAKE, &m_dwSysIntr, 
                sizeof(m_dwSysIntr), NULL, 0, NULL);
            break;

        case D3:
            KernelIoControl(IOCTL_HAL_ENABLE_WAKE, &m_dwSysIntr, 
                sizeof(m_dwSysIntr), NULL, 0, NULL);
            break;
        }

        SetDevicePowerState(m_hBusAccess, cpsNew, NULL);
        m_cpsCurrent = cpsNew;
    }

    return SD_API_STATUS_SUCCESS;
}
开发者ID:darwinbeing,项目名称:wince-on-iphone,代码行数:25,代码来源:sdhc.cpp


示例4: DdsiTouchPanelEnable

BOOL
DdsiTouchPanelEnable(VOID)
{
	UINT32 Irq[3];

	TSPMSG((_T("[TSP] ++DdsiTouchPanelEnable()\r\n")));

	if (!g_bTSP_Initialized)	// Map Virtual address and Interrupt at First time Only
	{
		if (!TSP_VirtualAlloc())
		{
			TSPERR((_T("[TSP:ERR] DdsiTouchPanelEnable() : TSP_VirtualAlloc() Failed\r\n")));
			return FALSE;
		}

		// Initialize Critical Section
		InitializeCriticalSection(&g_csTouchADC);

		// Obtain SysIntr values from the OAL for the touch and touch timer interrupts.
		Irq[0] = -1;
		Irq[1] = OAL_INTR_FORCE_STATIC;
		Irq[2] = IRQ_PENDN;
		if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &Irq, sizeof(Irq), &gIntrTouch, sizeof(UINT32), NULL))
		{
			TSPERR((_T("[TSP:ERR] DdsiTouchPanelEnable() : IOCTL_HAL_REQUEST_SYSINTR Failed\r\n")));
			gIntrTouch = SYSINTR_UNDEFINED;
			return FALSE;
		}

		Irq[0] = -1;
		Irq[1] = OAL_INTR_FORCE_STATIC;
		Irq[2] = IRQ_TIMER3;
		if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &Irq, sizeof(Irq), &gIntrTouchChanged, sizeof(UINT32), NULL))
		{
			TSPERR((_T("[TSP:ERR] DdsiTouchPanelEnable() : IOCTL_HAL_REQUEST_SYSINTR Failed\r\n")));
			gIntrTouchChanged = SYSINTR_UNDEFINED;
			return FALSE ;
		}

		TSPINF((_T("[TSP:INF] DdsiTouchPanelEnable() : gIntrTouch = %d\r\n"), gIntrTouch));
		TSPINF((_T("[TSP:INF] DdsiTouchPanelEnable() : gIntrTouchChanged = %d\r\n"), gIntrTouchChanged));

		g_bTSP_Initialized = TRUE;
	}

	TSP_PowerOn();

	TSPMSG((_T("[TSP] --DdsiTouchPanelEnable()\r\n")));

	return TRUE;
}
开发者ID:darwinbeing,项目名称:wince-on-iphone,代码行数:51,代码来源:s3c6400_touch.cpp


示例5: PWR_ReleaseResources

static void
PWR_ReleaseResources(void)
{
	PWRBTN_MSG((_T("[PWR] ++PWR_ReleaseResources()\r\n")));

	if (g_pGPIOReg != NULL)
	{
		DrvLib_UnmapIoSpace((PVOID)g_pGPIOReg);
		g_pGPIOReg = NULL;
	}

	if (g_dwSysIntrPowerBtn != SYSINTR_UNDEFINED)
	{
		InterruptDisable(g_dwSysIntrPowerBtn);
	}

	if (g_hEventPowerBtn != NULL)
	{
		CloseHandle(g_hEventPowerBtn);
	}

	if (g_dwSysIntrPowerBtn != SYSINTR_UNDEFINED)
	{
		KernelIoControl(IOCTL_HAL_RELEASE_SYSINTR, &g_dwSysIntrPowerBtn, sizeof(DWORD), NULL, 0, NULL);
	}

	if (g_dwSysIntrResetBtn != SYSINTR_UNDEFINED)
	{
		InterruptDisable(g_dwSysIntrResetBtn);
	}

	if (g_hEventResetBtn != NULL)
	{
		CloseHandle(g_hEventResetBtn);
	}

	if (g_dwSysIntrResetBtn != SYSINTR_UNDEFINED)
	{
		KernelIoControl(IOCTL_HAL_RELEASE_SYSINTR, &g_dwSysIntrResetBtn, sizeof(DWORD), NULL, 0, NULL);
	}

	g_pGPIOReg = NULL;

	g_dwSysIntrPowerBtn = SYSINTR_UNDEFINED;
	g_dwSysIntrResetBtn = SYSINTR_UNDEFINED;

	g_hEventPowerBtn = NULL;
	g_hEventResetBtn = NULL;

	PWRBTN_MSG((_T("[PWR] --PWR_ReleaseResources()\r\n")));
}
开发者ID:blueskycoco,项目名称:BigStar,代码行数:51,代码来源:PowerButton_bak.c


示例6: KGetProcInfo

//Example function for later use
unsigned long KGetProcInfo(unsigned char * InStructurePointer,
		unsigned long InStructureLength, unsigned char * OutStructurePointer,
		unsigned long OutStructureLength) {

	Output("GetProcInfo(0x%x, %d, 0x%X, %d)\n", InStructurePointer,
			InStructureLength, OutStructurePointer, OutStructureLength);

	Output("sizeof(VOID_STRUCT) = %d, sizeof(PROCESSOR_INFO) = %d)\n",
			sizeof(VOID_STRUCT), sizeof(PROCESSOR_INFO));

	if (InStructurePointer && OutStructurePointer
			&& sizeof(VOID_STRUCT) == InStructureLength
			&& sizeof(PROCESSOR_INFO) == OutStructureLength) {
		PROCESSOR_INFO * pinfo = (PROCESSOR_INFO *) OutStructurePointer;

		// Try to lookup processor type.
		DWORD rsize;
		memset(&pinfo, sizeof(pinfo), 0);
		int ret = KernelIoControl(IOCTL_PROCESSOR_INFORMATION, NULL, 0, &pinfo,
				sizeof(pinfo), &rsize);
		if (ret) {
			Output("pinfo filled, GetProcInfo returns ERROR_SUCCESS\n");

			return ERROR_SUCCESS;
		}
		Output("pinfo not filled, GetProcInfo returns ERROR_SUCCESS\n");
		return ERROR;
	}
	return ERROR_INVALID_PARAMETER;
}
开发者ID:spavlin,项目名称:HaRET-K,代码行数:31,代码来源:kmode_dll.cpp


示例7: TWS_CKC_GetBUS

int TWS_CKC_GetBUS(int pckname,int *pckcfreq)
{     
#ifdef __TCC89XX_WINCE__
	int retVal = -1;
	stckcioctl pCKCIOCTL;
	stckcinfo pCKCINFO;
	unsigned long returnedbyte;

	pCKCIOCTL.ioctlcode = IOCTL_CKC_GET_CLOCKINFO;

	KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);
	printf("======================================\n");
	printf("[TWS_CKC_GetBUS] PLL: %10d\n", pCKCINFO.currentsysfreq);
	printf("[TWS_CKC_GetBUS] CPU: %10d\n",pCKCINFO.currentcpufreq);
	printf("[TWS_CKC_GetBUS] MEM: %10d\n",pCKCINFO.currentbusfreq);
	printf("======================================\n");

	if(pckcfreq!=NULL)
	{
		*pckcfreq = pCKCINFO.currentbusfreq;
	}

	return pCKCINFO.currentbusfreq;
#else
	return 0;
#endif
}
开发者ID:bgtwoigu,项目名称:tcc8900,代码行数:27,代码来源:vpu_clk_ctrl.c


示例8: NLedBoardInit

BOOL NLedBoardInit()
{  
    if (NLedCpuFamily == -1)
    {
        KernelIoControl(
                        IOCTL_HAL_GET_CPUFAMILY,
                        &NLedCpuFamily,
                        sizeof(DWORD),
                        &NLedCpuFamily,
                        sizeof(DWORD),
                        NULL
                        );
    }
    if( NLedCpuFamily != CPU_FAMILY_DM37XX)
    {    
        if (RequestAndConfigurePadArray(LedPinMux))
        {
            return TRUE;
        }
        else
        {
            ERRORMSG(1,(TEXT("Unable to request PAD configuration for NLED driver\r\n")));
            return FALSE;
        }
    }
    return FALSE;
}
开发者ID:zizilala,项目名称:projects_wince_AA,代码行数:27,代码来源:nled.c


示例9: HalContextUpdateDirtyRegister

//-----------------------------------------------------------------------------
//
//  Function:  HalContextUpdateDirtyRegister
//
//  update context save mask to indicate registers need to be saved before
//  off
//
void
HalContextUpdateDirtyRegister(
    UINT32 ffRegister
    )
{
#if 1
#if (_WINCEOSVER<600)
    BOOL bOldMode = SetKMode(TRUE);
#endif

    static UINT32 *pKernelContextSaveMask = NULL;

    if (pKernelContextSaveMask == NULL)
        {
        KernelIoControl(IOCTL_HAL_CONTEXTSAVE_GETBUFFER, 
            NULL, 
            0, 
            &pKernelContextSaveMask, 
            sizeof(UINT**), 
            0
            );
        }

    *pKernelContextSaveMask |= ffRegister;

#if (_WINCEOSVER<600)
    SetKMode(bOldMode);
#endif
#else
    UNREFERENCED_PARAMETER(ffRegister);
#endif
}
开发者ID:zizilala,项目名称:projects_etest,代码行数:39,代码来源:pmext.cpp


示例10: vm_sys_info_get_cpu_name

void vm_sys_info_get_cpu_name(vm_char *cpu_name)
{
    PROCESSOR_INFO pi;
    Ipp32u dwBytesReturned;
    Ipp32u dwSize = sizeof(PROCESSOR_INFO);
    BOOL bResult;

    /* check error(s) */
    if (NULL == cpu_name)
        return;

    ZeroMemory(&pi, sizeof(PROCESSOR_INFO));
    bResult = KernelIoControl(IOCTL_PROCESSOR_INFORMATION,
                              NULL,
                              0,
                              &pi,
                              sizeof(PROCESSOR_INFO),
                              &dwBytesReturned);

    vm_string_sprintf(cpu_name,
                      VM_STRING("%s %s"),
                      pi.szProcessCore,
                      pi.szProcessorName);

} /* void vm_sys_info_get_cpu_name(vm_char *cpu_name) */
开发者ID:metamediatechnologies,项目名称:libvm,代码行数:25,代码来源:vm_sys_info_win32.c


示例11: KernelIoControl

SD_API_STATUS
CSDHCBase::Stop()
{
    // Mark for shutdown
    m_fDriverShutdown = TRUE;

    if (m_fInterruptInitialized) {
        KernelIoControl(IOCTL_HAL_DISABLE_WAKE, &m_dwSysIntr, sizeof(m_dwSysIntr),
            NULL, 0, NULL);

        InterruptDisable(m_dwSysIntr);
    }

    // Clean up controller IST
    if (m_htIST) {
        // Wake up the IST
        SetEvent(m_hevInterrupt);
        WaitForSingleObject(m_htIST, INFINITE); 
        CloseHandle(m_htIST);
        m_htIST = NULL;
    }

    // free controller interrupt event
    if (m_hevInterrupt) {
        CloseHandle(m_hevInterrupt);
        m_hevInterrupt = NULL;
    }

    for (DWORD dwSlot = 0; dwSlot < m_cSlots; ++dwSlot) {
        PCSDHCSlotBase pSlot = GetSlot(dwSlot);
        pSlot->Stop();
    }

    return SD_API_STATUS_SUCCESS;
}
开发者ID:darwinbeing,项目名称:wince-on-iphone,代码行数:35,代码来源:sdhc.cpp


示例12: HalSetBusDataByOffset

//------------------------------------------------------------------------------
//
// Function:     HalSetBusDataByOffset
//
//  This function write bus configuration data. It convert input parameters
//  to new format and then it calls kernel to do rest.
//
ULONG HalSetBusDataByOffset(
    BUS_DATA_TYPE busDataType, ULONG busNumber, ULONG slotNumber, VOID *pBuffer,
    ULONG offset, ULONG length
) {
    OAL_DDK_PARAMS params;
    PCI_SLOT_NUMBER slot;
    UINT32 outSize, rc = 0;

    params.function = IOCTL_OAL_WRITEBUSDATA;
    params.rc = 0;
    switch (busDataType) {
    case PCIConfiguration:
        params.busData.devLoc.IfcType = PCIBus;
        slot.u.AsULONG = slotNumber;
        params.busData.devLoc.BusNumber = busNumber >> 8;
        params.busData.devLoc.LogicalLoc = (busNumber & 0xFF) << 16;
        params.busData.devLoc.LogicalLoc |= slot.u.bits.DeviceNumber << 8;
        params.busData.devLoc.LogicalLoc |= slot.u.bits.FunctionNumber;
        rc = TRUE;
        break;
    }
    params.busData.offset = offset;
    params.busData.length = length;
    params.busData.pBuffer = pBuffer;

    if (KernelIoControl(
        IOCTL_HAL_DDK_CALL, &params, sizeof(params), NULL, 0, &outSize
    )) {
        rc = params.rc;
    }

    return rc;
}
开发者ID:Phong005,项目名称:aeroboot,代码行数:40,代码来源:data.c


示例13: TWS_CKC_SetFBUS

void TWS_CKC_SetFBUS(int pckname,int pckcenable,int mode, int pckcfreq, int source)
{           
#ifdef __TCC89XX_WINCE__
	int retVal = -1;
	stckcioctl    pCKCIOCTL;
	stckcinfo	 pCKCINFO;
	unsigned long returnedbyte;
	int ret;

	pCKCIOCTL.ioctlcode	=  IOCTL_CKC_SET_CHANGEFBUS;
	pCKCIOCTL.fbusname	= pckname;
	pCKCIOCTL.fbusfreq	= pckcfreq;

	ret = KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);

	// check a frequency	
	printf("[TWS_CKC_SetFBUS] %d, %10d\n", pckname, TWS_CKC_GetFBUS(pckname));

	// check a relative PMU status
	switch(pckname)
	{
	case CLKCTRL3:
		{
			pCKCIOCTL.ioctlcode = IOCTL_CKC_GET_PMUPOWER;
			pCKCIOCTL.pmuoffname = PMU_GRAPHICBUS;
			KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);
			if(pCKCINFO.state == 1) // 1 : Disable, 0: Enable
				printf("[TWS_CKC_SetFBUS]PMU_GRAPHICBUS:    Disable\n");
			else
				printf("[TWS_CKC_SetFBUS]PMU_GRAPHICBUS:    Enable\n");
		}
		break;

	case CLKCTRL5:
		{
			pCKCIOCTL.ioctlcode = IOCTL_CKC_GET_PMUPOWER;
			pCKCIOCTL.pmuoffname = PMU_VIDEOBUS;
			KernelIoControl(IOCTL_HAL_TCCCKC, &pCKCIOCTL, sizeof(stckcioctl), &pCKCINFO, sizeof(stckcinfo), &returnedbyte);
			if(pCKCINFO.state == 1) // 1 : Disable, 0: Enable
				printf("[TWS_CKC_SetFBUS]PMU_VIDEOBUS:    Disable\n");
			else
				printf("[TWS_CKC_SetFBUS]PMU_VIDEOBUS:    Enable\n");
		}
		break;
	}
#endif
}
开发者ID:bgtwoigu,项目名称:tcc8900,代码行数:47,代码来源:vpu_clk_ctrl.c


示例14: Init

    virtual BOOL Init()
    {
        PHYSICAL_ADDRESS    ioPhysicalBase = {0,0};

        ioPhysicalBase.LowPart = S3C6410_BASE_REG_PA_SYSCON;
        ioPhysicalBase.HighPart = 0;
        m_pSysconRegs = (S3C6410_SYSCON_REG *) MmMapIoSpace(ioPhysicalBase,sizeof(S3C6410_SYSCON_REG),FALSE);

        if(m_pSysconRegs)
        {
            m_pSysconRegs->PCLK_GATE  |= PCLK_UART0;        // UART0
            m_pSysconRegs->SCLK_GATE  |= SCLK_UART;        // UART0~3    
        }
        else
        {
            return FALSE;
        }

        ioPhysicalBase.LowPart = S3C6410_BASE_REG_PA_GPIO;
        ioPhysicalBase.HighPart = 0;
        m_pIOPregs = (S3C6410_GPIO_REG *) MmMapIoSpace(ioPhysicalBase, sizeof(S3C6410_GPIO_REG),FALSE);

        if (m_pIOPregs)
        {
            DDKISRINFO ddi;
            if (GetIsrInfo(&ddi)== ERROR_SUCCESS && 
                KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &ddi.dwIrq, sizeof(UINT32), &ddi.dwSysintr, sizeof(UINT32), NULL))
            {   
                RETAILMSG( FALSE, (TEXT("DEBUG: Serial0 SYSINTR : %d\r\n"), (PBYTE)&ddi.dwSysintr)); 
                RegSetValueEx(DEVLOAD_SYSINTR_VALNAME,REG_DWORD,(PBYTE)&ddi.dwSysintr, sizeof(UINT32));
            }
            else
            {
                return FALSE;
            }

            m_pDTRPort = (volatile ULONG *)&(m_pIOPregs->GPNDAT);
            m_pDSRPort = (volatile ULONG *)&(m_pIOPregs->GPNDAT);
            m_dwDTRPortNum = DTR_PORT_NUMBER;
            m_dwDSRPortNum = DSR_PORT_NUMBER;

            // CTS0(GPA2), RTS0(GPA3), TXD0(GPA1), RXD0(GPA0)
            m_pIOPregs->GPACON &= ~(0xf<<0 | 0xf<<4 | 0xf<<8 | 0xf<<12 );    ///< Clear Bit
            m_pIOPregs->GPACON |=  (0x2<<0 | 0x2<<4 | 0x2<<8 | 0x2<<12 );     ///< Select UART IP                
            m_pIOPregs->GPAPUD &= ~(0x3<<0 | 0x3<<2 | 0x3<<4 | 0x3<<6 );    ///< Pull-Up/Down Disable  

            // DTR0(GPN6), DSR0(GPN7)
            // DTR and DSR are used for ActiveSync connection.
            m_pIOPregs->GPNCON &= ~(0x3<<12);    ///< DTR0 Clear Bit
            m_pIOPregs->GPNCON |= (0x1<<12);    ///< Output
            m_pIOPregs->GPNPUD &= ~(0x3<<12);    ///< Pull-Up/Down Disable 
            m_pIOPregs->GPNCON &= ~(0x3<<14);    ///< DSR0 Clear Bit
            m_pIOPregs->GPNCON |= (0x0<<14);    ///< Input
            m_pIOPregs->GPNPUD &= ~(0x3<<14);    ///< Pull-Up/Down Disable 

            return CPdd6410Uart::Init();
        }
        return FALSE;
    }
开发者ID:hibive,项目名称:sjmt6410pm090728,代码行数:59,代码来源:ser_smdk6410.cpp


示例15: OnWarmBoot

void OnWarmBoot() 
{
	BOOL  status;
	DWORD bytes_returned;
	status = KernelIoControl( IOCTL_HAL_WARMBOOT, NULL, 0, NULL, 0, &bytes_returned );

	//TODO: Add check to see that changes haven't been made since last "OnUpdate()" & alert if necessary
}
开发者ID:hjgode,项目名称:c00p,代码行数:8,代码来源:RebootDialog2.cpp


示例16: Init

	virtual BOOL Init()
	{
		PHYSICAL_ADDRESS	ioPhysicalBase = { S3C6400_BASE_REG_PA_GPIO, 0};
		ULONG				inIoSpace = 0;
		if (TranslateBusAddr(m_hParent,Internal,0, ioPhysicalBase,&inIoSpace,&ioPhysicalBase))
		{
			// Map it if it is Memeory Mapped IO.
			m_pIOPregs = (S3C6400_GPIO_REG *)DrvLib_MapIoSpace(ioPhysicalBase.LowPart , sizeof(S3C6400_GPIO_REG),FALSE);
		}
		ioPhysicalBase.LowPart = S3C6400_BASE_REG_PA_SYSCON;
		ioPhysicalBase.HighPart = 0;
		if (TranslateBusAddr(m_hParent,Internal,0, ioPhysicalBase,&inIoSpace,&ioPhysicalBase))
		{
			m_pSysconRegs = (S3C6400_SYSCON_REG *) DrvLib_MapIoSpace(ioPhysicalBase.LowPart ,sizeof(S3C6400_SYSCON_REG),FALSE);
		}
		if(m_pSysconRegs)
		{
			m_pSysconRegs->PCLK_GATE  |= (1<<1);		// UART0
			m_pSysconRegs->SCLK_GATE  |= (1<<5);		// UART0~3	
		}
		if (m_pIOPregs)
		{
			DDKISRINFO ddi;
			if (GetIsrInfo(&ddi)== ERROR_SUCCESS && 
				 KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &ddi.dwIrq, sizeof(UINT32), &ddi.dwSysintr, sizeof(UINT32), NULL))
			{   
				//RETAILMSG( TRUE, (TEXT("DEBUG: Serial0 SYSINTR : %d\r\n"), (PBYTE)&ddi.dwSysintr)); 
				RegSetValueEx(DEVLOAD_SYSINTR_VALNAME,REG_DWORD,(PBYTE)&ddi.dwSysintr, sizeof(UINT32));
			}
			else
			{
				return FALSE;
			}

			m_pDTRPort = (volatile ULONG *)&(m_pIOPregs->GPNDAT);
			m_pDSRPort = (volatile ULONG *)&(m_pIOPregs->GPNDAT);
			m_dwDTRPortNum = 6;
			m_dwDSRPortNum = 7;

			// CTS0(GPA2), RTS0(GPA3), TXD0(GPA1), RXD0(GPA0)
			m_pIOPregs->GPACON &= ~(0xf<<0 | 0xf<<4 | 0xf<<8 | 0xf<<12 );	///< Clear Bit
			m_pIOPregs->GPACON |=  (0x2<<0 | 0x2<<4 | 0x2<<8 | 0x2<<12 ); 	///< Select UART IP                
			m_pIOPregs->GPAPUD &= ~(0x3<<0 | 0x3<<2 | 0x3<<4 | 0x3<<6 );    ///< Pull-Up/Down Disable  

			// DTR0(GPN6), DSR0(GPN7)
			// If you want to use COM1 port for ActiveSync, use these statements.     
			m_pIOPregs->GPNCON &= ~(0x3<<12);	///< DTR0 Clear Bit
			m_pIOPregs->GPNCON |= (0x1<<12);	///< Output
			m_pIOPregs->GPNPUD &= ~(0x3<<12);	///< Pull-Up/Down Disable 
			m_pIOPregs->GPNCON &= ~(0x3<<14);	///< DSR0 Clear Bit
			m_pIOPregs->GPNCON |= (0x0<<14);	///< Input
			m_pIOPregs->GPNPUD &= ~(0x3<<14);	///< Pull-Up/Down Disable 

			return CPdd6400Uart::Init();
		}
		return FALSE;
	}
开发者ID:darwinbeing,项目名称:wince-on-iphone,代码行数:57,代码来源:ser_smdk6400.cpp


示例17: InitializeIST

static BOOL InitializeIST()
{
    BOOL r;

    gMfcIntrEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    if (!gMfcIntrEvent) {
        ERRORMSG(1, (L"Unable to create interrupt event"));
        return(FALSE);
    }

    if (!CreateInterruptNotification()) {
        ERRORMSG(1, (L"Unable to create interrupt notification"));
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }

    r = KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR,
                        &g_MfcIrq,     sizeof(UINT32),
                        &g_MfcSysIntr, sizeof(UINT32),
                        NULL);
    if (r != TRUE) {
        ERRORMSG(1, (L"Failed to request sysintr value for MFC interrupt.\r\n"));
        DeleteInterruptNotification();
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }


    r = InterruptInitialize(g_MfcSysIntr, gMfcIntrEvent, NULL, 0);
    if (r != TRUE) {
        ERRORMSG(1, (L"Unable to initialize output interrupt"));
        DeleteInterruptNotification();
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }

    gMfcIntrThread = CreateThread((LPSECURITY_ATTRIBUTES)NULL,
                                  0,
                                  (LPTHREAD_START_ROUTINE)MFC_IntrThread,
                                  0,
                                  0,
                                  NULL);
    if (!gMfcIntrThread) {
        ERRORMSG(1, (L"Unable to create interrupt thread"));
        InterruptDisable(g_MfcSysIntr);
        DeleteInterruptNotification();
        CloseHandle(gMfcIntrEvent);
        return FALSE;
    }

    // Bump up the priority since the interrupt must be serviced immediately.
    CeSetThreadPriority(gMfcIntrThread, MFC_THREAD_PRIORITY_DEFAULT);

    RETAILMSG(1, (L"MFC Interrupt has been initialized.\n"));

    return TRUE;
}
开发者ID:HITEG,项目名称:TenByTen6410_SLC,代码行数:57,代码来源:MfcDriver.cpp


示例18: harness_deinit

void harness_deinit(void)
#define HAS_DEINIT
{
	int res;
	DWORD out;

	res = KernelIoControl(IOCTL_HAL_RELEASE_SYSINTR, 
	                      &sysintr, sizeof(sysintr), NULL, 0, &out);
	assert(res);
}
开发者ID:henrryhe,项目名称:beijing-7101,代码行数:10,代码来源:harness_wince.c


示例19: GetUUID

BOOL GetUUID (TCHAR* szClientHWID) 
{
  GUID myUUID;
  BOOL bRetVal;
  DWORD dwBytesReturned;

  bRetVal = KernelIoControl (IOCTL_HAL_GET_UUID, NULL, 0, &myUUID, 
                             sizeof (myUUID), &dwBytesReturned);
  if (!bRetVal) 
  {
    //MessageBox(NULL, L"KernelIoControl call failed!\r\n", L"getUUID", MB_OK | MB_TOPMOST | MB_SETFOREGROUND);
    DEBUGMSG(1, (L"KernelIoControl call failed!\r\n"));
    return FALSE;
  }

  TCHAR txt[MAX_PATH];
/*
	[HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing\HardwareID]
	"ClientHWID"=hex(3):01,00,02,00,
		00,40,05,6a,
			0e,9d,
				01,08,
					00,20,
						4f,ac,10,40,60,00
	[HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client]
	"UUID"=hex(3):
		00,40,05,6a,
			0e,9d,
				01,08,
					00,20,
						4f,ac,10,40,60,00

*/
  // "6A054000-9D0E-0801-0020-4FAC10406000"
  wsprintf(txt, L"UUID: \n%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X\r\n",
    myUUID.Data1,
    myUUID.Data2,
    myUUID.Data3,
    myUUID.Data4[0],
    myUUID.Data4[1],
    myUUID.Data4[2],
    myUUID.Data4[3],
    myUUID.Data4[4],
    myUUID.Data4[5],
    myUUID.Data4[6],
    myUUID.Data4[7]);

  RETAILMSG(
    1,
    (txt));

  wsprintf(szClientHWID, txt);
  //MessageBox(NULL, txt, L"getUUID", MB_OK | MB_TOPMOST | MB_SETFOREGROUND);
  return TRUE;
}
开发者ID:340211173,项目名称:rdp-auto-login,代码行数:55,代码来源:getUUID.cpp


示例20: SendRetentionVoltages

//-----------------------------------------------------------------------------
//
//  Function:  SendRetentionVoltages
//
//  Function that sends new retention voltages via KernelIOCTL
//
VOID
SendRetentionVoltages()
{
    KernelIoControl(
        IOCTL_UPDATE_RETENTION_VOLTAGES,
        &s_KernIoCtlInfo,
        sizeof(IOCTL_RETENTION_VOLTAGES),
        NULL,
        0,
        NULL
        );
}
开发者ID:zizilala,项目名称:projects_wince_AA,代码行数:18,代码来源:smartreflexpolicy.cpp



注:本文中的KernelIoControl函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KeyDown函数代码示例发布时间:2022-05-30
下一篇:
C++ KeWaitForSingleObject函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap