📄 args.c
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
#include <bsp.h>
BSP_ARGS *g_pBSPArgs = (BSP_ARGS *) IMAGE_SHARE_ARGS_UA_START;
//------------------------------------------------------------------------------
//
// Function: OALArgsQuery
//
// This function is called from other OAL modules to return boot arguments.
// Boot arguments are typically placed in fixed memory location and they are
// filled by boot loader. In case that boot arguments can't be located
// the function should return NULL. The OAL module then must use default
// values.
//
VOID* OALArgsQuery(UINT32 type)
{
VOID *pData = NULL;
BSP_ARGS *pArgs = (BSP_ARGS *)IMAGE_SHARE_ARGS_UA_START;
OALMSG(OAL_ARGS&&OAL_FUNC, (L"+OALArgsQuery(%d)\r\n", type));
// Check if there is expected signature
if (
pArgs->header.signature != OAL_ARGS_SIGNATURE ||
pArgs->header.oalVersion != OAL_ARGS_VERSION ||
pArgs->header.bspVersion != BSP_ARGS_VERSION
) goto cleanUp;
// Depending on required args
switch (type) {
case OAL_ARGS_QUERY_DEVID:
pData = &pArgs->deviceId;
break;
case OAL_ARGS_QUERY_KITL:
pData = &pArgs->kitl;
break;
case BSP_ARGS_QUERY_DBGSERIAL:
pData = &pArgs->dbgSerPhysAddr;
break;
case BSP_ARGS_QUERY_CLEANBOOT:
pData = &pArgs->bCleanBootFlag;
break;
case BSP_ARGS_QUERY_FORMATPART:
pData = &pArgs->bFormatPartFlag;
break;
}
cleanUp:
OALMSG(OAL_ARGS&&OAL_FUNC, (L"-OALArgsQuery(pData = 0x%08x)\r\n", pData));
return pData;
}
//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -