Browse Source

[efi] Remove raw EFI_HANDLE values from debug messages

The raw EFI_HANDLE value is almost never useful to know, and simply
adds noise to the already verbose debug messages.  Improve the
legibility of debug messages by using only the name generated by
efi_handle_name().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
9501eaf68d

+ 2
- 2
src/drivers/net/efi/nii.c View File

1125
 	/* Register network device */
1125
 	/* Register network device */
1126
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
1126
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
1127
 		goto err_register_netdev;
1127
 		goto err_register_netdev;
1128
-	DBGC ( nii, "NII %s registered as %s for %p %s\n", nii->dev.name,
1129
-	       netdev->name, device, efi_handle_name ( device ) );
1128
+	DBGC ( nii, "NII %s registered as %s for %s\n", nii->dev.name,
1129
+	       netdev->name, efi_handle_name ( device ) );
1130
 
1130
 
1131
 	/* Set initial link state (if media detection is not supported) */
1131
 	/* Set initial link state (if media detection is not supported) */
1132
 	if ( ! nii->media )
1132
 	if ( ! nii->media )

+ 12
- 12
src/drivers/net/efi/snp.c View File

48
 
48
 
49
 	/* Check that this is not a device we are providing ourselves */
49
 	/* Check that this is not a device we are providing ourselves */
50
 	if ( find_snpdev ( device ) != NULL ) {
50
 	if ( find_snpdev ( device ) != NULL ) {
51
-		DBGCP ( device, "SNP %p %s is provided by this binary\n",
52
-			device, efi_handle_name ( device ) );
51
+		DBGCP ( device, "SNP %s is provided by this binary\n",
52
+			efi_handle_name ( device ) );
53
 		return -ENOTTY;
53
 		return -ENOTTY;
54
 	}
54
 	}
55
 
55
 
58
 					  &efi_simple_network_protocol_guid,
58
 					  &efi_simple_network_protocol_guid,
59
 					  NULL, efi_image_handle, device,
59
 					  NULL, efi_image_handle, device,
60
 					  EFI_OPEN_PROTOCOL_TEST_PROTOCOL))!=0){
60
 					  EFI_OPEN_PROTOCOL_TEST_PROTOCOL))!=0){
61
-		DBGCP ( device, "SNP %p %s is not an SNP device\n",
62
-			device, efi_handle_name ( device ) );
61
+		DBGCP ( device, "SNP %s is not an SNP device\n",
62
+			efi_handle_name ( device ) );
63
 		return -EEFI ( efirc );
63
 		return -EEFI ( efirc );
64
 	}
64
 	}
65
-	DBGC ( device, "SNP %p %s is an SNP device\n",
66
-	       device, efi_handle_name ( device ) );
65
+	DBGC ( device, "SNP %s is an SNP device\n",
66
+	       efi_handle_name ( device ) );
67
 
67
 
68
 	return 0;
68
 	return 0;
69
 }
69
 }
80
 
80
 
81
 	/* Check that this is not a device we are providing ourselves */
81
 	/* Check that this is not a device we are providing ourselves */
82
 	if ( find_snpdev ( device ) != NULL ) {
82
 	if ( find_snpdev ( device ) != NULL ) {
83
-		DBGCP ( device, "NII %p %s is provided by this binary\n",
84
-			device, efi_handle_name ( device ) );
83
+		DBGCP ( device, "NII %s is provided by this binary\n",
84
+			efi_handle_name ( device ) );
85
 		return -ENOTTY;
85
 		return -ENOTTY;
86
 	}
86
 	}
87
 
87
 
90
 					  &efi_nii31_protocol_guid,
90
 					  &efi_nii31_protocol_guid,
91
 					  NULL, efi_image_handle, device,
91
 					  NULL, efi_image_handle, device,
92
 					  EFI_OPEN_PROTOCOL_TEST_PROTOCOL))!=0){
92
 					  EFI_OPEN_PROTOCOL_TEST_PROTOCOL))!=0){
93
-		DBGCP ( device, "NII %p %s is not an NII device\n",
94
-			device, efi_handle_name ( device ) );
93
+		DBGCP ( device, "NII %s is not an NII device\n",
94
+			efi_handle_name ( device ) );
95
 		return -EEFI ( efirc );
95
 		return -EEFI ( efirc );
96
 	}
96
 	}
97
-	DBGC ( device, "NII %p %s is an NII device\n",
98
-	       device, efi_handle_name ( device ) );
97
+	DBGC ( device, "NII %s is an NII device\n",
98
+	       efi_handle_name ( device ) );
99
 
99
 
100
 	return 0;
100
 	return 0;
101
 }
101
 }

+ 11
- 13
src/drivers/net/efi/snpnet.c View File

