当前位置:网站首页>【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
2022-08-11 06:12:00 【wellnw】
功能描述
由于开发需要,有时候需要在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",
边栏推荐
猜你喜欢
随机推荐
第一个C函数:如何实现板级初始化?
maxwell concept
How Unity handles C# under the hood
抖音API接口
Redis + lua implements distributed interface current limiting implementation scheme
Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
Depth (relay supervision)
矩阵分析——Jordan标准形
Douyin share password url API tool
常见激活函数及其导数
Taobao product details API interface
2022-08-09 第四小组 修身课 学习笔记(every day)
buu—Re(5)
Taobao API common interface and acquisition method
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
抖音关键词搜索商品-API工具
淘宝sku API 接口(PHP示例)
Monte Carlo
Daily sql-seek the sum of successful investments in 2016
《Show and Tell: A Neural Image Caption Generator》论文解读