Use char16_t literals

Add char16_t('u') literals
Remove wchar_t('L') literals

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Callum Farmer 2024-05-30 16:39:00 +01:00
parent ce1ec9d27b
commit f8ebcfc077
No known key found for this signature in database
GPG Key ID: 9A5B19E18CD0013C
36 changed files with 453 additions and 453 deletions

View File

@ -120,29 +120,29 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
InitializeLib(image, systab); InitializeLib(image, systab);
Print(L"AllocatePage: __AllocType__ __MemType__ __NumPages__ [__Addr__]\n"); Print(u"AllocatePage: __AllocType__ __MemType__ __NumPages__ [__Addr__]\n");
Print(L"__AllocType__ {0,1,2} -- Any, MaxAddr, Addr\n"); Print(u"__AllocType__ {0,1,2} -- Any, MaxAddr, Addr\n");
Print(L"__MemType__ {0..13}, Reserved ==0, LCode==1, LData==2, BSCode==3, BSData==4, ...\n"); Print(u"__MemType__ {0..13}, Reserved ==0, LCode==1, LData==2, BSCode==3, BSData==4, ...\n");
Print(L"__NumPages__ {0..%x}\n", MAX_NUM_PAGES); Print(u"__NumPages__ {0..%x}\n", MAX_NUM_PAGES);
Print(L"[__Addr__] 0... %llx\n", MAX_ADDR); Print(u"[__Addr__] 0... %llx\n", MAX_ADDR);
Print(L"All numbers in hex no leading 0x\n"); Print(u"All numbers in hex no leading 0x\n");
Print(L"\n"); Print(u"\n");
#if DEBUG #if DEBUG
Print(L"Now get argc/argv\n"); Print(u"Now get argc/argv\n");
#endif #endif
argc = GetShellArgcArgv(image, &argv); argc = GetShellArgcArgv(image, &argv);
#if DEBUG #if DEBUG
Print(L"argc = %d\n", argc); Print(u"argc = %d\n", argc);
#endif #endif
#if DEBUG #if DEBUG
for (c = 0; c < argc; c++ ) { for (c = 0; c < argc; c++ ) {
Print(L"argv[%d] = <%s>\n", c, argv[c]); Print(u"argv[%d] = <%s>\n", c, argv[c]);
} }
#endif #endif
if ( (argc < 4) || (argc > 5) ) { if ( (argc < 4) || (argc > 5) ) {
Print(L"Wrong argument count\n"); Print(u"Wrong argument count\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -152,31 +152,31 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
if ( argc == 5 ) Addr = xtoi(argv[4]); if ( argc == 5 ) Addr = xtoi(argv[4]);
if ( (AllocType < 0) || (AllocType > 2)) { if ( (AllocType < 0) || (AllocType > 2)) {
Print(L"Invalid AllocType\n"); Print(u"Invalid AllocType\n");
err++; err++;
} }
if ( (MemType < 0) || (MemType > 13) ) { if ( (MemType < 0) || (MemType > 13) ) {
Print(L"Invalid MemType\n"); Print(u"Invalid MemType\n");
err++; err++;
} }
if ( (NumPages < 0) || (NumPages > MAX_NUM_PAGES) ) { if ( (NumPages < 0) || (NumPages > MAX_NUM_PAGES) ) {
Print(L"Inavlid NumPages\n"); Print(u"Inavlid NumPages\n");
err++; err++;
} }
if ( Addr > MAX_ADDR ) { if ( Addr > MAX_ADDR ) {
Print(L"Inavlid Address\n"); Print(u"Inavlid Address\n");
err++; err++;
} }
if ( err ) { if ( err ) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
Print(L"AllocatPage(%d,%d,%d,%lx)\n", AllocType, MemType, NumPages, Addr); Print(u"AllocatPage(%d,%d,%d,%lx)\n", AllocType, MemType, NumPages, Addr);
efi_status = uefi_call_wrapper(BS->AllocatePages, 4, AllocType, MemType, NumPages, &Addr); efi_status = uefi_call_wrapper(BS->AllocatePages, 4, AllocType, MemType, NumPages, &Addr);
if ( EFI_ERROR(efi_status) ) { if ( EFI_ERROR(efi_status) ) {
Print(L"Allocate Pages Failed: %d\n", efi_status); Print(u"Allocate Pages Failed: %d\n", efi_status);
return efi_status; return efi_status;
} }

View File

@ -93,27 +93,27 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
InitializeLib(image, systab); InitializeLib(image, systab);
Print(L"FreePages: __PhysAddr__ __PgCnt__\n"); Print(u"FreePages: __PhysAddr__ __PgCnt__\n");
Print(L"__PhysAddr__ 0... %llx\n", MAX_ADDR); Print(u"__PhysAddr__ 0... %llx\n", MAX_ADDR);
Print(L"__PgCnt__ [0..%lx]\n", MAX_NUM_PAGES); Print(u"__PgCnt__ [0..%lx]\n", MAX_NUM_PAGES);
Print(L"All numbers hex w/ no leading 0x\n"); Print(u"All numbers hex w/ no leading 0x\n");
Print(L"\n"); Print(u"\n");
#if DEBUG #if DEBUG
Print(L"Now parse argc/argv\n"); Print(u"Now parse argc/argv\n");
#endif #endif
argc = GetShellArgcArgv(image, &argv); argc = GetShellArgcArgv(image, &argv);
#if DEBUG #if DEBUG
Print(L"argc = %d\n", argc); Print(u"argc = %d\n", argc);
#endif #endif
#if DEBUG #if DEBUG
for (c = 0; c < argc; c++ ) { for (c = 0; c < argc; c++ ) {
Print(L"argv[%d] = <%s>\n", c, argv[c]); Print(u"argv[%d] = <%s>\n", c, argv[c]);
} }
#endif #endif
if (argc != 3) { if (argc != 3) {
Print(L"Invalid argument count\n"); Print(u"Invalid argument count\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -121,23 +121,23 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
PgCnt = xtoi(argv[2]); PgCnt = xtoi(argv[2]);
if ( (PgCnt < 0) || (PgCnt > MAX_NUM_PAGES) ) { if ( (PgCnt < 0) || (PgCnt > MAX_NUM_PAGES) ) {
Print(L"Inavlid PgCnt\n"); Print(u"Inavlid PgCnt\n");
err++; err++;
} }
if ( PhysAddr > MAX_ADDR ) { if ( PhysAddr > MAX_ADDR ) {
Print(L"Inavlid Address\n"); Print(u"Inavlid Address\n");
err++; err++;
} }
if ( err ) { if ( err ) {
return EFI_SUCCESS; return EFI_SUCCESS;
} }
Print(L"FreePages(%lx,%d)\n", PhysAddr, PgCnt); Print(u"FreePages(%lx,%d)\n", PhysAddr, PgCnt);
efi_status = uefi_call_wrapper(BS->FreePages, 2, PhysAddr, PgCnt); efi_status = uefi_call_wrapper(BS->FreePages, 2, PhysAddr, PgCnt);
if ( EFI_ERROR(efi_status) ) { if ( EFI_ERROR(efi_status) ) {
Print(L"Free Pages Failed: %d\n", efi_status); Print(u"Free Pages Failed: %d\n", efi_status);
return efi_status; return efi_status;
} }

View File

@ -38,7 +38,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
if (gop->Mode) { if (gop->Mode) {
imax = gop->Mode->MaxMode; imax = gop->Mode->MaxMode;
} else { } else {
Print(L"gop->Mode is NULL\n"); Print(u"gop->Mode is NULL\n");
return; return;
} }
@ -47,8 +47,8 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
&info); &info);
if (rc == EFI_NOT_STARTED) { if (rc == EFI_NOT_STARTED) {
Print(L"gop->QueryMode() returned %r\n", rc); Print(u"gop->QueryMode() returned %r\n", rc);
Print(L"Trying to start GOP with SetMode().\n"); Print(u"Trying to start GOP with SetMode().\n");
rc = uefi_call_wrapper(gop->SetMode, 2, gop, rc = uefi_call_wrapper(gop->SetMode, 2, gop,
gop->Mode ? gop->Mode->Mode : 0); gop->Mode ? gop->Mode->Mode : 0);
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
@ -56,7 +56,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
} }
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"%d: Bad response from QueryMode: %r (%d)\n", Print(u"%d: Bad response from QueryMode: %r (%d)\n",
i, rc, rc); i, rc, rc);
continue; continue;
} }
@ -70,7 +70,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
PixelBuffer = AllocatePool(BufferSize); PixelBuffer = AllocatePool(BufferSize);
if (!PixelBuffer) { if (!PixelBuffer) {
Print(L"Allocation of 0x%08lx bytes failed.\n", Print(u"Allocation of 0x%08lx bytes failed.\n",
sizeof(UINT32) * NumPixels); sizeof(UINT32) * NumPixels);
return; return;
} }
@ -88,7 +88,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
FreePool(PixelBuffer); FreePool(PixelBuffer);
return; return;
} }
Print(L"Never found the active video mode?\n"); Print(u"Never found the active video mode?\n");
} }
static EFI_STATUS static EFI_STATUS
@ -100,7 +100,7 @@ SetWatchdog(UINTN seconds)
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
CHAR16 Buffer[64]; CHAR16 Buffer[64];
StatusToString(Buffer, rc); StatusToString(Buffer, rc);
Print(L"Bad response from QueryMode: %s (%d)\n", Buffer, rc); Print(u"Bad response from QueryMode: %s (%d)\n", Buffer, rc);
} }
return rc; return rc;
} }
@ -117,12 +117,12 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop); rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop);
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"Could not locate GOP: %r\n", rc); Print(u"Could not locate GOP: %r\n", rc);
return rc; return rc;
} }
if (!gop) { if (!gop) {
Print(L"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc); Print(u"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc);
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -3,27 +3,27 @@
// 101 in init_array, 65434 in ctors // 101 in init_array, 65434 in ctors
static void __attribute__((constructor(101))) EFI_NO_TAIL_CALL ctors101() { static void __attribute__((constructor(101))) EFI_NO_TAIL_CALL ctors101() {
Print(L"1) ctor with lower numbered priority \r\n"); Print(u"1) ctor with lower numbered priority \r\n");
} }
// 65434 in init_array, 101 in ctors // 65434 in init_array, 101 in ctors
static void __attribute__((constructor(65434))) EFI_NO_TAIL_CALL ctors65434() { static void __attribute__((constructor(65434))) EFI_NO_TAIL_CALL ctors65434() {
Print(L"2) ctor with higher numbered priority \r\n"); Print(u"2) ctor with higher numbered priority \r\n");
} }
// 101 in fini_array, 65434 in dtors // 101 in fini_array, 65434 in dtors
static void __attribute__((destructor(101))) EFI_NO_TAIL_CALL dtors101() { static void __attribute__((destructor(101))) EFI_NO_TAIL_CALL dtors101() {
Print(L"4) dtor with lower numbered priority \r\n"); Print(u"4) dtor with lower numbered priority \r\n");
} }
// 65434 in fini_array, 101 in dtors // 65434 in fini_array, 101 in dtors
static void __attribute__((destructor(65434))) EFI_NO_TAIL_CALL dtors65434() { static void __attribute__((destructor(65434))) EFI_NO_TAIL_CALL dtors65434() {
Print(L"3) dtor with higher numbered priority \r\n"); Print(u"3) dtor with higher numbered priority \r\n");
} }
EFI_STATUS EFI_STATUS
efi_main (EFI_HANDLE image EFI_UNUSED, EFI_SYSTEM_TABLE *systab EFI_UNUSED) efi_main (EFI_HANDLE image EFI_UNUSED, EFI_SYSTEM_TABLE *systab EFI_UNUSED)
{ {
Print(L"Main function \r\n"); Print(u"Main function \r\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -11,16 +11,16 @@ int constructed_value = 0;
static void __attribute__((__constructor__)) EFI_NO_TAIL_CALL ctor(void) static void __attribute__((__constructor__)) EFI_NO_TAIL_CALL ctor(void)
{ {
Print(L"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value); Print(u"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value);
constructed_value = 1; constructed_value = 1;
Print(L"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value); Print(u"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value);
} }
static void __attribute__((__destructor__)) EFI_NO_TAIL_CALL dtor(void) static void __attribute__((__destructor__)) EFI_NO_TAIL_CALL dtor(void)
{ {
Print(L"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value); Print(u"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value);
constructed_value = 0; constructed_value = 0;
Print(L"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value); Print(u"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value);
} }
// vim:fenc=utf-8:tw=75:noet // vim:fenc=utf-8:tw=75:noet

View File

@ -12,7 +12,7 @@ extern int constructed_value;
EFI_STATUS EFI_STATUS
efi_main (EFI_HANDLE image EFI_UNUSED, EFI_SYSTEM_TABLE *systab EFI_UNUSED) efi_main (EFI_HANDLE image EFI_UNUSED, EFI_SYSTEM_TABLE *systab EFI_UNUSED)
{ {
Print(L"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value); Print(u"%a:%d:%a() constructed_value:%d\n", __FILE__, __LINE__, __func__, constructed_value);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -50,16 +50,16 @@ DebugHook(void)
if (x) if (x)
return; return;
efi_status = GetVariable(L"DUMMY_DEBUG", &data, &dataSize, guid); efi_status = GetVariable(u"DUMMY_DEBUG", &data, &dataSize, guid);
if (EFI_ERROR(efi_status)) { if (EFI_ERROR(efi_status)) {
return; return;
} }
Print(L"add-symbol-file /usr/lib/debug/boot/efi/debughook.debug " Print(u"add-symbol-file /usr/lib/debug/boot/efi/debughook.debug "
L"0x%08x -s .data 0x%08x\n", &_text, &_data); u"0x%08x -s .data 0x%08x\n", &_text, &_data);
Print(L"Pausing for debugger attachment.\n"); Print(u"Pausing for debugger attachment.\n");
Print(L"To disable this, remove the EFI variable DUMMY_DEBUG-%g .\n", Print(u"To disable this, remove the EFI variable DUMMY_DEBUG-%g .\n",
&guid); &guid);
x = 1; x = 1;
while (x++) { while (x++) {

View File

@ -111,7 +111,7 @@ Drv0SayHello(
if (! HelloWho) if (! HelloWho)
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
Print(L"Hello %s!\n", HelloWho); Print(u"Hello %s!\n", HelloWho);
InternalGnuEfiAppsDrv0ProtocolData.Counter ++; InternalGnuEfiAppsDrv0ProtocolData.Counter ++;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -141,7 +141,7 @@ Drv0Unload(IN EFI_HANDLE ImageHandle)
&GnuEfiAppsDrv0ProtocolGuid, &GnuEfiAppsDrv0ProtocolGuid,
&InternalGnuEfiAppsDrv0ProtocolData.Proto, &InternalGnuEfiAppsDrv0ProtocolData.Proto,
NULL); NULL);
Print(L"Driver instance unloaded.\n", ImageHandle); Print(u"Driver instance unloaded.\n", ImageHandle);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -167,7 +167,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab)
(void**)&LoadedImage, ImageHandle, (void**)&LoadedImage, ImageHandle,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Could not open loaded image protocol: %d\n", Status); Print(u"Could not open loaded image protocol: %d\n", Status);
return Status; return Status;
} }
@ -176,7 +176,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab)
&ImageHandle, &GnuEfiAppsDrv0ProtocolGuid, &ImageHandle, &GnuEfiAppsDrv0ProtocolGuid,
&InternalGnuEfiAppsDrv0ProtocolData.Proto, NULL); &InternalGnuEfiAppsDrv0ProtocolData.Proto, NULL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Error registering driver instance: %d\n", Status); Print(u"Error registering driver instance: %d\n", Status);
return Status; return Status;
} }
@ -184,7 +184,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab)
* instance from system */ * instance from system */
LoadedImage->Unload = (EFI_IMAGE_UNLOAD)Drv0Unload; LoadedImage->Unload = (EFI_IMAGE_UNLOAD)Drv0Unload;
Print(L"Driver instance loaded successfully.\n"); Print(u"Driver instance loaded successfully.\n");
return EFI_SUCCESS; /* at this point, this instance stays resident return EFI_SUCCESS; /* at this point, this instance stays resident
* until image is unloaded, eg. with shell's unload, * until image is unloaded, eg. with shell's unload,
* ExitBootServices() */ * ExitBootServices() */

View File

@ -28,20 +28,20 @@ PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) {
NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL); EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Cannot open proto: %d\n", Status); Print(u"Cannot open proto: %d\n", Status);
return Status; return Status;
} }
Status = uefi_call_wrapper(drv->SayHello, 2, L"Sample UEFI Driver"); Status = uefi_call_wrapper(drv->SayHello, 2, u"Sample UEFI Driver");
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Cannot call SayHello: %d\n", Status); Print(u"Cannot call SayHello: %d\n", Status);
} }
Status = uefi_call_wrapper(drv->GetNumberOfHello, 2, &NumberOfHello); Status = uefi_call_wrapper(drv->GetNumberOfHello, 2, &NumberOfHello);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Cannot call GetNumberOfHello: %d\n", Status); Print(u"Cannot call GetNumberOfHello: %d\n", Status);
} else { } else {
Print(L"Hello was called %d time(s).\n", NumberOfHello); Print(u"Hello was called %d time(s).\n", NumberOfHello);
} }
return EFI_SUCCESS; return EFI_SUCCESS;
@ -60,16 +60,16 @@ efi_main (EFI_HANDLE Image, EFI_SYSTEM_TABLE *SysTab)
Status = LibLocateHandle(ByProtocol, &GnuEfiAppsDrv0ProtocolGuid, Status = LibLocateHandle(ByProtocol, &GnuEfiAppsDrv0ProtocolGuid,
NULL, &NoHandles, &Handles); NULL, &NoHandles, &Handles);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Error looking up handles for proto: %d\n", Status); Print(u"Error looking up handles for proto: %d\n", Status);
return Status; return Status;
} }
for (i = 0 ; i < NoHandles ; ++i) for (i = 0 ; i < NoHandles ; ++i)
{ {
Print(L"Playing with driver instance %d...\n", i); Print(u"Playing with driver instance %d...\n", i);
Status = PlayWithGnuEfiAppsDrv0Protocol(Handles[i]); Status = PlayWithGnuEfiAppsDrv0Protocol(Handles[i]);
if (EFI_ERROR(Status)) if (EFI_ERROR(Status))
Print(L"Error playing with instance %d, skipping\n", i); Print(u"Error playing with instance %d, skipping\n", i);
} }
if (Handles) if (Handles)

View File

@ -45,7 +45,7 @@ fill_boxes(UINT32 *PixelBuffer, UINT32 Width, UINT32 Height, UINT32 Pitch,
case PixelBltOnly: case PixelBltOnly:
return; return;
default: default:
Print(L"Invalid pixel format\n"); Print(u"Invalid pixel format\n");
return; return;
} }
@ -79,7 +79,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
if (gop->Mode) { if (gop->Mode) {
imax = gop->Mode->MaxMode; imax = gop->Mode->MaxMode;
} else { } else {
Print(L"gop->Mode is NULL\n"); Print(u"gop->Mode is NULL\n");
return; return;
} }
@ -88,8 +88,8 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
&info); &info);
if (rc == EFI_NOT_STARTED) { if (rc == EFI_NOT_STARTED) {
Print(L"gop->QueryMode() returned %r\n", rc); Print(u"gop->QueryMode() returned %r\n", rc);
Print(L"Trying to start GOP with SetMode().\n"); Print(u"Trying to start GOP with SetMode().\n");
rc = uefi_call_wrapper(gop->SetMode, 2, gop, rc = uefi_call_wrapper(gop->SetMode, 2, gop,
gop->Mode ? gop->Mode->Mode : 0); gop->Mode ? gop->Mode->Mode : 0);
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
@ -97,7 +97,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
} }
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"%d: Bad response from QueryMode: %r (%d)\n", Print(u"%d: Bad response from QueryMode: %r (%d)\n",
i, rc, rc); i, rc, rc);
continue; continue;
} }
@ -113,13 +113,13 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
} else { } else {
CopySize = BufferSize < gop->Mode->FrameBufferSize ? CopySize = BufferSize < gop->Mode->FrameBufferSize ?
BufferSize : (UINT32)gop->Mode->FrameBufferSize; BufferSize : (UINT32)gop->Mode->FrameBufferSize;
Print(L"height * pitch * pixelsize = %lu buf fb size is %lu; using %lu\n", Print(u"height * pitch * pixelsize = %lu buf fb size is %lu; using %lu\n",
BufferSize, gop->Mode->FrameBufferSize, CopySize); BufferSize, gop->Mode->FrameBufferSize, CopySize);
} }
PixelBuffer = AllocatePool(BufferSize); PixelBuffer = AllocatePool(BufferSize);
if (!PixelBuffer) { if (!PixelBuffer) {
Print(L"Allocation of 0x%08lx bytes failed.\n", Print(u"Allocation of 0x%08lx bytes failed.\n",
sizeof(UINT32) * NumPixels); sizeof(UINT32) * NumPixels);
return; return;
} }
@ -129,7 +129,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
info->PixelFormat, info->PixelInformation); info->PixelFormat, info->PixelInformation);
if (info->PixelFormat == PixelBltOnly) { if (info->PixelFormat == PixelBltOnly) {
Print(L"No linear framebuffer on this device.\n"); Print(u"No linear framebuffer on this device.\n");
return; return;
} }
#if __SIZEOF_POINTER__ == 8 #if __SIZEOF_POINTER__ == 8
@ -143,7 +143,7 @@ draw_boxes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
CopyMem((VOID *)FrameBufferAddr, PixelBuffer, CopySize); CopyMem((VOID *)FrameBufferAddr, PixelBuffer, CopySize);
return; return;
} }
Print(L"Never found the active video mode?\n"); Print(u"Never found the active video mode?\n");
} }
static EFI_STATUS static EFI_STATUS
@ -155,7 +155,7 @@ SetWatchdog(UINTN seconds)
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
CHAR16 Buffer[64]; CHAR16 Buffer[64];
StatusToString(Buffer, rc); StatusToString(Buffer, rc);
Print(L"Bad response from QueryMode: %s (%d)\n", Buffer, rc); Print(u"Bad response from QueryMode: %s (%d)\n", Buffer, rc);
} }
return rc; return rc;
} }
@ -172,12 +172,12 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop); rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop);
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"Could not locate GOP: %r\n", rc); Print(u"Could not locate GOP: %r\n", rc);
return rc; return rc;
} }
if (!gop) { if (!gop) {
Print(L"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc); Print(u"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc);
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -11,9 +11,9 @@ print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
if (gop->Mode) { if (gop->Mode) {
imax = gop->Mode->MaxMode; imax = gop->Mode->MaxMode;
Print(L"GOP reports MaxMode %d\n", imax); Print(u"GOP reports MaxMode %d\n", imax);
} else { } else {
Print(L"gop->Mode is NULL\n"); Print(u"gop->Mode is NULL\n");
imax = 1; imax = 1;
} }
@ -23,8 +23,8 @@ print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
&info); &info);
if (rc == EFI_NOT_STARTED) { if (rc == EFI_NOT_STARTED) {
Print(L"gop->QueryMode() returned %r\n", rc); Print(u"gop->QueryMode() returned %r\n", rc);
Print(L"Trying to start GOP with SetMode().\n"); Print(u"Trying to start GOP with SetMode().\n");
rc = uefi_call_wrapper(gop->SetMode, 2, gop, rc = uefi_call_wrapper(gop->SetMode, 2, gop,
gop->Mode ? gop->Mode->Mode : 0); gop->Mode ? gop->Mode->Mode : 0);
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
@ -32,37 +32,37 @@ print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
} }
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"%d: Bad response from QueryMode: %r (%d)\n", Print(u"%d: Bad response from QueryMode: %r (%d)\n",
i, rc, rc); i, rc, rc);
continue; continue;
} }
Print(L"%c%d: %dx%d ", Print(u"%c%d: %dx%d ",
(gop->Mode && (gop->Mode &&
CompareMem(info,gop->Mode->Info,sizeof(*info)) == 0 CompareMem(info,gop->Mode->Info,sizeof(*info)) == 0
) ? '*' : ' ', ) ? '*' : ' ',
i, info->HorizontalResolution, info->VerticalResolution); i, info->HorizontalResolution, info->VerticalResolution);
switch(info->PixelFormat) { switch(info->PixelFormat) {
case PixelRedGreenBlueReserved8BitPerColor: case PixelRedGreenBlueReserved8BitPerColor:
Print(L"RGBR"); Print(u"RGBR");
break; break;
case PixelBlueGreenRedReserved8BitPerColor: case PixelBlueGreenRedReserved8BitPerColor:
Print(L"BGRR"); Print(u"BGRR");
break; break;
case PixelBitMask: case PixelBitMask:
Print(L"R:%08x G:%08x B:%08x X:%08x", Print(u"R:%08x G:%08x B:%08x X:%08x",
info->PixelInformation.RedMask, info->PixelInformation.RedMask,
info->PixelInformation.GreenMask, info->PixelInformation.GreenMask,
info->PixelInformation.BlueMask, info->PixelInformation.BlueMask,
info->PixelInformation.ReservedMask); info->PixelInformation.ReservedMask);
break; break;
case PixelBltOnly: case PixelBltOnly:
Print(L"(blt only)"); Print(u"(blt only)");
break; break;
default: default:
Print(L"(Invalid pixel format)"); Print(u"(Invalid pixel format)");
break; break;
} }
Print(L" pitch %d\n", info->PixelsPerScanLine); Print(u" pitch %d\n", info->PixelsPerScanLine);
} }
} }
@ -75,7 +75,7 @@ SetWatchdog(UINTN seconds)
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
CHAR16 Buffer[64]; CHAR16 Buffer[64];
StatusToString(Buffer, rc); StatusToString(Buffer, rc);
Print(L"Bad response from QueryMode: %s (%d)\n", Buffer, rc); Print(u"Bad response from QueryMode: %s (%d)\n", Buffer, rc);
} }
return rc; return rc;
} }
@ -92,12 +92,12 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop); rc = LibLocateProtocol(&GraphicsOutputProtocol, (void **)&gop);
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"Could not locate GOP: %r\n", rc); Print(u"Could not locate GOP: %r\n", rc);
return rc; return rc;
} }
if (!gop) { if (!gop) {
Print(L"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc); Print(u"LocateProtocol(GOP, &gop) returned %r but GOP is NULL\n", rc);
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -11,12 +11,12 @@ efi_main (EFI_HANDLE image EFI_UNUSED, EFI_SYSTEM_TABLE *systab EFI_UNUSED)
CHAR16 *Dest = 0; CHAR16 *Dest = 0;
EFI_UNUSED CHAR16 *Copy = 0; EFI_UNUSED CHAR16 *Copy = 0;
UINTN test_str_size = 0; UINTN test_str_size = 0;
CONST CHAR16 *test_str = L"Hello World!"; CONST CHAR16 *test_str = u"Hello World!";
test_str_size = StrSize(test_str); test_str_size = StrSize(test_str);
Dest = AllocatePool(test_str_size); Dest = AllocatePool(test_str_size);
CopyMem(Dest, test_str, test_str_size); CopyMem(Dest, test_str, test_str_size);
Copy = ReallocatePool(Dest, test_str_size, test_str_size+10); Copy = ReallocatePool(Dest, test_str_size, test_str_size+10);
Print(L"Done!\r\n"); Print(u"Done!\r\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -14,10 +14,10 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
name[0] = 0; name[0] = 0;
vendor = NullGuid; vendor = NullGuid;
Print(L"GUID Variable Name Value\n"); Print(u"GUID Variable Name Value\n");
Print(L"=================================== ==================== ========\n"); Print(u"=================================== ==================== ========\n");
StrCpy(fmt, L"%.-35g %.-20s %s\n"); StrCpy(fmt, u"%.-35g %.-20s %s\n");
while (1) { while (1) {
size = sizeof(name); size = sizeof(name);
status = uefi_call_wrapper(RT->GetNextVariableName, 3, &size, name, &vendor); status = uefi_call_wrapper(RT->GetNextVariableName, 3, &size, name, &vendor);

View File

@ -27,17 +27,17 @@ typedef struct {
static inline void set_bit(volatile uint32_t *flag, int bit, int value) static inline void set_bit(volatile uint32_t *flag, int bit, int value)
{ {
uint32_t val = *flag; uint32_t val = *flag;
Print(L"current value is 0x%2x\n", val); Print(u"current value is 0x%2x\n", val);
if (value) { if (value) {
val |= (1 << bit); val |= (1 << bit);
} else { } else {
val &= ~(1 << bit); val &= ~(1 << bit);
} }
Print(L"setting value to 0x%2x\n", val); Print(u"setting value to 0x%2x\n", val);
*flag = val; *flag = val;
val = *flag; val = *flag;
Print(L"new value is 0x%2x\n", val); Print(u"new value is 0x%2x\n", val);
} }
static int is_device(EFI_PCI_IO *pciio, uint16_t vendor_id, uint16_t device_id) static int is_device(EFI_PCI_IO *pciio, uint16_t vendor_id, uint16_t device_id)
@ -112,7 +112,7 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
} }
if (rc == EFI_NOT_FOUND) { if (rc == EFI_NOT_FOUND) {
Print(L"Device not found.\n"); Print(u"Device not found.\n");
return rc; return rc;
} else if (EFI_ERROR(rc)) { } else if (EFI_ERROR(rc)) {
return rc; return rc;
@ -123,12 +123,12 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
if (EFI_ERROR(rc)) if (EFI_ERROR(rc))
return rc; return rc;
if (!(lpcif.rcba & 1)) { if (!(lpcif.rcba & 1)) {
Print(L"rcrb is not mapped, cannot route port 80h\n"); Print(u"rcrb is not mapped, cannot route port 80h\n");
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
lpcif.rcba &= ~1UL; lpcif.rcba &= ~1UL;
Print(L"rcba: 0x%8x\n", lpcif.rcba, lpcif.rcba); Print(u"rcba: 0x%8x\n", lpcif.rcba, lpcif.rcba);
set_bit((uint32_t *)(intptr_t)(lpcif.rcba + GCS_OFFSET_ADDR), set_bit((uint32_t *)(intptr_t)(lpcif.rcba + GCS_OFFSET_ADDR),
GCS_RPR_SHIFT, GCS_RPR_PCI); GCS_RPR_SHIFT, GCS_RPR_PCI);

View File

@ -16,22 +16,22 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
#if 0 #if 0
UINT8 data = 1; UINT8 data = 1;
status = RT->SetVariable(L"SHIM_DEBUG", &SHIM_GUID, status = RT->SetVariable(u"SHIM_DEBUG", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(data), &data); sizeof(data), &data);
if (EFI_ERROR(status)) if (EFI_ERROR(status))
Print(L"SetVariable failed: %r\n", status); Print(u"SetVariable failed: %r\n", status);
#endif #endif
status = RT->SetVariable(L"GRUB_ENV", &SHIM_GUID, status = RT->SetVariable(u"GRUB_ENV", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(grubenv)-1, grubenv); sizeof(grubenv)-1, grubenv);
if (EFI_ERROR(status)) if (EFI_ERROR(status))
Print(L"SetVariable(GRUB_ENV) failed: %r\n", status); Print(u"SetVariable(GRUB_ENV) failed: %r\n", status);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -14,16 +14,16 @@ efi_main(
InitializeLib(image_handle, systab); InitializeLib(image_handle, systab);
rc = setjmp(env); rc = setjmp(env);
Print(L"setjmp() = %d\n", rc); Print(u"setjmp() = %d\n", rc);
if (rc == 3) { if (rc == 3) {
Print(L"3 worked\n"); Print(u"3 worked\n");
longjmp(env, 0); longjmp(env, 0);
return 0; return 0;
} }
if (rc == 1) { if (rc == 1) {
Print(L"0 got to be one yay\n"); Print(u"0 got to be one yay\n");
return 0; return 0;
} }

View File

@ -20,7 +20,7 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
InitializeLib(image_handle, systab); InitializeLib(image_handle, systab);
conout = systab->ConOut; conout = systab->ConOut;
uefi_call_wrapper(conout->OutputString, 2, conout, (CHAR16 *)L"Hello World!\r\n"); uefi_call_wrapper(conout->OutputString, 2, conout, (CHAR16 *)u"Hello World!\r\n");
uefi_call_wrapper(conout->OutputString, 2, conout, a2u("Hello World!\r\n")); uefi_call_wrapper(conout->OutputString, 2, conout, a2u("Hello World!\r\n"));
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -8,7 +8,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
InitializeLib(image, systab); InitializeLib(image, systab);
conout = systab->ConOut; conout = systab->ConOut;
uefi_call_wrapper(conout->OutputString, 2, conout, L"Hello World!\r\n"); uefi_call_wrapper(conout->OutputString, 2, conout, u"Hello World!\r\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -16,19 +16,19 @@ efi_main(
InitializeLib(image_handle, systab); InitializeLib(image_handle, systab);
PoolAllocationType = 2; /* klooj */ PoolAllocationType = 2; /* klooj */
Print(L"Hello World! (0xd=0x%x, 13=%d)\n", 13, 13); Print(u"Hello World! (0xd=0x%x, 13=%d)\n", 13, 13);
Print(L"before InitializeLib(): PoolAllocationType=%d\n", Print(u"before InitializeLib(): PoolAllocationType=%d\n",
pat); pat);
Print(L" after InitializeLib(): PoolAllocationType=%d\n", Print(u" after InitializeLib(): PoolAllocationType=%d\n",
PoolAllocationType); PoolAllocationType);
/* /*
* Locate loaded_image_handle instance. * Locate loaded_image_handle instance.
*/ */
Print(L"BS->HandleProtocol() "); Print(u"BS->HandleProtocol() ");
efi_status = uefi_call_wrapper( efi_status = uefi_call_wrapper(
BS->HandleProtocol, BS->HandleProtocol,
@ -38,31 +38,31 @@ efi_main(
&void_li_p); &void_li_p);
li = void_li_p; li = void_li_p;
Print(L"%xh (%r)\n", efi_status, efi_status); Print(u"%xh (%r)\n", efi_status, efi_status);
if (efi_status != EFI_SUCCESS) { if (efi_status != EFI_SUCCESS) {
return efi_status; return efi_status;
} }
Print(L" li: %xh\n", li); Print(u" li: %xh\n", li);
if (!li) { if (!li) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
Print(L" li->Revision: %xh\n", li->Revision); Print(u" li->Revision: %xh\n", li->Revision);
Print(L" li->ParentHandle: %xh\n", li->ParentHandle); Print(u" li->ParentHandle: %xh\n", li->ParentHandle);
Print(L" li->SystemTable: %xh\n", li->SystemTable); Print(u" li->SystemTable: %xh\n", li->SystemTable);
Print(L" li->DeviceHandle: %xh\n", li->DeviceHandle); Print(u" li->DeviceHandle: %xh\n", li->DeviceHandle);
Print(L" li->FilePath: %xh\n", li->FilePath); Print(u" li->FilePath: %xh\n", li->FilePath);
Print(L" li->Reserved: %xh\n", li->Reserved); Print(u" li->Reserved: %xh\n", li->Reserved);
Print(L" li->LoadOptionsSize: %xh\n", li->LoadOptionsSize); Print(u" li->LoadOptionsSize: %xh\n", li->LoadOptionsSize);
Print(L" li->LoadOptions: %xh\n", li->LoadOptions); Print(u" li->LoadOptions: %xh\n", li->LoadOptions);
Print(L" li->ImageBase: %xh\n", li->ImageBase); Print(u" li->ImageBase: %xh\n", li->ImageBase);
Print(L" li->ImageSize: %xh\n", li->ImageSize); Print(u" li->ImageSize: %xh\n", li->ImageSize);
Print(L" li->ImageCodeType: %xh\n", li->ImageCodeType); Print(u" li->ImageCodeType: %xh\n", li->ImageCodeType);
Print(L" li->ImageDataType: %xh\n", li->ImageDataType); Print(u" li->ImageDataType: %xh\n", li->ImageDataType);
Print(L" li->Unload: %xh\n", li->Unload); Print(u" li->Unload: %xh\n", li->Unload);
#if 0 #if 0
typedef struct { typedef struct {

View File

@ -7,8 +7,8 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
UINTN index; UINTN index;
InitializeLib(image, systab); InitializeLib(image, systab);
uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, L"Hello application started\r\n"); uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, u"Hello application started\r\n");
uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, L"\r\n\r\n\r\nHit any key to exit\r\n"); uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, u"\r\n\r\n\r\nHit any key to exit\r\n");
uefi_call_wrapper(systab->BootServices->WaitForEvent, 3, 1, &systab->ConIn->WaitForKey, &index); uefi_call_wrapper(systab->BootServices->WaitForEvent, 3, 1, &systab->ConIn->WaitForKey, &index);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -5,9 +5,9 @@ EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{ {
InitializeLib(image, systab); InitializeLib(image, systab);
Print(L"HelloLib application started\n"); Print(u"HelloLib application started\n");
Print(L"\n\n\nHit any key to exit this image\n"); Print(u"\n\n\nHit any key to exit this image\n");
WaitForSingleEvent(ST->ConIn->WaitForKey, 0); WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\n\n"); uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, u"\n\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -25,19 +25,19 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
&LoadedImageProtocol, &LoadedImageProtocol,
(void **) &loaded_image); (void **) &loaded_image);
if (EFI_ERROR(status)) { if (EFI_ERROR(status)) {
Print(L"handleprotocol: %r\n", status); Print(u"handleprotocol: %r\n", status);
} }
#if 0 #if 0
BS->HandleProtocol(loaded_image->DeviceHandle, &DevicePathProtocol, (void **) &dev_path); BS->HandleProtocol(loaded_image->DeviceHandle, &DevicePathProtocol, (void **) &dev_path);
Print(L"Image device : %s\n", DevicePathToStr(dev_path)); Print(u"Image device : %s\n", DevicePathToStr(dev_path));
Print(L"Image file : %s\n", DevicePathToStr(loaded_image->FilePath)); Print(u"Image file : %s\n", DevicePathToStr(loaded_image->FilePath));
#endif #endif
Print(L"Image base : %lx\n", loaded_image->ImageBase); Print(u"Image base : %lx\n", loaded_image->ImageBase);
Print(L"Image size : %lx\n", loaded_image->ImageSize); Print(u"Image size : %lx\n", loaded_image->ImageSize);
Print(L"Load options size : %lx\n", loaded_image->LoadOptionsSize); Print(u"Load options size : %lx\n", loaded_image->LoadOptionsSize);
Print(L"Load options : %s\n", loaded_image->LoadOptions); Print(u"Load options : %s\n", loaded_image->LoadOptions);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -9,16 +9,16 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
InitializeLib(image, systab); InitializeLib(image, systab);
Print(L"HelloLib application started\n"); Print(u"HelloLib application started\n");
Print(L"\n\n\nHit any key to exit this image\n"); Print(u"\n\n\nHit any key to exit this image\n");
WaitForSingleEvent(ST->ConIn->WaitForKey, 0); WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\n\n"); uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, u"\n\n");
efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key); efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key);
Print(L"ScanCode: %xh UnicodeChar: %xh CallRtStatus: %x\n", Print(u"ScanCode: %xh UnicodeChar: %xh CallRtStatus: %x\n",
efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status); efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status);
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -10,10 +10,10 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
InitializeLib(ImageHandle, SystemTable); InitializeLib(ImageHandle, SystemTable);
Argc = GetShellArgcArgv(ImageHandle, &Argv); Argc = GetShellArgcArgv(ImageHandle, &Argv);
Print(L"Hello World, started with Argc=%d\n", Argc); Print(u"Hello World, started with Argc=%d\n", Argc);
for (i = 0 ; i < Argc ; ++i) for (i = 0 ; i < Argc ; ++i)
Print(L" Argv[%d] = '%s'\n", i, Argv[i]); Print(u" Argv[%d] = '%s'\n", i, Argv[i]);
Print(L"Bye.\n"); Print(u"Bye.\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -18,15 +18,15 @@ void dump_stack_helper(uint64_t rsp_val)
uint64_t *rsp = (uint64_t *)rsp_val; uint64_t *rsp = (uint64_t *)rsp_val;
int x; int x;
Print(L"%%rsp: 0x%08x%08x stack:\r\n", Print(u"%%rsp: 0x%08x%08x stack:\r\n",
(rsp_val & 0xffffffff00000000) >>32, (rsp_val & 0xffffffff00000000) >>32,
rsp_val & 0xffffffff); rsp_val & 0xffffffff);
for (x = 0; x < 8; x++) { for (x = 0; x < 8; x++) {
Print(L"%08x: ", ((uint64_t)rsp) & 0xffffffff); Print(u"%08x: ", ((uint64_t)rsp) & 0xffffffff);
Print(L"%016x ", *rsp++); Print(u"%016x ", *rsp++);
Print(L"%016x ", *rsp++); Print(u"%016x ", *rsp++);
Print(L"%016x ", *rsp++); Print(u"%016x ", *rsp++);
Print(L"%016x\r\n", *rsp++); Print(u"%016x\r\n", *rsp++);
} }
} }
#endif #endif
@ -328,102 +328,102 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
__asm__ volatile("out %0,%1" : : "a" ((uint8_t)0x14), "dN" (0x80)); __asm__ volatile("out %0,%1" : : "a" ((uint8_t)0x14), "dN" (0x80));
#endif #endif
Print(L"Hello\n"); Print(u"Hello\n");
rc = test_failure(); rc = test_failure();
if (EFI_ERROR(rc)) { if (EFI_ERROR(rc)) {
Print(L"Returning Failure works\n"); Print(u"Returning Failure works\n");
} else { } else {
Print(L"Returning failure doesn't work.\n"); Print(u"Returning failure doesn't work.\n");
Print(L"%%rax was 0x%016x, should have been 0x%016x\n", Print(u"%%rax was 0x%016x, should have been 0x%016x\n",
rc, EFI_UNSUPPORTED); rc, EFI_UNSUPPORTED);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
rc = test_call0(); rc = test_call0();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"0 args works just fine here.\n"); Print(u"0 args works just fine here.\n");
} else { } else {
Print(L"0 args failed: 0x%016x\n", rc); Print(u"0 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call1(); rc = test_call1();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"1 arg works just fine here.\n"); Print(u"1 arg works just fine here.\n");
} else { } else {
Print(L"1 arg failed: 0x%016x\n", rc); Print(u"1 arg failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call2(); rc = test_call2();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"2 args works just fine here.\n"); Print(u"2 args works just fine here.\n");
} else { } else {
Print(L"2 args failed: 0x%016x\n", rc); Print(u"2 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call3(); rc = test_call3();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"3 args works just fine here.\n"); Print(u"3 args works just fine here.\n");
} else { } else {
Print(L"3 args failed: 0x%016x\n", rc); Print(u"3 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call4(); rc = test_call4();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"4 args works just fine here.\n"); Print(u"4 args works just fine here.\n");
} else { } else {
Print(L"4 args failed: 0x%016x\n", rc); Print(u"4 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call5(); rc = test_call5();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"5 args works just fine here.\n"); Print(u"5 args works just fine here.\n");
} else { } else {
Print(L"5 args failed: 0x%016x\n", rc); Print(u"5 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call6(); rc = test_call6();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"6 args works just fine here.\n"); Print(u"6 args works just fine here.\n");
} else { } else {
Print(L"6 args failed: 0x%016x\n", rc); Print(u"6 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call7(); rc = test_call7();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"7 args works just fine here.\n"); Print(u"7 args works just fine here.\n");
} else { } else {
Print(L"7 args failed: 0x%016x\n", rc); Print(u"7 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call8(); rc = test_call8();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"8 args works just fine here.\n"); Print(u"8 args works just fine here.\n");
} else { } else {
Print(L"8 args failed: 0x%016x\n", rc); Print(u"8 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call9(); rc = test_call9();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"9 args works just fine here.\n"); Print(u"9 args works just fine here.\n");
} else { } else {
Print(L"9 args failed: 0x%016x\n", rc); Print(u"9 args failed: 0x%016x\n", rc);
return rc; return rc;
} }
rc = test_call10(); rc = test_call10();
if (!EFI_ERROR(rc)) { if (!EFI_ERROR(rc)) {
Print(L"10 args works just fine here.\n"); Print(u"10 args works just fine here.\n");
} else { } else {
Print(L"10 args failed: 0x%016x\n", rc); Print(u"10 args failed: 0x%016x\n", rc);
return rc; return rc;
} }

View File

@ -4,6 +4,6 @@
EFI_STATUS EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{ {
Print(L"Press `q' to quit, any other key to continue:\n"); Print(u"Press `q' to quit, any other key to continue:\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -15,22 +15,22 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
UINT8 data = 1; UINT8 data = 1;
InitializeLib(image, systab); InitializeLib(image, systab);
status = RT->SetVariable(L"SHIM_DEBUG", &SHIM_GUID, status = RT->SetVariable(u"SHIM_DEBUG", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_RUNTIME_ACCESS,
0, &data); 0, &data);
if (EFI_ERROR(status)) if (EFI_ERROR(status))
Print(L"SetVariable failed: %r\n", status); Print(u"SetVariable failed: %r\n", status);
#if 0 #if 0
status = RT->SetVariable(L"GRUB_ENV", &SHIM_GUID, status = RT->SetVariable(u"GRUB_ENV", &SHIM_GUID,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(grubenv)-1, grubenv); sizeof(grubenv)-1, grubenv);
if (EFI_ERROR(status)) if (EFI_ERROR(status))
Print(L"SetVariable(GRUB_ENV) failed: %r\n", status); Print(u"SetVariable(GRUB_ENV) failed: %r\n", status);
#endif #endif
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -182,21 +182,21 @@ extern EFI_GUID ShellDynamicCommandProtocolGuid;
// //
#define LOAD_OPTION_ACTIVE 0x00000001 #define LOAD_OPTION_ACTIVE 0x00000001
#define VarLanguageCodes L"LangCodes" #define VarLanguageCodes u"LangCodes"
#define VarLanguage L"Lang" #define VarLanguage u"Lang"
#define VarTimeout L"Timeout" #define VarTimeout u"Timeout"
#define VarConsoleInp L"ConIn" #define VarConsoleInp u"ConIn"
#define VarConsoleOut L"ConOut" #define VarConsoleOut u"ConOut"
#define VarErrorOut L"ErrOut" #define VarErrorOut u"ErrOut"
#define VarBootOption L"Boot%04x" #define VarBootOption u"Boot%04x"
#define VarBootOrder L"BootOrder" #define VarBootOrder u"BootOrder"
#define VarBootNext L"BootNext" #define VarBootNext u"BootNext"
#define VarBootCurrent L"BootCurrent" #define VarBootCurrent u"BootCurrent"
#define VarDriverOption L"Driver%04x" #define VarDriverOption u"Driver%04x"
#define VarDriverOrder L"DriverOrder" #define VarDriverOrder u"DriverOrder"
#define VarConsoleInpDev L"ConInDev" #define VarConsoleInpDev u"ConInDev"
#define VarConsoleOutDev L"ConOutDev" #define VarConsoleOutDev u"ConOutDev"
#define VarErrorOutDev L"ErrOutDev" #define VarErrorOutDev u"ErrOutDev"
#define LanguageCodeEnglish "eng" #define LanguageCodeEnglish "eng"

View File

@ -32,70 +32,70 @@ typedef struct {
// //
STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = { STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
{ BOXDRAW_HORIZONTAL, 0xc4, L'-'}, { BOXDRAW_HORIZONTAL, 0xc4, u'-'},
{ BOXDRAW_VERTICAL, 0xb3, L'|'}, { BOXDRAW_VERTICAL, 0xb3, u'|'},
{ BOXDRAW_DOWN_RIGHT, 0xda, L'/'}, { BOXDRAW_DOWN_RIGHT, 0xda, u'/'},
{ BOXDRAW_DOWN_LEFT, 0xbf, L'\\'}, { BOXDRAW_DOWN_LEFT, 0xbf, u'\\'},
{ BOXDRAW_UP_RIGHT, 0xc0, L'\\'}, { BOXDRAW_UP_RIGHT, 0xc0, u'\\'},
{ BOXDRAW_UP_LEFT, 0xd9, L'/'}, { BOXDRAW_UP_LEFT, 0xd9, u'/'},
{ BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|'}, { BOXDRAW_VERTICAL_RIGHT, 0xc3, u'|'},
{ BOXDRAW_VERTICAL_LEFT, 0xb4, L'|'}, { BOXDRAW_VERTICAL_LEFT, 0xb4, u'|'},
{ BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+'}, { BOXDRAW_DOWN_HORIZONTAL, 0xc2, u'+'},
{ BOXDRAW_UP_HORIZONTAL, 0xc1, L'+'}, { BOXDRAW_UP_HORIZONTAL, 0xc1, u'+'},
{ BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+'}, { BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, u'+'},
{ BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-'}, { BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, u'-'},
{ BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|'}, { BOXDRAW_DOUBLE_VERTICAL, 0xba, u'|'},
{ BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/'}, { BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, u'/'},
{ BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/'}, { BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, u'/'},
{ BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/'}, { BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, u'/'},
{ BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\'}, { BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, u'\\'},
{ BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\'}, { BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, u'\\'},
{ BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\'}, { BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, u'\\'},
{ BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\'}, { BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, u'\\'},
{ BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\'}, { BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, u'\\'},
{ BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\'}, { BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, u'\\'},
{ BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/'}, { BOXDRAW_UP_LEFT_DOUBLE, 0xbe, u'/'},
{ BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/'}, { BOXDRAW_UP_DOUBLE_LEFT, 0xbd, u'/'},
{ BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/'}, { BOXDRAW_DOUBLE_UP_LEFT, 0xbc, u'/'},
{ BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|'}, { BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, u'|'},
{ BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|'}, { BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, u'|'},
{ BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|'}, { BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, u'|'},
{ BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|'}, { BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, u'|'},
{ BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|'}, { BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, u'|'},
{ BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|'}, { BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, u'|'},
{ BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+'}, { BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, u'+'},
{ BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+'}, { BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, u'+'},
{ BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+'}, { BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, u'+'},
{ BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+'}, { BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, u'+'},
{ BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+'}, { BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, u'+'},
{ BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+'}, { BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, u'+'},
{ BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+'}, { BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, u'+'},
{ BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+'}, { BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, u'+'},
{ BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+'}, { BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, u'+'},
{ BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*'}, { BLOCKELEMENT_FULL_BLOCK, 0xdb, u'*'},
{ BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+'}, { BLOCKELEMENT_LIGHT_SHADE, 0xb0, u'+'},
{ GEOMETRICSHAPE_UP_TRIANGLE, 0x1e, L'^'}, { GEOMETRICSHAPE_UP_TRIANGLE, 0x1e, u'^'},
{ GEOMETRICSHAPE_RIGHT_TRIANGLE, 0x10, L'>'}, { GEOMETRICSHAPE_RIGHT_TRIANGLE, 0x10, u'>'},
{ GEOMETRICSHAPE_DOWN_TRIANGLE, 0x1f, L'v'}, { GEOMETRICSHAPE_DOWN_TRIANGLE, 0x1f, u'v'},
{ GEOMETRICSHAPE_LEFT_TRIANGLE, 0x11, L'<'}, { GEOMETRICSHAPE_LEFT_TRIANGLE, 0x11, u'<'},
/* BugBug: Left Arrow is an ESC. We can not make it print /* BugBug: Left Arrow is an ESC. We can not make it print
on a PCANSI terminal. If we can make left arrow on a PCANSI terminal. If we can make left arrow
come out on PC ANSI we can add it back. come out on PC ANSI we can add it back.
{ ARROW_LEFT, 0x1b, L'<'}, { ARROW_LEFT, 0x1b, u'<'},
*/ */
{ ARROW_UP, 0x18, L'^'}, { ARROW_UP, 0x18, u'^'},
/* BugBut: Took out left arrow so right has to go too. /* BugBut: Took out left arrow so right has to go too.
{ ARROW_RIGHT, 0x1a, L'>'}, { ARROW_RIGHT, 0x1a, u'>'},
*/ */
{ ARROW_DOWN, 0x19, L'v'}, { ARROW_DOWN, 0x19, u'v'},
{ 0x0000, 0x00, L'\0' } { 0x0000, 0x00, u'\0' }
}; };

View File

@ -54,20 +54,20 @@ GetShellArgcArgvFromLoadedImage(
BufLen = sizeof(ArgvContents); BufLen = sizeof(ArgvContents);
CopyMem(ArgvContents, ((EFI_LOADED_IMAGE *)LoadedImage)->LoadOptions, BufLen); CopyMem(ArgvContents, ((EFI_LOADED_IMAGE *)LoadedImage)->LoadOptions, BufLen);
ArgvContents[MAX_CMDLINE_SIZE - 1] = L'\0'; ArgvContents[MAX_CMDLINE_SIZE - 1] = u'\0';
for (c = ArgStart = ArgvContents ; *c != L'\0' ; ++c) { for (c = ArgStart = ArgvContents ; *c != u'\0' ; ++c) {
if (*c == L' ') { if (*c == u' ') {
*c = L'\0'; *c = u'\0';
if (Argc < MAX_CMDLINE_ARGC) Argv[Argc++] = ArgStart; if (Argc < MAX_CMDLINE_ARGC) Argv[Argc++] = ArgStart;
ArgStart = c + 1; ArgStart = c + 1;
} }
} }
if ((*ArgStart != L'\0') && (Argc < MAX_CMDLINE_ARGC)) if ((*ArgStart != u'\0') && (Argc < MAX_CMDLINE_ARGC))
Argv[Argc++] = ArgStart; Argv[Argc++] = ArgStart;
// Print(L"Got argc/argv from loaded image proto\n"); // Print(u"Got argc/argv from loaded image proto\n");
*ResultArgv = Argv; *ResultArgv = Argv;
return Argc; return Argc;
} }
@ -93,7 +93,7 @@ INTN GetShellArgcArgv(EFI_HANDLE ImageHandle, CHAR16 **Argv[])
if (!EFI_ERROR(Status)) if (!EFI_ERROR(Status))
{ {
// use shell 2.0 interface // use shell 2.0 interface
// Print(L"Got argc/argv from shell intf proto\n"); // Print(u"Got argc/argv from shell intf proto\n");
*Argv = EfiShellParametersProtocol->Argv; *Argv = EfiShellParametersProtocol->Argv;
return EfiShellParametersProtocol->Argc; return EfiShellParametersProtocol->Argc;
} }
@ -109,7 +109,7 @@ INTN GetShellArgcArgv(EFI_HANDLE ImageHandle, CHAR16 **Argv[])
); );
if (!EFI_ERROR(Status)) if (!EFI_ERROR(Status))
{ {
// Print(L"Got argc/argv from shell params proto\n"); // Print(u"Got argc/argv from shell params proto\n");
*Argv = EfiShellInterfaceProtocol->Argv; *Argv = EfiShellInterfaceProtocol->Argv;
return EfiShellInterfaceProtocol->Argc; return EfiShellInterfaceProtocol->Argc;
} }

View File

@ -81,7 +81,7 @@ IInput (
if (Key.UnicodeChar == '\b') { if (Key.UnicodeChar == '\b') {
if (Len) { if (Len) {
uefi_call_wrapper(ConOut->OutputString, 2, ConOut, L"\b \b"); uefi_call_wrapper(ConOut->OutputString, 2, ConOut, u"\b \b");
Len -= 1; Len -= 1;
} }
continue; continue;

View File

@ -479,7 +479,7 @@ _DevPathPci (
PCI_DEVICE_PATH *Pci; PCI_DEVICE_PATH *Pci;
Pci = DevPath; Pci = DevPath;
CatPrint(Str, L"Pci(0x%x,0x%x)", Pci->Device, Pci->Function); CatPrint(Str, u"Pci(0x%x,0x%x)", Pci->Device, Pci->Function);
} }
static VOID static VOID
@ -491,7 +491,7 @@ _DevPathPccard (
PCCARD_DEVICE_PATH *Pccard; PCCARD_DEVICE_PATH *Pccard;
Pccard = DevPath; Pccard = DevPath;
CatPrint(Str, L"Pccard(0x%x)", Pccard-> FunctionNumber ); CatPrint(Str, u"Pccard(0x%x)", Pccard-> FunctionNumber );
} }
static VOID static VOID
@ -503,7 +503,7 @@ _DevPathMemMap (
MEMMAP_DEVICE_PATH *MemMap; MEMMAP_DEVICE_PATH *MemMap;
MemMap = DevPath; MemMap = DevPath;
CatPrint(Str, L"MemMap(%d,0x%x,0x%x)", CatPrint(Str, u"MemMap(%d,0x%x,0x%x)",
MemMap->MemoryType, MemMap->MemoryType,
MemMap->StartingAddress, MemMap->StartingAddress,
MemMap->EndingAddress MemMap->EndingAddress
@ -519,7 +519,7 @@ _DevPathController (
CONTROLLER_DEVICE_PATH *Controller; CONTROLLER_DEVICE_PATH *Controller;
Controller = DevPath; Controller = DevPath;
CatPrint(Str, L"Ctrl(%d)", CatPrint(Str, u"Ctrl(%d)",
Controller->Controller Controller->Controller
); );
} }
@ -536,21 +536,21 @@ _DevPathVendor (
Vendor = DevPath; Vendor = DevPath;
switch (DevicePathType(&Vendor->Header)) { switch (DevicePathType(&Vendor->Header)) {
case HARDWARE_DEVICE_PATH: Type = L"Hw"; break; case HARDWARE_DEVICE_PATH: Type = u"Hw"; break;
case MESSAGING_DEVICE_PATH: Type = L"Msg"; break; case MESSAGING_DEVICE_PATH: Type = u"Msg"; break;
case MEDIA_DEVICE_PATH: Type = L"Media"; break; case MEDIA_DEVICE_PATH: Type = u"Media"; break;
default: Type = L"?"; break; default: Type = u"?"; break;
} }
CatPrint(Str, L"Ven%s(%g", Type, &Vendor->Guid); CatPrint(Str, u"Ven%s(%g", Type, &Vendor->Guid);
if (CompareGuid (&Vendor->Guid, &UnknownDevice) == 0) { if (CompareGuid (&Vendor->Guid, &UnknownDevice) == 0) {
// //
// GUID used by EFI to enumerate an EDD 1.1 device // GUID used by EFI to enumerate an EDD 1.1 device
// //
UnknownDevPath = (UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *)Vendor; UnknownDevPath = (UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *)Vendor;
CatPrint(Str, L":%02x)", UnknownDevPath->LegacyDriveLetter); CatPrint(Str, u":%02x)", UnknownDevPath->LegacyDriveLetter);
} else { } else {
CatPrint(Str, L")"); CatPrint(Str, u")");
} }
} }
@ -570,40 +570,40 @@ _DevPathAcpi (
if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
switch ( EISA_ID_TO_NUM( Acpi-> HID ) ) { switch ( EISA_ID_TO_NUM( Acpi-> HID ) ) {
case 0x301 : { case 0x301 : {
CatPrint( Str , L"Keyboard(%d)" , Acpi-> UID ) ; CatPrint( Str , u"Keyboard(%d)" , Acpi-> UID ) ;
break ; break ;
} }
case 0x401 : { case 0x401 : {
CatPrint( Str , L"ParallelPort(%d)" , Acpi-> UID ) ; CatPrint( Str , u"ParallelPort(%d)" , Acpi-> UID ) ;
break ; break ;
} }
case 0x501 : { case 0x501 : {
CatPrint( Str , L"Serial(%d)" , Acpi-> UID ) ; CatPrint( Str , u"Serial(%d)" , Acpi-> UID ) ;
break ; break ;
} }
case 0x604 : { case 0x604 : {
CatPrint( Str , L"Floppy(%d)" , Acpi-> UID ) ; CatPrint( Str , u"Floppy(%d)" , Acpi-> UID ) ;
break ; break ;
} }
case 0xa03 : { case 0xa03 : {
CatPrint( Str , L"PciRoot(%d)" , Acpi-> UID ) ; CatPrint( Str , u"PciRoot(%d)" , Acpi-> UID ) ;
break ; break ;
} }
case 0xa08 : { case 0xa08 : {
CatPrint( Str , L"PcieRoot(%d)" , Acpi-> UID ) ; CatPrint( Str , u"PcieRoot(%d)" , Acpi-> UID ) ;
break ; break ;
} }
default : { default : {
CatPrint( Str , L"Acpi(PNP%04x" , EISA_ID_TO_NUM( Acpi-> HID ) ) ; CatPrint( Str , u"Acpi(PNP%04x" , EISA_ID_TO_NUM( Acpi-> HID ) ) ;
if ( Acpi-> UID ) CatPrint( Str , L",%d" , Acpi-> UID ) ; if ( Acpi-> UID ) CatPrint( Str , u",%d" , Acpi-> UID ) ;
CatPrint( Str , L")" ) ; CatPrint( Str , u")" ) ;
break ; break ;
} }
} }
} else { } else {
CatPrint( Str , L"Acpi(0x%X" , Acpi-> HID ) ; CatPrint( Str , u"Acpi(0x%X" , Acpi-> HID ) ;
if ( Acpi-> UID ) CatPrint( Str , L",%d" , Acpi-> UID ) ; if ( Acpi-> UID ) CatPrint( Str , u",%d" , Acpi-> UID ) ;
CatPrint( Str , L")" , Acpi-> HID , Acpi-> UID ) ; CatPrint( Str , u")" , Acpi-> HID , Acpi-> UID ) ;
} }
} }
@ -617,9 +617,9 @@ _DevPathAtapi (
ATAPI_DEVICE_PATH *Atapi; ATAPI_DEVICE_PATH *Atapi;
Atapi = DevPath; Atapi = DevPath;
CatPrint(Str, L"Ata(%s,%s)", CatPrint(Str, u"Ata(%s,%s)",
Atapi->PrimarySecondary ? L"Secondary" : L"Primary", Atapi->PrimarySecondary ? u"Secondary" : u"Primary",
Atapi->SlaveMaster ? L"Slave" : L"Master" Atapi->SlaveMaster ? u"Slave" : u"Master"
); );
} }
@ -632,7 +632,7 @@ _DevPathScsi (
SCSI_DEVICE_PATH *Scsi; SCSI_DEVICE_PATH *Scsi;
Scsi = DevPath; Scsi = DevPath;
CatPrint(Str, L"Scsi(%d,%d)", Scsi->Pun, Scsi->Lun); CatPrint(Str, u"Scsi(%d,%d)", Scsi->Pun, Scsi->Lun);
} }
@ -645,8 +645,8 @@ _DevPathFibre (
FIBRECHANNEL_DEVICE_PATH *Fibre; FIBRECHANNEL_DEVICE_PATH *Fibre;
Fibre = DevPath; Fibre = DevPath;
CatPrint( Str , L"Fibre%s(0x%016lx,0x%016lx)" , CatPrint( Str , u"Fibre%s(0x%016lx,0x%016lx)" ,
DevicePathType( & Fibre-> Header ) == MSG_FIBRECHANNEL_DP ? L"" : L"Ex" , DevicePathType( & Fibre-> Header ) == MSG_FIBRECHANNEL_DP ? u"" : u"Ex" ,
Fibre-> WWN , Fibre-> Lun ) ; Fibre-> WWN , Fibre-> Lun ) ;
} }
@ -660,7 +660,7 @@ _DevPath1394 (
F1394 = DevPath; F1394 = DevPath;
// Guid has format of IEEE-EUI64 // Guid has format of IEEE-EUI64
CatPrint(Str, L"I1394(%016lx)", F1394->Guid); CatPrint(Str, u"I1394(%016lx)", F1394->Guid);
} }
@ -674,7 +674,7 @@ _DevPathUsb (
USB_DEVICE_PATH *Usb; USB_DEVICE_PATH *Usb;
Usb = DevPath; Usb = DevPath;
CatPrint( Str , L"Usb(0x%x,0x%x)" , Usb-> Port , Usb-> Endpoint ) ; CatPrint( Str , u"Usb(0x%x,0x%x)" , Usb-> Port , Usb-> Endpoint ) ;
} }
@ -687,7 +687,7 @@ _DevPathI2O (
I2O_DEVICE_PATH *I2O; I2O_DEVICE_PATH *I2O;
I2O = DevPath; I2O = DevPath;
CatPrint(Str, L"I2O(0x%X)", I2O->Tid); CatPrint(Str, u"I2O(0x%X)", I2O->Tid);
} }
static VOID static VOID
@ -710,15 +710,15 @@ _DevPathMacAddr (
HwAddressSize = 6; HwAddressSize = 6;
} }
CatPrint(Str, L"Mac("); CatPrint(Str, u"Mac(");
for(Index = 0; Index < HwAddressSize; Index++) { for(Index = 0; Index < HwAddressSize; Index++) {
CatPrint(Str, L"%02x",MAC->MacAddress.Addr[Index]); CatPrint(Str, u"%02x",MAC->MacAddress.Addr[Index]);
} }
if ( MAC-> IfType != 0 ) { if ( MAC-> IfType != 0 ) {
CatPrint(Str, L",%d" , MAC-> IfType ) ; CatPrint(Str, u",%d" , MAC-> IfType ) ;
} }
CatPrint(Str, L")"); CatPrint(Str, u")");
} }
static VOID static VOID
@ -727,7 +727,7 @@ CatPrintIPv4(
IN EFI_IPv4_ADDRESS * Address IN EFI_IPv4_ADDRESS * Address
) )
{ {
CatPrint( Str , L"%d.%d.%d.%d" , Address-> Addr[ 0 ] , Address-> Addr[ 1 ] , CatPrint( Str , u"%d.%d.%d.%d" , Address-> Addr[ 0 ] , Address-> Addr[ 1 ] ,
Address-> Addr[ 2 ] , Address-> Addr[ 3 ] ) ; Address-> Addr[ 2 ] , Address-> Addr[ 3 ] ) ;
} }
@ -749,11 +749,11 @@ CatPrintNetworkProtocol(
) )
{ {
if ( Proto == 6 ) { if ( Proto == 6 ) {
CatPrint( Str , L"TCP" ) ; CatPrint( Str , u"TCP" ) ;
} else if ( Proto == 17 ) { } else if ( Proto == 17 ) {
CatPrint( Str , L"UDP" ) ; CatPrint( Str , u"UDP" ) ;
} else { } else {
CatPrint( Str , L"%d" , Proto ) ; CatPrint( Str , u"%d" , Proto ) ;
} }
} }
@ -767,11 +767,11 @@ _DevPathIPv4 (
BOOLEAN show ; BOOLEAN show ;
IP = DevPath; IP = DevPath;
CatPrint( Str , L"IPv4(") ; CatPrint( Str , u"IPv4(") ;
CatPrintIPv4( Str , & IP-> RemoteIpAddress ) ; CatPrintIPv4( Str , & IP-> RemoteIpAddress ) ;
CatPrint( Str , L",") ; CatPrint( Str , u",") ;
CatPrintNetworkProtocol( Str , IP-> Protocol ) ; CatPrintNetworkProtocol( Str , IP-> Protocol ) ;
CatPrint( Str , L",%s" , IP-> StaticIpAddress ? L"Static" : L"DHCP" ) ; CatPrint( Str , u",%s" , IP-> StaticIpAddress ? u"Static" : u"DHCP" ) ;
show = IsNotNullIPv4( & IP-> LocalIpAddress ) ; show = IsNotNullIPv4( & IP-> LocalIpAddress ) ;
if ( ! show && DevicePathNodeLength( & IP-> Header ) == sizeof( IPv4_DEVICE_PATH ) ) { if ( ! show && DevicePathNodeLength( & IP-> Header ) == sizeof( IPv4_DEVICE_PATH ) ) {
/* only version 2 includes gateway and netmask */ /* only version 2 includes gateway and netmask */
@ -779,23 +779,23 @@ _DevPathIPv4 (
show |= IsNotNullIPv4( & IP-> SubnetMask ) ; show |= IsNotNullIPv4( & IP-> SubnetMask ) ;
} }
if ( show ) { if ( show ) {
CatPrint( Str , L"," ) ; CatPrint( Str , u"," ) ;
CatPrintIPv4( Str , & IP-> LocalIpAddress ) ; CatPrintIPv4( Str , & IP-> LocalIpAddress ) ;
if ( DevicePathNodeLength( & IP-> Header ) == sizeof( IPv4_DEVICE_PATH ) ) { if ( DevicePathNodeLength( & IP-> Header ) == sizeof( IPv4_DEVICE_PATH ) ) {
/* only version 2 includes gateway and netmask */ /* only version 2 includes gateway and netmask */
show = IsNotNullIPv4( & IP-> GatewayIpAddress ) ; show = IsNotNullIPv4( & IP-> GatewayIpAddress ) ;
show |= IsNotNullIPv4( & IP-> SubnetMask ) ; show |= IsNotNullIPv4( & IP-> SubnetMask ) ;
if ( show ) { if ( show ) {
CatPrint( Str , L",") ; CatPrint( Str , u",") ;
CatPrintIPv4( Str , & IP-> GatewayIpAddress ) ; CatPrintIPv4( Str , & IP-> GatewayIpAddress ) ;
if ( IsNotNullIPv4( & IP-> SubnetMask ) ) { if ( IsNotNullIPv4( & IP-> SubnetMask ) ) {
CatPrint( Str , L",") ; CatPrint( Str , u",") ;
CatPrintIPv4( Str , & IP-> SubnetMask ) ; CatPrintIPv4( Str , & IP-> SubnetMask ) ;
} }
} }
} }
} }
CatPrint( Str , L")") ; CatPrint( Str , u")") ;
} }
#define CatPrintIPv6_ADD( x , y ) ( ( (UINT16) ( x ) ) << 8 | ( y ) ) #define CatPrintIPv6_ADD( x , y ) ( ( (UINT16) ( x ) ) << 8 | ( y ) )
@ -805,7 +805,7 @@ CatPrintIPv6(
IN EFI_IPv6_ADDRESS * Address IN EFI_IPv6_ADDRESS * Address
) )
{ {
CatPrint( Str , L"%x:%x:%x:%x:%x:%x:%x:%x" , CatPrint( Str , u"%x:%x:%x:%x:%x:%x:%x:%x" ,
CatPrintIPv6_ADD( Address-> Addr[ 0 ] , Address-> Addr[ 1 ] ) , CatPrintIPv6_ADD( Address-> Addr[ 0 ] , Address-> Addr[ 1 ] ) ,
CatPrintIPv6_ADD( Address-> Addr[ 2 ] , Address-> Addr[ 3 ] ) , CatPrintIPv6_ADD( Address-> Addr[ 2 ] , Address-> Addr[ 3 ] ) ,
CatPrintIPv6_ADD( Address-> Addr[ 4 ] , Address-> Addr[ 5 ] ) , CatPrintIPv6_ADD( Address-> Addr[ 4 ] , Address-> Addr[ 5 ] ) ,
@ -825,21 +825,21 @@ _DevPathIPv6 (
IPv6_DEVICE_PATH *IP; IPv6_DEVICE_PATH *IP;
IP = DevPath; IP = DevPath;
CatPrint( Str , L"IPv6(") ; CatPrint( Str , u"IPv6(") ;
CatPrintIPv6( Str , & IP-> RemoteIpAddress ) ; CatPrintIPv6( Str , & IP-> RemoteIpAddress ) ;
CatPrint( Str , L",") ; CatPrint( Str , u",") ;
CatPrintNetworkProtocol( Str, IP-> Protocol ) ; CatPrintNetworkProtocol( Str, IP-> Protocol ) ;
CatPrint( Str , L",%s," , IP-> IPAddressOrigin ? CatPrint( Str , u",%s," , IP-> IPAddressOrigin ?
( IP-> IPAddressOrigin == 1 ? L"StatelessAutoConfigure" : ( IP-> IPAddressOrigin == 1 ? u"StatelessAutoConfigure" :
L"StatefulAutoConfigure" ) : L"Static" ) ; u"StatefulAutoConfigure" ) : u"Static" ) ;
CatPrintIPv6( Str , & IP-> LocalIpAddress ) ; CatPrintIPv6( Str , & IP-> LocalIpAddress ) ;
if ( DevicePathNodeLength( & IP-> Header ) == sizeof( IPv6_DEVICE_PATH ) ) { if ( DevicePathNodeLength( & IP-> Header ) == sizeof( IPv6_DEVICE_PATH ) ) {
CatPrint( Str , L",") ; CatPrint( Str , u",") ;
CatPrintIPv6( Str , & IP-> GatewayIpAddress ) ; CatPrintIPv6( Str , & IP-> GatewayIpAddress ) ;
CatPrint( Str , L",") ; CatPrint( Str , u",") ;
CatPrint( Str , L"%d" , & IP-> PrefixLength ) ; CatPrint( Str , u"%d" , & IP-> PrefixLength ) ;
} }
CatPrint( Str , L")") ; CatPrint( Str , u")") ;
} }
static VOID static VOID
@ -852,7 +852,7 @@ _DevPathUri (
Uri = DevPath; Uri = DevPath;
CatPrint( Str, L"Uri(%a)", Uri->Uri ); CatPrint( Str, u"Uri(%a)", Uri->Uri );
} }
static VOID static VOID
@ -864,7 +864,7 @@ _DevPathInfiniBand (
INFINIBAND_DEVICE_PATH *InfiniBand; INFINIBAND_DEVICE_PATH *InfiniBand;
InfiniBand = DevPath; InfiniBand = DevPath;
CatPrint(Str, L"Infiniband(0x%x,%g,0x%lx,0x%lx,0x%lx)", CatPrint(Str, u"Infiniband(0x%x,%g,0x%lx,0x%lx,0x%lx)",
InfiniBand->ResourceFlags, InfiniBand->PortGid, InfiniBand->ServiceId, InfiniBand->ResourceFlags, InfiniBand->PortGid, InfiniBand->ServiceId,
InfiniBand->TargetPortId, InfiniBand->DeviceId); InfiniBand->TargetPortId, InfiniBand->DeviceId);
} }
@ -890,25 +890,25 @@ _DevPathUart (
} }
if (Uart->BaudRate == 0) { if (Uart->BaudRate == 0) {
CatPrint(Str, L"Uart(DEFAULT,"); CatPrint(Str, u"Uart(DEFAULT,");
} else { } else {
CatPrint(Str, L"Uart(%ld,", Uart->BaudRate); CatPrint(Str, u"Uart(%ld,", Uart->BaudRate);
} }
if (Uart->DataBits == 0) { if (Uart->DataBits == 0) {
CatPrint(Str, L"DEFAULT,"); CatPrint(Str, u"DEFAULT,");
} else { } else {
CatPrint(Str, L"%d,", Uart->DataBits); CatPrint(Str, u"%d,", Uart->DataBits);
} }
CatPrint(Str, L"%c,", Parity); CatPrint(Str, u"%c,", Parity);
switch (Uart->StopBits) { switch (Uart->StopBits) {
case 0 : CatPrint(Str, L"D)"); break; case 0 : CatPrint(Str, u"D)"); break;
case 1 : CatPrint(Str, L"1)"); break; case 1 : CatPrint(Str, u"1)"); break;
case 2 : CatPrint(Str, L"1.5)"); break; case 2 : CatPrint(Str, u"1.5)"); break;
case 3 : CatPrint(Str, L"2)"); break; case 3 : CatPrint(Str, u"2)"); break;
default : CatPrint(Str, L"x)"); break; default : CatPrint(Str, u"x)"); break;
} }
} }
@ -921,7 +921,7 @@ _DevPathSata (
SATA_DEVICE_PATH * Sata ; SATA_DEVICE_PATH * Sata ;
Sata = DevPath; Sata = DevPath;
CatPrint( Str , L"Sata(0x%x,0x%x,0x%x)" , Sata-> HBAPortNumber , CatPrint( Str , u"Sata(0x%x,0x%x,0x%x)" , Sata-> HBAPortNumber ,
Sata-> PortMultiplierPortNumber , Sata-> Lun ) ; Sata-> PortMultiplierPortNumber , Sata-> Lun ) ;
} }
@ -936,19 +936,19 @@ _DevPathHardDrive (
Hd = DevPath; Hd = DevPath;
switch (Hd->SignatureType) { switch (Hd->SignatureType) {
case SIGNATURE_TYPE_MBR: case SIGNATURE_TYPE_MBR:
CatPrint(Str, L"HD(%d,MBR,0x%08x)", CatPrint(Str, u"HD(%d,MBR,0x%08x)",
Hd->PartitionNumber, Hd->PartitionNumber,
*((UINT32 *)(&(Hd->Signature[0]))) *((UINT32 *)(&(Hd->Signature[0])))
); );
break; break;
case SIGNATURE_TYPE_GUID: case SIGNATURE_TYPE_GUID:
CatPrint(Str, L"HD(%d,GPT,%g)", CatPrint(Str, u"HD(%d,GPT,%g)",
Hd->PartitionNumber, Hd->PartitionNumber,
(EFI_GUID *) &(Hd->Signature[0]) (EFI_GUID *) &(Hd->Signature[0])
); );
break; break;
default: default:
CatPrint(Str, L"HD(%d,%d,0)", CatPrint(Str, u"HD(%d,%d,0)",
Hd->PartitionNumber, Hd->PartitionNumber,
Hd->SignatureType Hd->SignatureType
); );
@ -965,7 +965,7 @@ _DevPathCDROM (
CDROM_DEVICE_PATH *Cd; CDROM_DEVICE_PATH *Cd;
Cd = DevPath; Cd = DevPath;
CatPrint( Str , L"CDROM(0x%x)" , Cd-> BootEntry ) ; CatPrint( Str , u"CDROM(0x%x)" , Cd-> BootEntry ) ;
} }
static VOID static VOID
@ -977,7 +977,7 @@ _DevPathFilePath (
FILEPATH_DEVICE_PATH *Fp; FILEPATH_DEVICE_PATH *Fp;
Fp = DevPath; Fp = DevPath;
CatPrint(Str, L"%s", Fp->PathName); CatPrint(Str, u"%s", Fp->PathName);
} }
static VOID static VOID
@ -989,7 +989,7 @@ _DevPathMediaProtocol (
MEDIA_PROTOCOL_DEVICE_PATH *MediaProt; MEDIA_PROTOCOL_DEVICE_PATH *MediaProt;
MediaProt = DevPath; MediaProt = DevPath;
CatPrint(Str, L"%g", &MediaProt->Protocol); CatPrint(Str, u"%g", &MediaProt->Protocol);
} }
static VOID static VOID
@ -1003,16 +1003,16 @@ _DevPathBssBss (
Bss = DevPath; Bss = DevPath;
switch (Bss->DeviceType) { switch (Bss->DeviceType) {
case BBS_TYPE_FLOPPY: Type = L"Floppy"; break; case BBS_TYPE_FLOPPY: Type = u"Floppy"; break;
case BBS_TYPE_HARDDRIVE: Type = L"Harddrive"; break; case BBS_TYPE_HARDDRIVE: Type = u"Harddrive"; break;
case BBS_TYPE_CDROM: Type = L"CDROM"; break; case BBS_TYPE_CDROM: Type = u"CDROM"; break;
case BBS_TYPE_PCMCIA: Type = L"PCMCIA"; break; case BBS_TYPE_PCMCIA: Type = u"PCMCIA"; break;
case BBS_TYPE_USB: Type = L"Usb"; break; case BBS_TYPE_USB: Type = u"Usb"; break;
case BBS_TYPE_EMBEDDED_NETWORK: Type = L"Net"; break; case BBS_TYPE_EMBEDDED_NETWORK: Type = u"Net"; break;
default: Type = L"?"; break; default: Type = u"?"; break;
} }
CatPrint(Str, L"Bss-%s(%a)", Type, Bss->String); CatPrint(Str, u"Bss-%s(%a)", Type, Bss->String);
} }
@ -1022,7 +1022,7 @@ _DevPathEndInstance (
IN VOID *DevPath EFI_UNUSED IN VOID *DevPath EFI_UNUSED
) )
{ {
CatPrint(Str, L","); CatPrint(Str, u",");
} }
/** /**
@ -1044,37 +1044,37 @@ _DevPathNodeUnknown (
value += 4 ; value += 4 ;
switch ( Path-> Type ) { switch ( Path-> Type ) {
case HARDWARE_DEVICE_PATH : { /* Unknown Hardware Device Path */ case HARDWARE_DEVICE_PATH : { /* Unknown Hardware Device Path */
CatPrint( Str , L"HardwarePath(%d" , Path-> SubType ) ; CatPrint( Str , u"HardwarePath(%d" , Path-> SubType ) ;
break ; break ;
} }
case ACPI_DEVICE_PATH : { /* Unknown ACPI Device Path */ case ACPI_DEVICE_PATH : { /* Unknown ACPI Device Path */
CatPrint( Str , L"AcpiPath(%d" , Path-> SubType ) ; CatPrint( Str , u"AcpiPath(%d" , Path-> SubType ) ;
break ; break ;
} }
case MESSAGING_DEVICE_PATH : { /* Unknown Messaging Device Path */ case MESSAGING_DEVICE_PATH : { /* Unknown Messaging Device Path */
CatPrint( Str , L"Msg(%d" , Path-> SubType ) ; CatPrint( Str , u"Msg(%d" , Path-> SubType ) ;
break ; break ;
} }
case MEDIA_DEVICE_PATH : { /* Unknown Media Device Path */ case MEDIA_DEVICE_PATH : { /* Unknown Media Device Path */
CatPrint( Str , L"MediaPath(%d" , Path-> SubType ) ; CatPrint( Str , u"MediaPath(%d" , Path-> SubType ) ;
break ; break ;
} }
case BBS_DEVICE_PATH : { /* Unknown BIOS Boot Specification Device Path */ case BBS_DEVICE_PATH : { /* Unknown BIOS Boot Specification Device Path */
CatPrint( Str , L"BbsPath(%d" , Path-> SubType ) ; CatPrint( Str , u"BbsPath(%d" , Path-> SubType ) ;
break ; break ;
} }
default : { /* Unknown Device Path */ default : { /* Unknown Device Path */
CatPrint( Str , L"Path(%d,%d" , Path-> Type , Path-> SubType ) ; CatPrint( Str , u"Path(%d,%d" , Path-> Type , Path-> SubType ) ;
break ; break ;
} }
} }
length = DevicePathNodeLength( Path ) ; length = DevicePathNodeLength( Path ) ;
for ( index = 0 ; index < length ; index ++ ) { for ( index = 0 ; index < length ; index ++ ) {
if ( index == 0 ) CatPrint( Str , L",0x" ) ; if ( index == 0 ) CatPrint( Str , u",0x" ) ;
CatPrint( Str , L"%02x" , * value ) ; CatPrint( Str , u"%02x" , * value ) ;
value ++ ; value ++ ;
} }
CatPrint( Str , L")" ) ; CatPrint( Str , u")" ) ;
} }
@ -1180,7 +1180,7 @@ DevicePathToStr (
// //
if (Str.len && DumpNode != _DevPathEndInstance) { if (Str.len && DumpNode != _DevPathEndInstance) {
CatPrint (&Str, L"/"); CatPrint (&Str, u"/");
} }
// //

View File

@ -23,49 +23,49 @@ typedef struct {
WCHAR *Desc; WCHAR *Desc;
} ErrorCodeTable_Type; } ErrorCodeTable_Type;
ErrorCodeTable_Type ErrorCodeTable[] = { ErrorCodeTable_Type ErrorCodeTable[] = {
{ EFI_SUCCESS, L"Success"}, { EFI_SUCCESS, u"Success"},
{ EFI_LOAD_ERROR, L"Load Error"}, { EFI_LOAD_ERROR, u"Load Error"},
{ EFI_INVALID_PARAMETER, L"Invalid Parameter"}, { EFI_INVALID_PARAMETER, u"Invalid Parameter"},
{ EFI_UNSUPPORTED, L"Unsupported"}, { EFI_UNSUPPORTED, u"Unsupported"},
{ EFI_BAD_BUFFER_SIZE, L"Bad Buffer Size"}, { EFI_BAD_BUFFER_SIZE, u"Bad Buffer Size"},
{ EFI_BUFFER_TOO_SMALL, L"Buffer Too Small"}, { EFI_BUFFER_TOO_SMALL, u"Buffer Too Small"},
{ EFI_NOT_READY, L"Not Ready"}, { EFI_NOT_READY, u"Not Ready"},
{ EFI_DEVICE_ERROR, L"Device Error"}, { EFI_DEVICE_ERROR, u"Device Error"},
{ EFI_WRITE_PROTECTED, L"Write Protected"}, { EFI_WRITE_PROTECTED, u"Write Protected"},
{ EFI_OUT_OF_RESOURCES, L"Out of Resources"}, { EFI_OUT_OF_RESOURCES, u"Out of Resources"},
{ EFI_VOLUME_CORRUPTED, L"Volume Corrupt"}, { EFI_VOLUME_CORRUPTED, u"Volume Corrupt"},
{ EFI_VOLUME_FULL, L"Volume Full"}, { EFI_VOLUME_FULL, u"Volume Full"},
{ EFI_NO_MEDIA, L"No Media"}, { EFI_NO_MEDIA, u"No Media"},
{ EFI_MEDIA_CHANGED, L"Media changed"}, { EFI_MEDIA_CHANGED, u"Media changed"},
{ EFI_NOT_FOUND, L"Not Found"}, { EFI_NOT_FOUND, u"Not Found"},
{ EFI_ACCESS_DENIED, L"Access Denied"}, { EFI_ACCESS_DENIED, u"Access Denied"},
{ EFI_NO_RESPONSE, L"No Response"}, { EFI_NO_RESPONSE, u"No Response"},
{ EFI_NO_MAPPING, L"No mapping"}, { EFI_NO_MAPPING, u"No mapping"},
{ EFI_TIMEOUT, L"Time out"}, { EFI_TIMEOUT, u"Time out"},
{ EFI_NOT_STARTED, L"Not started"}, { EFI_NOT_STARTED, u"Not started"},
{ EFI_ALREADY_STARTED, L"Already started"}, { EFI_ALREADY_STARTED, u"Already started"},
{ EFI_ABORTED, L"Aborted"}, { EFI_ABORTED, u"Aborted"},
{ EFI_ICMP_ERROR, L"ICMP Error"}, { EFI_ICMP_ERROR, u"ICMP Error"},
{ EFI_TFTP_ERROR, L"TFTP Error"}, { EFI_TFTP_ERROR, u"TFTP Error"},
{ EFI_PROTOCOL_ERROR, L"Protocol Error"}, { EFI_PROTOCOL_ERROR, u"Protocol Error"},
{ EFI_INCOMPATIBLE_VERSION, L"Incompatible Version"}, { EFI_INCOMPATIBLE_VERSION, u"Incompatible Version"},
{ EFI_SECURITY_VIOLATION, L"Security Policy Violation"}, { EFI_SECURITY_VIOLATION, u"Security Policy Violation"},
{ EFI_CRC_ERROR, L"CRC Error"}, { EFI_CRC_ERROR, u"CRC Error"},
{ EFI_END_OF_MEDIA, L"End of Media"}, { EFI_END_OF_MEDIA, u"End of Media"},
{ EFI_END_OF_FILE, L"End of File"}, { EFI_END_OF_FILE, u"End of File"},
{ EFI_INVALID_LANGUAGE, L"Invalid Languages"}, { EFI_INVALID_LANGUAGE, u"Invalid Languages"},
{ EFI_COMPROMISED_DATA, L"Compromised Data"}, { EFI_COMPROMISED_DATA, u"Compromised Data"},
{ EFI_IP_ADDRESS_CONFLICT, L"IP Address Conflict"}, { EFI_IP_ADDRESS_CONFLICT, u"IP Address Conflict"},
{ EFI_HTTP_ERROR, L"HTTP Error"}, { EFI_HTTP_ERROR, u"HTTP Error"},
// warnings // warnings
{ EFI_WARN_UNKNOWN_GLYPH, L"Warning Unknown Glyph"}, { EFI_WARN_UNKNOWN_GLYPH, u"Warning Unknown Glyph"},
{ EFI_WARN_DELETE_FAILURE, L"Warning Delete Failure"}, { EFI_WARN_DELETE_FAILURE, u"Warning Delete Failure"},
{ EFI_WARN_WRITE_FAILURE, L"Warning Write Failure"}, { EFI_WARN_WRITE_FAILURE, u"Warning Write Failure"},
{ EFI_WARN_BUFFER_TOO_SMALL, L"Warning Buffer Too Small"}, { EFI_WARN_BUFFER_TOO_SMALL, u"Warning Buffer Too Small"},
{ EFI_WARN_STALE_DATA, L"Warning Stale Data"}, { EFI_WARN_STALE_DATA, u"Warning Stale Data"},
{ EFI_WARN_FILE_SYSTEM, L"Warning File System"}, { EFI_WARN_FILE_SYSTEM, u"Warning File System"},
{ EFI_WARN_RESET_REQUIRED, L"Warning Reset Required"}, { EFI_WARN_RESET_REQUIRED, u"Warning Reset Required"},
{ 0, NULL} { 0, NULL}
} ; } ;
@ -85,5 +85,5 @@ StatusToString (
} }
} }
UnicodeSPrint (Buffer, 0, L"%X", Status); UnicodeSPrint (Buffer, 0, u"%X", Status);
} }

View File

@ -48,56 +48,56 @@ static struct {
EFI_GUID *Guid; EFI_GUID *Guid;
WCHAR *GuidName; WCHAR *GuidName;
} KnownGuids[] = { } KnownGuids[] = {
{ &NullGuid, L"G0" }, { &NullGuid, u"G0" },
{ &gEfiGlobalVariableGuid, L"EfiVar" }, { &gEfiGlobalVariableGuid, u"EfiVar" },
{ &VariableStoreProtocol, L"VarStore" }, { &VariableStoreProtocol, u"VarStore" },
{ &gEfiDevicePathProtocolGuid, L"DevPath" }, { &gEfiDevicePathProtocolGuid, u"DevPath" },
{ &gEfiLoadedImageProtocolGuid, L"LdImg" }, { &gEfiLoadedImageProtocolGuid, u"LdImg" },
{ &gEfiSimpleTextInProtocolGuid, L"TxtIn" }, { &gEfiSimpleTextInProtocolGuid, u"TxtIn" },
{ &gEfiSimpleTextOutProtocolGuid, L"TxtOut" }, { &gEfiSimpleTextOutProtocolGuid, u"TxtOut" },
{ &gEfiBlockIoProtocolGuid, L"BlkIo" }, { &gEfiBlockIoProtocolGuid, u"BlkIo" },
{ &gEfiBlockIo2ProtocolGuid, L"BlkIo2" }, { &gEfiBlockIo2ProtocolGuid, u"BlkIo2" },
{ &gEfiDiskIoProtocolGuid, L"DskIo" }, { &gEfiDiskIoProtocolGuid, u"DskIo" },
{ &gEfiDiskIo2ProtocolGuid, L"DskIo2" }, { &gEfiDiskIo2ProtocolGuid, u"DskIo2" },
{ &gEfiSimpleFileSystemProtocolGuid, L"Fs" }, { &gEfiSimpleFileSystemProtocolGuid, u"Fs" },
{ &gEfiLoadFileProtocolGuid, L"LdFile" }, { &gEfiLoadFileProtocolGuid, u"LdFile" },
{ &gEfiDeviceIoProtocolGuid, L"DevIo" }, { &gEfiDeviceIoProtocolGuid, u"DevIo" },
{ &gEfiComponentNameProtocolGuid, L"CName" }, { &gEfiComponentNameProtocolGuid, u"CName" },
{ &gEfiComponentName2ProtocolGuid, L"CName2" }, { &gEfiComponentName2ProtocolGuid, u"CName2" },
{ &gEfiFileInfoGuid, L"FileInfo" }, { &gEfiFileInfoGuid, u"FileInfo" },
{ &gEfiFileSystemInfoGuid, L"FsInfo" }, { &gEfiFileSystemInfoGuid, u"FsInfo" },
{ &gEfiFileSystemVolumeLabelInfoIdGuid, L"FsVolInfo" }, { &gEfiFileSystemVolumeLabelInfoIdGuid, u"FsVolInfo" },
{ &gEfiUnicodeCollationProtocolGuid, L"Unicode" }, { &gEfiUnicodeCollationProtocolGuid, u"Unicode" },
{ &LegacyBootProtocol, L"LegacyBoot" }, { &LegacyBootProtocol, u"LegacyBoot" },
{ &gEfiSerialIoProtocolGuid, L"SerIo" }, { &gEfiSerialIoProtocolGuid, u"SerIo" },
{ &VgaClassProtocol, L"VgaClass"}, { &VgaClassProtocol, u"VgaClass"},
{ &gEfiSimpleNetworkProtocolGuid, L"Net" }, { &gEfiSimpleNetworkProtocolGuid, u"Net" },
{ &gEfiNetworkInterfaceIdentifierProtocolGuid, L"Nii" }, { &gEfiNetworkInterfaceIdentifierProtocolGuid, u"Nii" },
{ &gEfiPxeBaseCodeProtocolGuid, L"Pxe" }, { &gEfiPxeBaseCodeProtocolGuid, u"Pxe" },
{ &gEfiPxeBaseCodeCallbackProtocolGuid, L"PxeCb" }, { &gEfiPxeBaseCodeCallbackProtocolGuid, u"PxeCb" },
{ &TextOutSpliterProtocol, L"TxtOutSplit" }, { &TextOutSpliterProtocol, u"TxtOutSplit" },
{ &ErrorOutSpliterProtocol, L"ErrOutSplit" }, { &ErrorOutSpliterProtocol, u"ErrOutSplit" },
{ &TextInSpliterProtocol, L"TxtInSplit" }, { &TextInSpliterProtocol, u"TxtInSplit" },
{ &gEfiPcAnsiGuid, L"PcAnsi" }, { &gEfiPcAnsiGuid, u"PcAnsi" },
{ &gEfiVT100Guid, L"Vt100" }, { &gEfiVT100Guid, u"Vt100" },
{ &gEfiVT100PlusGuid, L"Vt100Plus" }, { &gEfiVT100PlusGuid, u"Vt100Plus" },
{ &gEfiVTUTF8Guid, L"VtUtf8" }, { &gEfiVTUTF8Guid, u"VtUtf8" },
{ &UnknownDevice, L"UnknownDev" }, { &UnknownDevice, u"UnknownDev" },
{ &EfiPartTypeSystemPartitionGuid, L"ESP" }, { &EfiPartTypeSystemPartitionGuid, u"ESP" },
{ &EfiPartTypeLegacyMbrGuid, L"GPT MBR" }, { &EfiPartTypeLegacyMbrGuid, u"GPT MBR" },
{ &ShellInterfaceProtocol, L"ShellInt" }, { &ShellInterfaceProtocol, u"ShellInt" },
{ &SEnvId, L"SEnv" }, { &SEnvId, u"SEnv" },
{ &SProtId, L"ShellProtId" }, { &SProtId, u"ShellProtId" },
{ &SMapId, L"ShellDevPathMap" }, { &SMapId, u"ShellDevPathMap" },
{ &SAliasId, L"ShellAlias" }, { &SAliasId, u"ShellAlias" },
{ NULL, L"" } { NULL, u"" }
}; };
// //
@ -163,7 +163,7 @@ GuidToString (
// Else dump it // Else dump it
// //
UnicodeSPrint (Buffer, 0, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", UnicodeSPrint (Buffer, 0, u"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Guid->Data1, Guid->Data1,
Guid->Data2, Guid->Data2,
Guid->Data3, Guid->Data3,

View File

@ -172,7 +172,7 @@ EFIDebugVariable (
UINTN NewEFIDebug; UINTN NewEFIDebug;
DataSize = sizeof(EFIDebug); DataSize = sizeof(EFIDebug);
Status = uefi_call_wrapper(RT->GetVariable, 5, L"EFIDebug", &EfiGlobalVariable, &Attributes, &DataSize, &NewEFIDebug); Status = uefi_call_wrapper(RT->GetVariable, 5, u"EFIDebug", &EfiGlobalVariable, &Attributes, &DataSize, &NewEFIDebug);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
EFIDebug = NewEFIDebug; EFIDebug = NewEFIDebug;
} }

View File

@ -881,7 +881,7 @@ Returns:
if (!UnicodeStr) if (!UnicodeStr)
return 0; return 0;
UnicodeFmt = PoolPrint(L"%a", fmt); UnicodeFmt = PoolPrint(u"%a", fmt);
if (!UnicodeFmt) { if (!UnicodeFmt) {
FreePool(UnicodeStr); FreePool(UnicodeStr);
return 0; return 0;
@ -1261,7 +1261,7 @@ Returns:
case 's': case 's':
Item.Item.pw = va_arg(ps->args, CHAR16 *); Item.Item.pw = va_arg(ps->args, CHAR16 *);
if (!Item.Item.pw) { if (!Item.Item.pw) {
Item.Item.pw = L"(null)"; Item.Item.pw = u"(null)";
} }
break; break;
@ -1484,7 +1484,7 @@ TimeToString (
Year = Time->Year % 100; Year = Time->Year % 100;
// bugbug: for now just print it any old way // bugbug: for now just print it any old way
UnicodeSPrint (Buffer, 0, L"%02d/%02d/%02d %02d:%02d%c", UnicodeSPrint (Buffer, 0, u"%02d/%02d/%02d %02d:%02d%c",
Time->Month, Time->Month,
Time->Day, Time->Day,
Year, Year,
@ -1535,7 +1535,7 @@ DumpHex (
Val[Index*3] = 0; Val[Index*3] = 0;
Str[Index] = 0; Str[Index] = 0;
Print (L"%*a%X: %-.48a *%a*\n", Indent, "", Offset, Val, Str); Print (u"%*a%X: %-.48a *%a*\n", Indent, "", Offset, Val, Str);
Data += Size; Data += Size;
Offset += Size; Offset += Size;
@ -1548,9 +1548,9 @@ DumpHex (
// block updates // block updates
// //
ScreenCount = 0; ScreenCount = 0;
Print (L"Press Enter to continue :"); Print (u"Press Enter to continue :");
Input (L"", ReturnStr, sizeof(ReturnStr)/sizeof(CHAR16)); Input (u"", ReturnStr, sizeof(ReturnStr)/sizeof(CHAR16));
Print (L"\n"); Print (u"\n");
} }
} }