当前位置: 首页>>代码示例>>C++>>正文


C++ EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces方法代码示例

本文整理汇总了C++中EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces方法的具体用法?C++ EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces怎么用?C++ EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EFI_BOOT_SERVICES的用法示例。


在下文中一共展示了EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

EFI_STATUS EFIAPI
OvrInstallMultipleProtocolInterfaces(
	IN OUT EFI_HANDLE	*Handle,
	...
)
{
	EFI_STATUS			Status;
	EFI_HANDLE			HandleIn = *Handle;
	VA_LIST				Args;
	EFI_GUID			*Protocol[4];
	VOID				*Interface[4];
	UINTN				Index;
	
	// oh my, va args ... well, we'll just have to support constant number
	VA_START(Args, Handle);
	// will start with Index=1 to cover the case when no Protocol/Interface is specified at all
	for (Index = 1; Index < 4; Index++) {
		Protocol[Index] = VA_ARG(Args, EFI_GUID *);
		if (Protocol[Index] == NULL) {
			Index--;
			break;
		}
		Interface[Index] = VA_ARG(Args, VOID *);
	}
	VA_END(Args);
	switch (Index) {
	case 0:
		Status = gOrgBS.InstallMultipleProtocolInterfaces(Handle, NULL);
		PRINT("->InstallMultipleProtocolInterfaces(%p/%p) = %r\n", HandleIn, *Handle, Status);
		break;
		
	case 1:
		Status = gOrgBS.InstallMultipleProtocolInterfaces(Handle, Protocol[1], Interface[1], NULL);
		PRINT("->InstallMultipleProtocolInterfaces(%p/%p, %s, %p) = %r\n",
			HandleIn, *Handle,
			GuidStr(Protocol[1]), Interface[1],
			Status);
		break;
		
	case 2:
		Status = gOrgBS.InstallMultipleProtocolInterfaces(Handle, Protocol[1], Interface[1], Protocol[2], Interface[2], NULL);
		PRINT("->InstallMultipleProtocolInterfaces(%p/%p, %s, %p, %s, %p) = %r\n",
			HandleIn, *Handle,
			GuidStr(Protocol[1]), Interface[1],
			GuidStr(Protocol[2]), Interface[2],
			Status);
		break;
		
	case 3:
		Status = gOrgBS.InstallMultipleProtocolInterfaces(Handle, Protocol[1], Interface[1], Protocol[2], Interface[2], Protocol[3], Interface[3], NULL);
		PRINT("->InstallMultipleProtocolInterfaces(%p/%p, %s, %p, %s, %p, %s, %p) = %r\n",
			HandleIn, *Handle,
			GuidStr(Protocol[1]), Interface[1],
			GuidStr(Protocol[2]), Interface[2],
			GuidStr(Protocol[3]), Interface[3],
			Status);
		break;
	
	default:
		Status = EFI_UNSUPPORTED;
		PRINT("->InstallMultipleProtocolInterfaces(%p, ...) = %r, too many Protocol/Interface pairs\n", *Handle, Status);
		break;
	}
	return Status;
}
开发者ID:jief666,项目名称:clover,代码行数:65,代码来源:BootServices.c

示例2: sizeof


