Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main_first_hart does not use provided HLS #16

Open
plwalsh opened this issue Jan 4, 2023 · 0 comments
Open

main_first_hart does not use provided HLS #16

plwalsh opened this issue Jan 4, 2023 · 0 comments

Comments

@plwalsh
Copy link

plwalsh commented Jan 4, 2023

Why does main_first_hart() take in a pointer to the HLS from the caller, but then overwrite its value to be hard-coded to the HLS for hart0?

stack_top = (ptrdiff_t)((uint8_t*)&__stack_top_h0$);
hls = (HLS_DATA*)(stack_top - HLS_DEBUG_AREA_SIZE);

That HLS pointer for hart0 then gets passed into main_other_hart() to kick off the hart entry-point function, even if the specified "first hart" is not hart0.

And similarly for main_first_hart_app(), the HLS is passed in, but then overwritten to be hard-coded to the HLS for hart1. And that value is then passed into main_other_hart():

stack_top = (ptrdiff_t)((uint8_t*)&__stack_top_h1$);
hls = (HLS_DATA*)(stack_top - HLS_DEBUG_AREA_SIZE);
hls->in_wfi_indicator = HLS_MAIN_HART_FIN_INIT;
(void)main_other_hart(hls);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant