This could have been done in r359673, but I didn't think I would return
to this function so soon. Lift these macros from arm64 so we don't need
to worry about the size when inserting new elements.
Details
- Reviewers
kp br markj - Group Reviewers
riscv - Commits
- rS361587: Add macros simplifying the fake preload setup
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/riscv/riscv/machdep.c | ||
---|---|---|
770 ↗ | (On Diff #72080) | BTW, anyone have a clue how this code works on arm/arm64? It would be good to enable or just remove it here as appropriate. sys/arm/include/elf.h has the following hint, but it's not clear enough to me: /* * Magic number for the elf trampoline, chosen wisely to be an immediate * value. */ #define MAGIC_TRAMP_NUMBER 0x5c000003 |
Seems ok to me aside from the comment.
sys/riscv/riscv/machdep.c | ||
---|---|---|
740 ↗ | (On Diff #71974) | I just forgot that riscv permits misaligned memory accesses. I'm not sure that the added roundup by 4 really helps anything? |
sys/riscv/riscv/machdep.c | ||
---|---|---|
740 ↗ | (On Diff #71974) | It permits it, but it may be emulated by M-mode if the hardware doesn't, so it should be avoided where possible as it will be orders of magnitude slower. |
Neat, did you find that somehow or were you already aware of its usage? I'll remove that section in a follow-up.
git blame on the definition in the header to find its introduction, then git log on elf_trampoline.c to find when that got GC'ed.
sys/riscv/riscv/machdep.c | ||
---|---|---|
740 ↗ | (On Diff #71974) | I dropped the rounding in the committed version, it did not change anything for the current set of preload data, and I intend on adding anything smaller than a uint32_t in there. |