431
 					  ( EFI_OPEN_PROTOCOL_BY_DRIVER |
431
 					  ( EFI_OPEN_PROTOCOL_BY_DRIVER |
432
 					    EFI_OPEN_PROTOCOL_EXCLUSIVE )))!=0){
432
 					    EFI_OPEN_PROTOCOL_EXCLUSIVE )))!=0){
433
 		rc = -EEFI ( efirc );
433
 		rc = -EEFI ( efirc );
434
-		DBGC ( device, "SNP %p %s cannot open SNP protocol: %s\n",
435
-		       device, efi_handle_name ( device ), strerror ( rc ) );
434
+		DBGC ( device, "SNP %s cannot open SNP protocol: %s\n",
435
+		       efi_handle_name ( device ), strerror ( rc ) );
436
 		DBGC_EFI_OPENERS ( device, device,
436
 		DBGC_EFI_OPENERS ( device, device,
437
 				   &efi_simple_network_protocol_guid );
437
 				   &efi_simple_network_protocol_guid );
438
 		goto err_open_protocol;
438
 		goto err_open_protocol;
463
 	if ( ( mode->State == EfiSimpleNetworkStopped ) &&
463
 	if ( ( mode->State == EfiSimpleNetworkStopped ) &&
464
 	     ( ( efirc = snp->snp->Start ( snp->snp ) ) != 0 ) ) {
464
 	     ( ( efirc = snp->snp->Start ( snp->snp ) ) != 0 ) ) {
465
 		rc = -EEFI ( efirc );
465
 		rc = -EEFI ( efirc );
466
-		DBGC ( device, "SNP %p %s could not start: %s\n", device,
466
+		DBGC ( device, "SNP %s could not start: %s\n",
467
 		       efi_handle_name ( device ), strerror ( rc ) );
467
 		       efi_handle_name ( device ), strerror ( rc ) );
468
 		goto err_start;
468
 		goto err_start;
469
 	}
469
 	}
470
 	if ( ( mode->State == EfiSimpleNetworkInitialized ) &&
470
 	if ( ( mode->State == EfiSimpleNetworkInitialized ) &&
471
 	     ( ( efirc = snp->snp->Shutdown ( snp->snp ) ) != 0 ) ) {
471
 	     ( ( efirc = snp->snp->Shutdown ( snp->snp ) ) != 0 ) ) {
472
 		rc = -EEFI ( efirc );
472
 		rc = -EEFI ( efirc );
473
-		DBGC ( device, "SNP %p %s could not shut down: %s\n", device,
473
+		DBGC ( device, "SNP %s could not shut down: %s\n",
474
 		       efi_handle_name ( device ), strerror ( rc ) );
474
 		       efi_handle_name ( device ), strerror ( rc ) );
475
 		goto err_shutdown;
475
 		goto err_shutdown;
476
 	}
476
 	}
477
 
477
 
478
 	/* Populate network device parameters */
478
 	/* Populate network device parameters */
479
 	if ( mode->HwAddressSize != netdev->ll_protocol->hw_addr_len ) {
479
 	if ( mode->HwAddressSize != netdev->ll_protocol->hw_addr_len ) {
480
-		DBGC ( device, "SNP %p %s has invalid hardware address "
481
-		       "length %d\n", device, efi_handle_name ( device ),
482
-		       mode->HwAddressSize );
480
+		DBGC ( device, "SNP %s has invalid hardware address length "
481
+		       "%d\n", efi_handle_name ( device ), mode->HwAddressSize);
483
 		rc = -ENOTSUP;
482
 		rc = -ENOTSUP;
484
 		goto err_hw_addr_len;
483
 		goto err_hw_addr_len;
485
 	}
484
 	}
486
 	memcpy ( netdev->hw_addr, &mode->PermanentAddress,
485
 	memcpy ( netdev->hw_addr, &mode->PermanentAddress,
487
 		 netdev->ll_protocol->hw_addr_len );
486
 		 netdev->ll_protocol->hw_addr_len );
488
 	if ( mode->HwAddressSize != netdev->ll_protocol->ll_addr_len ) {
487
 	if ( mode->HwAddressSize != netdev->ll_protocol->ll_addr_len ) {
489
-		DBGC ( device, "SNP %p %s has invalid link-layer address "
490
-		       "length %d\n", device, efi_handle_name ( device ),
491
-		       mode->HwAddressSize );
488
+		DBGC ( device, "SNP %s has invalid link-layer address length "
489
+		       "%d\n", efi_handle_name ( device ), mode->HwAddressSize);
492
 		rc = -ENOTSUP;
490
 		rc = -ENOTSUP;
493
 		goto err_ll_addr_len;
491
 		goto err_ll_addr_len;
494
 	}
492
 	}
500
 	/* Register network device */
498
 	/* Register network device */
501
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
499
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
502
 		goto err_register_netdev;
500
 		goto err_register_netdev;
503
-	DBGC ( device, "SNP %p %s registered as %s\n",
504
-	       device, efi_handle_name ( device ), netdev->name );
501
+	DBGC ( device, "SNP %s registered as %s\n",
502
+	       efi_handle_name ( device ), netdev->name );
505
 
503
 
506
 	/* Set initial link state */
504
 	/* Set initial link state */
507
 	if ( snp->snp->Mode->MediaPresentSupported ) {
505
 	if ( snp->snp->Mode->MediaPresentSupported ) {
547
 	/* Stop SNP protocol */
545
 	/* Stop SNP protocol */
548
 	if ( ( efirc = snp->snp->Stop ( snp->snp ) ) != 0 ) {
546
 	if ( ( efirc = snp->snp->Stop ( snp->snp ) ) != 0 ) {
549
 		rc = -EEFI ( efirc );
547
 		rc = -EEFI ( efirc );
550
-		DBGC ( device, "SNP %p %s could not stop: %s\n", device,
548
+		DBGC ( device, "SNP %s could not stop: %s\n",
551
 		       efi_handle_name ( device ), strerror ( rc ) );
549
 		       efi_handle_name ( device ), strerror ( rc ) );
552
 		/* Nothing we can do about this */
550
 		/* Nothing we can do about this */
553
 	}
551
 	}

+ 16
- 16
src/drivers/net/efi/snponly.c View File

81
 	/* Locate handle supporting this protocol */
81
 	/* Locate handle supporting this protocol */
82
 	if ( ( rc = efi_locate_device ( device, chained->protocol,
82
 	if ( ( rc = efi_locate_device ( device, chained->protocol,
83
 					&parent ) ) != 0 ) {
83
 					&parent ) ) != 0 ) {
84
-		DBGC ( device, "CHAINED %p %s does not support %s: %s\n",
85
-		       device, efi_handle_name ( device ),
84
+		DBGC ( device, "CHAINED %s does not support %s: %s\n",
85
+		       efi_handle_name ( device ),
86
 		       efi_guid_ntoa ( chained->protocol ), strerror ( rc ) );
86
 		       efi_guid_ntoa ( chained->protocol ), strerror ( rc ) );
87
 		goto err_locate_device;
87
 		goto err_locate_device;
88
 	}
88
 	}
89
-	DBGC ( device, "CHAINED %p %s found %s on ", device,
90
-	       efi_handle_name ( device ), efi_guid_ntoa ( chained->protocol ));
91
-	DBGC ( device, "%p %s\n", parent, efi_handle_name ( parent ) );
89
+	DBGC ( device, "CHAINED %s found %s on ", efi_handle_name ( device ),
90
+	       efi_guid_ntoa ( chained->protocol ) );
91
+	DBGC ( device, "%s\n", efi_handle_name ( parent ) );
92
 
92
 
93
 	/* Get protocol instance */
93
 	/* Get protocol instance */
94
 	if ( ( efirc = bs->OpenProtocol ( parent, chained->protocol,
94
 	if ( ( efirc = bs->OpenProtocol ( parent, chained->protocol,
96
 					  device,
96
 					  device,
97
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
97
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
98
 		rc = -EEFI ( efirc );
98
 		rc = -EEFI ( efirc );
99
-		DBGC ( device, "CHAINED %p %s could not open %s on ",
100
-		       device, efi_handle_name ( device ),
99
+		DBGC ( device, "CHAINED %s could not open %s on ",
100
+		       efi_handle_name ( device ),
101
 		       efi_guid_ntoa ( chained->protocol ) );
101
 		       efi_guid_ntoa ( chained->protocol ) );
102
-		DBGC ( device, "%p %s: %s\n",
103
-		       parent, efi_handle_name ( parent ), strerror ( rc ) );
102
+		DBGC ( device, "%s: %s\n",
103
+		       efi_handle_name ( parent ), strerror ( rc ) );
104
 		goto err_open_protocol;
104
 		goto err_open_protocol;
105
 	}
105
 	}
106
 
106
 
130
 					  efi_image_handle, device,
130
 					  efi_image_handle, device,
131
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
131
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
132
 		rc = -EEFI ( efirc );
132
 		rc = -EEFI ( efirc );
133
-		DBGCP ( device, "CHAINED %p %s is not a %s device\n",
134
-			device, efi_handle_name ( device ),
133
+		DBGCP ( device, "CHAINED %s is not a %s device\n",
134
+			efi_handle_name ( device ),
135
 			efi_guid_ntoa ( chained->protocol ) );
135
 			efi_guid_ntoa ( chained->protocol ) );
136
 		goto err_open_protocol;
136
 		goto err_open_protocol;
137
 	}
137
 	}
138
 
138
 
139
 	/* Test for a match against the chainloading device */
139
 	/* Test for a match against the chainloading device */
140
 	if ( interface != chained->interface ) {
140
 	if ( interface != chained->interface ) {
141
-		DBGC ( device, "CHAINED %p %s %p is not the chainloaded "
142
-		       "%s\n", device, efi_handle_name ( device ),
143
-		       interface, efi_guid_ntoa ( chained->protocol ) );
141
+		DBGC ( device, "CHAINED %s %p is not the chainloaded %s\n",
142
+		       efi_handle_name ( device ), interface,
143
+		       efi_guid_ntoa ( chained->protocol ) );
144
 		rc = -ENOTTY;
144
 		rc = -ENOTTY;
145
 		goto err_no_match;
145
 		goto err_no_match;
146
 	}
146
 	}
147
 
147
 
148
 	/* Success */
148
 	/* Success */
149
 	rc = 0;
149
 	rc = 0;
150
-	DBGC ( device, "CHAINED %p %s %p is the chainloaded %s\n",
151
-	       device, efi_handle_name ( device ), interface,
150
+	DBGC ( device, "CHAINED %s %p is the chainloaded %s\n",
151
+	       efi_handle_name ( device ), interface,
152
 	       efi_guid_ntoa ( chained->protocol ) );
152
 	       efi_guid_ntoa ( chained->protocol ) );
153
 
153
 
154
  err_no_match:
154
  err_no_match:

+ 33
- 34
src/interface/efi/efi_bofm.c View File

178
 
178
 
179
 	/* Look for a BOFM driver */
179
 	/* Look for a BOFM driver */
180
 	if ( ( rc = bofm_find_driver ( &pci ) ) != 0 ) {
180
 	if ( ( rc = bofm_find_driver ( &pci ) ) != 0 ) {
181
-		DBGCP ( device, "EFIBOFM %p %s has no driver\n",
182
-			device, efi_handle_name ( device ) );
181
+		DBGCP ( device, "EFIBOFM %s has no driver\n",
182
+			efi_handle_name ( device ) );
183
 		return rc;
183
 		return rc;
184
 	}
184
 	}
185
 
185
 
187
 	if ( ( efirc = bs->LocateProtocol ( &bofm1_protocol_guid, NULL,
187
 	if ( ( efirc = bs->LocateProtocol ( &bofm1_protocol_guid, NULL,
188
 					    &bofm1.interface ) ) != 0 ) {
188
 					    &bofm1.interface ) ) != 0 ) {
189
 		rc = -EEFI ( efirc );
189
 		rc = -EEFI ( efirc );
190
-		DBGC ( device, "EFIBOFM %p %s cannot find BOFM protocol\n",
191
-		       device, efi_handle_name ( device ) );
190
+		DBGC ( device, "EFIBOFM %s cannot find BOFM protocol\n",
191
+		       efi_handle_name ( device ) );
192
 		return rc;
192
 		return rc;
193
 	}
193
 	}
194
 
194
 
198
 						      0x00 /* No iSCSI */,
198
 						      0x00 /* No iSCSI */,
199
 						      0x02 /* Version */ ))!=0){
199
 						      0x02 /* Version */ ))!=0){
200
 		rc = -EEFI ( efirc );
200
 		rc = -EEFI ( efirc );
201
-		DBGC ( device, "EFIBOFM %p %s could not register support: %s\n",
202
-		       device, efi_handle_name ( device ), strerror ( rc ) );
201
+		DBGC ( device, "EFIBOFM %s could not register support: %s\n",
202
+		       efi_handle_name ( device ), strerror ( rc ) );
203
 		return rc;
203
 		return rc;
204
 	}
