📄 kitl.c
字号:
//
// Copyright(C) Renesas Technology Corp. 2005. All rights reserved.
//
// NK Kernel for ITS-DS7
//
// FILE : kitl.c
// CREATED : 2005.08.10
// MODIFIED :
// AUTHOR : Renesas Technology Corp.
// HARDWARE : RENESAS ITS-DS7
// HISTORY :
// 2005.08.10
// - Created release code.
// (based on SMDK2410/MAINSTONEII for WCE5.0)
//
// 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: kitl.c
//
// Support routines for KITL.
//
// Note: this routines are stubbed out in the kern image.
//
//------------------------------------------------------------------------------
#include <bsp.h>
#include <its_ds7.h>
#include <kitl_cfg.h>
#include "drv_glob.h"
//------------------------------------------------------------------------------
BOOL OALKitlStart()
{
BOOL rc = FALSE;
OAL_KITL_ARGS *pKITLArgs;
CHAR *pszDeviceId;
static CHAR szDeviceId[OAL_KITL_ID_SIZE];
OALMSG(OAL_KITL&&OAL_FUNC, (L"+OALKitlStart\r\n"));
pKITLArgs = (OAL_KITL_ARGS*) OALArgsQuery(OAL_ARGS_QUERY_KITL);
pszDeviceId = (CHAR*) OALArgsQuery(OAL_ARGS_QUERY_DEVID);
// If there isn't device id from bootloader let KITL create some for us
if (pszDeviceId == NULL || pszDeviceId[0] == '\0') {
pszDeviceId = szDeviceId;
strncpy(pszDeviceId, BSP_DEVICE_PREFIX, OAL_KITL_ID_SIZE);
pKITLArgs->flags |= OAL_KITL_FLAGS_EXTNAME;
}
// Finally call KITL library.
//
rc = OALKitlInit(pszDeviceId, pKITLArgs, g_kitlDevices);
OALMSG(OAL_KITL&&OAL_FUNC, (L"-OALKitlStart(rc = %d)\r\n", rc));
return(rc);
}
DWORD OEMEthGetSecs (void)
{
SYSTEMTIME st;
DWORD dwRet;
static DWORD dwBias;
static DWORD dwLastTime;
OEMGetRealTime( &st );
dwRet = ((60UL * (60UL * (24UL * (31UL * st.wMonth + st.wDay) + st.wHour) + st.wMinute)) + st.wSecond);
dwBias = dwRet;
if (dwRet < dwLastTime) {
KITLOutputDebugString("! Time went backwards (or wrapped): cur: %u, last %u\n",
dwRet,dwLastTime);
}
dwLastTime = dwRet;
return (dwRet);
}
//------------------------------------------------------------------------------
//
// Function: OALGetTickCount
//
// This function is called by some KITL libraries to obtain relative time
// since device boot. It is mostly used to implement timeout in network
// protocol.
//
UINT32 OALGetTickCount()
{
return OEMEthGetSecs () * 1000;
}
//------------------------------------------------------------------------------
//
// Function: OALKitlInitRegistry
//
// This function is called during the initialization process to allow the
// OAL to denote devices which are being used by the KITL connection
// and thus shouldn't be touched during the OS initialization process. The
// OAL provides this information via the registry.
//
VOID OALKitlInitRegistry()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -