Page MenuHomeFreeBSD

locore.S: prepare for C function calls earlier
Needs ReviewPublic

Authored by mhorne on Tue, Nov 5, 8:42 PM.

Details

Reviewers
br
jrtc27
jhb
Group Reviewers
riscv
Summary

First, set the stack pointer right away, and zero the frame pointer.

Second, switch the boot argument registers to the unused s3 and s4. This
ensures the values will not be clobbered by function calls; they are
consumed late in the assembly routine.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60409
Build 57293: arc lint + arc unit

Event Timeline

As with D47458, C code should not be run prior to enabling translation so we're running at the right address, so IMO this patch is a sign of going down the wrong road. Yes, Linux does horrendously fragile things like this, but that doesn't mean we should do the same.