Fix output of test apps to produce CRLF rather than LFCR

LFCR results in unwanted blank lines being added on serial output.
CRLF is what UEFI actually uses.
Also fix unneeded CR added to Print() optput in tcc.c.

These fixes are needed to to use these application for build time tests.

Signed-off-by: Pete Batard <pete@akeo.ie>
This commit is contained in:
Pete Batard 2024-05-18 15:23:12 +01:00
parent 5dee8b0339
commit 9e2483ab62
No known key found for this signature in database
GPG Key ID: 38E0CF5E69EDD671
3 changed files with 16 additions and 16 deletions

View File

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

View File

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

View File

@ -328,12 +328,12 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
__asm__ volatile("out %0,%1" : : "a" ((uint8_t)0x14), "dN" (0x80));
#endif
Print(L"Hello\r\n");
Print(L"Hello\n");
rc = test_failure();
if (EFI_ERROR(rc)) {
Print(L"Returning Failure works\n");
} else {
Print(L"Returning failure doesn't work.\r\n");
Print(L"Returning failure doesn't work.\n");
Print(L"%%rax was 0x%016x, should have been 0x%016x\n",
rc, EFI_UNSUPPORTED);
return EFI_INVALID_PARAMETER;
@ -341,7 +341,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call0();
if (!EFI_ERROR(rc)) {
Print(L"0 args works just fine here.\r\n");
Print(L"0 args works just fine here.\n");
} else {
Print(L"0 args failed: 0x%016x\n", rc);
return rc;
@ -349,7 +349,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call1();
if (!EFI_ERROR(rc)) {
Print(L"1 arg works just fine here.\r\n");
Print(L"1 arg works just fine here.\n");
} else {
Print(L"1 arg failed: 0x%016x\n", rc);
return rc;
@ -357,7 +357,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call2();
if (!EFI_ERROR(rc)) {
Print(L"2 args works just fine here.\r\n");
Print(L"2 args works just fine here.\n");
} else {
Print(L"2 args failed: 0x%016x\n", rc);
return rc;
@ -365,7 +365,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call3();
if (!EFI_ERROR(rc)) {
Print(L"3 args works just fine here.\r\n");
Print(L"3 args works just fine here.\n");
} else {
Print(L"3 args failed: 0x%016x\n", rc);
return rc;
@ -373,7 +373,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call4();
if (!EFI_ERROR(rc)) {
Print(L"4 args works just fine here.\r\n");
Print(L"4 args works just fine here.\n");
} else {
Print(L"4 args failed: 0x%016x\n", rc);
return rc;
@ -381,7 +381,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call5();
if (!EFI_ERROR(rc)) {
Print(L"5 args works just fine here.\r\n");
Print(L"5 args works just fine here.\n");
} else {
Print(L"5 args failed: 0x%016x\n", rc);
return rc;
@ -389,7 +389,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call6();
if (!EFI_ERROR(rc)) {
Print(L"6 args works just fine here.\r\n");
Print(L"6 args works just fine here.\n");
} else {
Print(L"6 args failed: 0x%016x\n", rc);
return rc;
@ -397,7 +397,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call7();
if (!EFI_ERROR(rc)) {
Print(L"7 args works just fine here.\r\n");
Print(L"7 args works just fine here.\n");
} else {
Print(L"7 args failed: 0x%016x\n", rc);
return rc;
@ -405,7 +405,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call8();
if (!EFI_ERROR(rc)) {
Print(L"8 args works just fine here.\r\n");
Print(L"8 args works just fine here.\n");
} else {
Print(L"8 args failed: 0x%016x\n", rc);
return rc;
@ -413,7 +413,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call9();
if (!EFI_ERROR(rc)) {
Print(L"9 args works just fine here.\r\n");
Print(L"9 args works just fine here.\n");
} else {
Print(L"9 args failed: 0x%016x\n", rc);
return rc;
@ -421,7 +421,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
rc = test_call10();
if (!EFI_ERROR(rc)) {
Print(L"10 args works just fine here.\r\n");
Print(L"10 args works just fine here.\n");
} else {
Print(L"10 args failed: 0x%016x\n", rc);
return rc;