Delay()
1
gBS->Stall(Microsecond);
使用Stall要注意如下
#include <Library/UefiBootServicesTableLib.h>
Stall以微秒(µs,10-6)為單位
方法二:使用標準C Library的函數
1
sleep(second);
使用sleep要注意如下
#include <Include/unistd.h>
inf中,在[LibraryClasses]添加LibC
sleep以秒為單位
pST = SystemTable
gBS = SystemTable->BootServices)
UDK: #include <Library/UefiBootServicesTableLib.h>
MdePkg.dec
TimerLib
#include <Library/TimerLib.h>
MicroSecondDelay()
===================
EVENT
CreateEventEx 為事件組 一個 event 被觸發 就全部都跑一遍 (優先權為 先看TPL 在來是晚註冊的先跑)
EFI_EVENT Event;
EFI_GUID gGuid = EFI_MY_GUID;
gBS->CreateEventEx (0, 0, NULL, NULL,&gGuid,&Event);
gBS->SignalEvent (Event);
gBS->CloseEvent (Event);
原型:
CoreCreateEventEx (
IN UINT32 Type,
IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
IN CONST VOID *NotifyContext, OPTIONAL
IN CONST EFI_GUID *EventGroup, OPTIONAL
OUT EFI_EVENT *Event
);
1.If a UEFI Driver creates events in its driver entry point, those events must be closed with CloseEvent() in the UEFI Driver's Unload() function
2.If a UEFI Driver creates events in its Driver Binding Protocol Start()function associated with a device, those events must be closed with CloseEvent() in its Driver Binding Protocol Stop() function.
3.If a UEFI Driver creates events as part of an I/O operation, the event should be closed with CloseEvent() when the I /O operation is completed.
https://blog.csdn.net/luobing4365/article/details/104552594
https://blog.csdn.net/stringNewName/article/details/80004887
extern EFI_BOOT_SERVICES *gBS;
extern EFI_SYSTEM_TABLE *gST;
extern EFI_RUNTIME_SERVICES *gRT;
https://blog.csdn.net/stringNewName/article/details/80004887
extern EFI_BOOT_SERVICES *gBS;
extern EFI_SYSTEM_TABLE *gST;
extern EFI_RUNTIME_SERVICES *gRT;
InitAmiLib()
pST = SystemTable;
pBS = pST->BootServices;
pRS = pST->RuntimeServices;
#define gBS pBS
#define gRT pRS
gST = pST;
gBS = pBS;
gRT = pRS;
沒有留言:
張貼留言