Rev 1760 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1760 | Rev 1766 | ||
|---|---|---|---|
| Line 59... | Line 59... | ||
| 59 | 59 | ||
| 60 | static struct smp_config_operations *ops = NULL; |
60 | static struct smp_config_operations *ops = NULL; |
| 61 | 61 | ||
| 62 | void smp_init(void) |
62 | void smp_init(void) |
| 63 | { |
63 | { |
| 64 | int status; |
- | |
| 65 | __address l_apic_address, io_apic_address; |
64 | __address l_apic_address, io_apic_address; |
| 66 | 65 | ||
| 67 | if (acpi_madt) { |
66 | if (acpi_madt) { |
| 68 | acpi_madt_parse(); |
67 | acpi_madt_parse(); |
| 69 | ops = &madt_config_operations; |
68 | ops = &madt_config_operations; |
| Line 71... | Line 70... | ||
| 71 | if (config.cpu_count == 1) { |
70 | if (config.cpu_count == 1) { |
| 72 | mps_init(); |
71 | mps_init(); |
| 73 | ops = &mps_config_operations; |
72 | ops = &mps_config_operations; |
| 74 | } |
73 | } |
| 75 | 74 | ||
| 76 | l_apic_address = (__address) frame_alloc_rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status); |
75 | l_apic_address = (__address) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
| 77 | if (status != FRAME_OK) |
76 | if (!l_apic_address) |
| 78 | panic("cannot allocate address for l_apic\n"); |
77 | panic("cannot allocate address for l_apic\n"); |
| 79 | 78 | ||
| 80 | io_apic_address = (__address) frame_alloc_rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status); |
79 | io_apic_address = (__address) frame_alloc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA); |
| 81 | if (status != FRAME_OK) |
80 | if (!io_apic_address) |
| 82 | panic("cannot allocate address for io_apic\n"); |
81 | panic("cannot allocate address for io_apic\n"); |
| 83 | 82 | ||
| 84 | if (config.cpu_count > 1) { |
83 | if (config.cpu_count > 1) { |
| 85 | page_mapping_insert(AS_KERNEL, l_apic_address, (__address) l_apic, |
84 | page_mapping_insert(AS_KERNEL, l_apic_address, (__address) l_apic, |
| 86 | PAGE_NOT_CACHEABLE); |
85 | PAGE_NOT_CACHEABLE); |