Skip to content

Rework register usage in early boot code #99

Open
@danh-arm

Description

@danh-arm

The very early boot code in BL1 and BL3-1 needs to be reviewed regarding register usage. Currently we are relying on all functions collaborating to not step on each other's toes - this needs to be validated.

This task is motivated by the "TODO" comment in plat/fvp/aarch64/bl1_plat_helpers.S:

// TODO: Not a good idea to save lr in a temp reg

LR is saved in x9, which is a caller-saved register according to the AAPCS and thus x9 should be saved by the caller of platform_get_entrypoint(). This is not done currently but BL1 reset code doesn't use x9 so it's OK. Ideally LR should be pushed on the stack but we don't have stack at this point of time.

One solution is to define a convention of register usage in the early boot code (even if it's not AAPCS compliant) and stick to it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions