+++ /dev/null
-/** @file\r
- Constructor and Deconstructor functions for <wchar.h>.\r
-\r
- Unless explicitly stated otherwise, the functions defined in this file order\r
- two wide characters the same way as two integers of the underlying integer\r
- type designated by wchar_t.\r
-\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.\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/DebugLib.h>\r
-\r
-#include <LibConfig.h>\r
-\r
-#include <wchar.h>\r
-\r
-/* Data initialized by the library constructor */\r
-UINT8 *__wchar_bitmap = NULL;\r
-UINTN __wchar_bitmap_size;\r
-UINTN __wchar_bitmap_64;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-__wchar_construct(\r
- IN EFI_HANDLE ImageHandle,\r
- 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
-\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
- return RETURN_ALREADY_STARTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-__wchar_deconstruct(\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status = RETURN_SUCCESS;\r
-\r
- if( __wchar_bitmap != NULL) {\r
- Status = SystemTable->BootServices->FreePool( __wchar_bitmap);\r
- ASSERT_EFI_ERROR (Status);\r
- __wchar_bitmap = NULL;\r
- }\r
- return Status;\r
-}\r