Changeset 7f043c0 in mainline for kernel/arch/ia32/src/smp/smp.c


Ignore:
Timestamp:
2007-05-31T21:39:13Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7bb0c32
Parents:
d8431986
Message:

fix ICC compilation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/smp/smp.c

    rd8431986 r7f043c0  
    9999 * as an initialization stack for each AP.)
    100100 */
    101 void kmp(void *arg)
     101void kmp(void *arg __attribute__((unused)))
    102102{
    103103        unsigned int i;
     
    113113         * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot()
    114114         */
    115         *((uint16_t *) (PA2KA(0x467 + 0))) =  ((uintptr_t) ap_boot) >> 4;       /* segment */
    116         *((uint16_t *) (PA2KA(0x467 + 2))) =  0;                                /* offset */
     115        *((uint16_t *) (PA2KA(0x467 + 0))) = (uint16_t) (((uintptr_t) ap_boot) >> 4);   /* segment */
     116        *((uint16_t *) (PA2KA(0x467 + 2))) = 0;                         /* offset */
    117117       
    118118        /*
     
    125125        pic_disable_irqs(0xffff);
    126126        apic_init();
     127       
     128        uint8_t apic = l_apic_id();
    127129
    128130        for (i = 0; i < ops->cpu_count(); i++) {
     
    141143                        continue;
    142144
    143                 if (ops->cpu_apic_id(i) == l_apic_id()) {
    144                         printf("%s: bad processor entry #%d, will not send IPI to myself\n", __FUNCTION__, i);
     145                if (ops->cpu_apic_id(i) == apic) {
     146                        printf("%s: bad processor entry #%u, will not send IPI to myself\n", __FUNCTION__, i);
    145147                        continue;
    146148                }
     
    149151                 * Prepare new GDT for CPU in question.
    150152                 */
    151                 if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor), FRAME_ATOMIC)))
     153                if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS * sizeof(struct descriptor), FRAME_ATOMIC)))
    152154                        panic("couldn't allocate memory for GDT\n");
    153155
     
    164166                         * supposed to wake us up.
    165167                         */
    166                         if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT)
    167                                 printf("%s: waiting for cpu%d (APIC ID = %d) timed out\n", __FUNCTION__, config.cpu_active > i ? config.cpu_active : i, ops->cpu_apic_id(i));
     168                        if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT) {
     169                                unsigned int cpu = (config.cpu_active > i) ? config.cpu_active : i;
     170                                printf("%s: waiting for cpu%u (APIC ID = %d) timed out\n", __FUNCTION__, cpu, ops->cpu_apic_id(i));
     171                        }
    168172                } else
    169173                        printf("INIT IPI for l_apic%d failed\n", ops->cpu_apic_id(i));
Note: See TracChangeset for help on using the changeset viewer.