这篇教程C++ uefi_call_wrapper函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uefi_call_wrapper函数的典型用法代码示例。如果您正苦于以下问题:C++ uefi_call_wrapper函数的具体用法?C++ uefi_call_wrapper怎么用?C++ uefi_call_wrapper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uefi_call_wrapper函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: tpm1_measure_to_pcr_and_event_logstatic EFI_STATUS tpm1_measure_to_pcr_and_event_log(const EFI_TCG *tcg, UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UINTN buffer_size, const CHAR16 *description) { EFI_STATUS status; TCG_PCR_EVENT *tcg_event; UINT32 event_number; EFI_PHYSICAL_ADDRESS event_log_last; UINTN desc_len; desc_len = (StrLen(description) + 1) * sizeof(CHAR16); tcg_event = AllocateZeroPool(desc_len + sizeof(TCG_PCR_EVENT)); if (tcg_event == NULL) return EFI_OUT_OF_RESOURCES; tcg_event->EventSize = desc_len; CopyMem((VOID *) & tcg_event->Event[0], (VOID *) description, desc_len); tcg_event->PCRIndex = pcrindex; tcg_event->EventType = EV_IPL; event_number = 1; status = uefi_call_wrapper(tcg->HashLogExtendEvent, 7, tcg, buffer, buffer_size, TCG_ALG_SHA, tcg_event, &event_number, &event_log_last); if (EFI_ERROR(status)) return status; uefi_call_wrapper(BS->FreePool, 1, tcg_event); return EFI_SUCCESS;}
开发者ID:GuillaumeSeren,项目名称:systemd,代码行数:32,
示例2: simple_file_read_allEFI_STATUSsimple_file_read_all(EFI_FILE *file, UINTN *size, void **buffer){ EFI_STATUS efi_status; EFI_FILE_INFO *fi; char buf[1024]; *size = sizeof(buf); fi = (void *)buf; efi_status = uefi_call_wrapper(file->GetInfo, 4, file, &FILE_INFO, size, fi); if (efi_status != EFI_SUCCESS) { Print(L"Failed to get file info/n"); return efi_status; } *size = fi->FileSize; *buffer = AllocatePool(*size); if (!*buffer) { Print(L"Failed to allocate buffer of size %d/n", *size); return EFI_OUT_OF_RESOURCES; } efi_status = uefi_call_wrapper(file->Read, 3, file, size, *buffer); return efi_status;}
开发者ID:Acidburn0zzz,项目名称:shim,代码行数:29,
示例3: efi_mainEFI_STATUSefi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab){ EFI_STATUS rc; InitializeLib(image, systab); rc = uefi_call_wrapper(BS->HandleProtocol, 3, image, &LoadedImageProtocol, (void *)&this_image); if (EFI_ERROR(rc)) { Print(L"Error: could not find loaded image: %d/n", rc); return rc; } Print(L"System BootOrder not found. Initializing defaults./n"); set_boot_order(); rc = find_boot_options(this_image->DeviceHandle); if (EFI_ERROR(rc)) { Print(L"Error: could not find boot options: %d/n", rc); return rc; } try_start_first_option(image); Print(L"Reset System/n"); uefi_call_wrapper(RT->ResetSystem, 4, EfiResetCold, EFI_SUCCESS, 0, NULL); return EFI_SUCCESS;}
开发者ID:PerditionC,项目名称:shim,代码行数:31,
示例4: executeEFI_STATUSexecute(EFI_HANDLE image, CHAR16 *name){ EFI_STATUS status; EFI_HANDLE h; EFI_LOADED_IMAGE *li; EFI_DEVICE_PATH *devpath; CHAR16 *PathName; status = uefi_call_wrapper(BS->HandleProtocol, 3, image, &IMAGE_PROTOCOL, (void **)&li); if (status != EFI_SUCCESS) return status; status = generate_path(name, li, &devpath, &PathName); if (status != EFI_SUCCESS) return status; status = uefi_call_wrapper(BS->LoadImage, 6, FALSE, image, devpath, NULL, 0, &h); if (status != EFI_SUCCESS) goto out; status = uefi_call_wrapper(BS->StartImage, 3, h, NULL, NULL); uefi_call_wrapper(BS->UnloadImage, 1, h); out: FreePool(PathName); FreePool(devpath); return status;}
开发者ID:Acidburn0zzz,项目名称:shim,代码行数:32,
示例5: get_variable_attrEFI_STATUSget_variable_attr(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner, UINT32 *attributes){ EFI_STATUS efi_status; *len = 0; efi_status = uefi_call_wrapper(RT->GetVariable, 5, var, &owner, NULL, len, NULL); if (efi_status != EFI_BUFFER_TOO_SMALL) return efi_status; *data = AllocateZeroPool(*len); if (!*data) return EFI_OUT_OF_RESOURCES; efi_status = uefi_call_wrapper(RT->GetVariable, 5, var, &owner, attributes, len, *data); if (efi_status != EFI_SUCCESS) { FreePool(*data); *data = NULL; } return efi_status;}
开发者ID:Acidburn0zzz,项目名称:shim,代码行数:26,
示例6: try_start_first_optionstatic EFI_STATUStry_start_first_option(EFI_HANDLE parent_image_handle){ EFI_STATUS rc; EFI_HANDLE image_handle; if (!first_new_option) { return EFI_SUCCESS; } rc = uefi_call_wrapper(BS->LoadImage, 6, 0, parent_image_handle, first_new_option, NULL, 0, &image_handle); if (EFI_ERROR(rc)) { Print(L"LoadImage failed: %d/n", rc); uefi_call_wrapper(BS->Stall, 1, 2000000); return rc; } EFI_LOADED_IMAGE *image; rc = uefi_call_wrapper(BS->HandleProtocol, 3, image_handle, &LoadedImageProtocol, (void *)&image); if (!EFI_ERROR(rc)) { image->LoadOptions = first_new_option_args; image->LoadOptionsSize = first_new_option_size; } rc = uefi_call_wrapper(BS->StartImage, 3, image_handle, NULL, NULL); if (EFI_ERROR(rc)) { Print(L"StartImage failed: %d/n", rc); uefi_call_wrapper(BS->Stall, 1, 2000000); } return rc;}
开发者ID:samBeanham,项目名称:shim,代码行数:33,
示例7: fwup_malloc_raw/* * Allocate some raw pages that aren't part of the pool allocator. */VOID *fwup_malloc_raw(UINTN size){ UINTN pages = size / 4096 + ((size % 4096) ? 1 : 0); /* page size is always 4096 */ EFI_STATUS rc; EFI_PHYSICAL_ADDRESS pageaddr = 0; EFI_ALLOCATE_TYPE type = AllocateAnyPages; if (sizeof(VOID *) == 4) { pageaddr = 0xffffffffULL - 8192; type = AllocateMaxAddress; } rc = uefi_call_wrapper(BS->AllocatePages, 4, type, EfiLoaderData, pages, &pageaddr); if (EFI_ERROR(rc)) { fwup_warning(L"Could not allocate %d", size); return NULL; } if (sizeof(VOID *) == 4 && pageaddr > 0xffffffffULL) { uefi_call_wrapper(BS->FreePages, 2, pageaddr, pages); fwup_warning(L"Got bad allocation at 0x%016x", (UINT64)pageaddr); return NULL; } return (VOID *)(UINTN)pageaddr;}
开发者ID:vathpela,项目名称:fwupd,代码行数:30,
示例8: simple_file_open_by_handleEFI_STATUSsimple_file_open_by_handle(EFI_HANDLE device, CHAR16 *name, EFI_FILE **file, UINT64 mode){ EFI_STATUS efi_status; EFI_FILE_IO_INTERFACE *drive; EFI_FILE *root; efi_status = uefi_call_wrapper(BS->HandleProtocol, 3, device, &SIMPLE_FS_PROTOCOL, &drive); if (efi_status != EFI_SUCCESS) { Print(L"Unable to find simple file protocol (%d)/n", efi_status); goto error; } efi_status = uefi_call_wrapper(drive->OpenVolume, 2, drive, &root); if (efi_status != EFI_SUCCESS) { Print(L"Failed to open drive volume (%d)/n", efi_status); goto error; } efi_status = uefi_call_wrapper(root->Open, 5, root, file, name, mode, 0); error: return efi_status;}
开发者ID:syuu1228,项目名称:peloader,代码行数:28,
示例9: update_boot_orderEFI_STATUSupdate_boot_order(void){ UINTN size; UINTN len = 0; EFI_GUID global = EFI_GLOBAL_VARIABLE; CHAR16 *newbootorder = NULL; EFI_STATUS rc; size = nbootorder * sizeof(CHAR16); newbootorder = AllocateZeroPool(size); if (!newbootorder) return EFI_OUT_OF_RESOURCES; CopyMem(newbootorder, bootorder, size);#ifdef DEBUG_FALLBACK Print(L"nbootorder: %d/nBootOrder: ", size / sizeof (CHAR16)); UINTN j; for (j = 0 ; j < size / sizeof (CHAR16); j++) Print(L"%04x ", newbootorder[j]); Print(L"/n");#endif rc = uefi_call_wrapper(RT->GetVariable, 5, L"BootOrder", &global, NULL, &len, NULL); if (rc == EFI_BUFFER_TOO_SMALL) LibDeleteVariable(L"BootOrder", &global); rc = uefi_call_wrapper(RT->SetVariable, 5, L"BootOrder", &global, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, size, newbootorder); FreePool(newbootorder); return rc;}
开发者ID:Acidburn0zzz,项目名称:shim,代码行数:35,
示例10: simple_file_read_allEFI_STATUSsimple_file_read_all(EFI_FILE *file, UINTN *size, void **buffer){ EFI_STATUS efi_status; EFI_FILE_INFO *fi; char buf[1024]; *size = sizeof(buf); fi = (void *)buf; efi_status = uefi_call_wrapper(file->GetInfo, 4, file, &FILE_INFO, size, fi); if (efi_status != EFI_SUCCESS) { Print(L"Failed to get file info/n"); return efi_status; } *size = fi->FileSize; /* might use memory mapped, so align up to nearest page */ *buffer = AllocateZeroPool(ALIGN_VALUE(*size, 4096)); if (!*buffer) { Print(L"Failed to allocate buffer of size %d/n", *size); return EFI_OUT_OF_RESOURCES; } efi_status = uefi_call_wrapper(file->Read, 3, file, size, *buffer); return efi_status;}
开发者ID:syuu1228,项目名称:peloader,代码行数:30,
示例11: apply_capsulesstatic EFI_STATUSapply_capsules(EFI_CAPSULE_HEADER **capsules, EFI_CAPSULE_BLOCK_DESCRIPTOR *cbd, UINTN num_updates, EFI_RESET_TYPE *reset){ UINT64 max_capsule_size; EFI_STATUS rc; rc = uefi_call_wrapper(RT->QueryCapsuleCapabilities, 4, capsules, num_updates, &max_capsule_size, reset); if (debugging) { Print(L"QueryCapsuleCapabilities: %r max: %ld reset:%d/n", rc, max_capsule_size, *reset); Print(L"Capsules: %d/n", num_updates); } uefi_call_wrapper(BS->Stall, 1, 1000000); rc = uefi_call_wrapper(RT->UpdateCapsule, 3, capsules, num_updates, (EFI_PHYSICAL_ADDRESS)(VOID *)cbd); if (EFI_ERROR(rc)) { Print(L"%a:%a():%d: Could not apply capsule update: %r/n", __FILE__, __func__, __LINE__, rc); return rc; } return EFI_SUCCESS;}
开发者ID:vathpela,项目名称:fwupdate,代码行数:27,
示例12: uefi_get_file_sizeEFI_STATUS uefi_get_file_size(EFI_FILE_IO_INTERFACE *io, CHAR16 *filename, UINTN *size){ EFI_STATUS ret; EFI_FILE_INFO *info; UINTN info_size; EFI_FILE *file; ret = uefi_open_file(io, filename, &file); if (EFI_ERROR(ret)) goto out; info_size = SIZE_OF_EFI_FILE_INFO + FILENAME_MAX_LENGTH; info = AllocatePool(info_size); if (!info) { ret = EFI_OUT_OF_RESOURCES; goto close; } ret = uefi_call_wrapper(file->GetInfo, 4, file, &GenericFileInfo, &info_size, info); if (EFI_ERROR(ret)) goto free_info; *size = info->FileSize;free_info: FreePool(info);close: uefi_call_wrapper(file->Close, 1, file);out: if (EFI_ERROR(ret)) efi_perror(ret, L"Failed to read file %s", filename); return ret;}
开发者ID:avoidik,项目名称:hardware_intel_efi_kernelflinger,代码行数:34,
示例13: memory_mapEFI_STATUSmemory_map(EFI_MEMORY_DESCRIPTOR **map_buf, UINTN *map_size, UINTN *map_key, UINTN *desc_size, UINT32 *desc_version){ EFI_STATUS err = EFI_SUCCESS; *map_size = sizeof(**map_buf) * 31;get_map: *map_size += sizeof(**map_buf); err = uefi_call_wrapper(BS->AllocatePool, 3, EfiLoaderData, *map_size, (void **)map_buf); if (err != EFI_SUCCESS) { Print(L"ERROR: Failed to allocate pool for memory map"); return err; } err = uefi_call_wrapper(BS->GetMemoryMap, 5, map_size, *map_buf, map_key, desc_size, desc_version); if (err != EFI_SUCCESS) { if (err == EFI_BUFFER_TOO_SMALL) { uefi_call_wrapper(BS->FreePool, 1, (void *)*map_buf); goto get_map; } Print(L"ERROR: Failed to get memory map"); } return err;}
开发者ID:RafaelRMachado,项目名称:UEFI-Utilities,代码行数:27,
|