//.........这里部分代码省略.........

  //
  // Set PPM policy structure to known value
  //
  pBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);

  //
  // Find the MpService Protocol
  //
  Status = pBS->LocateProtocol (&gEfiMpServiceProtocolGuid,
                                NULL,
                                (void **)&MpService
                               );
  ASSERT_EFI_ERROR (Status);

  //
  // Get processor count from MP service.
  //
  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount, NULL);
  ASSERT_EFI_ERROR (Status);

  //
  // Store the CPUID for use by SETUP items.
  //
  AsmCpuid (EFI_CPUID_VERSION_INFO, &Cpuid01.RegEax, &Cpuid01.RegEbx, &Cpuid01.RegEcx, &Cpuid01.RegEdx);

  mDxePlatformPpmPolicy.Revision                       = PPM_PLATFORM_POLICY_PROTOCOL_REVISION_4;

  //Read CPU Mobile feature from PLATFORM_ID_MSR MSR(0x17) NOTFB_I_AM_NOT_MOBILE_FUSE_CLIAMC00H Bit 28
  //Bit Description: { Disables Mobile features 0 = I am NOT a mobile part 1 = I am a mobile part (default)"}
  CPUMobileFeature = ((RShiftU64 (AsmReadMsr64(EFI_MSR_IA32_PLATFORM_ID), 28)) & 0x1);

  if (!EFI_ERROR(Status)) {
    if (CPUMobileFeature == 1){//CPU mobile feature
      mDxePlatformPpmPolicy.FunctionEnables.EnableGv       = ICH_DEVICE_ENABLE;
      mDxePlatformPpmPolicy.FunctionEnables.EnableCx       = ICH_DEVICE_ENABLE;
      mDxePlatformPpmPolicy.FunctionEnables.EnableCxe      = ICH_DEVICE_DISABLE;
      mDxePlatformPpmPolicy.FunctionEnables.EnableTm       = ICH_DEVICE_ENABLE;
      //MaxC7
      mDxePlatformPpmPolicy.FunctionEnables.EnableC7       = ICH_DEVICE_ENABLE;
      mDxePlatformPpmPolicy.FunctionEnables.EnableC6       = ICH_DEVICE_ENABLE;
      mDxePlatformPpmPolicy.FunctionEnables.EnableC4       = ICH_DEVICE_ENABLE;
       
      
    }else{//CPU desktop feature
       mDxePlatformPpmPolicy.FunctionEnables.EnableGv       = ICH_DEVICE_DISABLE;
       mDxePlatformPpmPolicy.FunctionEnables.EnableCx       = ICH_DEVICE_DISABLE;
       mDxePlatformPpmPolicy.FunctionEnables.EnableCxe      = ICH_DEVICE_DISABLE;
       mDxePlatformPpmPolicy.FunctionEnables.EnableTm       = ICH_DEVICE_DISABLE;
       mDxePlatformPpmPolicy.FunctionEnables.EnableC4       = ICH_DEVICE_DISABLE;
       mDxePlatformPpmPolicy.FunctionEnables.EnableC6       = ICH_DEVICE_DISABLE;
       mDxePlatformPpmPolicy.FunctionEnables.EnableC7       = ICH_DEVICE_DISABLE;
    }


    mDxePlatformPpmPolicy.FunctionEnables.EnableProcHot  = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.TStatesEnable  = ICH_DEVICE_ENABLE;

    
    Stepping = PchStepping();
    if (Stepping < PchB3) {
      // If SoC is B0~B2 Stepping, disable the Turbo
      mDxePlatformPpmPolicy.FunctionEnables.EnableTurboMode= ICH_DEVICE_DISABLE;
    } else {
      mDxePlatformPpmPolicy.FunctionEnables.EnableTurboMode= ICH_DEVICE_ENABLE;
    }
    
    mDxePlatformPpmPolicy.FunctionEnables.EnableTm      = ICH_DEVICE_ENABLE;

    mDxePlatformPpmPolicy.FunctionEnables.EnableCMP      = ICH_DEVICE_ENABLE;

  } else {
    mDxePlatformPpmPolicy.FunctionEnables.EnableGv       = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableCx       = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableCxe      = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableTm      = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableProcHot  = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableCMP       = ICH_DEVICE_DISABLE;
    mDxePlatformPpmPolicy.FunctionEnables.TStatesEnable  = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableTurboMode= ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableC4       = ICH_DEVICE_ENABLE;
    mDxePlatformPpmPolicy.FunctionEnables.EnableC6       = ICH_DEVICE_ENABLE;
  }



  mDxePlatformPpmPolicy.S3RestoreMsrSwSmiNumber                       = S3_RESTORE_MSR_SW_SMI;

  Handle = NULL;
  Status = pBS->InstallMultipleProtocolInterfaces (
                                                  &Handle,
                                                  &gPpmPlatformPolicyProtocolGuid,
                                                  &mDxePlatformPpmPolicy,
                                                  NULL
                                                  );

  ASSERT_EFI_ERROR (Status);

  return EFI_SUCCESS;
}
开发者ID:shijunjing,项目名称:edk2,代码行数:101,代码来源:PpmPolicy.c


注:本文中的EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。