Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

help with assembly (2)



Hi,
Again I'm stuck with some assembly code (I don't know much about i386 assembly,
and I've never mixed assembly and C). I have this code in xen/i386/vector.S:
#define hypervisor_asm_unmask(num)                      \
        movl    irq_to_evtchn + (num) * 4,%ecx          ;\
        movl    HYPERVISOR_shared_info,%eax             ;\
        lock                                            ;\
        btrl    %ecx,EVENTS_MASK(%eax)
(BTW, what does the "lock" instruction ?)
I need to add a call to this C function at the end of this asm
statement:
        pirq_notify(num)
num being a constant. The prototype for the function is:
void pirq_notify(int irq);

I tried
                pushl   $(num)                                  ;\
                call    _C_LABEL(pirq_notify) 
but I get a page fault trap at the first call, with something that doesn't
make much sense on the stack. So I guess I missed something, but I don't
know what ... I assume registers are callee-saved, but maybe I'm wrong
on this.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--



Home | Main Index | Thread Index | Old Index