Skip to content

main_first_hart does not use provided HLS #16

@plwalsh

Description

@plwalsh

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions