Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234756
b: refs/heads/master
c: d5eb4ad
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Feb 19, 2011
1 parent 6feb359 commit 9123fa2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 091738a266fc74329ae186f22ff2b3f01319112d
refs/heads/master: d5eb4ad2dfb2dfae43fd51bc8630b4fc3ef00e92
28 changes: 28 additions & 0 deletions trunk/kernel/irq/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,34 @@ static inline void chip_bus_sync_unlock(struct irq_desc *desc)
desc->irq_data.chip->irq_bus_sync_unlock(&desc->irq_data);
}

struct irq_desc *
__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus);
void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus);

static inline struct irq_desc *
irq_get_desc_buslock(unsigned int irq, unsigned long *flags)
{
return __irq_get_desc_lock(irq, flags, true);
}

static inline void
irq_put_desc_busunlock(struct irq_desc *desc, unsigned long flags)
{
__irq_put_desc_unlock(desc, flags, true);
}

static inline struct irq_desc *
irq_get_desc_lock(unsigned int irq, unsigned long *flags)
{
return __irq_get_desc_lock(irq, flags, false);
}

static inline void
irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags)
{
__irq_put_desc_unlock(desc, flags, false);
}

/*
* Manipulation functions for irq_data.state
*/
Expand Down
20 changes: 20 additions & 0 deletions trunk/kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,26 @@ unsigned int irq_get_next_irq(unsigned int offset)
return find_next_bit(allocated_irqs, nr_irqs, offset);
}

struct irq_desc *
__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus)
{
struct irq_desc *desc = irq_to_desc(irq);

if (desc) {
if (bus)
chip_bus_lock(desc);
raw_spin_lock_irqsave(&desc->lock, *flags);
}
return desc;
}

void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
{
raw_spin_unlock_irqrestore(&desc->lock, flags);
if (bus)
chip_bus_sync_unlock(desc);
}

/**
* dynamic_irq_cleanup - cleanup a dynamically allocated irq
* @irq: irq number to initialize
Expand Down

0 comments on commit 9123fa2

Please sign in to comment.