]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/EfiSocketLib/Init.c
Fix a bug about the iSCSI DHCP dependency issue.
[mirror_edk2.git] / StdLib / EfiSocketLib / Init.c
CommitLineData
d7ce7006 1/** @file\r
2 Implement the constructor and destructor for the EFI socket library\r
3\r
4 Copyright (c) 2011, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
eb222aea 8 http://opensource.org/licenses/bsd-license.\r
d7ce7006 9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
eb222aea 15#include "Socket.h"\r
d7ce7006 16\r
17\r
18/**\r
19 EFI Socket Library Constructor\r
20\r
a88c3163 21 This routine supports an implementation dependent constructor\r
22 depending upon whether the library is linked to a socket\r
23 application or the SocketDxe driver. The following modules\r
24 declare the redirection for the constructor in ::mpfnEslConstructor:\r
25 <ul>\r
26 <li>StdLib/EfiSocketLib/UseSocketLib.c - Application links against EfiSocketLib</li>\r
27 <li>StdLib/SocketDxe/EntryUnload.c - SocketDxe links against EfiSocketLib</li>\r
28 </ul>\r
29\r
30 The EfiSocketLib.inf file lists ::EslConstructor as the CONSTRUCTOR\r
31 in the [Defines] section. As a result, this routine is called by\r
32 the ProcessLibraryConstructorList routine of the AutoGen.c module\r
33 in the Build directory associated with the socket application or\r
34 the SocketDxe driver.\r
35\r
36 @retval EFI_SUCCESS The socket layer initialization was successful\r
d7ce7006 37\r
38 **/\r
39EFI_STATUS\r
40EFIAPI\r
41EslConstructor (\r
42 VOID\r
43 )\r
44{\r
45 EFI_STATUS Status;\r
46\r
47 DBG_ENTER ( );\r
48\r
49 //\r
50 // Assume success\r
51 //\r
52 Status = EFI_SUCCESS;\r
53\r
54 //\r
55 // Call the image dependent constructor if available\r
56 //\r
57 if ( NULL != mpfnEslConstructor ) {\r
58 Status = mpfnEslConstructor ( );\r
59 }\r
60\r
61 //\r
62 // Return the constructor status\r
63 //\r
64 DBG_EXIT_STATUS ( Status );\r
65 return Status;\r
66}\r
67\r
68\r
69/**\r
70 EFI Socket Library Destructor\r
71\r
a88c3163 72 This routine supports an implementation dependent destructor\r
73 depending upon whether the library is linked to a socket\r
74 application or the SocketDxe driver. The following modules\r
75 declare the redirection for the destructor in ::mpfnEslDestructor:\r
76 <ul>\r
77 <li>StdLib/EfiSocketLib/UseSocketLib.c - Application links against EfiSocketLib</li>\r
78 <li>StdLib/SocketDxe/EntryUnload.c - SocketDxe links against EfiSocketLib</li>\r
79 </ul>\r
80\r
81 The EfiSocketLib.inf file lists ::EslDestructor as the DESTRUCTOR\r
82 in the [Defines] section. As a result, this routine is called by\r
83 the ProcessLibraryDestructorList routine of the AutoGen.c module\r
84 in the Build directory associated with the socket application or\r
85 the SocketDxe driver.\r
86\r
87 @retval EFI_SUCCESS The socket layer shutdown was successful\r
d7ce7006 88\r
89 **/\r
90EFI_STATUS\r
91EFIAPI\r
92EslDestructor (\r
93 VOID\r
94 )\r
95{\r
96 EFI_STATUS Status;\r
97\r
98 DBG_ENTER ( );\r
99\r
100 //\r
101 // Assume success\r
102 //\r
103 Status = EFI_SUCCESS;\r
104\r
105 //\r
106 // Call the image dependent destructor if available\r
107 //\r
108 if ( NULL != mpfnEslDestructor ) {\r
109 Status = mpfnEslDestructor ( );\r
110 }\r
111\r
112 //\r
113 // Return the constructor status\r
114 //\r
115 DBG_EXIT_STATUS ( Status );\r
116 return Status;\r
117}\r