Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pal/baremetal/target/RDN2/src/pal_bsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "platform_image_def.h"
#include "platform_override_struct.h"
#include "platform_override_fvp.h"
#include "pal_pl011_uart.h"

/**
Conduits for service calls (SMC vs HVC).
Expand Down Expand Up @@ -868,10 +869,15 @@ static uint64_t heap_init_done = 0;

@return None
**/

void
pal_print(char *string, uint64_t data)
pal_print(uint64_t data)
{
print(ACS_PRINT_ERR, string, data);
char *buf = (char *)(uintptr_t)data;

while (*buf != '\0') {
pal_uart_putc(*buf++);
}
}

/**
Expand Down Expand Up @@ -1263,4 +1269,4 @@ uint32_t pal_exit_acs(void)
{
while (1);
return 0;
}
}
11 changes: 7 additions & 4 deletions pal/baremetal/target/RDV3/src/pal_bsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "platform_image_def.h"
#include "platform_override_struct.h"
#include "platform_override_fvp.h"
#include "pal_pl011_uart.h"

/**
Conduits for service calls (SMC vs HVC).
Expand Down Expand Up @@ -898,11 +899,13 @@ static uint8_t heap_init_done;
@return None
**/
void
pal_print(char *string, uint64_t data)
pal_print(uint64_t data)
{
char *buf = (char *)(uintptr_t)data;

print(ACS_PRINT_ERR, string, data);
return;
while (*buf != '\0') {
pal_uart_putc(*buf++);
}
}

/**
Expand Down Expand Up @@ -1296,4 +1299,4 @@ uint32_t pal_exit_acs(void)
{
while (1);
return 0;
}
}
9 changes: 6 additions & 3 deletions pal/baremetal/target/RDV3CFG1/src/pal_bsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "platform_image_def.h"
#include "platform_override_struct.h"
#include "platform_override_fvp.h"
#include "pal_pl011_uart.h"

/**
Conduits for service calls (SMC vs HVC).
Expand Down Expand Up @@ -898,11 +899,13 @@ static uint8_t heap_init_done;
@return None
**/
void
pal_print(char *string, uint64_t data)
pal_print(uint64_t data)
{
char *buf = (char *)(uintptr_t)data;

print(ACS_PRINT_ERR, string, data);
return;
while (*buf != '\0') {
pal_uart_putc(*buf++);
}
}

/**
Expand Down
40 changes: 25 additions & 15 deletions pal/uefi_acpi/src/pal_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,26 @@ pal_mmio_write(UINT64 addr, UINT32 data)

@return None
**/

VOID
pal_print(CHAR8 *string, UINT64 data)
pal_print(UINT64 data)
{
if(g_acs_log_file_handle)
CHAR8 *buf = (CHAR8 *)(UINTN)data;

if (g_acs_log_file_handle)
{
CHAR8 Buffer[1024];
UINTN BufferSize = 1;
EFI_STATUS Status = 0;
BufferSize = AsciiSPrint(Buffer, 1024, string, data);
AsciiPrint(Buffer);
Status = ShellWriteFile(g_acs_log_file_handle, &BufferSize, (VOID*)Buffer);
if(EFI_ERROR(Status))
UINTN BufferSize = AsciiStrLen(buf);
EFI_STATUS Status;

AsciiPrint("%a", buf);
Status = ShellWriteFile(g_acs_log_file_handle, &BufferSize, (VOID *)buf);
if (EFI_ERROR(Status))
acs_print(ACS_PRINT_ERR, L" Error in writing to log file\n");
} else
AsciiPrint(string, data);
}
else
{
AsciiPrint("%a", buf);
}
}

/**
Expand All @@ -214,13 +219,18 @@ pal_print(CHAR8 *string, UINT64 data)
VOID
pal_warn_not_implemented(const CHAR8 *api_name)
{
CHAR8 Buffer[512];

if (api_name == NULL)
return;

pal_print("\n %a is not implemented."
"\n Please implement the PAL function in test suite or"
"\n conduct an offline review for this rule.\n",
(UINT64)(UINTN)api_name);
AsciiSPrint(Buffer, sizeof(Buffer),
"\n %a is not implemented."
"\n Please implement the PAL function in test suite or"
"\n conduct an offline review for this rule.\n",
api_name);

pal_print((UINT64)(UINTN)Buffer);
}

/**
Expand Down
39 changes: 24 additions & 15 deletions pal/uefi_dt/src/pal_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,24 @@ pal_mmio_write(UINT64 addr, UINT32 data)
@return None
**/
VOID
pal_print(CHAR8 *string, UINT64 data)
pal_print(UINT64 data)
{
if(g_acs_log_file_handle)
CHAR8 *buf = (CHAR8 *)(UINTN)data;

if (g_acs_log_file_handle)
{
CHAR8 Buffer[1024];
UINTN BufferSize = 1;
EFI_STATUS Status = 0;
BufferSize = AsciiSPrint(Buffer, 1024, string, data);
AsciiPrint(Buffer);
Status = ShellWriteFile(g_acs_log_file_handle, &BufferSize, (VOID*)Buffer);
if(EFI_ERROR(Status))
UINTN BufferSize = AsciiStrLen(buf);
EFI_STATUS Status;

AsciiPrint("%a", buf);
Status = ShellWriteFile(g_acs_log_file_handle, &BufferSize, (VOID *)buf);
if (EFI_ERROR(Status))
acs_print(ACS_PRINT_ERR, L" Error in writing to log file\n");
} else
AsciiPrint(string, data);
}
else
{
AsciiPrint("%a", buf);
}
}

/**
Expand All @@ -215,13 +219,18 @@ pal_print(CHAR8 *string, UINT64 data)
VOID
pal_warn_not_implemented(const CHAR8 *api_name)
{
CHAR8 Buffer[512];

if (api_name == NULL)
return;

pal_print("\n %a is not implemented."
"\n Please implement the PAL function in test suite or"
"\n conduct an offline review for this rule.\n",
(UINT64)(UINTN)api_name);
AsciiSPrint(Buffer, sizeof(Buffer),
"\n %a is not implemented."
"\n Please implement the PAL function in test suite or"
"\n conduct an offline review for this rule.\n",
api_name);

pal_print((UINT64)(UINTN)Buffer);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion val/include/pal_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ uint64_t pal_memory_get_unpopulated_addr(uint64_t *addr, uint32_t instance);
uint32_t pal_mem_set_wb_executable(void *addr, uint32_t size);

/* Common Definitions */
void pal_print(char8_t *string, uint64_t data);
void pal_print(uint64_t data);
void pal_uart_print(int log, const char *fmt, ...);
void pal_print_raw(uint64_t addr, char8_t *string, uint64_t data);
uint32_t pal_strncmp(char8_t *str1, char8_t *str2, uint32_t len);
Expand Down
Loading
Loading