Ignore:
Timestamp:
Jul 4, 2017, 10:17:44 AM (7 years ago)
Author:
max@…
Message:

improve the APIC implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_init.c

    r135 r137  
    8484static void init_bootinfo_icu(boot_device_t *dev)
    8585{
     86        extern uint32_t hwi_baseidx;
     87        extern uint32_t wti_baseidx;
     88        extern uint32_t pti_baseidx;
     89        extern size_t ioapic_pins;
     90
    8691        memset(dev, 0, sizeof(boot_device_t));
    8792
    88         dev->base = NULL; /* XXX */
     93        dev->base = 0;
    8994        dev->type = (DEV_FUNC_ICU << 16) | IMPL_ICU_XCU;
    9095        dev->channels = 1;
    91         dev->param0 = 0;
    92         dev->param1 = 0;
    93         dev->param2 = 0;
     96
     97        /*
     98         * Give 20% of the pins to HWI, 80% to WTI.
     99         */
     100        dev->param0 = (ioapic_pins * 20) / 100;  /* hwi_nr */
     101        dev->param1 = ioapic_pins - dev->param0; /* wti_nr */
     102
     103        /*
     104         * We always set 1 for pti_nr. On x86, timer interrupts are handled by
     105         * LAPIC, which is per-cpu and not global. Therefore, we always have one
     106         * timer for each CPU, and its IRQ number is faked to 0.
     107         */
     108        dev->param2 = 1; /* pti_nr */
     109
    94110        dev->param3 = 0;
     111
     112        /* Set the base idx for the XCU driver */
     113        hwi_baseidx = 0;
     114        wti_baseidx = dev->param0;
     115        pti_baseidx = 0xFFFFFFFF;
    95116
    96117#ifdef NOTYET
     
    132153        size_t i, rsvd_nr;
    133154
    134         memset(rsvd, 0, sizeof(boot_rsvd_t));
     155        memset(rsvd, 0, sizeof(boot_rsvd_t) * CONFIG_PPM_MAX_RSVD);
    135156
    136157        i = 0, rsvd_nr = 0;
     
    208229        init_bootinfo_core(&info->core[0]);
    209230
    210         info->rsvd_nr = init_bootinfo_rsvd(&info->rsvd);
     231        info->rsvd_nr = init_bootinfo_rsvd((boot_rsvd_t *)&info->rsvd);
    211232
    212233        init_bootinfo_icu(&info->dev_icu);
Note: See TracChangeset for help on using the changeset viewer.