8
8
#include < stdlib.h>
9
9
#include < string>
10
10
#include < vector>
11
+ #include < cinttypes>
11
12
12
13
// Internal headers.
13
14
#include < acl_auto_configure.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,7 +289,7 @@ 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
+ " HAL Kern Error: Read failed from addr %x, read %zu expected %zu \n " , addr,
292
293
r, size);
293
294
return -1 ;
294
295
}
@@ -334,7 +335,7 @@ 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
+ " HAL Kern Error: Read failed from addr %x, read %zu expected %zu \n " , addr,
338
339
r, size);
339
340
return -1 ;
340
341
}
@@ -381,7 +382,7 @@ 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
+ kern->io .printf (" HAL Kern Error: Write failed to addr %x with value %" PRIu64 " , "
385
386
" wrote %d, expected %d\n " ,
386
387
addr, val, r, size);
387
388
return -1 ;
@@ -423,8 +424,8 @@ static int acl_kernel_if_write_block(acl_kernel_if *kern, unsigned int addr,
423
424
424
425
if (r < aligned_size) {
425
426
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);
427
+ " wrote %zu expected %zu \n " ,
428
+ addr, * val, r, aligned_size);
428
429
return -1 ;
429
430
}
430
431
return 0 ;
@@ -930,7 +931,7 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
930
931
OFFSET_KERNEL_CRA + devdef.hal_info [ii].csr .address ;
931
932
kern->accel_csr [ii].bytes = devdef.hal_info [ii].csr .num_bytes ;
932
933
933
- ACL_KERNEL_IF_DEBUG_MSG (kern, " Kernel_%s CSR { 0x%08x , 0x%08x }\n " ,
934
+ ACL_KERNEL_IF_DEBUG_MSG (kern, " Kernel_%s CSR { 0x%08 " PRIuPTR " , 0x%08 " PRIuPTR " }\n " ,
934
935
devdef.accel [ii].iface .name .c_str (),
935
936
kern->accel_csr [ii].address ,
936
937
kern->accel_csr [ii].bytes );
@@ -942,7 +943,7 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
942
943
OFFSET_KERNEL_CRA + devdef.hal_info [ii].perf_mon .address ;
943
944
kern->accel_perf_mon [ii].bytes = devdef.hal_info [ii].perf_mon .num_bytes ;
944
945
945
- ACL_KERNEL_IF_DEBUG_MSG (kern, " Kernel_%s perf_mon { 0x%08x , 0x%08x }\n " ,
946
+ ACL_KERNEL_IF_DEBUG_MSG (kern, " Kernel_%s perf_mon { 0x%08 " PRIuPTR " , 0x%08 " PRIuPTR " }\n " ,
946
947
devdef.accel [ii].iface .name .c_str (),
947
948
kern->accel_perf_mon [ii].address ,
948
949
kern->accel_perf_mon [ii].bytes );
@@ -1056,7 +1057,7 @@ int acl_kernel_if_post_pll_config_init(acl_kernel_if *kern) {
1056
1057
kern->csr_version = version;
1057
1058
ACL_KERNEL_IF_DEBUG_MSG (kern,
1058
1059
" Read CSR version from kernel 0: Version = %u\n " ,
1059
- kern->csr_version );
1060
+ kern->csr_version . value () );
1060
1061
if (kern->csr_version < 5 ) {
1061
1062
// Register addresses are pushed back since previous versions
1062
1063
// doesn't have the start register
@@ -1190,7 +1191,7 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1190
1191
kern->io .printf (" currently in use, OR\n " );
1191
1192
kern->io .printf (" b) The host can not communicate properly with the "
1192
1193
" compiled kernel.\n " );
1193
- kern->io .printf (" Saw version=%u, expected=%u.\n " , kern->csr_version ,
1194
+ kern->io .printf (" Saw version=%u, expected=%u.\n " , kern->csr_version . value () ,
1194
1195
CSR_VERSION_ID);
1195
1196
assert (0 ); // Assert here because no way to pass an error up to the user.
1196
1197
// clEnqueue has already returned.
@@ -1885,7 +1886,7 @@ int acl_kernel_if_get_profile_data(acl_kernel_if *kern, cl_uint accel_id,
1885
1886
data[i] = acl_kernel_if_get_profile_data_word (kern, accel_id);
1886
1887
ACL_KERNEL_IF_DEBUG_MSG (kern,
1887
1888
" :: Read profile hardware:: Accelerator %d "
1888
- " profile_data word [%u ] is 0x%016llx.\n " ,
1889
+ " profile_data word [%" PRIu64 " ] is 0x%016llx.\n " ,
1889
1890
accel_id, i, data[i]);
1890
1891
}
1891
1892
0 commit comments