diff options
author | Roy Franz <roy.franz@linaro.org> | 2013-12-13 14:04:49 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-04-14 12:50:02 -0400 |
commit | f966ea021f947b20c22b31194d7e3042375c7f24 (patch) | |
tree | 894e0e74a7c444e94b895948c5772f7ea26c44bb /drivers/firmware/efi | |
parent | e885cd805fc6e65ef5150a211c7bac02f925af04 (diff) |
efi: Add shared printk wrapper for consistent prefixing
Add a wrapper for printk to standardize the prefix for informational and
error messages from the EFI stub.
Signed-off-by: Roy Franz <roy.franz@linaro.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware/efi')
-rw-r--r-- | drivers/firmware/efi/efi-stub-helper.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c index 47722003b8fc..1bf439be9138 100644 --- a/drivers/firmware/efi/efi-stub-helper.c +++ b/drivers/firmware/efi/efi-stub-helper.c | |||
@@ -33,6 +33,9 @@ static void efi_printk(efi_system_table_t *sys_table_arg, char *str) | |||
33 | } | 33 | } |
34 | } | 34 | } |
35 | 35 | ||
36 | #define pr_efi(sys_table, msg) efi_printk(sys_table, "EFI stub: "msg) | ||
37 | #define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg) | ||
38 | |||
36 | 39 | ||
37 | static efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, | 40 | static efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, |
38 | efi_memory_desc_t **map, | 41 | efi_memory_desc_t **map, |
@@ -310,7 +313,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, | |||
310 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, | 313 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, |
311 | nr_files * sizeof(*files), (void **)&files); | 314 | nr_files * sizeof(*files), (void **)&files); |
312 | if (status != EFI_SUCCESS) { | 315 | if (status != EFI_SUCCESS) { |
313 | efi_printk(sys_table_arg, "Failed to alloc mem for file handle list\n"); | 316 | pr_efi_err(sys_table_arg, "Failed to alloc mem for file handle list\n"); |
314 | goto fail; | 317 | goto fail; |
315 | } | 318 | } |
316 | 319 | ||
@@ -374,13 +377,13 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, | |||
374 | status = efi_high_alloc(sys_table_arg, file_size_total, 0x1000, | 377 | status = efi_high_alloc(sys_table_arg, file_size_total, 0x1000, |
375 | &file_addr, max_addr); | 378 | &file_addr, max_addr); |
376 | if (status != EFI_SUCCESS) { | 379 | if (status != EFI_SUCCESS) { |
377 | efi_printk(sys_table_arg, "Failed to alloc highmem for files\n"); | 380 | pr_efi_err(sys_table_arg, "Failed to alloc highmem for files\n"); |
378 | goto close_handles; | 381 | goto close_handles; |
379 | } | 382 | } |
380 | 383 | ||
381 | /* We've run out of free low memory. */ | 384 | /* We've run out of free low memory. */ |
382 | if (file_addr > max_addr) { | 385 | if (file_addr > max_addr) { |
383 | efi_printk(sys_table_arg, "We've run out of free low memory\n"); | 386 | pr_efi_err(sys_table_arg, "We've run out of free low memory\n"); |
384 | status = EFI_INVALID_PARAMETER; | 387 | status = EFI_INVALID_PARAMETER; |
385 | goto free_file_total; | 388 | goto free_file_total; |
386 | } | 389 | } |
@@ -401,7 +404,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, | |||
401 | &chunksize, | 404 | &chunksize, |
402 | (void *)addr); | 405 | (void *)addr); |
403 | if (status != EFI_SUCCESS) { | 406 | if (status != EFI_SUCCESS) { |
404 | efi_printk(sys_table_arg, "Failed to read file\n"); | 407 | pr_efi_err(sys_table_arg, "Failed to read file\n"); |
405 | goto free_file_total; | 408 | goto free_file_total; |
406 | } | 409 | } |
407 | addr += chunksize; | 410 | addr += chunksize; |
@@ -486,7 +489,7 @@ static efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg, | |||
486 | &new_addr); | 489 | &new_addr); |
487 | } | 490 | } |
488 | if (status != EFI_SUCCESS) { | 491 | if (status != EFI_SUCCESS) { |
489 | efi_printk(sys_table_arg, "ERROR: Failed to allocate usable memory for kernel.\n"); | 492 | pr_efi_err(sys_table_arg, "Failed to allocate usable memory for kernel.\n"); |
490 | return status; | 493 | return status; |
491 | } | 494 | } |
492 | 495 | ||