Subject: CLI and STI for XEN
To: None <port-amd64@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: port-amd64
Date: 12/02/2007 22:34:28
sys/arch/amd64/include/frameasm.h defines macros for STI and CLI
for XEN that use 2 temp registers.
I think the patch below is equivalent - but only uses 1.

--- frameasm.h  22 Nov 2007 16:16:45 -0000      1.8
+++ frameasm.h  2 Dec 2007 22:00:04 -0000
@@ -140,15 +140,13 @@
 #define CLI(reg1,reg2) \
        movl CPUVAR(CPUID),%e/**/reg1 ;                 \
        shlq $6,%r/**/reg1 ;                                    \
-       movq _C_LABEL(HYPERVISOR_shared_info),%r/**/reg2 ;      \
-       addq %r/**/reg1,%r/**/reg2 ;                            \
-       movb $1,EVTCHN_UPCALL_MASK(%r/**/reg2)
+       addq _C_LABEL(HYPERVISOR_shared_info),%r/**/reg1 ;      \
+       movb $1,EVTCHN_UPCALL_MASK(%r/**/reg1)
 #define STI(reg1,reg2) \
        movl CPUVAR(CPUID),%e/**/reg1 ;                 \
        shlq $6,%r/**/reg1 ;                                    \
-       movq _C_LABEL(HYPERVISOR_shared_info),%r/**/reg2 ;      \
-       addq %r/**/reg1,%r/**/reg2 ;                            \
-       movb $0,EVTCHN_UPCALL_MASK(%r/**/reg2)
+       addq _C_LABEL(HYPERVISOR_shared_info),%r/**/reg1 ;      \
+       movb $0,EVTCHN_UPCALL_MASK(%r/**/reg1)
 #else /* XEN */
 #define CLI(reg1,reg2) cli
 #define STI(reg1,reg2) sti

However I don't have a XEN install so can't test it.

	David

-- 
David Laight: david@l8s.co.uk