204
 	}
205
 
205
 
206
-	DBGC ( device, "EFIBOFM %p %s has driver \"%s\"\n",
207
-	       device, efi_handle_name ( device ), pci.id->name );
206
+	DBGC ( device, "EFIBOFM %s has driver \"%s\"\n",
207
+	       efi_handle_name ( device ), pci.id->name );
208
 	return 0;
208
 	return 0;
209
 }
209
 }
210
 
210
 
241
 	if ( ( efirc = bs->LocateProtocol ( &bofm1_protocol_guid, NULL,
241
 	if ( ( efirc = bs->LocateProtocol ( &bofm1_protocol_guid, NULL,
242
 					    &bofm1.interface ) ) != 0 ) {
242
 					    &bofm1.interface ) ) != 0 ) {
243
 		rc = -EEFI ( efirc );
243
 		rc = -EEFI ( efirc );
244
-		DBGC ( device, "EFIBOFM %p %s cannot find BOFM protocol\n",
245
-		       device, efi_handle_name ( device ) );
244
+		DBGC ( device, "EFIBOFM %s cannot find BOFM protocol\n",
245
+		       efi_handle_name ( device ) );
246
 		goto err_locate_bofm;
246
 		goto err_locate_bofm;
247
 	}
247
 	}
248
 	bofmtab = &bofm1.bofm1->BofmTable;
248
 	bofmtab = &bofm1.bofm1->BofmTable;
249
-	DBGC ( device, "EFIBOFM %p %s found version 1 BOFM table at %p+%04x\n",
250
-	       device, efi_handle_name ( device ), bofmtab,
251
-	       bofmtab->Parameters.Length );
249
+	DBGC ( device, "EFIBOFM %s found version 1 BOFM table at %p+%04x\n",
250
+	       efi_handle_name ( device ), bofmtab, bofmtab->Parameters.Length);
252
 
251
 
253
 	/* Locate BOFM2 protocol, if available */
252
 	/* Locate BOFM2 protocol, if available */
254
 	if ( ( efirc = bs->LocateProtocol ( &bofm2_protocol_guid, NULL,
253
 	if ( ( efirc = bs->LocateProtocol ( &bofm2_protocol_guid, NULL,
255
 					    &bofm2.interface ) ) == 0 ) {
254
 					    &bofm2.interface ) ) == 0 ) {
256
 		bofmtab2 = &bofm2.bofm2->BofmTable;
255
 		bofmtab2 = &bofm2.bofm2->BofmTable;
257
-		DBGC ( device, "EFIBOFM %p %s found version 2 BOFM table at "
258
-		       "%p+%04x\n", device, efi_handle_name ( device ),
259
-		       bofmtab2, bofmtab2->Parameters.Length );
256
+		DBGC ( device, "EFIBOFM %s found version 2 BOFM table at "
257
+		       "%p+%04x\n", efi_handle_name ( device ), bofmtab2,
258
+		       bofmtab2->Parameters.Length );
260
 		assert ( bofm2.bofm2->RegisterSupport ==
259
 		assert ( bofm2.bofm2->RegisterSupport ==
261
 			 bofm1.bofm1->RegisterSupport );
260
 			 bofm1.bofm1->RegisterSupport );
262
 	} else {
261
 	} else {
263
-		DBGC ( device, "EFIBOFM %p %s cannot find BOFM2 protocol\n",
264
-		       device, efi_handle_name ( device ) );
262
+		DBGC ( device, "EFIBOFM %s cannot find BOFM2 protocol\n",
263
+		       efi_handle_name ( device ) );
265
 		/* Not a fatal error; may be a BOFM1-only system */
264
 		/* Not a fatal error; may be a BOFM1-only system */
266
 		bofmtab2 = NULL;
265
 		bofmtab2 = NULL;
267
 	}
266
 	}
268
 
267
 
269
 	/* Process BOFM table */
268
 	/* Process BOFM table */
270
-	DBGC2 ( device, "EFIBOFM %p %s version 1 before processing:\n",
271
-		device, efi_handle_name ( device ) );
269
+	DBGC2 ( device, "EFIBOFM %s version 1 before processing:\n",
270
+		efi_handle_name ( device ) );
272
 	DBGC2_HD ( device, bofmtab, bofmtab->Parameters.Length );
271
 	DBGC2_HD ( device, bofmtab, bofmtab->Parameters.Length );
273
 	if ( bofmtab2 ) {
272
 	if ( bofmtab2 ) {
274
-		DBGC2 ( device, "EFIBOFM %p %s version 2 before processing:\n",
275
-			device, efi_handle_name ( device ) );
273
+		DBGC2 ( device, "EFIBOFM %s version 2 before processing:\n",
274
+			efi_handle_name ( device ) );
276
 		DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
275
 		DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
277
 	}
276
 	}
278
 	bofmrc = bofm ( virt_to_user ( bofmtab2 ? bofmtab2 : bofmtab ), &pci );
277
 	bofmrc = bofm ( virt_to_user ( bofmtab2 ? bofmtab2 : bofmtab ), &pci );
279
-	DBGC ( device, "EFIBOFM %p %s status %08x\n",
280
-	       device, efi_handle_name ( device ), bofmrc );
281
-	DBGC2 ( device, "EFIBOFM %p %s version 1 after processing:\n",
282
-		device, efi_handle_name ( device ) );
278
+	DBGC ( device, "EFIBOFM %s status %08x\n",
279
+	       efi_handle_name ( device ), bofmrc );
280
+	DBGC2 ( device, "EFIBOFM %s version 1 after processing:\n",
281
+		efi_handle_name ( device ) );
283
 	DBGC2_HD ( device, bofmtab, bofmtab->Parameters.Length );
282
 	DBGC2_HD ( device, bofmtab, bofmtab->Parameters.Length );
284
 	if ( bofmtab2 ) {
283
 	if ( bofmtab2 ) {
285
-		DBGC2 ( device, "EFIBOFM %p %s version 2 after processing:\n",
286
-			device, efi_handle_name ( device ) );
284
+		DBGC2 ( device, "EFIBOFM %s version 2 after processing:\n",
285
+			efi_handle_name ( device ) );
287
 		DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
286
 		DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
288
 	}
287
 	}
289
 
288
 
292
 		if ( ( efirc = bofm2.bofm2->SetStatus ( bofm2.bofm2, device,
291
 		if ( ( efirc = bofm2.bofm2->SetStatus ( bofm2.bofm2, device,
293
 							FALSE, bofmrc ) ) != 0){
292
 							FALSE, bofmrc ) ) != 0){
294
 			rc = -EEFI ( efirc );
293
 			rc = -EEFI ( efirc );
295
-			DBGC ( device, "EFIBOFM %p %s could not set BOFM2 "
296
-			       "status: %s\n", device,
297
-			       efi_handle_name ( device ), strerror ( rc ) );
294
+			DBGC ( device, "EFIBOFM %s could not set BOFM2 "
295
+			       "status: %s\n", efi_handle_name ( device ),
296
+			       strerror ( rc ) );
298
 			goto err_set_status;
297
 			goto err_set_status;
299
 		}
298
 		}
300
 	} else {
299
 	} else {
301
 		if ( ( efirc = bofm1.bofm1->SetStatus ( bofm1.bofm1, device,
300
 		if ( ( efirc = bofm1.bofm1->SetStatus ( bofm1.bofm1, device,
302
 							FALSE, bofmrc ) ) != 0){
301
 							FALSE, bofmrc ) ) != 0){
303
 			rc = -EEFI ( efirc );
302
 			rc = -EEFI ( efirc );
304
-			DBGC ( device, "EFIBOFM %p %s could not set BOFM "
305
-			       "status: %s\n", device,
306
-			       efi_handle_name ( device ), strerror ( rc ) );
303
+			DBGC ( device, "EFIBOFM %s could not set BOFM "
304
+			       "status: %s\n", efi_handle_name ( device ),
305
+			       strerror ( rc ) );
307
 			goto err_set_status;
306
 			goto err_set_status;
308
 		}
307
 		}
309
 	}
308
 	}

+ 19
- 15
src/interface/efi/efi_debug.c View File

231
 
231
 
232
 	/* Sanity check */
232
 	/* Sanity check */
233
 	if ( ( ! handle ) || ( ! protocol ) ) {
233
 	if ( ( ! handle ) || ( ! protocol ) ) {
234
-		printf ( "EFI could not retrieve openers for %s on %p\n",
235
-			 efi_guid_ntoa ( protocol ), handle );
234
+		printf ( "HANDLE %s could not retrieve openers for %s\n",
235
+			 efi_handle_name ( handle ),
236
+			 efi_guid_ntoa ( protocol ) );
236
 		return;
237
 		return;
237
 	}
238
 	}
238
 
239
 
240
 	if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
241
 	if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
241
 						     &count ) ) != 0 ) {
242
 						     &count ) ) != 0 ) {
242
 		rc = -EEFI ( efirc );
243
 		rc = -EEFI ( efirc );
243
-		printf ( "EFI could not retrieve openers for %s on %p: %s\n",
244
-			 efi_guid_ntoa ( protocol ), handle, strerror ( rc ) );
244
+		printf ( "HANDLE %s could not retrieve openers for %s: %s\n",
245
+			 efi_handle_name ( handle ),
246
+			 efi_guid_ntoa ( protocol ), strerror ( rc ) );
245
 		return;
247
 		return;
246
 	}
248
 	}
247
 
249
 
248
 	/* Dump list of openers */
250
 	/* Dump list of openers */
249
 	for ( i = 0 ; i < count ; i++ ) {
251
 	for ( i = 0 ; i < count ; i++ ) {
250
 		opener = &openers[i];
252
 		opener = &openers[i];
251
-		printf ( "HANDLE %p %s %s opened %dx (%s)",
252
-			 handle, efi_handle_name ( handle ),
253
+		printf ( "HANDLE %s %s opened %dx (%s)",
254
+			 efi_handle_name ( handle ),
253
 			 efi_guid_ntoa ( protocol ), opener->OpenCount,
255
 			 efi_guid_ntoa ( protocol ), opener->OpenCount,
254
 			 efi_open_attributes_name ( opener->Attributes ) );
256
 			 efi_open_attributes_name ( opener->Attributes ) );
255
-		printf ( " by %p %s", opener->AgentHandle,
256
-			 efi_handle_name ( opener->AgentHandle ) );
257
+		printf ( " by %s", efi_handle_name ( opener->AgentHandle ) );
257
 		if ( opener->ControllerHandle == handle ) {
258
 		if ( opener->ControllerHandle == handle ) {
258
 			printf ( "\n" );
259
 			printf ( "\n" );
259
 		} else {
260
 		} else {
260
-			printf ( " for %p %s\n", opener->ControllerHandle,
261
+			printf ( " for %s\n",
261
 				 efi_handle_name ( opener->ControllerHandle ) );
262
 				 efi_handle_name ( opener->ControllerHandle ) );
262
 		}
263
 		}
263
 	}
264
 	}
282
 
283
 
283
 	/* Sanity check */
284
 	/* Sanity check */
284
 	if ( ! handle ) {
285
 	if ( ! handle ) {
285
-		printf ( "EFI could not retrieve protocols for %p\n", handle );
286
+		printf ( "HANDLE %s could not retrieve protocols\n",
287
+			 efi_handle_name ( handle ) );
286
 		return;
288
 		return;
287
 	}
289
 	}
288
 
290
 
290
 	if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
292
 	if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
291
 						&count ) ) != 0 ) {
293
 						&count ) ) != 0 ) {
292
 		rc = -EEFI ( efirc );
294
 		rc = -EEFI ( efirc );
293
-		printf ( "EFI could not retrieve protocols for %p: %s\n",
294
-			 handle, strerror ( rc ) );
295
+		printf ( "HANDLE %s could not retrieve protocols: %s\n",
296
+			 efi_handle_name ( handle ), strerror ( rc ) );
295
 		return;
297
 		return;
296
 	}
298
 	}
297
 
299
 
298
 	/* Dump list of protocols */
300
 	/* Dump list of protocols */
299
 	for ( i = 0 ; i < count ; i++ ) {
301
 	for ( i = 0 ; i < count ; i++ ) {
300
 		protocol = protocols[i];
302
 		protocol = protocols[i];
301
-		printf ( "HANDLE %p %s %s supported\n",
302
-			 handle, efi_handle_name ( handle ),
303
+		printf ( "HANDLE %s %s supported\n", efi_handle_name ( handle ),
303
 			 efi_guid_ntoa ( protocol ) );
304
 			 efi_guid_ntoa ( protocol ) );
304
 		dbg_efi_openers ( handle, protocol );
305
 		dbg_efi_openers ( handle, protocol );
305
 	}
306
 	}
631
 const __attribute__ (( pure )) char * efi_handle_name ( EFI_HANDLE handle ) {
632
 const __attribute__ (( pure )) char * efi_handle_name ( EFI_HANDLE handle ) {
632
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
633
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
633
 	struct efi_handle_name_type *type;
634
 	struct efi_handle_name_type *type;
635
+	static char buf[32];
634
 	unsigned int i;
636
 	unsigned int i;
635
 	void *interface;
637
 	void *interface;
636
 	const char *name;
638
 	const char *name;
670
 			return name;
672
 			return name;
671
 	}
673
 	}
672
 
674
 
673
-	return "UNKNOWN";
675
+	/* Use raw handle value if no name found */
676
+	snprintf ( buf, sizeof ( buf ), "UNKNOWN<%p>", handle );
677
+	return buf;
674
 }
678
 }

+ 38
- 42
src/interface/efi/efi_driver.c View File

96
 	struct efi_driver *efidrv;
96
 	struct efi_driver *efidrv;
97
 	int rc;
97
 	int rc;
98
 
98
 
99
-	DBGCP ( device, "EFIDRV %p %s DRIVER_SUPPORTED",
100
-		device, efi_handle_name ( device ) );
99
+	DBGCP ( device, "EFIDRV %s DRIVER_SUPPORTED",
100
+		efi_handle_name ( device ) );
101
 	if ( child )
101
 	if ( child )
102
 		DBGCP ( device, " (child %s)", efi_devpath_text ( child ) );
102
 		DBGCP ( device, " (child %s)", efi_devpath_text ( child ) );
103
 	DBGCP ( device, "\n" );
103
 	DBGCP ( device, "\n" );
104
 
104
 
105
 	/* Do nothing if we are already driving this device */
105
 	/* Do nothing if we are already driving this device */
106
 	if ( efidev_find ( device ) != NULL ) {
106
 	if ( efidev_find ( device ) != NULL ) {
107
-		DBGCP ( device, "EFIDRV %p %s is already started\n",
108
-			device, efi_handle_name ( device ) );
107
+		DBGCP ( device, "EFIDRV %s is already started\n",
108
+			efi_handle_name ( device ) );
109
 		return EFI_ALREADY_STARTED;
109
 		return EFI_ALREADY_STARTED;
110
 	}
110
 	}
111
 
111
 
112
 	/* Look for a driver claiming to support this device */
112
 	/* Look for a driver claiming to support this device */
113
 	for_each_table_entry ( efidrv, EFI_DRIVERS ) {
113
 	for_each_table_entry ( efidrv, EFI_DRIVERS ) {
114
 		if ( ( rc = efidrv->supported ( device ) ) == 0 ) {
114
 		if ( ( rc = efidrv->supported ( device ) ) == 0 ) {
115
-			DBGC ( device, "EFIDRV %p %s has driver \"%s\"\n",
116
-			       device, efi_handle_name ( device ),
117
-			       efidrv->name );
115
+			DBGC ( device, "EFIDRV %s has driver \"%s\"\n",
116
+			       efi_handle_name ( device ), efidrv->name );
118
 			return 0;
117
 			return 0;
119
 		}
118
 		}
120
 	}
119
 	}
121
-	DBGCP ( device, "EFIDRV %p %s has no driver\n",
122
-		device, efi_handle_name ( device ) );
120
+	DBGCP ( device, "EFIDRV %s has no driver\n",
121
+		efi_handle_name ( device ) );
123
 
122
 
124
 	return EFI_UNSUPPORTED;
123
 	return EFI_UNSUPPORTED;
125
 }
124
 }
140
 	EFI_STATUS efirc;
139
 	EFI_STATUS efirc;
141
 	int rc;
140
 	int rc;
142
 
141
 
143
-	DBGC ( device, "EFIDRV %p %s DRIVER_START",
144
-	       device, efi_handle_name ( device ) );
142
+	DBGC ( device, "EFIDRV %s DRIVER_START", efi_handle_name ( device ) );
145
 	if ( child )
143
 	if ( child )
146
 		DBGC ( device, " (child %s)", efi_devpath_text ( child ) );
