功能描述
由于开发需要,有时候需要在SBL阶段设置一些参数变量,然后给到系统启动之后读取操作
功能分析
查看代码发现,高通默认有测试程序可以写共享内存,代码如下smem_test.c
./boot_images/boot/QcomPkg/QcomTestCommon/SmemTestApp/smem_test.c
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/TestInterface.h>
#include "Protocol/EFISmem.h"
EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_SMEM_PROTOCOL * smem_protocol;
EFI_STATUS status;
UINT32 * vendor0;
UINT32 * vendor1;
UINT32 * vendor1_b;
UINT32 * vendor1_c;
UINT32 size;
TEST_START("SMEM");
status = gBS->LocateProtocol(&gEfiSMEMProtocolGuid, NULL,
(void**)&smem_protocol);
if(status != EFI_SUCCESS)
{
AsciiPrint("ERROR: LocateProtocol returned %d\n",