Commit 0b25bc5e authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by David Mosberger

[PATCH] ia64: iosapic: rationalize __init/__devinit

Rationalize __init/__devinit attributes.  The noteworthy changes are
that
iosapic_system_init(),
iosapic_init(),
iosapic_register_platform_intr(), and
iosapic_override_isa_irq()
are __init (only called from ACPI __init functions), but
iosapic_lists[],
num_iosapic,
find_iosapic(),
register_intr(),
iosapic_register_intr(), and
acpi_register_irq()
are not because they may be used after init-time by modules.

More detailed analysis:

        iosapic_lists[], num_iosapic: normal, referenced by
                find_iosapic (normal)
                register_intr (normal)
                iosapic_init (__init)

        pcat_compat: __initdata, referenced by
                iosapic_system_init (__init)
                iosapic_init (__init)
                iosapic_parse_prt (__init)

        find_iosapic: normal, called by
                register_intr (normal)

        register_intr: normal, called by
                iosapic_register_intr (normal), called by
                        acpi_register_irq (normal), called by
                                modules (=> can't be __init or __devinit)
                iosapic_register_platform_intr (__init)
                iosapic_override_isa_irq (__init)
                iosapic_parse_prt (__init)

        iosapic_reassign_vector: __init, called by
                iosapic_register_platform_intr (__init), called by
                        acpi_parse_plat_int_src (__init)

        iosapic_system_init: __init, called by
                acpi_parse_madt (__init)

        iosapic_init: __init, called by
                acpi_parse_iosapic (__init)

        iosapic_register_platform_intr: __init, called by
                acpi_parse_plat_int_src (__init)

        iosapic_override_isa_irq: __init, called by
                acpi_parse_int_src_ovr (__init)
                iosapic_init (__init)

        fixup_vector: __init, called by
                iosapic_parse_prt (__init), called by
                        acpi_pci_irq_init (__init)
parent 65f93f19
...@@ -837,7 +837,7 @@ acpi_irq_to_vector (u32 irq) ...@@ -837,7 +837,7 @@ acpi_irq_to_vector (u32 irq)
return gsi_to_vector(irq); return gsi_to_vector(irq);
} }
int __init int
acpi_register_irq (u32 gsi, u32 polarity, u32 trigger) acpi_register_irq (u32 gsi, u32 polarity, u32 trigger)
{ {
int vector = 0; int vector = 0;
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
* 02/07/29 T. Kochi Allocate interrupt vectors dynamically * 02/07/29 T. Kochi Allocate interrupt vectors dynamically
* 02/08/04 T. Kochi Cleaned up terminology (irq, global system interrupt, vector, etc.) * 02/08/04 T. Kochi Cleaned up terminology (irq, global system interrupt, vector, etc.)
* 02/09/20 D. Mosberger Simplified by taking advantage of ACPI's pci_irq code. * 02/09/20 D. Mosberger Simplified by taking advantage of ACPI's pci_irq code.
* 03/02/19 B. Helgaas Make pcat_compat system-wide, not per-IOSAPIC.
* Remove iosapic_address & gsi_base from external interfaces.
* Rationalize __init/__devinit attributes.
*/ */
/* /*
* Here is what the interrupt logic between a PCI device and the kernel looks like: * Here is what the interrupt logic between a PCI device and the kernel looks like:
...@@ -111,17 +114,17 @@ static struct iosapic { ...@@ -111,17 +114,17 @@ static struct iosapic {
char *addr; /* base address of IOSAPIC */ char *addr; /* base address of IOSAPIC */
unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
unsigned short num_rte; /* number of RTE in this IOSAPIC */ unsigned short num_rte; /* number of RTE in this IOSAPIC */
} iosapic_lists[256] __devinitdata; } iosapic_lists[256];
static int num_iosapic = 0; static int num_iosapic;
static unsigned char pcat_compat; /* 8259 compatibility flag */ static unsigned char pcat_compat __initdata; /* 8259 compatibility flag */
/* /*
* Find an IOSAPIC associated with a GSI * Find an IOSAPIC associated with a GSI
*/ */
static inline int __devinit static inline int
find_iosapic (unsigned int gsi) find_iosapic (unsigned int gsi)
{ {
int i; int i;
...@@ -424,7 +427,7 @@ iosapic_version (char *addr) ...@@ -424,7 +427,7 @@ iosapic_version (char *addr)
* if the given vector is already owned by other, * if the given vector is already owned by other,
* assign a new vector for the other and make the vector available * assign a new vector for the other and make the vector available
*/ */
static void static void __init
iosapic_reassign_vector (int vector) iosapic_reassign_vector (int vector)
{ {
int new_vector; int new_vector;
...@@ -516,7 +519,7 @@ iosapic_register_intr (unsigned int gsi, ...@@ -516,7 +519,7 @@ iosapic_register_intr (unsigned int gsi,
* ACPI calls this when it finds an entry for a platform interrupt. * ACPI calls this when it finds an entry for a platform interrupt.
* Note that the irq_base and IOSAPIC address must be set in iosapic_init(). * Note that the irq_base and IOSAPIC address must be set in iosapic_init().
*/ */
int int __init
iosapic_register_platform_intr (u32 int_type, unsigned int gsi, iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
int iosapic_vector, u16 eid, u16 id, int iosapic_vector, u16 eid, u16 id,
unsigned long polarity, unsigned long trigger) unsigned long polarity, unsigned long trigger)
...@@ -565,7 +568,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi, ...@@ -565,7 +568,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
* ACPI calls this when it finds an entry for a legacy ISA IRQ override. * ACPI calls this when it finds an entry for a legacy ISA IRQ override.
* Note that the gsi_base and IOSAPIC address must be set in iosapic_init(). * Note that the gsi_base and IOSAPIC address must be set in iosapic_init().
*/ */
void void __init
iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
unsigned long polarity, unsigned long polarity,
unsigned long trigger) unsigned long trigger)
...@@ -586,7 +589,7 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, ...@@ -586,7 +589,7 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
set_rte(vector, dest); set_rte(vector, dest);
} }
void __devinit void __init
iosapic_system_init (int system_pcat_compat) iosapic_system_init (int system_pcat_compat)
{ {
int vector; int vector;
...@@ -606,7 +609,7 @@ iosapic_system_init (int system_pcat_compat) ...@@ -606,7 +609,7 @@ iosapic_system_init (int system_pcat_compat)
} }
} }
void __devinit void __init
iosapic_init (unsigned long phys_addr, unsigned int gsi_base) iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
{ {
int num_rte; int num_rte;
...@@ -643,7 +646,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base) ...@@ -643,7 +646,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
} }
} }
static void static void __init
fixup_vector (int vector, unsigned int gsi, const char *pci_id) fixup_vector (int vector, unsigned int gsi, const char *pci_id)
{ {
struct hw_interrupt_type *irq_type = &irq_type_iosapic_level; struct hw_interrupt_type *irq_type = &irq_type_iosapic_level;
......
...@@ -51,18 +51,18 @@ ...@@ -51,18 +51,18 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void __devinit iosapic_system_init (int pcat_compat); extern void __init iosapic_system_init (int pcat_compat);
extern void __devinit iosapic_init (unsigned long address, extern void __init iosapic_init (unsigned long address,
unsigned int gsi_base); unsigned int gsi_base);
extern int gsi_to_vector (unsigned int gsi); extern int gsi_to_vector (unsigned int gsi);
extern int gsi_to_irq (unsigned int gsi); extern int gsi_to_irq (unsigned int gsi);
extern void iosapic_parse_prt (void); extern void __init iosapic_parse_prt (void);
extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
unsigned long trigger); unsigned long trigger);
extern void iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, extern void __init iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
unsigned long polarity, unsigned long polarity,
unsigned long trigger); unsigned long trigger);
extern int iosapic_register_platform_intr (u32 int_type, extern int __init iosapic_register_platform_intr (u32 int_type,
unsigned int gsi, unsigned int gsi,
int pmi_vector, int pmi_vector,
u16 eid, u16 id, u16 eid, u16 id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment