Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4598
b: refs/heads/master
c: 3b5cc09
h: refs/heads/master
v: v3
  • Loading branch information
Kenji Kaneshige authored and Tony Luck committed Jul 11, 2005
1 parent 01c88e3 commit 7288460
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 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: 699139279d29e36e39d353b0536b510dab2e5ffa
refs/heads/master: 3b5cc09033f49d004006acf44e5b05036bd46a85
6 changes: 4 additions & 2 deletions trunk/arch/ia64/hp/sim/simeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ simeth_probe1(void)
unsigned char mac_addr[ETH_ALEN];
struct simeth_local *local;
struct net_device *dev;
int fd, i, err;
int fd, i, err, rc;

/*
* XXX Fix me
Expand Down Expand Up @@ -228,7 +228,9 @@ simeth_probe1(void)
return err;
}

dev->irq = assign_irq_vector(AUTO_ASSIGN);
if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__);
dev->irq = rc;

/*
* attach the interrupt in the simulator, this does enable interrupts
Expand Down
7 changes: 5 additions & 2 deletions trunk/arch/ia64/hp/sim/simserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ static struct tty_operations hp_ops = {
static int __init
simrs_init (void)
{
int i;
int i, rc;
struct serial_state *state;

if (!ia64_platform_is("hpsim"))
Expand Down Expand Up @@ -1017,7 +1017,10 @@ simrs_init (void)
if (state->type == PORT_UNKNOWN) continue;

if (!state->irq) {
state->irq = assign_irq_vector(AUTO_ASSIGN);
if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
panic("%s: out of interrupt vectors!\n",
__FUNCTION__);
state->irq = rc;
ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
}

Expand Down
13 changes: 9 additions & 4 deletions trunk/arch/ia64/kernel/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,6 @@ static int iosapic_find_sharable_vector (unsigned long trigger, unsigned long po
}
}
}
if (vector < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__);

return vector;
}
Expand All @@ -506,6 +504,8 @@ iosapic_reassign_vector (int vector)

if (!list_empty(&iosapic_intr_info[vector].rtes)) {
new_vector = assign_irq_vector(AUTO_ASSIGN);
if (new_vector < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__);
printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector);
memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector],
sizeof(struct iosapic_intr_info));
Expand Down Expand Up @@ -734,9 +734,12 @@ iosapic_register_intr (unsigned int gsi,
spin_unlock_irqrestore(&iosapic_lock, flags);

/* If vector is running out, we try to find a sharable vector */
vector = assign_irq_vector_nopanic(AUTO_ASSIGN);
if (vector < 0)
vector = assign_irq_vector(AUTO_ASSIGN);
if (vector < 0) {
vector = iosapic_find_sharable_vector(trigger, polarity);
if (vector < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__);
}

spin_lock_irqsave(&irq_descp(vector)->lock, flags);
spin_lock(&iosapic_lock);
Expand Down Expand Up @@ -884,6 +887,8 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
break;
case ACPI_INTERRUPT_INIT:
vector = assign_irq_vector(AUTO_ASSIGN);
if (vector < 0)
panic("%s: out of interrupt vectors!\n", __FUNCTION__);
delivery = IOSAPIC_INIT;
break;
case ACPI_INTERRUPT_CPEI:
Expand Down
15 changes: 2 additions & 13 deletions trunk/arch/ia64/kernel/irq_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,19 @@ EXPORT_SYMBOL(isa_irq_to_vector_map);
static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)];

int
assign_irq_vector_nopanic (int irq)
assign_irq_vector (int irq)
{
int pos, vector;
again:
pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
vector = IA64_FIRST_DEVICE_VECTOR + pos;
if (vector > IA64_LAST_DEVICE_VECTOR)
return -1;
return -ENOSPC;
if (test_and_set_bit(pos, ia64_vector_mask))
goto again;
return vector;
}

int
assign_irq_vector (int irq)
{
int vector = assign_irq_vector_nopanic(irq);

if (vector < 0)
panic("assign_irq_vector: out of interrupt vectors!");

return vector;
}

void
free_irq_vector (int vector)
{
Expand Down
1 change: 0 additions & 1 deletion trunk/include/asm-ia64/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ extern __u8 isa_irq_to_vector_map[16];

extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */

extern int assign_irq_vector_nopanic (int irq); /* allocate a free vector without panic */
extern int assign_irq_vector (int irq); /* allocate a free vector */
extern void free_irq_vector (int vector);
extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
Expand Down

0 comments on commit 7288460

Please sign in to comment.