aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2015-08-27 01:40:40 +0100
committerMichael Brown <mcb30@ipxe.org>2015-08-27 15:40:44 +0100
commit0e407377dde26c5915d6df17397566244bb9d412 (patch)
treebefc0b6fe52c73d0da0941f9c999492d23b7c694
parenta09dd5c03d0356e82c1e3fe46b9f09ead2d0b268 (diff)
downloadipxe-0e407377dde26c5915d6df17397566244bb9d412.zip
ipxe-0e407377dde26c5915d6df17397566244bb9d412.tar.gz
ipxe-0e407377dde26c5915d6df17397566244bb9d412.tar.bz2
[efi] Mark EFI debug transcription functions as __attribute__ (( pure ))
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/include/ipxe/efi/efi.h8
-rw-r--r--src/interface/efi/efi_debug.c7
2 files changed, 9 insertions, 6 deletions
diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h
index 57c9f01..f3f1d1a 100644
--- a/src/include/ipxe/efi/efi.h
+++ b/src/include/ipxe/efi/efi.h
@@ -200,9 +200,11 @@ extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;
extern EFI_SYSTEM_TABLE *efi_systab;
-extern const char * efi_guid_ntoa ( EFI_GUID *guid );
-extern const char * efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path );
-extern const char * efi_handle_name ( EFI_HANDLE handle );
+extern const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid );
+extern const __attribute__ (( pure )) char *
+efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path );
+extern const __attribute__ (( pure )) char *
+efi_handle_name ( EFI_HANDLE handle );
extern void dbg_efi_openers ( EFI_HANDLE handle, EFI_GUID *protocol );
extern void dbg_efi_protocols ( EFI_HANDLE handle );
diff --git a/src/interface/efi/efi_debug.c b/src/interface/efi/efi_debug.c
index 7cfaabf..607e628 100644
--- a/src/interface/efi/efi_debug.c
+++ b/src/interface/efi/efi_debug.c
@@ -162,7 +162,7 @@ static struct efi_well_known_guid efi_well_known_guids[] = {
* @v guid GUID
* @ret string Printable string
*/
-const char * efi_guid_ntoa ( EFI_GUID *guid ) {
+const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid ) {
union {
union uuid uuid;
EFI_GUID guid;
@@ -314,7 +314,8 @@ void dbg_efi_protocols ( EFI_HANDLE handle ) {
* @v path Device path
* @ret text Textual representation of device path, or NULL
*/
-const char * efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path ) {
+const __attribute__ (( pure )) char *
+efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
static char text[256];
void *start;
@@ -627,7 +628,7 @@ static struct efi_handle_name_type efi_handle_name_types[] = {
* @v handle EFI handle
* @ret text Name of handle, or NULL
*/
-const char * efi_handle_name ( EFI_HANDLE handle ) {
+const __attribute__ (( pure )) char * efi_handle_name ( EFI_HANDLE handle ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
struct efi_handle_name_type *type;
unsigned int i;