Changeset a35b458 in mainline for kernel/arch/ia32/src/smp/mps.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    7575{
    7676        assert(i < processor_entry_cnt);
    77        
     77
    7878        return processor_entries[i].l_apic_id;
    7979}
     
    8282{
    8383        assert(i < processor_entry_cnt);
    84        
     84
    8585        /*
    8686         * FIXME: The current local APIC driver limits usable
     
    9090        if (i > 7)
    9191                return false;
    92        
     92
    9393        return ((processor_entries[i].cpu_flags & 0x01) == 0x01);
    9494}
     
    9797{
    9898        assert(i < processor_entry_cnt);
    99        
     99
    100100        return ((processor_entries[i].cpu_flags & 0x02) == 0x02);
    101101}
     
    104104{
    105105        size_t i;
    106        
     106
    107107        for (i = 0; i < io_intr_entry_cnt; i++) {
    108108                if (io_intr_entries[i].src_bus_irq == irq &&
     
    110110                        return io_intr_entries[i].dst_io_apic_pin;
    111111        }
    112        
     112
    113113        return -1;
    114114}
     
    131131        unsigned int i;
    132132        uint8_t sum;
    133        
     133
    134134        for (i = 0, sum = 0; i < 16; i++)
    135135                sum = (uint8_t) (sum + base[i]);
    136        
     136
    137137        return (sum == 0);
    138138}
     
    147147        uint8_t sum;
    148148        uint16_t i;
    149        
     149
    150150        /* Compute the checksum for the base table */
    151151        for (i = 0, sum = 0; i < ct->base_table_length; i++)
    152152                sum = (uint8_t) (sum + base[i]);
    153        
     153
    154154        if (sum)
    155155                return false;
    156        
     156
    157157        /* Compute the checksum for the extended table */
    158158        for (i = 0, sum = 0; i < ct->ext_table_length; i++)
    159159                sum = (uint8_t) (sum + ext[i]);
    160        
     160
    161161        return (sum == ct->ext_table_checksum);
    162162}
     
    169169        if ((pr->cpu_flags & (1 << 0)) == 0)
    170170                return;
    171        
     171
    172172        apic_id_mask |= (1 << pr->l_apic_id);
    173173}
     
    177177#ifdef MPSCT_VERBOSE
    178178        char buf[7];
    179        
     179
    180180        memcpy((void *) buf, (void *) bus->bus_type, 6);
    181181        buf[6] = 0;
    182        
     182
    183183        log(LF_ARCH, LVL_DEBUG, "MPS: bus=%" PRIu8 " (%s)", bus->bus_id, buf);
    184184#endif
     
    190190        if ((ioa->io_apic_flags & 1) == 0)
    191191                return;
    192        
     192
    193193        if (io_apic_cnt++ > 0) {
    194194                /*
     
    197197                return;
    198198        }
    199        
     199
    200200        io_apic = (uint32_t *) (uintptr_t) ioa->io_apic;
    201201}
     
    207207        log_begin(LF_ARCH, LVL_DEBUG);
    208208        log_printf("MPS: ");
    209        
     209
    210210        switch (iointr->intr_type) {
    211211        case 0:
     
    222222                break;
    223223        }
    224        
     224
    225225        log_printf(", ");
    226        
     226
    227227        switch (iointr->poel & 3) {
    228228        case 0:
     
    239239                break;
    240240        }
    241        
     241
    242242        log_printf(", ");
    243        
     243
    244244        switch ((iointr->poel >> 2) & 3) {
    245245        case 0:
     
    256256                break;
    257257        }
    258        
     258
    259259        log_printf(", bus=%" PRIu8 " irq=%" PRIu8 " io_apic=%" PRIu8" pin=%"
    260260            PRIu8, iointr->src_bus_id, iointr->src_bus_irq,
     
    270270        log_begin(LF_ARCH, LVL_DEBUG);
    271271        log_printf("MPS: ");
    272        
     272
    273273        switch (lintr->intr_type) {
    274274        case 0:
     
    285285                break;
    286286        }
    287        
     287
    288288        log_printf(", ");
    289        
     289
    290290        switch (lintr->poel & 3) {
    291291        case 0:
     
    302302                break;
    303303        }
    304        
     304
    305305        log_printf(", ");
    306        
     306
    307307        switch ((lintr->poel >> 2) & 3) {
    308308        case 0:
     
    319319                break;
    320320        }
    321        
     321
    322322        log_printf(", bus=%" PRIu8 " irq=%" PRIu8 " l_apic=%" PRIu8" pin=%"
    323323            PRIu8, lintr->src_bus_id, lintr->src_bus_irq,
     
    331331        uint8_t *ext = (uint8_t *) ct + ct->base_table_length;
    332332        uint8_t *cur;
    333        
     333
    334334        for (cur = ext; cur < ext + ct->ext_table_length;
    335335            cur += cur[CT_EXT_ENTRY_LEN]) {
     
    349349                return;
    350350        }
    351        
     351
    352352        if (!mps_ct_check()) {
    353353                log(LF_ARCH, LVL_WARN, "MPS: Wrong ct checksum");
    354354                return;
    355355        }
    356        
     356
    357357        if (ct->oem_table) {
    358358                log(LF_ARCH, LVL_WARN, "MPS: ct->oem_table not supported");
    359359                return;
    360360        }
    361        
     361
    362362        l_apic = (uint32_t *) (uintptr_t) ct->l_apic;
    363        
     363
    364364        uint8_t *cur = &ct->base_table[0];
    365365        uint16_t i;
    366        
     366
    367367        for (i = 0; i < ct->entry_count; i++) {
    368368                switch (*cur) {
     
    411411                }
    412412        }
    413        
     413
    414414        /*
    415415         * Process extended entries.
     
    432432        unsigned int j;
    433433        unsigned int length[2] = { 1024, 64 * 1024 };
    434        
     434
    435435        /*
    436436         * Find MP Floating Pointer Structure
     
    439439         *  2.  search 64K starting at 0xf0000
    440440         */
    441        
     441
    442442        addr[0] = (uint8_t *) PA2KA(ebda ? ebda : 639 * 1024);
    443443        for (i = 0; i < 2; i++) {
     
    450450                }
    451451        }
    452        
     452
    453453        return;
    454        
     454
    455455fs_found:
    456456        log(LF_ARCH, LVL_NOTE, "%p: MPS Floating Pointer Structure", fs);
    457        
     457
    458458        if ((fs->config_type == 0) && (fs->configuration_table)) {
    459459                if (fs->mpfib2 >> 7) {
     
    461461                        return;
    462462                }
    463                
     463
    464464                ct = (struct mps_ct *) PA2KA((uintptr_t) fs->configuration_table);
    465465                configure_via_ct();
    466466        } else
    467467                configure_via_default(fs->config_type);
    468        
     468
    469469        if (processor_entry_cnt > 0)
    470470                config.cpu_count = processor_entry_cnt;
Note: See TracChangeset for help on using the changeset viewer.