Skip to content

Question about tp in kernelvec #410

@unicornx

Description

@unicornx
kernelvec:
        # make room to save registers.
        addi sp, sp, -256

        # save caller-saved registers.
        ......
        sd tp, 24(sp)  // <----------- this line
        ......
        # call the C trap handler in trap.c
        call kerneltrap

        # restore registers.
        ......
        # not tp (contains hartid), in case we moved CPUs
        ......

tp is not restored, why do we still save it?

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