144
 		DBGC ( device, " (child %s)", efi_devpath_text ( child ) );
147
 	DBGC ( device, "\n" );
145
 	DBGC ( device, "\n" );
149
 	/* Do nothing if we are already driving this device */
147
 	/* Do nothing if we are already driving this device */
150
 	efidev = efidev_find ( device );
148
 	efidev = efidev_find ( device );
151
 	if ( efidev ) {
149
 	if ( efidev ) {
152
-		DBGCP ( device, "EFIDRV %p %s is already started\n",
153
-			device, efi_handle_name ( device ) );
150
+		DBGCP ( device, "EFIDRV %s is already started\n",
151
+			efi_handle_name ( device ) );
154
 		efirc = EFI_ALREADY_STARTED;
152
 		efirc = EFI_ALREADY_STARTED;
155
 		goto err_already_started;
153
 		goto err_already_started;
156
 	}
154
 	}
169
 	/* Try to start this device */
167
 	/* Try to start this device */
170
 	for_each_table_entry ( efidrv, EFI_DRIVERS ) {
168
 	for_each_table_entry ( efidrv, EFI_DRIVERS ) {
171
 		if ( ( rc = efidrv->supported ( device ) ) != 0 ) {
169
 		if ( ( rc = efidrv->supported ( device ) ) != 0 ) {
172
-			DBGC ( device, "EFIDRV %p %s is not supported by "
173
-			       "driver \"%s\": %s\n", device,
174
-			       efi_handle_name ( device ), efidrv->name,
170
+			DBGC ( device, "EFIDRV %s is not supported by driver "
171
+			       "\"%s\": %s\n", efi_handle_name ( device ),
172
+			       efidrv->name,
175
 			       strerror ( rc ) );
173
 			       strerror ( rc ) );
176
 			continue;
174
 			continue;
177
 		}
175
 		}
178
 		if ( ( rc = efidrv->start ( efidev ) ) == 0 ) {
176
 		if ( ( rc = efidrv->start ( efidev ) ) == 0 ) {
179
 			efidev->driver = efidrv;
177
 			efidev->driver = efidrv;
180
-			DBGC ( device, "EFIDRV %p %s using driver \"%s\"\n",
181
-			       device, efi_handle_name ( device ),
178
+			DBGC ( device, "EFIDRV %s using driver \"%s\"\n",
179
+			       efi_handle_name ( device ),
182
 			       efidev->driver->name );
180
 			       efidev->driver->name );
183
 			return 0;
181
 			return 0;
184
 		}
182
 		}
185
-		DBGC ( device, "EFIDRV %p %s could not start driver \"%s\": "
186
-		       "%s\n", device, efi_handle_name ( device ),
187
-		       efidrv->name, strerror ( rc ) );
183
+		DBGC ( device, "EFIDRV %s could not start driver \"%s\": %s\n",
184
+		       efi_handle_name ( device ), efidrv->name,
185
+		       strerror ( rc ) );
188
 	}
186
 	}
189
 	efirc = EFI_UNSUPPORTED;
187
 	efirc = EFI_UNSUPPORTED;
190
 
188
 
213
 	struct efi_device *efidev;
211
 	struct efi_device *efidev;
214
 	UINTN i;
212
 	UINTN i;
215
 
213
 
216
-	DBGC ( device, "EFIDRV %p %s DRIVER_STOP",
217
-	       device, efi_handle_name ( device ) );
214
+	DBGC ( device, "EFIDRV %s DRIVER_STOP", efi_handle_name ( device ) );
218
 	for ( i = 0 ; i < num_children ; i++ ) {
215
 	for ( i = 0 ; i < num_children ; i++ ) {
219
-		DBGC ( device, "%s%p %s", ( i ? ", " : " child " ),
220
-		       children[i], efi_handle_name ( children[i] ) );
216
+		DBGC ( device, "%s%s", ( i ? ", " : " child " ),
217
+		       efi_handle_name ( children[i] ) );
221
 	}
218
 	}
222
 	DBGC ( device, "\n" );
219
 	DBGC ( device, "\n" );
223
 
220
 
224
 	/* Do nothing unless we are driving this device */
221
 	/* Do nothing unless we are driving this device */
225
 	efidev = efidev_find ( device );
222
 	efidev = efidev_find ( device );
226
 	if ( ! efidev ) {
223
 	if ( ! efidev ) {
227
-		DBGCP ( device, "EFIDRV %p %s is not started\n",
228
-			device, efi_handle_name ( device ) );
224
+		DBGCP ( device, "EFIDRV %s is not started\n",
225
+			efi_handle_name ( device ) );
229
 		return 0;
226
 		return 0;
230
 	}
227
 	}
231
 
228
 
378
 	}
375
 	}
379
 
376
 
380
 	/* Disconnect any existing drivers */
377
 	/* Disconnect any existing drivers */
381
-	DBGC2 ( device, "EFIDRV %p %s before disconnecting:\n",
382
-		device, efi_handle_name ( device ) );
378
+	DBGC2 ( device, "EFIDRV %s before disconnecting:\n",
379
+		efi_handle_name ( device ) );
383
 	DBGC2_EFI_PROTOCOLS ( device, device );
380
 	DBGC2_EFI_PROTOCOLS ( device, device );
384
-	DBGC ( device, "EFIDRV %p %s disconnecting existing drivers\n",
385
-	       device, efi_handle_name ( device ) );
381
+	DBGC ( device, "EFIDRV %s disconnecting existing drivers\n",
382
+	       efi_handle_name ( device ) );
386
 	if ( ( efirc = bs->DisconnectController ( device, NULL,
383
 	if ( ( efirc = bs->DisconnectController ( device, NULL,
387
 						  NULL ) ) != 0 ) {
384
 						  NULL ) ) != 0 ) {
388
 		rc = -EEFI ( efirc );
385
 		rc = -EEFI ( efirc );
389
-		DBGC ( device, "EFIDRV %p %s could not disconnect existing "
390
-		       "drivers: %s\n", device, efi_handle_name ( device ),
386
+		DBGC ( device, "EFIDRV %s could not disconnect existing "
387
+		       "drivers: %s\n", efi_handle_name ( device ),
391
 		       strerror ( rc ) );
388
 		       strerror ( rc ) );
392
 		/* Ignore the error and attempt to connect our drivers */
389
 		/* Ignore the error and attempt to connect our drivers */
393
 	}
390
 	}
394
-	DBGC2 ( device, "EFIDRV %p %s after disconnecting:\n",
395
-		device, efi_handle_name ( device ) );
391
+	DBGC2 ( device, "EFIDRV %s after disconnecting:\n",
392
+		efi_handle_name ( device ) );
396
 	DBGC2_EFI_PROTOCOLS ( device, device );
393
 	DBGC2_EFI_PROTOCOLS ( device, device );
397
 
394
 
398
 	/* Connect our driver */
395
 	/* Connect our driver */
399
-	DBGC ( device, "EFIDRV %p %s connecting new drivers\n",
400
-	       device, efi_handle_name ( device ) );
396
+	DBGC ( device, "EFIDRV %s connecting new drivers\n",
397
+	       efi_handle_name ( device ) );
401
 	if ( ( efirc = bs->ConnectController ( device, drivers, NULL,
398
 	if ( ( efirc = bs->ConnectController ( device, drivers, NULL,
402
 					       FALSE ) ) != 0 ) {
399
 					       FALSE ) ) != 0 ) {
403
 		rc = -EEFI ( efirc );
400
 		rc = -EEFI ( efirc );
404
-		DBGC ( device, "EFIDRV %p %s could not connect new drivers: "
405
-		       "%s\n", device, efi_handle_name ( device ),
406
-		       strerror ( rc ) );
401
+		DBGC ( device, "EFIDRV %s could not connect new drivers: "
402
+		       "%s\n", efi_handle_name ( device ), strerror ( rc ) );
407
 		return rc;
403
 		return rc;
408
 	}
404
 	}
409
-	DBGC2 ( device, "EFIDRV %p %s after connecting:\n",
410
-		device, efi_handle_name ( device ) );
405
+	DBGC2 ( device, "EFIDRV %s after connecting:\n",
406
+		efi_handle_name ( device ) );
411
 	DBGC2_EFI_PROTOCOLS ( device, device );
407
 	DBGC2_EFI_PROTOCOLS ( device, device );
412
 
408
 
413
 	return 0;
409
 	return 0;

+ 20
- 21
src/interface/efi/efi_pci.c View File

154
 					  &pci_io.interface, efi_image_handle,
154
 					  &pci_io.interface, efi_image_handle,
