dxe 如何跟smm 沟通 SMM Communication Protocol

This protocol provides a means of communicating between drivers outside of SMM and SMI
handlers inside of SMM.

SmmCommunication>
Communicate();

当前在DXE 环境,但是需要在smm mode 做一些事情。此时就需要把dxe 的数据信息传递给smm. 然后在smi callback里面做相做的事情。

sample:

注册一个smi handler call back, HeadrType 为指定的GUID.

// 

Status  = gSmst->SmiHandlerRegister(

                 ErasePspFtpmNvmesmmHandler,

                 &gPlatfromEarsePspFtpmvamieguid,

                 &mErasepspFtpmsmmhandle

                );

创建commBuffer,Commsize 空间。 通过smmCommunication->communicate() 传递给smm mode, 并且调用

smi handler callback.

 注意 HeaderGuid

   CommHeader = (EFI_SMM_COMMUNICATE_HEADER *) CommBuffer;

   CopyMem(&CommHeader->HeaderGuid, &gPlatformEarseftpmNvramguid, sizeof(efiguid);

猜你喜欢

转载自blog.csdn.net/robinsongsog/article/details/106033303