diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-05-12 15:54:24 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-05-12 15:54:24 +0000 |
commit | c9cbf814f77829b03cf273042c147b4ef754e939 (patch) | |
tree | ba86fe2ad548b575e5dd835aadbbd7ec09682599 /xenolinux-2.4.26-sparse/arch | |
parent | 95e7814b6642863a49ad38d6a64b7eedde195b71 (diff) | |
download | xen-c9cbf814f77829b03cf273042c147b4ef754e939.tar.gz xen-c9cbf814f77829b03cf273042c147b4ef754e939.tar.bz2 xen-c9cbf814f77829b03cf273042c147b4ef754e939.zip |
bitkeeper revision 1.891.1.12 (40a248b0WTGoOa9206iWkyGN0mTPNw)
Allow forcing of IRQ trigger-type to edge or level
(NB. DANGEROUS!).
Diffstat (limited to 'xenolinux-2.4.26-sparse/arch')
-rw-r--r-- | xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c | 6 | ||||
-rw-r--r-- | xenolinux-2.4.26-sparse/arch/xen/kernel/evtchn.c | 21 |
2 files changed, 24 insertions, 3 deletions
diff --git a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c index 62a4adf27d..8178608959 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c @@ -116,12 +116,14 @@ int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev) /* * We do not copy the packet unless: - * 1. It is fragmented; or + * 1. The data is shared; or * 2. It spans a page boundary; or * 3. We cannot be sure the whole data page is allocated. * The copying method is taken from skb_copy(). + * NB. We also couldn't cope with fragmented packets, but we won't get + * any because we not advertise the NETIF_F_SG feature. */ - if ( (skb_shinfo(skb)->nr_frags != 0) || + if ( skb_shared(skb) || skb_cloned(skb) || (((unsigned long)skb->end ^ (unsigned long)skb->head) & PAGE_MASK) || ((skb->end - skb->head) < (PAGE_SIZE/2)) ) { diff --git a/xenolinux-2.4.26-sparse/arch/xen/kernel/evtchn.c b/xenolinux-2.4.26-sparse/arch/xen/kernel/evtchn.c index 1d70d00bb5..fc6f22fc34 100644 --- a/xenolinux-2.4.26-sparse/arch/xen/kernel/evtchn.c +++ b/xenolinux-2.4.26-sparse/arch/xen/kernel/evtchn.c @@ -36,6 +36,9 @@ static int virq_to_irq[NR_VIRQS]; /* Reference counts for bindings to IRQs. */ static int irq_bindcount[NR_IRQS]; +/* Bitmap indicating which PIRQs require Xen to be notified on unmask. */ +static unsigned long pirq_needs_unmask_notify[NR_PIRQS/sizeof(unsigned long)]; + /* Upcall to generic IRQ layer. */ extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs); @@ -234,8 +237,22 @@ static struct hw_interrupt_type dynirq_type = { static inline void pirq_unmask_notify(int pirq) { physdev_op_t op; - op.cmd = PHYSDEVOP_UNMASK_IRQ; + if ( unlikely(test_bit(pirq, &pirq_needs_unmask_notify[0])) ) + { + op.cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY; + (void)HYPERVISOR_physdev_op(&op); + } +} + +static inline void pirq_query_unmask(int pirq) +{ + physdev_op_t op; + op.cmd = PHYSDEVOP_IRQ_STATUS_QUERY; + op.u.irq_status_query.irq = pirq; (void)HYPERVISOR_physdev_op(&op); + clear_bit(pirq, &pirq_needs_unmask_notify[0]); + if ( op.u.irq_status_query.flags & PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY ) + set_bit(pirq, &pirq_needs_unmask_notify[0]); } /* @@ -261,6 +278,8 @@ static unsigned int startup_pirq(unsigned int irq) } evtchn = op.u.bind_pirq.port; + pirq_query_unmask(irq_to_pirq(irq)); + evtchn_to_irq[evtchn] = irq; irq_to_evtchn[irq] = evtchn; |