Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131254
b: refs/heads/master
c: 3f4a739
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Feb 9, 2009
1 parent a873cb7 commit 978ccd8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 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: e736ad548db152776de61d7a26805cfae77ce5ce
refs/heads/master: 3f4a739c6accd651a11fcf3c7a20ec8147c42660
6 changes: 6 additions & 0 deletions trunk/arch/x86/include/asm/mpspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
u32 gsi);
extern void mp_config_acpi_legacy_irqs(void);
extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low);
extern int acpi_probe_gsi(void);
#ifdef CONFIG_X86_IO_APIC
extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
u32 gsi, int triggering, int polarity);
Expand All @@ -71,6 +72,11 @@ mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
return 0;
}
#endif
#else /* !CONFIG_ACPI: */
static inline int acpi_probe_gsi(void)
{
return 0;
}
#endif /* CONFIG_ACPI */

#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
Expand Down
23 changes: 23 additions & 0 deletions trunk/arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
nr_ioapics++;
}

int __init acpi_probe_gsi(void)
{
int idx;
int gsi;
int max_gsi = 0;

if (acpi_disabled)
return 0;

if (!acpi_ioapic)
return 0;

max_gsi = 0;
for (idx = 0; idx < nr_ioapics; idx++) {
gsi = mp_ioapic_routing[idx].gsi_end;

if (gsi > max_gsi)
max_gsi = gsi;
}

return max_gsi + 1;
}

static void assign_to_mp_irq(struct mp_config_intsrc *m,
struct mp_config_intsrc *mp_irq)
{
Expand Down
20 changes: 15 additions & 5 deletions trunk/arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3841,14 +3841,24 @@ int __init io_apic_get_redir_entries (int ioapic)

void __init probe_nr_irqs_gsi(void)
{
int idx;
int nr = 0;

for (idx = 0; idx < nr_ioapics; idx++)
nr += io_apic_get_redir_entries(idx) + 1;

if (nr > nr_irqs_gsi)
nr = acpi_probe_gsi();
if (nr > nr_irqs_gsi) {
nr_irqs_gsi = nr;
} else {
/* for acpi=off or acpi is not compiled in */
int idx;

nr = 0;
for (idx = 0; idx < nr_ioapics; idx++)
nr += io_apic_get_redir_entries(idx) + 1;

if (nr > nr_irqs_gsi)
nr_irqs_gsi = nr;
}

printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
}

/* --------------------------------------------------------------------------
Expand Down

0 comments on commit 978ccd8

Please sign in to comment.