@@ -150,11 +150,11 @@ typedef struct {
150150
151151typedef struct {
152152 /* The indexed used to address this hart in its DM. */
153- unsigned index ;
153+ unsigned int index ;
154154 /* Number of address bits in the dbus register. */
155- unsigned abits ;
155+ unsigned int abits ;
156156 /* Number of abstract command data registers. */
157- unsigned datacount ;
157+ unsigned int datacount ;
158158 /* Number of words in the Program Buffer. */
159159 unsigned int progbufsize ;
160160 /* Hart contains an implicit ebreak at the end of the program buffer. */
@@ -514,7 +514,7 @@ static int increase_ac_busy_delay(struct target *target)
514514 RISCV_DELAY_ABSTRACT_COMMAND );
515515}
516516
517- static uint32_t __attribute__((unused )) abstract_register_size (unsigned width )
517+ static uint32_t __attribute__((unused )) abstract_register_size (unsigned int width )
518518{
519519 switch (width ) {
520520 case 32 :
@@ -738,10 +738,10 @@ static void abstract_data_write_fill_batch(struct riscv_batch *batch,
738738}
739739
740740/* TODO: reuse "abstract_data_write_fill_batch()" here*/
741- static int write_abstract_arg (struct target * target , unsigned index ,
742- riscv_reg_t value , unsigned size_bits )
741+ static int write_abstract_arg (struct target * target , unsigned int index ,
742+ riscv_reg_t value , unsigned int size_bits )
743743{
744- unsigned offset = index * size_bits / 32 ;
744+ unsigned int offset = index * size_bits / 32 ;
745745 switch (size_bits ) {
746746 default :
747747 LOG_TARGET_ERROR (target , "Unsupported size: %d bits" , size_bits );
@@ -759,7 +759,7 @@ static int write_abstract_arg(struct target *target, unsigned index,
759759 * @par size in bits
760760 */
761761uint32_t riscv013_access_register_command (struct target * target , uint32_t number ,
762- unsigned size , uint32_t flags )
762+ unsigned int size , uint32_t flags )
763763{
764764 uint32_t command = set_field (0 , DM_COMMAND_CMDTYPE , 0 );
765765 switch (size ) {
@@ -907,7 +907,7 @@ static int register_write_abstract(struct target *target, enum gdb_regno number,
907907 * Sets the AAMSIZE field of a memory access abstract command based on
908908 * the width (bits).
909909 */
910- static uint32_t abstract_memory_size (unsigned width )
910+ static uint32_t abstract_memory_size (unsigned int width )
911911{
912912 switch (width ) {
913913 case 8 :
@@ -1089,7 +1089,7 @@ typedef struct {
10891089static int scratch_reserve (struct target * target ,
10901090 scratch_mem_t * scratch ,
10911091 struct riscv_program * program ,
1092- unsigned size_bytes )
1092+ unsigned int size_bytes )
10931093{
10941094 riscv_addr_t alignment = 1 ;
10951095 while (alignment < size_bytes )
@@ -1121,7 +1121,7 @@ static int scratch_reserve(struct target *target,
11211121 return ERROR_FAIL ;
11221122
11231123 /* Allow for ebreak at the end of the program. */
1124- unsigned program_size = (program -> instruction_count + 1 ) * 4 ;
1124+ unsigned int program_size = (program -> instruction_count + 1 ) * 4 ;
11251125 scratch -> hart_address = (info -> progbuf_address + program_size + alignment - 1 ) &
11261126 ~(alignment - 1 );
11271127 if ((info -> progbuf_writable == YNM_YES ) &&
@@ -1237,7 +1237,7 @@ static unsigned int register_size(struct target *target, enum gdb_regno number)
12371237 return riscv_xlen (target );
12381238}
12391239
1240- static bool has_sufficient_progbuf (struct target * target , unsigned size )
1240+ static bool has_sufficient_progbuf (struct target * target , unsigned int size )
12411241{
12421242 RISCV013_INFO (info );
12431243 return info -> progbufsize + info -> impebreak >= size ;
@@ -2085,7 +2085,7 @@ static int riscv013_authdata_write(struct target *target, uint32_t value, unsign
20852085}
20862086
20872087/* Try to find out the widest memory access size depending on the selected memory access methods. */
2088- static unsigned riscv013_data_bits (struct target * target )
2088+ static unsigned int riscv013_data_bits (struct target * target )
20892089{
20902090 RISCV013_INFO (info );
20912091 RISCV_INFO (r );
@@ -3022,7 +3022,7 @@ static int read_memory_bus_word(struct target *target, target_addr_t address,
30223022static target_addr_t sb_read_address (struct target * target )
30233023{
30243024 RISCV013_INFO (info );
3025- unsigned sbasize = get_field (info -> sbcs , DM_SBCS_SBASIZE );
3025+ unsigned int sbasize = get_field (info -> sbcs , DM_SBCS_SBASIZE );
30263026 target_addr_t address = 0 ;
30273027 uint32_t v ;
30283028 if (sbasize > 32 ) {
@@ -3296,7 +3296,7 @@ static int read_memory_bus_v1(struct target *target, target_addr_t address,
32963296 continue ;
32973297 }
32983298
3299- unsigned error = get_field (sbcs_read , DM_SBCS_SBERROR );
3299+ unsigned int error = get_field (sbcs_read , DM_SBCS_SBERROR );
33003300 if (error == DM_SBCS_SBERROR_NONE ) {
33013301 next_address = end_address ;
33023302 } else {
@@ -3535,7 +3535,7 @@ read_memory_abstract(struct target *target, target_addr_t address,
35353535 memset (buffer , 0 , count * size );
35363536
35373537 /* Convert the size (bytes) to width (bits) */
3538- unsigned width = size << 3 ;
3538+ unsigned int width = size << 3 ;
35393539
35403540 /* Create the command (physical address, postincrement, read) */
35413541 uint32_t command = access_memory_command (target , false, width , use_aampostincrement , false);
@@ -3632,7 +3632,7 @@ write_memory_abstract(struct target *target, target_addr_t address,
36323632 size , address );
36333633
36343634 /* Convert the size (bytes) to width (bits) */
3635- unsigned width = size << 3 ;
3635+ unsigned int width = size << 3 ;
36363636
36373637 /* Create the command (physical address, postincrement, write) */
36383638 uint32_t command = access_memory_command (target , false, width , use_aampostincrement , true);
@@ -5047,13 +5047,13 @@ static int select_prepped_harts(struct target *target)
50475047 }
50485048
50495049 assert (dm -> hart_count );
5050- unsigned hawindow_count = (dm -> hart_count + 31 ) / 32 ;
5050+ unsigned int hawindow_count = (dm -> hart_count + 31 ) / 32 ;
50515051 uint32_t * hawindow = calloc (hawindow_count , sizeof (uint32_t ));
50525052 if (!hawindow )
50535053 return ERROR_FAIL ;
50545054
50555055 target_list_t * entry ;
5056- unsigned total_selected = 0 ;
5056+ unsigned int total_selected = 0 ;
50575057 unsigned int selected_index = 0 ;
50585058 list_for_each_entry (entry , & dm -> target_list , list ) {
50595059 struct target * t = entry -> target ;
@@ -5085,7 +5085,7 @@ static int select_prepped_harts(struct target *target)
50855085 return ERROR_FAIL ;
50865086 }
50875087
5088- for (unsigned i = 0 ; i < hawindow_count ; i ++ ) {
5088+ for (unsigned int i = 0 ; i < hawindow_count ; i ++ ) {
50895089 if (dm_write (target , DM_HAWINDOWSEL , i ) != ERROR_OK ) {
50905090 free (hawindow );
50915091 return ERROR_FAIL ;
0 commit comments