Changeset 99718a2e in mainline for kernel/arch/ia32/src/smp/apic.c


Ignore:
Timestamp:
2010-06-30T20:42:42Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
873c681
Parents:
50f4b95
Message:

improve code readability

File:
1 edited

Legend:

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

    r50f4b95 r99718a2e  
    7676
    7777uint32_t apic_id_mask = 0;
     78uint8_t bsp_l_apic = 0;
     79
    7880static irq_t l_apic_timer_irq;
    7981
     
    154156}
    155157
     158/** Get Local APIC ID.
     159 *
     160 * @return Local APIC ID.
     161 *
     162 */
     163static uint8_t l_apic_id(void)
     164{
     165        l_apic_id_t idreg;
     166       
     167        idreg.value = l_apic[L_APIC_ID];
     168        return idreg.apic_id;
     169}
     170
    156171/** Initialize APIC on BSP. */
    157172void apic_init(void)
     
    208223        l_apic_init();
    209224        l_apic_debug();
     225       
     226        bsp_l_apic = l_apic_id();
    210227}
    211228
     
    460477{
    461478#ifdef LAPIC_VERBOSE
    462         printf("LVT on cpu%" PRIs ", LAPIC ID: %" PRIu8 "\n", CPU->id, l_apic_id());
     479        printf("LVT on cpu%" PRIs ", LAPIC ID: %" PRIu8 "\n",
     480            CPU->id, l_apic_id());
    463481       
    464482        lvt_tm_t tm;
    465483        tm.value = l_apic[LVT_Tm];
    466         printf("LVT Tm: vector=%hhd, %s, %s, %s\n", tm.vector, delivs_str[tm.delivs], mask_str[tm.masked], tm_mode_str[tm.mode]);
     484        printf("LVT Tm: vector=%" PRIu8 ", %s, %s, %s\n",
     485            tm.vector, delivs_str[tm.delivs], mask_str[tm.masked],
     486            tm_mode_str[tm.mode]);
    467487       
    468488        lvt_lint_t lint;
    469489        lint.value = l_apic[LVT_LINT0];
    470         printf("LVT LINT0: vector=%hhd, %s, %s, %s, irr=%d, %s, %s\n", tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs], intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode], mask_str[lint.masked]);
    471         lint.value = l_apic[LVT_LINT1];
    472         printf("LVT LINT1: vector=%hhd, %s, %s, %s, irr=%d, %s, %s\n", tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs], intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode], mask_str[lint.masked]); 
     490        printf("LVT LINT0: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",
     491            tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs],
     492            intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode],
     493            mask_str[lint.masked]);
     494       
     495        lint.value = l_apic[LVT_LINT1];
     496        printf("LVT LINT1: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",
     497            tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs],
     498            intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode],
     499            mask_str[lint.masked]);
    473500       
    474501        lvt_error_t error;
    475502        error.value = l_apic[LVT_Err];
    476         printf("LVT Err: vector=%hhd, %s, %s\n", error.vector, delivs_str[error.delivs], mask_str[error.masked]);
     503        printf("LVT Err: vector=%" PRIu8 ", %s, %s\n", error.vector,
     504            delivs_str[error.delivs], mask_str[error.masked]);
    477505#endif
    478 }
    479 
    480 /** Get Local APIC ID.
    481  *
    482  * @return Local APIC ID.
    483  *
    484  */
    485 uint8_t l_apic_id(void)
    486 {
    487         l_apic_id_t idreg;
    488        
    489         idreg.value = l_apic[L_APIC_ID];
    490         return idreg.apic_id;
    491506}
    492507
Note: See TracChangeset for help on using the changeset viewer.