Page MenuHomeFreeBSD

Linux ARM 6/16

Authored by on Jun 8 2016, 2:48 PM.



Linux ARM : Add linux_locore.s that contains a translation in ARM assembler of linux_sigcode(), linux_rt_sigcode() and linux_vsyscall() functions

Diff Detail

rS FreeBSD src repository - subversion
Lint Skipped
Unit Tests Skipped

Event Timeline retitled this revision from to Linux ARM 6/16. updated this object. edited the test plan for this revision. (Show Details) set the repository for this revision to rS FreeBSD src repository - subversion.

Which instruction do you expect lr to point to? pc on ARM doesn't point to the current instruction, but one 8 bytes later.


This should be #LINUX_SYS_linux_sigreturn

Rework linux_sigcode() and linux_rt_sigcode() after andrew comments

  • Use # instead of $ (but $ seems to works too)
  • Bad computation of return address (that should be the instruction following branch one)
  • Frame was taken from r0, but it should be take from sp

I don't think b [r1] does what you think it does. The b instruction will only branch to a label, not a register value. For armv6 you could use the blx instruction to branch to an address in a register. This will save lr so there would be no need calculate it.


How is this called? r7 is callee saved so if it's called directly you will need to backup this value. FreeBSD uses the same calling convention. The libc part of it is in lib/libc/arm/SYS.h


You're right. After looking at disassembly, it seems the compiler does the job by itself. I'll will change it.


Regarding the documentation in depth, it seems that ARM architecture doesn't needs vsyscall support in vDSO. I'll drop it.

Rework linux_locore.s. Now linux_sigcode() and linux_rt_sigcode() are simpler because all parameters all pre positioned in linux_sysvec.c while precedent implementation was just a translation.