Pārlūkot izejas kodu

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 gadus atpakaļ
vecāks
revīzija
0e407377dd
2 mainītis faili ar 9 papildinājumiem un 6 dzēšanām
  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 Parādīt failu

@@ -200,9 +200,11 @@ extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
200 200
 extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;
201 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 209
 extern void dbg_efi_openers ( EFI_HANDLE handle, EFI_GUID *protocol );
208 210
 extern void dbg_efi_protocols ( EFI_HANDLE handle );

+ 4
- 3
src/interface/efi/efi_debug.c Parādīt failu

@@ -162,7 +162,7 @@ static struct efi_well_known_guid efi_well_known_guids[] = {
162 162
  * @v guid		GUID
163 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 166
 	union {
167 167
 		union uuid uuid;
168 168
 		EFI_GUID guid;
@@ -314,7 +314,8 @@ void dbg_efi_protocols ( EFI_HANDLE handle ) {
314 314
  * @v path		Device path
315 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 319
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
319 320
 	static char text[256];
320 321
 	void *start;
@@ -627,7 +628,7 @@ static struct efi_handle_name_type efi_handle_name_types[] = {
627 628
  * @v handle		EFI handle
628 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 632
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
632 633
 	struct efi_handle_name_type *type;
633 634
 	unsigned int i;

Notiek ielāde…
Atcelt
Saglabāt