Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297408
b: refs/heads/master
c: 8abc312
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Mar 28, 2012
1 parent 4ce4685 commit 1347a30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f0750f19789cf352d7e24a6cc50f2ab1b4f1372
refs/heads/master: 8abc3122aa02567bfe626cd13f4d34853c9b1225
13 changes: 9 additions & 4 deletions trunk/arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,20 +383,25 @@ static inline int eilvt_entry_is_changeable(unsigned int old, unsigned int new)

static unsigned int reserve_eilvt_offset(int offset, unsigned int new)
{
unsigned int rsvd; /* 0: uninitialized */
unsigned int rsvd, vector;

if (offset >= APIC_EILVT_NR_MAX)
return ~0;

rsvd = atomic_read(&eilvt_offsets[offset]) & ~APIC_EILVT_MASKED;
rsvd = atomic_read(&eilvt_offsets[offset]);
do {
if (rsvd &&
!eilvt_entry_is_changeable(rsvd, new))
vector = rsvd & ~APIC_EILVT_MASKED; /* 0: unassigned */
if (vector && !eilvt_entry_is_changeable(vector, new))
/* may not change if vectors are different */
return rsvd;
rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new);
} while (rsvd != new);

rsvd &= ~APIC_EILVT_MASKED;
if (rsvd && rsvd != vector)
pr_info("LVT offset %d assigned for vector 0x%02x\n",
offset, rsvd);

return new;
}

Expand Down

0 comments on commit 1347a30

Please sign in to comment.