UEFI申请内存

来源:互联网 发布:php 获取header 编辑:程序博客网 时间:2024/05/16 00:58


EFI_STATUS EFIAPI GetMemory(EFI_SYSTEM_TABLE* gST)

EFI_STATUS               status;
 CHAR16                   *keys=NULL;

 status=gST->BootServices->AllocatePool(EfiBootServicesData,100,&keys);

 if(EFI_SUCCESS==status)
 {
  Print(L"success to allocate memory\n");
 }
 else
 {
  Print(L"failed to allocate memory\n");
 }

 keys[0]=65;
 keys[1]=66;
 keys[2]=67;
 keys[3]=0;

 Print(L"==allocate<>%s==\n",keys);

 gST->BootServices->FreePool(keys);
 Print(L"==allocate<>%s==\n",keys);

 return EFI_SUCCESS;

}

0 0