3
3
4
4
// System headers.
5
5
#include < cassert>
6
+ #include < cinttypes>
6
7
#include < cstdint>
7
8
#include < stdio.h>
8
9
#include < stdlib.h>
@@ -247,7 +248,7 @@ static int get_auto_discovery_string(acl_kernel_if *kern, char *config_str) {
247
248
kern->io .printf (" HAL Kern: Version ID incorrect\n " );
248
249
return -1 ;
249
250
}
250
- ACL_KERNEL_IF_DEBUG_MSG (kern, " Read %d bytes from kernel auto discovery" , r);
251
+ ACL_KERNEL_IF_DEBUG_MSG (kern, " Read %zu bytes from kernel auto discovery" , r);
251
252
252
253
return (r == rom_size) ? 0 : -1 ;
253
254
}
@@ -288,8 +289,8 @@ static int acl_kernel_if_read_32b(acl_kernel_if *kern, unsigned int addr,
288
289
r = kern->io .read (&kern->io , (dev_addr_t )addr, (char *)val, (size_t )size);
289
290
if (r < size) {
290
291
kern->io .printf (
291
- " HAL Kern Error: Read failed from addr %x, read %d expected %d \n " , addr ,
292
- r, size);
292
+ " HAL Kern Error: Read failed from addr %x, read %zu expected %zu \n " ,
293
+ addr, r, size);
293
294
return -1 ;
294
295
}
295
296
return 0 ;
@@ -334,8 +335,8 @@ static int acl_kernel_rom_read_block(acl_kernel_if *kern, unsigned int addr,
334
335
r = kern->io .read (&kern->io , (dev_addr_t )addr, config_rom, (size_t )size);
335
336
if (r < size) {
336
337
kern->io .printf (
337
- " HAL Kern Error: Read failed from addr %x, read %d expected %d \n " , addr ,
338
- r, size);
338
+ " HAL Kern Error: Read failed from addr %x, read %zu expected %zu \n " ,
339
+ addr, r, size);
339
340
return -1 ;
340
341
}
341
342
return 0 ;
@@ -381,9 +382,10 @@ static int acl_kernel_if_write_64b(acl_kernel_if *kern, unsigned int addr,
381
382
r = (int )kern->io .write (&kern->io , (dev_addr_t )addr, (char *)&val,
382
383
(size_t )size);
383
384
if (r < size) {
384
- kern->io .printf (" HAL Kern Error: Write failed to addr %x with value %x, "
385
- " wrote %d, expected %d\n " ,
386
- addr, val, r, size);
385
+ kern->io .printf (
386
+ " HAL Kern Error: Write failed to addr %x with value %" PRIx64 " , "
387
+ " wrote %d, expected %d\n " ,
388
+ addr, val, r, size);
387
389
return -1 ;
388
390
}
389
391
return 0 ;
@@ -423,8 +425,8 @@ static int acl_kernel_if_write_block(acl_kernel_if *kern, unsigned int addr,
423
425
424
426
if (r < aligned_size) {
425
427
kern->io .printf (" HAL Kern Error: Write failed to addr %x with value %x, "
426
- " wrote %d expected %d \n " ,
427
- addr, val, r, aligned_size);
428
+ " wrote %zu expected %zu \n " ,
429
+ addr, * val, r, aligned_size);
428
430
return -1 ;
429
431
}
430
432
return 0 ;
@@ -930,10 +932,10 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
930
932
OFFSET_KERNEL_CRA + devdef.hal_info [ii].csr .address ;
931
933
kern->accel_csr [ii].bytes = devdef.hal_info [ii].csr .num_bytes ;
932
934
933
- ACL_KERNEL_IF_DEBUG_MSG (kern, " Kernel_%s CSR { 0x%08x, 0x%08x } \n " ,
934
- devdef. accel [ii]. iface . name . c_str () ,
935
- kern->accel_csr [ii].address ,
936
- kern->accel_csr [ii].bytes );
935
+ ACL_KERNEL_IF_DEBUG_MSG (
936
+ kern, " Kernel_%s CSR { 0x%08 " PRIxPTR " , 0x%08 " PRIxPTR " } \n " ,
937
+ devdef. accel [ii]. iface . name . c_str (), kern->accel_csr [ii].address ,
938
+ kern->accel_csr [ii].bytes );
937
939
}
938
940
939
941
// The Kernel performance monitor registers
@@ -942,10 +944,10 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
942
944
OFFSET_KERNEL_CRA + devdef.hal_info [ii].perf_mon .address ;
943
945
kern->accel_perf_mon [ii].bytes = devdef.hal_info [ii].perf_mon .num_bytes ;
944
946
945
- ACL_KERNEL_IF_DEBUG_MSG (kern, " Kernel_%s perf_mon { 0x%08x, 0x%08x } \n " ,
946
- devdef. accel [ii]. iface . name . c_str () ,
947
- kern->accel_perf_mon [ii].address ,
948
- kern->accel_perf_mon [ii].bytes );
947
+ ACL_KERNEL_IF_DEBUG_MSG (
948
+ kern, " Kernel_%s perf_mon { 0x%08 " PRIxPTR " , 0x%08 " PRIxPTR " } \n " ,
949
+ devdef. accel [ii]. iface . name . c_str (), kern->accel_perf_mon [ii].address ,
950
+ kern->accel_perf_mon [ii].bytes );
949
951
950
952
// printf info
951
953
kern->accel_num_printfs [ii] =
@@ -1056,7 +1058,7 @@ int acl_kernel_if_post_pll_config_init(acl_kernel_if *kern) {
1056
1058
kern->csr_version = version;
1057
1059
ACL_KERNEL_IF_DEBUG_MSG (kern,
1058
1060
" Read CSR version from kernel 0: Version = %u\n " ,
1059
- kern->csr_version );
1061
+ kern->csr_version . value () );
1060
1062
if (kern->csr_version < 5 ) {
1061
1063
// Register addresses are pushed back since previous versions
1062
1064
// doesn't have the start register
@@ -1190,7 +1192,7 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1190
1192
kern->io .printf (" currently in use, OR\n " );
1191
1193
kern->io .printf (" b) The host can not communicate properly with the "
1192
1194
" compiled kernel.\n " );
1193
- kern->io .printf (" Saw version=%u, expected=%u.\n " , kern->csr_version ,
1195
+ kern->io .printf (" Saw version=%u, expected=%u.\n " , kern->csr_version . value () ,
1194
1196
CSR_VERSION_ID);
1195
1197
assert (0 ); // Assert here because no way to pass an error up to the user.
1196
1198
// clEnqueue has already returned.
@@ -1885,7 +1887,7 @@ int acl_kernel_if_get_profile_data(acl_kernel_if *kern, cl_uint accel_id,
1885
1887
data[i] = acl_kernel_if_get_profile_data_word (kern, accel_id);
1886
1888
ACL_KERNEL_IF_DEBUG_MSG (kern,
1887
1889
" :: Read profile hardware:: Accelerator %d "
1888
- " profile_data word [%u ] is 0x%016llx.\n " ,
1890
+ " profile_data word [%" PRIu64 " ] is 0x%016llx.\n " ,
1889
1891
accel_id, i, data[i]);
1890
1892
}
1891
1893
0 commit comments