155
 					  device, attributes ) ) != 0 ) {
155
 					  device, attributes ) ) != 0 ) {
156
 		rc = -EEFI_PCI ( efirc );
156
 		rc = -EEFI_PCI ( efirc );
157
-		DBGCP ( device, "EFIPCI %p %s cannot open PCI protocols: %s\n",
158
-			device, efi_handle_name ( device ), strerror ( rc ) );
157
+		DBGCP ( device, "EFIPCI %s cannot open PCI protocols: %s\n",
158
+			efi_handle_name ( device ), strerror ( rc ) );
159
 		goto err_open_protocol;
159
 		goto err_open_protocol;
160
 	}
160
 	}
161
 
161
 
164
 						    &pci_bus, &pci_dev,
164
 						    &pci_bus, &pci_dev,
165
 						    &pci_fn ) ) != 0 ) {
165
 						    &pci_fn ) ) != 0 ) {
166
 		rc = -EEFI ( efirc );
166
 		rc = -EEFI ( efirc );
167
-		DBGC ( device, "EFIPCI %p %s could not get PCI location: %s\n",
168
-		       device, efi_handle_name ( device ), strerror ( rc ) );
167
+		DBGC ( device, "EFIPCI %s could not get PCI location: %s\n",
168
+		       efi_handle_name ( device ), strerror ( rc ) );
169
 		goto err_get_location;
169
 		goto err_get_location;
170
 	}
170
 	}
171
-	DBGC2 ( device, "EFIPCI %p %s is PCI %04lx:%02lx:%02lx.%lx\n", device,
171
+	DBGC2 ( device, "EFIPCI %s is PCI %04lx:%02lx:%02lx.%lx\n",
172
 		efi_handle_name ( device ), ( ( unsigned long ) pci_segment ),
172
 		efi_handle_name ( device ), ( ( unsigned long ) pci_segment ),
173
 		( ( unsigned long ) pci_bus ), ( ( unsigned long ) pci_dev ),
173
 		( ( unsigned long ) pci_bus ), ( ( unsigned long ) pci_dev ),
174
 		( ( unsigned long ) pci_fn ) );
174
 		( ( unsigned long ) pci_fn ) );
192
 	/* Populate PCI device */
192
 	/* Populate PCI device */
193
 	pci_init ( pci, PCI_BUSDEVFN ( pci_bus, pci_dev, pci_fn ) );
193
 	pci_init ( pci, PCI_BUSDEVFN ( pci_bus, pci_dev, pci_fn ) );
194
 	if ( ( rc = pci_read_config ( pci ) ) != 0 ) {
194
 	if ( ( rc = pci_read_config ( pci ) ) != 0 ) {
195
-		DBGC ( device, "EFIPCI %p %s cannot read PCI configuration: "
196
-		       "%s\n", device, efi_handle_name ( device ),
197
-		       strerror ( rc ) );
195
+		DBGC ( device, "EFIPCI %s cannot read PCI configuration: %s\n",
196
+		       efi_handle_name ( device ), strerror ( rc ) );
198
 		goto err_pci_read_config;
197
 		goto err_pci_read_config;
199
 	}
198
 	}
200
 
199
 
264
 
263
 
265
 	/* Look for a driver */
264
 	/* Look for a driver */
266
 	if ( ( rc = pci_find_driver ( &pci ) ) != 0 ) {
265
 	if ( ( rc = pci_find_driver ( &pci ) ) != 0 ) {
267
-		DBGCP ( device, "EFIPCI %p %s has no driver\n",
268
-			device, efi_handle_name ( device ) );
266
+		DBGCP ( device, "EFIPCI %s has no driver\n",
267
+			efi_handle_name ( device ) );
269
 		return rc;
268
 		return rc;
270
 	}
269
 	}
271
-	DBGC ( device, "EFIPCI %p %s has driver \"%s\"\n",
272
-	       device, efi_handle_name ( device ), pci.id->name );
270
+	DBGC ( device, "EFIPCI %s has driver \"%s\"\n",
271
+	       efi_handle_name ( device ), pci.id->name );
273
 
272
 
274
 	return 0;
273
 	return 0;
275
 }
274
 }
296
 	if ( ( rc = efipci_open ( device, ( EFI_OPEN_PROTOCOL_BY_DRIVER |
295
 	if ( ( rc = efipci_open ( device, ( EFI_OPEN_PROTOCOL_BY_DRIVER |
297
 					    EFI_OPEN_PROTOCOL_EXCLUSIVE ),
296
 					    EFI_OPEN_PROTOCOL_EXCLUSIVE ),
298
 				  pci ) ) != 0 ) {
297
 				  pci ) ) != 0 ) {
299
-		DBGC ( device, "EFIPCI %p %s could not open PCI device: %s\n",
300
-		       device, efi_handle_name ( device ), strerror ( rc ) );
298
+		DBGC ( device, "EFIPCI %s could not open PCI device: %s\n",
299
+		       efi_handle_name ( device ), strerror ( rc ) );
301
 		DBGC_EFI_OPENERS ( device, device, &efi_pci_io_protocol_guid );
300
 		DBGC_EFI_OPENERS ( device, device, &efi_pci_io_protocol_guid );
302
 		goto err_open;
301
 		goto err_open;
303
 	}
302
 	}
304
 
303
 
305
 	/* Find driver */
304
 	/* Find driver */
306
 	if ( ( rc = pci_find_driver ( pci ) ) != 0 ) {
305
 	if ( ( rc = pci_find_driver ( pci ) ) != 0 ) {
307
-		DBGC ( device, "EFIPCI %p %s has no driver\n",
308
-		       device, efi_handle_name ( device ) );
306
+		DBGC ( device, "EFIPCI %s has no driver\n",
307
+		       efi_handle_name ( device ) );
309
 		goto err_find_driver;
308
 		goto err_find_driver;
310
 	}
309
 	}
311
 
310
 
315
 
314
 
316
 	/* Probe driver */
315
 	/* Probe driver */
317
 	if ( ( rc = pci_probe ( pci ) ) != 0 ) {
316
 	if ( ( rc = pci_probe ( pci ) ) != 0 ) {
318
-		DBGC ( device, "EFIPCI %p %s could not probe driver \"%s\": "
319
-		       "%s\n", device, efi_handle_name ( device ),
320
-		       pci->id->name, strerror ( rc ) );
317
+		DBGC ( device, "EFIPCI %s could not probe driver \"%s\": %s\n",
318
+		       efi_handle_name ( device ), pci->id->name,
319
+		       strerror ( rc ) );
321
 		goto err_probe;
320
 		goto err_probe;
322
 	}
321
 	}
323
-	DBGC ( device, "EFIPCI %p %s using driver \"%s\"\n",
324
-	       device, efi_handle_name ( device ), pci->id->name );
322
+	DBGC ( device, "EFIPCI %s using driver \"%s\"\n",
323
+	       efi_handle_name ( device ), pci->id->name );
325
 
324
 
326
 	efidev_set_drvdata ( efidev, pci );
325
 	efidev_set_drvdata ( efidev, pci );
327
 	return 0;
326
 	return 0;

+ 10
- 11
src/interface/efi/efi_snp.c View File

1024
 					  efidev->device,
1024
 					  efidev->device,
1025
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
1025
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
1026
 		rc = -EEFI ( efirc );
1026
 		rc = -EEFI ( efirc );
1027
-		DBGC ( snpdev, "SNPDEV %p cannot get %p %s device path: %s\n",
1028
-		       snpdev, efidev->device,
1029
-		       efi_handle_name ( efidev->device ), strerror ( rc ) );
1027
+		DBGC ( snpdev, "SNPDEV %p cannot get %s device path: %s\n",
1028
+		       snpdev, efi_handle_name ( efidev->device ),
1029
+		       strerror ( rc ) );
1030
 		goto err_open_device_path;
1030
 		goto err_open_device_path;
1031
 	}
1031
 	}
1032
 
1032
 
1067
 			&efi_load_file_protocol_guid, &snpdev->load_file,
1067
 			&efi_load_file_protocol_guid, &snpdev->load_file,
1068
 			NULL ) ) != 0 ) {
1068
 			NULL ) ) != 0 ) {
1069
 		rc = -EEFI ( efirc );
1069
 		rc = -EEFI ( efirc );
1070
-		DBGC ( snpdev, "SNPDEV %p could not install protocols: "
1071
-		       "%s\n", snpdev, strerror ( rc ) );
1070
+		DBGC ( snpdev, "SNPDEV %p could not install protocols: %s\n",
1071
+		       snpdev, strerror ( rc ) );
1072
 		goto err_install_protocol_interface;
1072
 		goto err_install_protocol_interface;
1073
 	}
1073
 	}
1074
 
1074
 
1075
 	/* Add as child of EFI parent device */
1075
 	/* Add as child of EFI parent device */
1076
 	if ( ( rc = efi_child_add ( efidev->device, snpdev->handle ) ) != 0 ) {
1076
 	if ( ( rc = efi_child_add ( efidev->device, snpdev->handle ) ) != 0 ) {
1077
-		DBGC ( snpdev, "SNPDEV %p could not become child of %p %s: "
1078
-		       "%s\n", snpdev, efidev->device,
1079
-		       efi_handle_name ( efidev->device ), strerror ( rc ) );
1077
+		DBGC ( snpdev, "SNPDEV %p could not become child of %s: %s\n",
1078
+		       snpdev, efi_handle_name ( efidev->device ),
1079
+		       strerror ( rc ) );
1080
 		goto err_efi_child_add;
1080
 		goto err_efi_child_add;
1081
 	}
1081
 	}
1082
 
1082
 
1097
 	bs->CloseProtocol ( efidev->device, &efi_device_path_protocol_guid,
1097
 	bs->CloseProtocol ( efidev->device, &efi_device_path_protocol_guid,
1098
 			    efi_image_handle, efidev->device );
1098
 			    efi_image_handle, efidev->device );
1099
 
1099
 
1100
-	DBGC ( snpdev, "SNPDEV %p installed for %s as device %p %s\n",
1101
-	       snpdev, netdev->name, snpdev->handle,
1102
-	       efi_handle_name ( snpdev->handle ) );
1100
+	DBGC ( snpdev, "SNPDEV %p installed for %s as device %s\n",
1101
+	       snpdev, netdev->name, efi_handle_name ( snpdev->handle ) );
1103
 	return 0;
1102
 	return 0;
1104
 
1103
 
1105
 	if ( snpdev->package_list )
1104
 	if ( snpdev->package_list )

+ 17
- 21
src/interface/efi/efi_utils.c View File

76
 					  efi_image_handle, device,
76
 					  efi_image_handle, device,
77
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
77
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
78
 		rc = -EEFI ( efirc );
78
 		rc = -EEFI ( efirc );
79
-		DBGC ( device, "EFIDEV %p %s cannot open device path: %s\n",
80
-		       device, efi_handle_name ( device ), strerror ( rc ) );
79
+		DBGC ( device, "EFIDEV %s cannot open device path: %s\n",
80
+		       efi_handle_name ( device ), strerror ( rc ) );
81
 		goto err_open_device_path;
81
 		goto err_open_device_path;
82
 	}
82
 	}
83
 	devpath = path.path;
83
 	devpath = path.path;
86
 	if ( ( efirc = bs->LocateDevicePath ( protocol, &devpath,
86
 	if ( ( efirc = bs->LocateDevicePath ( protocol, &devpath,
87
 					      parent ) ) != 0 ) {
87
 					      parent ) ) != 0 ) {
88
 		rc = -EEFI ( efirc );
88
 		rc = -EEFI ( efirc );
89
-		DBGC ( device, "EFIDEV %p %s has no parent supporting %s: %s\n",
90
-		       device, efi_handle_name ( device ),
89
+		DBGC ( device, "EFIDEV %s has no parent supporting %s: %s\n",
90
+		       efi_handle_name ( device ),
91
 		       efi_guid_ntoa ( protocol ), strerror ( rc ) );
91
 		       efi_guid_ntoa ( protocol ), strerror ( rc ) );
92
 		goto err_locate_protocol;
92
 		goto err_locate_protocol;
93
 	}
93
 	}
123
 					  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
123
 					  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
124
 					  ) ) != 0 ) {
124
 					  ) ) != 0 ) {
125
 		rc = -EEFI ( efirc );
125
 		rc = -EEFI ( efirc );
126
-		DBGC ( parent, "EFIDEV %p %s could not add child",
127
-		       parent, efi_handle_name ( parent ) );
128
-		DBGC ( parent, " %p %s: %s\n", child,
126
+		DBGC ( parent, "EFIDEV %s could not add child",
127
+		       efi_handle_name ( parent ) );
128
+		DBGC ( parent, " %s: %s\n",
129
 		       efi_handle_name ( child ), strerror ( rc ) );
129
 		       efi_handle_name ( child ), strerror ( rc ) );
130
 		DBGC_EFI_OPENERS ( parent, parent,
130
 		DBGC_EFI_OPENERS ( parent, parent,
131
 				   &efi_device_path_protocol_guid );
131
 				   &efi_device_path_protocol_guid );
132
 		return rc;
132
 		return rc;
133
 	}
133
 	}
134
 
134
 
135
-	DBGC2 ( parent, "EFIDEV %p %s added child",
136
-		parent, efi_handle_name ( parent ) );
137
-	DBGC2 ( parent, " %p %s\n", child, efi_handle_name ( child ) );
135
+	DBGC2 ( parent, "EFIDEV %s added child", efi_handle_name ( parent ) );
136
+	DBGC2 ( parent, " %s\n", efi_handle_name ( child ) );
138
 	return 0;
137
 	return 0;
139
 }
138
 }
140
 
139
 
149
 
148
 
150
 	bs->CloseProtocol ( parent, &efi_device_path_protocol_guid,
149
 	bs->CloseProtocol ( parent, &efi_device_path_protocol_guid,
151
 			    efi_image_handle, child );
150
 			    efi_image_handle, child );
152
-	DBGC2 ( parent, "EFIDEV %p %s removed child",
153
-		parent, efi_handle_name ( parent ) );
154
-	DBGC2 ( parent, " %p %s\n",
155
-		child, efi_handle_name ( child ) );
151
+	DBGC2 ( parent, "EFIDEV %s removed child", efi_handle_name ( parent ) );
152
+	DBGC2 ( parent, " %s\n", efi_handle_name ( child ) );
156
 }
153
 }
157
 
154
 
158
 /**
155
 /**
172
 	/* Find parent PCI device */
169
 	/* Find parent PCI device */
173
 	if ( ( rc = efi_locate_device ( device, &efi_pci_io_protocol_guid,
170
 	if ( ( rc = efi_locate_device ( device, &efi_pci_io_protocol_guid,
174
 					&pci_device ) ) != 0 ) {
171
 					&pci_device ) ) != 0 ) {
175
-		DBGC ( device, "EFIDEV %p %s is not a PCI device: %s\n",
176
-		       device, efi_handle_name ( device ), strerror ( rc ) );
172
+		DBGC ( device, "EFIDEV %s is not a PCI device: %s\n",
173
+		       efi_handle_name ( device ), strerror ( rc ) );
177
 		return rc;
174
 		return rc;
178
 	}
175
 	}
179
 
176
 
180
 	/* Get PCI device information */
177
 	/* Get PCI device information */
181
 	if ( ( rc = efipci_info ( pci_device, &pci ) ) != 0 ) {
178
 	if ( ( rc = efipci_info ( pci_device, &pci ) ) != 0 ) {
182
-		DBGC ( device, "EFIDEV %p %s could not get PCI information: "
183
-		       "%s\n", device, efi_handle_name ( device ),
184
-		       strerror ( rc ) );
179
+		DBGC ( device, "EFIDEV %s could not get PCI information: %s\n",
180
+		       efi_handle_name ( device ), strerror ( rc ) );
185
 		return rc;
181
 		return rc;
186
 	}
182
 	}
187
 
183
 
211
 	/* If we cannot get any underlying device information, fall
207
 	/* If we cannot get any underlying device information, fall
212
 	 * back to providing information about the EFI handle.
208
 	 * back to providing information about the EFI handle.
213
 	 */
209
 	 */
214
-	DBGC ( device, "EFIDEV %p %s could not get underlying device "
215
-	       "information\n", device, efi_handle_name ( device ) );
210
+	DBGC ( device, "EFIDEV %s could not get underlying device "
211
+	       "information\n", efi_handle_name ( device ) );
216
 	dev->desc.bus_type = BUS_TYPE_EFI;
212
 	dev->desc.bus_type = BUS_TYPE_EFI;
217
 	snprintf ( dev->name, sizeof ( dev->name ), "%s-%p", prefix, device );
213
 	snprintf ( dev->name, sizeof ( dev->name ), "%s-%p", prefix, device );
218
 }
214
 }

+ 22
- 27
src/interface/efi/efi_wrap.c View File

111
 	void *retaddr = __builtin_return_address ( 0 );
111
 	void *retaddr = __builtin_return_address ( 0 );
112
 	EFI_STATUS efirc;
112
 	EFI_STATUS efirc;
113
 
113
 
114
-	DBGC ( colour, "HandleProtocol ( %p %s, %s, ... ) ", handle,
114
+	DBGC ( colour, "HandleProtocol ( %s, %s, ... ) ",
115
 	       efi_handle_name ( handle ), efi_guid_ntoa ( protocol ) );
115
 	       efi_handle_name ( handle ), efi_guid_ntoa ( protocol ) );
116
 	efirc = bs->HandleProtocol ( handle, protocol, interface );
116
 	efirc = bs->HandleProtocol ( handle, protocol, interface );
117
 	DBGC ( colour, "= %s ( %p ) -> %p\n",
117
 	DBGC ( colour, "= %s ( %p ) -> %p\n",
155
 	DBGC ( colour, "LocateDevicePath ( %s, %s, ... ) ",
155
 	DBGC ( colour, "LocateDevicePath ( %s, %s, ... ) ",
156
 	       efi_guid_ntoa ( protocol ), efi_devpath_text ( *device_path ) );
156
 	       efi_guid_ntoa ( protocol ), efi_devpath_text ( *device_path ) );
157
 	efirc = bs->LocateDevicePath ( protocol, device_path, device );
157
 	efirc = bs->LocateDevicePath ( protocol, device_path, device );
158
-	DBGC ( colour, "= %s ( %p, ",
158
+	DBGC ( colour, "= %s ( %s, ",
159
 	       efi_status ( efirc ), efi_devpath_text ( *device_path ) );
159
 	       efi_status ( efirc ), efi_devpath_text ( *device_path ) );
160
-	DBGC ( colour, "%p %s ) -> %p\n",
161
-	       *device, efi_handle_name ( *device ), retaddr );
160
+	DBGC ( colour, "%s ) -> %p\n", efi_handle_name ( *device ), retaddr );
162
 	return efirc;
161
 	return efirc;
163
 }
162
 }
164
 
163
 
175
 	void *retaddr = __builtin_return_address ( 0 );
174
 	void *retaddr = __builtin_return_address ( 0 );
176
 	EFI_STATUS efirc;
175
 	EFI_STATUS efirc;
177
 
176
 
178
-	DBGC ( colour, "LoadImage ( %d, %p %s, ", boot_policy,
179
-	       parent_image_handle, efi_handle_name ( parent_image_handle ) );
177
+	DBGC ( colour, "LoadImage ( %d, %s, ", boot_policy,
178
+	       efi_handle_name ( parent_image_handle ) );
180
 	DBGC ( colour, "%s, %p, %#llx, ... ) ",
179
 	DBGC ( colour, "%s, %p, %#llx, ... ) ",
181
 	       efi_devpath_text ( device_path ), source_buffer,
180
 	       efi_devpath_text ( device_path ), source_buffer,
182
 	       ( ( unsigned long long ) source_size ) );
181
 	       ( ( unsigned long long ) source_size ) );
183
 	efirc = bs->LoadImage ( boot_policy, parent_image_handle, device_path,
182
 	efirc = bs->LoadImage ( boot_policy, parent_image_handle, device_path,
184
 				source_buffer, source_size, image_handle );
183
 				source_buffer, source_size, image_handle );
185
 	DBGC ( colour, "= %s ( ", efi_status ( efirc ) );
184
 	DBGC ( colour, "= %s ( ", efi_status ( efirc ) );
186
-	if ( efirc == 0 ) {
187
-		DBGC ( colour, "%p %s ", *image_handle,
188
-		       efi_handle_name ( *image_handle ) );
189
-	}
185
+	if ( efirc == 0 )
186
+		DBGC ( colour, "%s ", efi_handle_name ( *image_handle ) );
190
 	DBGC ( colour, ") -> %p\n", retaddr );
187
 	DBGC ( colour, ") -> %p\n", retaddr );
191
 
188
 
192
 	/* Wrap the new image */
189
 	/* Wrap the new image */
206
 	void *retaddr = __builtin_return_address ( 0 );
203
 	void *retaddr = __builtin_return_address ( 0 );
207
 	EFI_STATUS efirc;
204
 	EFI_STATUS efirc;
208
 
205
 
209
-	DBGC ( colour, "ExitBootServices ( %p %s, %#llx ) ",
210
-	       image_handle, efi_handle_name ( image_handle ),
206
+	DBGC ( colour, "ExitBootServices ( %s, %#llx ) ",
207
+	       efi_handle_name ( image_handle ),
211
 	       ( ( unsigned long long ) map_key ) );
208
 	       ( ( unsigned long long ) map_key ) );
212
 	efirc = bs->ExitBootServices ( image_handle, map_key );
209
 	efirc = bs->ExitBootServices ( image_handle, map_key );
213
 	DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
210
 	DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
226
 	void *retaddr = __builtin_return_address ( 0 );
223
 	void *retaddr = __builtin_return_address ( 0 );
227
 	EFI_STATUS efirc;
224
 	EFI_STATUS efirc;
228
 
225
 
229
-	DBGC ( colour, "OpenProtocol ( %p %s, %s, ..., ", handle,
226
+	DBGC ( colour, "OpenProtocol ( %s, %s, ..., ",
230
 	       efi_handle_name ( handle ), efi_guid_ntoa ( protocol ) );
227
 	       efi_handle_name ( handle ), efi_guid_ntoa ( protocol ) );
231
-	DBGC ( colour, "%p %s, ", agent_handle,
232
-	       efi_handle_name ( agent_handle ) );
233
-	DBGC ( colour, "%p %s, %#x ) ", controller_handle,
228
+	DBGC ( colour, "%s, ", efi_handle_name ( agent_handle ) );
229
+	DBGC ( colour, "%s, %#x ) ",
234
 	       efi_handle_name ( controller_handle ), attributes );
230
 	       efi_handle_name ( controller_handle ), attributes );
235
 	efirc = bs->OpenProtocol ( handle, protocol, interface, agent_handle,
231
 	efirc = bs->OpenProtocol ( handle, protocol, interface, agent_handle,
236
 				   controller_handle, attributes );
232
 				   controller_handle, attributes );
295
 					  &loaded.intf, efi_image_handle, NULL,
291
 					  &loaded.intf, efi_image_handle, NULL,
296
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
292
 					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
297
 		rc = -EEFI ( efirc );
293
 		rc = -EEFI ( efirc );
298
-		DBGC ( colour, "Could not get loaded image protocol for %p %s: "
299
-		       "%s\n", handle, efi_handle_name ( handle ),
300
-		       strerror ( rc ) );
294
+		DBGC ( colour, "WRAP %s could not get loaded image protocol: "
295
+		       "%s\n", efi_handle_name ( handle ), strerror ( rc ) );
301
 		return;
296
 		return;
302
 	}
297
 	}
303
 
298
 
304
 	/* Provide system table wrapper to image */
299
 	/* Provide system table wrapper to image */
305
 	loaded.image->SystemTable = &efi_systab_wrapper;
300
 	loaded.image->SystemTable = &efi_systab_wrapper;
306
-	DBGC ( colour, "Wrapped image %p %s at base %p has protocols:\n",
307
-	       handle, efi_handle_name ( handle ), loaded.image->ImageBase );
301
+	DBGC ( colour, "WRAP %s at base %p has protocols:\n",
302
+	       efi_handle_name ( handle ), loaded.image->ImageBase );
308
 	DBGC_EFI_PROTOCOLS ( colour, handle );
303
 	DBGC_EFI_PROTOCOLS ( colour, handle );
309
-	DBGC ( colour, "Parent image %p %s\n", loaded.image->ParentHandle,
310
-	       efi_handle_name ( loaded.image->ParentHandle ) );
311
-	DBGC ( colour, "Device %p %s ", loaded.image->DeviceHandle,
312
-	       efi_handle_name ( loaded.image->DeviceHandle ) );
313
-	DBGC ( colour, "file %p %s\n", loaded.image->FilePath,
314
-	       efi_devpath_text ( loaded.image->FilePath ) );
304
+	DBGC ( colour, "WRAP %s parent", efi_handle_name ( handle ) );
305
+	DBGC ( colour, " %s\n", efi_handle_name ( loaded.image->ParentHandle ));
306
+	DBGC ( colour, "WRAP %s device", efi_handle_name ( handle ) );
307
+	DBGC ( colour, " %s\n", efi_handle_name ( loaded.image->DeviceHandle ));
308
+	DBGC ( colour, "WRAP %s file", efi_handle_name ( handle ) );
309
+	DBGC ( colour, " %s\n", efi_devpath_text ( loaded.image->FilePath ) );
315
 
310
 
316
 	/* Close loaded image protocol */
311
 	/* Close loaded image protocol */
317
 	bs->CloseProtocol ( handle, &efi_loaded_image_protocol_guid,
312
 	bs->CloseProtocol ( handle, &efi_loaded_image_protocol_guid,

Loading…
Cancel
Save