Changeset 8565a42 in mainline for kernel/generic/src/interrupt


Ignore:
Timestamp:
2018-03-02T20:34:50Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r3061bc1 r8565a42  
    7878        assert(n < IVT_ITEMS);
    7979#endif
    80        
     80
    8181        irq_spinlock_lock(&exctbl_lock, true);
    82        
     82
    8383        iroutine_t old = exc_table[n].handler;
    8484        exc_table[n].handler = handler;
     
    8787        exc_table[n].cycles = 0;
    8888        exc_table[n].count = 0;
    89        
     89
    9090        irq_spinlock_unlock(&exctbl_lock, true);
    91        
     91
    9292        return old;
    9393}
     
    104104        assert(n < IVT_ITEMS);
    105105#endif
    106        
     106
    107107        /* Account user cycles */
    108108        if (THREAD) {
     
    111111                irq_spinlock_unlock(&THREAD->lock, false);
    112112        }
    113        
     113
    114114        /* Account CPU usage if it woke up from sleep */
    115115        if (CPU && CPU->idle) {
     
    121121                irq_spinlock_unlock(&CPU->lock, false);
    122122        }
    123        
     123
    124124        uint64_t begin_cycle = get_cycle();
    125        
     125
    126126#ifdef CONFIG_UDEBUG
    127127        if (THREAD)
    128128                THREAD->udebug.uspace_state = istate;
    129129#endif
    130        
     130
    131131        exc_table[n].handler(n + IVT_FIRST, istate);
    132        
     132
    133133#ifdef CONFIG_UDEBUG
    134134        if (THREAD)
    135135                THREAD->udebug.uspace_state = NULL;
    136136#endif
    137        
     137
    138138        /* This is a safe place to exit exiting thread */
    139139        if ((THREAD) && (THREAD->interrupted) && (istate_from_uspace(istate)))
    140140                thread_exit();
    141        
     141
    142142        /* Account exception handling */
    143143        uint64_t end_cycle = get_cycle();
    144        
     144
    145145        irq_spinlock_lock(&exctbl_lock, false);
    146146        exc_table[n].cycles += end_cycle - begin_cycle;
    147147        exc_table[n].count++;
    148148        irq_spinlock_unlock(&exctbl_lock, false);
    149        
     149
    150150        /* Do not charge THREAD for exception cycles */
    151151        if (THREAD) {
     
    171171            "program counter %p.\n", TASK->name, TASK->taskid,
    172172            (void *) istate_get_pc(istate));
    173        
     173
    174174        istate_decode(istate);
    175175        stack_trace_istate(istate);
    176        
     176
    177177        printf("Kill message: ");
    178178        vprintf(fmt, args);
    179179        printf("\n");
    180        
     180
    181181        task_kill_self(true);
    182182}
     
    201201        if (!istate_from_uspace(istate))
    202202                return;
    203        
     203
    204204        va_list args;
    205205        va_start(args, fmt);
     
    236236{
    237237        bool excs_all;
    238        
     238
    239239        if (str_cmp(flag_buf, "-a") == 0)
    240240                excs_all = true;
     
    245245                return 1;
    246246        }
    247        
     247
    248248#if (IVT_ITEMS > 0)
    249249        unsigned int i;
    250250        unsigned int rows;
    251        
     251
    252252        irq_spinlock_lock(&exctbl_lock, true);
    253        
     253
    254254#ifdef __32_BITS__
    255255        printf("[exc   ] [description       ] [count   ] [cycles  ]"
     
    257257        rows = 1;
    258258#endif
    259        
     259
    260260#ifdef __64_BITS__
    261261        printf("[exc   ] [description       ] [count   ] [cycles  ]"
     
    264264        rows = 2;
    265265#endif
    266        
     266
    267267        for (i = 0; i < IVT_ITEMS; i++) {
    268268                if ((!excs_all) && (!exc_table[i].hot))
    269269                        continue;
    270                
     270
    271271                uint64_t count;
    272272                char count_suffix;
    273                
     273
    274274                order_suffix(exc_table[i].count, &count, &count_suffix);
    275                
     275
    276276                uint64_t cycles;
    277277                char cycles_suffix;
    278                
     278
    279279                order_suffix(exc_table[i].cycles, &cycles, &cycles_suffix);
    280                
     280
    281281                const char *symbol =
    282282                    symtab_fmt_name_lookup((sysarg_t) exc_table[i].handler);
    283                
     283
    284284#ifdef __32_BITS__
    285285                printf("%-8u %-20s %9" PRIu64 "%c %9" PRIu64 "%c %10p %s\n",
    286286                    i + IVT_FIRST, exc_table[i].name, count, count_suffix,
    287287                    cycles, cycles_suffix, exc_table[i].handler, symbol);
    288                
     288
    289289                PAGING(rows, 1, irq_spinlock_unlock(&exctbl_lock, true),
    290290                    irq_spinlock_lock(&exctbl_lock, true));
    291291#endif
    292                
     292
    293293#ifdef __64_BITS__
    294294                printf("%-8u %-20s %9" PRIu64 "%c %9" PRIu64 "%c %18p\n",
     
    296296                    cycles, cycles_suffix, exc_table[i].handler);
    297297                printf("         %s\n", symbol);
    298                
     298
    299299                PAGING(rows, 2, irq_spinlock_unlock(&exctbl_lock, true),
    300300                    irq_spinlock_lock(&exctbl_lock, true));
    301301#endif
    302302        }
    303        
     303
    304304        irq_spinlock_unlock(&exctbl_lock, true);
    305305#else /* (IVT_ITEMS > 0) */
    306        
     306
    307307        printf("No exception table%s.\n", excs_all ? " (showing all exceptions)" : "");
    308        
     308
    309309#endif /* (IVT_ITEMS > 0) */
    310        
     310
    311311        return 1;
    312312}
     
    335335{
    336336        (void) exc_undef;
    337        
     337
    338338#if (IVT_ITEMS > 0)
    339339        unsigned int i;
    340        
     340
    341341        for (i = 0; i < IVT_ITEMS; i++)
    342342                exc_register(i, "undef", false, (iroutine_t) exc_undef);
    343343#endif
    344        
     344
    345345#ifdef CONFIG_KCONSOLE
    346346        cmd_initialize(&exc_info);
Note: See TracChangeset for help on using the changeset viewer.