Page MenuHomeFreeBSD

Linux ARM 6/16
AbandonedPublic

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

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

soutade_gmail.com retitled this revision from to Linux ARM 6/16.
soutade_gmail.com updated this object.
soutade_gmail.com edited the test plan for this revision. (Show Details)
soutade_gmail.com set the repository for this revision to rS FreeBSD src repository - subversion.
sys/arm/linux/linux_locore.s
17–18

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

22

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
sys/arm/linux/linux_locore.s
19

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.

42

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

sys/arm/linux/linux_locore.s
19

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

42

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.