Rev 2089 | Rev 2101 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2089 | Rev 2095 | ||
---|---|---|---|
Line 75... | Line 75... | ||
75 | struct __bus_entry *bus_entries = NULL; |
75 | struct __bus_entry *bus_entries = NULL; |
76 | struct __io_apic_entry *io_apic_entries = NULL; |
76 | struct __io_apic_entry *io_apic_entries = NULL; |
77 | struct __io_intr_entry *io_intr_entries = NULL; |
77 | struct __io_intr_entry *io_intr_entries = NULL; |
78 | struct __l_intr_entry *l_intr_entries = NULL; |
78 | struct __l_intr_entry *l_intr_entries = NULL; |
79 | 79 | ||
80 | int processor_entry_cnt = 0; |
80 | unsigned int processor_entry_cnt = 0; |
81 | int bus_entry_cnt = 0; |
81 | unsigned int bus_entry_cnt = 0; |
82 | int io_apic_entry_cnt = 0; |
82 | unsigned int io_apic_entry_cnt = 0; |
83 | int io_intr_entry_cnt = 0; |
83 | unsigned int io_intr_entry_cnt = 0; |
84 | int l_intr_entry_cnt = 0; |
84 | unsigned int l_intr_entry_cnt = 0; |
85 | 85 | ||
86 | /* |
86 | /* |
87 | * Implementation of IA-32 SMP configuration interface. |
87 | * Implementation of IA-32 SMP configuration interface. |
88 | */ |
88 | */ |
89 | static count_t get_cpu_count(void); |
89 | static count_t get_cpu_count(void); |
Line 127... | Line 127... | ||
127 | /* |
127 | /* |
128 | * Used to check the integrity of the MP Floating Structure. |
128 | * Used to check the integrity of the MP Floating Structure. |
129 | */ |
129 | */ |
130 | int mps_fs_check(uint8_t *base) |
130 | int mps_fs_check(uint8_t *base) |
131 | { |
131 | { |
132 | int i; |
132 | unsigned int i; |
133 | uint8_t sum; |
133 | uint8_t sum; |
134 | 134 | ||
135 | for (i = 0, sum = 0; i < 16; i++) |
135 | for (i = 0, sum = 0; i < 16; i++) |
136 | sum += base[i]; |
136 | sum += base[i]; |
137 | 137 | ||
Line 163... | Line 163... | ||
163 | } |
163 | } |
164 | 164 | ||
165 | void mps_init(void) |
165 | void mps_init(void) |
166 | { |
166 | { |
167 | uint8_t *addr[2] = { NULL, (uint8_t *) PA2KA(0xf0000) }; |
167 | uint8_t *addr[2] = { NULL, (uint8_t *) PA2KA(0xf0000) }; |
168 | int i, j, length[2] = { 1024, 64*1024 }; |
168 | unsigned int i, j, length[2] = { 1024, 64 * 1024 }; |
169 | 169 | ||
170 | 170 | ||
171 | /* |
171 | /* |
172 | * Find MP Floating Pointer Structure |
172 | * Find MP Floating Pointer Structure |
173 | * 1a. search first 1K of EBDA |
173 | * 1a. search first 1K of EBDA |
Line 206... | Line 206... | ||
206 | } |
206 | } |
207 | 207 | ||
208 | int configure_via_ct(void) |
208 | int configure_via_ct(void) |
209 | { |
209 | { |
210 | uint8_t *cur; |
210 | uint8_t *cur; |
211 | int i, cnt; |
211 | unsigned int i, cnt; |
212 | 212 | ||
213 | if (ct->signature != CT_SIGNATURE) { |
213 | if (ct->signature != CT_SIGNATURE) { |
214 | printf("%s: bad ct->signature\n", __FUNCTION__); |
214 | printf("%s: bad ct->signature\n", __FUNCTION__); |
215 | return 1; |
215 | return 1; |
216 | } |
216 | } |
Line 318... | Line 318... | ||
318 | #endif |
318 | #endif |
319 | } |
319 | } |
320 | 320 | ||
321 | void ct_io_apic_entry(struct __io_apic_entry *ioa) |
321 | void ct_io_apic_entry(struct __io_apic_entry *ioa) |
322 | { |
322 | { |
323 | static int io_apic_count = 0; |
323 | static unsigned int io_apic_count = 0; |
324 | 324 | ||
325 | /* this ioapic is marked unusable */ |
325 | /* this ioapic is marked unusable */ |
326 | if ((ioa->io_apic_flags & 1) == 0) |
326 | if ((ioa->io_apic_flags & 1) == 0) |
327 | return; |
327 | return; |
328 | 328 | ||
Line 413... | Line 413... | ||
413 | } |
413 | } |
414 | } |
414 | } |
415 | 415 | ||
416 | int mps_irq_to_pin(int irq) |
416 | int mps_irq_to_pin(int irq) |
417 | { |
417 | { |
418 | int i; |
418 | unsigned int i; |
419 | 419 | ||
420 | for(i=0;i<io_intr_entry_cnt;i++) { |
420 | for(i = 0; i < io_intr_entry_cnt; i++) { |
421 | if (io_intr_entries[i].src_bus_irq == irq && io_intr_entries[i].intr_type == 0) |
421 | if (io_intr_entries[i].src_bus_irq == irq && io_intr_entries[i].intr_type == 0) |
422 | return io_intr_entries[i].dst_io_apic_pin; |
422 | return io_intr_entries[i].dst_io_apic_pin; |
423 | } |
423 | } |
424 | 424 | ||
425 | return -1; |
425 | return -1; |