]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Wchar/ConsDecons.c
StdLib: Update Copyright Notices.
[mirror_edk2.git] / StdLib / LibC / Wchar / ConsDecons.c
index ab139405fcaf730a3150371ea7ff370b2a0e892b..03815f49c5e7a95dd21c355c662e57ed3549600b 100644 (file)
@@ -5,23 +5,20 @@
     two wide characters the same way as two integers of the underlying integer\r
     type designated by wchar_t.\r
 \r
-    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+    Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made available under\r
     the terms and conditions of the BSD License that accompanies this distribution.\r
     The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.php.\r
+    http://opensource.org/licenses/bsd-license.\r
 \r
     THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
     WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 **/\r
 #include  <Uefi.h>\r
-#include  <Library/BaseLib.h>\r
-#include  <Library/BaseMemoryLib.h>\r
-#include  <Library/MemoryAllocationLib.h>\r
+#include  <Library/DebugLib.h>\r
 \r
 #include  <LibConfig.h>\r
 \r
-#include  <errno.h>\r
 #include  <wchar.h>\r
 \r
 /* Data initialized by the library constructor */\r
@@ -36,13 +33,17 @@ __wchar_construct(
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
+  EFI_STATUS  Status;\r
+\r
   if( __wchar_bitmap == NULL) {\r
     __wchar_bitmap_size = (WCHAR_MAX + 8) / 8U;\r
-    __wchar_bitmap = AllocatePool(__wchar_bitmap_size);\r
-    if( __wchar_bitmap == NULL) {\r
-      EFIerrno = RETURN_OUT_OF_RESOURCES;\r
-      errno = ENOMEM;\r
-      return EFIerrno;\r
+\r
+    Status  = SystemTable->BootServices->AllocatePool(\r
+                EfiBootServicesData, __wchar_bitmap_size, (VOID **)&__wchar_bitmap);\r
+    ASSERT(__wchar_bitmap != NULL);\r
+    if (EFI_ERROR (Status)) {\r
+      __wchar_bitmap = NULL;\r
+      return Status;\r
     }\r
     return  RETURN_SUCCESS;\r
   }\r
@@ -56,9 +57,12 @@ __wchar_deconstruct(
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
+  EFI_STATUS    Status  = RETURN_SUCCESS;\r
+\r
   if( __wchar_bitmap != NULL) {\r
-    FreePool( __wchar_bitmap);\r
+    Status = SystemTable->BootServices->FreePool( __wchar_bitmap);\r
+    ASSERT_EFI_ERROR (Status);\r
     __wchar_bitmap = NULL;\r
   }\r
-  return RETURN_SUCCESS;\r
+  return Status;\r
 }\r