Browse Source

[efi] Mark EFI debug transcription functions as __attribute__ (( pure ))

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
0e407377dd
2 changed files with 9 additions and 6 deletions
  1. 5
    3
      src/include/ipxe/efi/efi.h
  2. 4
    3
      src/interface/efi/efi_debug.c

+ 5
- 3
src/include/ipxe/efi/efi.h View File

200
 extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;
200
 extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;
201
 extern EFI_SYSTEM_TABLE *efi_systab;
201
 extern EFI_SYSTEM_TABLE *efi_systab;
202
 
202
 
203
-extern const char * efi_guid_ntoa ( EFI_GUID *guid );
204
-extern const char * efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path );
205
-extern const char * efi_handle_name ( EFI_HANDLE handle );
203
+extern const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid );
204
+extern const __attribute__ (( pure )) char *
205
+efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path );
206
+extern const __attribute__ (( pure )) char *
207
+efi_handle_name ( EFI_HANDLE handle );
206
 
208
 
207
 extern void dbg_efi_openers ( EFI_HANDLE handle, EFI_GUID *protocol );
209
 extern void dbg_efi_openers ( EFI_HANDLE handle, EFI_GUID *protocol );
208
 extern void dbg_efi_protocols ( EFI_HANDLE handle );
210
 extern void dbg_efi_protocols ( EFI_HANDLE handle );

+ 4
- 3
src/interface/efi/efi_debug.c View File

162
  * @v guid		GUID
162
  * @v guid		GUID
163
  * @ret string		Printable string
163
  * @ret string		Printable string
164
  */
164
  */
165
-const char * efi_guid_ntoa ( EFI_GUID *guid ) {
165
+const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid ) {
166
 	union {
166
 	union {
167
 		union uuid uuid;
167
 		union uuid uuid;
168
 		EFI_GUID guid;
168
 		EFI_GUID guid;
314
  * @v path		Device path
314
  * @v path		Device path
315
  * @ret text		Textual representation of device path, or NULL
315
  * @ret text		Textual representation of device path, or NULL
316
  */
316
  */
317
-const char * efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path ) {
317
+const __attribute__ (( pure )) char *
318
+efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path ) {
318
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
319
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
319
 	static char text[256];
320
 	static char text[256];
320
 	void *start;
321
 	void *start;
627
  * @v handle		EFI handle
628
  * @v handle		EFI handle
628
  * @ret text		Name of handle, or NULL
629
  * @ret text		Name of handle, or NULL
629
  */
630
  */
630
-const char * efi_handle_name ( EFI_HANDLE handle ) {
631
+const __attribute__ (( pure )) char * efi_handle_name ( EFI_HANDLE handle ) {
631
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
632
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
632
 	struct efi_handle_name_type *type;
633
 	struct efi_handle_name_type *type;
633
 	unsigned int i;
634
 	unsigned int i;

Loading…
Cancel
Save