diff options
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index cf27795c641c..ff1759a1128e 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -853,9 +853,9 @@ __setup("pirq=", ioapic_pirq_setup); | |||
853 | static struct IO_APIC_route_entry *early_ioapic_entries[MAX_IO_APICS]; | 853 | static struct IO_APIC_route_entry *early_ioapic_entries[MAX_IO_APICS]; |
854 | 854 | ||
855 | /* | 855 | /* |
856 | * Saves and masks all the unmasked IO-APIC RTE's | 856 | * Saves all the IO-APIC RTE's |
857 | */ | 857 | */ |
858 | int save_mask_IO_APIC_setup(void) | 858 | int save_IO_APIC_setup(void) |
859 | { | 859 | { |
860 | union IO_APIC_reg_01 reg_01; | 860 | union IO_APIC_reg_01 reg_01; |
861 | unsigned long flags; | 861 | unsigned long flags; |
@@ -880,16 +880,9 @@ int save_mask_IO_APIC_setup(void) | |||
880 | } | 880 | } |
881 | 881 | ||
882 | for (apic = 0; apic < nr_ioapics; apic++) | 882 | for (apic = 0; apic < nr_ioapics; apic++) |
883 | for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { | 883 | for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) |
884 | struct IO_APIC_route_entry entry; | 884 | early_ioapic_entries[apic][pin] = |
885 | |||
886 | entry = early_ioapic_entries[apic][pin] = | ||
887 | ioapic_read_entry(apic, pin); | 885 | ioapic_read_entry(apic, pin); |
888 | if (!entry.mask) { | ||
889 | entry.mask = 1; | ||
890 | ioapic_write_entry(apic, pin, entry); | ||
891 | } | ||
892 | } | ||
893 | 886 | ||
894 | return 0; | 887 | return 0; |
895 | 888 | ||
@@ -902,6 +895,25 @@ nomem: | |||
902 | return -ENOMEM; | 895 | return -ENOMEM; |
903 | } | 896 | } |
904 | 897 | ||
898 | void mask_IO_APIC_setup(void) | ||
899 | { | ||
900 | int apic, pin; | ||
901 | |||
902 | for (apic = 0; apic < nr_ioapics; apic++) { | ||
903 | if (!early_ioapic_entries[apic]) | ||
904 | break; | ||
905 | for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { | ||
906 | struct IO_APIC_route_entry entry; | ||
907 | |||
908 | entry = early_ioapic_entries[apic][pin]; | ||
909 | if (!entry.mask) { | ||
910 | entry.mask = 1; | ||
911 | ioapic_write_entry(apic, pin, entry); | ||
912 | } | ||
913 | } | ||
914 | } | ||
915 | } | ||
916 | |||
905 | void restore_IO_APIC_setup(void) | 917 | void restore_IO_APIC_setup(void) |
906 | { | 918 | { |
907 | int apic, pin; | 919 | int apic, pin; |