Thread (51 messages) 51 messages, 8 authors, 2012-03-09

[PATCH-WIP 01/13] xen/arm: use r12 to pass the hypercall number to the hypervisor

From: Russell King - ARM Linux <hidden>
Date: 2012-03-01 10:14:02
Also in: kvm, lkml, xen-devel

On Wed, Feb 29, 2012 at 02:44:24PM +0000, Ian Campbell wrote:
quoted
If you need a specific register, this means that you must set up that
register explicitly inside the asm if you want a guarantee that the
code will work:

	asm volatile (
		"movw	r12, %[hvc_num]\n\t"
Is gcc (or gas?) smart enough to optimise this away if it turns out that
%[hvc_num] == r12?
No, and it won't do, because %[hvc_num] is specified in these operands:
quoted
		...
		"hvc	#0"
		:: [hvc_num] "i" (NUMBER) : "r12"
to be an integer, not a register.
How are system calls implemented on the userspace side? I confess I
don't know what the ARM syscall ABI looks like -- is it all registers or
is some of it on the stack? It sounds like the solution ought to be
pretty similar though.
All registers.  We have a few which take a pointer to an in memory array,
but those are for some old multiplexed syscalls.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help