VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeDpcLib/DpcLib.c@ 58466

Last change on this file since 58466 was 58466, checked in by vboxsync, 9 years ago

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1/** @file
2 Help functions to access UDP service.
3
4Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
5This program and the accompanying materials
6are licensed and made available under the terms and conditions of the BSD License
7which accompanies this distribution. The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12**/
13
14#include <Uefi.h>
15#include <Library/DebugLib.h>
16#include <Library/UefiBootServicesTableLib.h>
17#include <Protocol/Dpc.h>
18
19//
20// Pointer to the DPC Protocol
21//
22EFI_DPC_PROTOCOL *mDpc;
23
24/**
25 This constructor function caches the EFI_DPC_PROTOCOL pointer.
26
27 @param[in] ImageHandle The firmware allocated handle for the EFI image.
28 @param[in] SystemTable A pointer to the EFI System Table.
29
30 @retval EFI_SUCCESS The constructor always return EFI_SUCCESS.
31
32**/
33EFI_STATUS
34EFIAPI
35DpcLibConstructor (
36 IN EFI_HANDLE ImageHandle,
37 IN EFI_SYSTEM_TABLE *SystemTable
38 )
39{
40 EFI_STATUS Status;
41
42 //
43 // Locate the EFI_DPC_PROTOCOL in the handle database
44 //
45 Status = gBS->LocateProtocol (&gEfiDpcProtocolGuid, NULL, (VOID **)&mDpc);
46 ASSERT_EFI_ERROR (Status);
47
48 return EFI_SUCCESS;
49}
50
51/**
52 Add a Deferred Procedure Call to the end of the DPC queue.
53
54 @param[in] DpcTpl The EFI_TPL that the DPC should be invoked.
55 @param[in] DpcProcedure Pointer to the DPC's function.
56 @param[in] DpcContext Pointer to the DPC's context. Passed to DpcProcedure
57 when DpcProcedure is invoked.
58
59 @retval EFI_SUCCESS The DPC was queued.
60 @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
61 @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
62 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
63 add the DPC to the queue.
64
65**/
66EFI_STATUS
67EFIAPI
68QueueDpc (
69 IN EFI_TPL DpcTpl,
70 IN EFI_DPC_PROCEDURE DpcProcedure,
71 IN VOID *DpcContext OPTIONAL
72 )
73{
74 //
75 // Call the EFI_DPC_PROTOCOL to queue the DPC
76 //
77 return mDpc->QueueDpc (mDpc, DpcTpl, DpcProcedure, DpcContext);
78}
79
80/**
81 Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl
82 value greater than or equal to the current TPL are invoked in the order that
83 they were queued. DPCs with higher DpcTpl values are invoked before DPCs with
84 lower DpcTpl values.
85
86 @retval EFI_SUCCESS One or more DPCs were invoked.
87 @retval EFI_NOT_FOUND No DPCs were invoked.
88
89**/
90EFI_STATUS
91EFIAPI
92DispatchDpc (
93 VOID
94 )
95{
96 //
97 // Call the EFI_DPC_PROTOCOL to dispatch previously queued DPCs
98 //
99 return mDpc->DispatchDpc (mDpc);
100}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette