File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -706,7 +706,7 @@ static int init_target(struct command_context *cmd_ctx,
706706 LOG_DEBUG ("init" );
707707 riscv_info_t * generic_info = (riscv_info_t * ) target -> arch_info ;
708708
709- riscv_info_init (generic_info );
709+ riscv_info_init (target , generic_info );
710710 generic_info -> get_register = & riscv013_get_register ;
711711 generic_info -> set_register = & riscv013_set_register ;
712712 generic_info -> select_current_hart = & riscv013_select_current_hart ;
Original file line number Diff line number Diff line change @@ -872,11 +872,12 @@ struct target_type riscv_target =
872872
873873/*** RISC-V Interface ***/
874874
875- void riscv_info_init (riscv_info_t * r )
875+ void riscv_info_init (struct target * target , riscv_info_t * r )
876876{
877877 memset (r , 0 , sizeof (* r ));
878878 r -> dtm_version = 1 ;
879879 r -> registers_initialized = false;
880+ r -> current_hartid = target -> coreid ;
880881
881882 for (size_t h = 0 ; h < RISCV_MAX_HARTS ; ++ h ) {
882883 r -> xlen [h ] = -1 ;
@@ -1068,10 +1069,7 @@ void riscv_invalidate_register_cache(struct target *target)
10681069int riscv_current_hartid (const struct target * target )
10691070{
10701071 RISCV_INFO (r );
1071- if (riscv_rtos_enabled (target ))
1072- return r -> current_hartid ;
1073- else
1074- return target -> coreid ;
1072+ return r -> current_hartid ;
10751073}
10761074
10771075void riscv_set_all_rtos_harts (struct target * target )
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ int riscv_openocd_deassert_reset(struct target *target);
134134/*** RISC-V Interface ***/
135135
136136/* Initializes the shared RISC-V structure. */
137- void riscv_info_init (riscv_info_t * r );
137+ void riscv_info_init (struct target * target , riscv_info_t * r );
138138
139139/* Run control, possibly for multiple harts. The _all_harts versions resume
140140 * all the enabled harts, which when running in RTOS mode is all the harts on
You can’t perform that action at this time.
0 commit comments