Changeset da1bafb in mainline for kernel/arch/ia32/src/interrupt.c


Ignore:
Timestamp:
2010-05-24T18:57:31Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0095368
Parents:
666f492
Message:

major code revision

  • replace spinlocks taken with interrupts disabled with irq_spinlocks
  • change spacing (not indendation) to be tab-size independent
  • use unsigned integer types where appropriate (especially bit flags)
  • visual separation
  • remove argument names in function prototypes
  • string changes
  • correct some formating directives
  • replace various cryptic single-character variables (t, a, m, c, b, etc.) with proper identifiers (thread, task, timeout, as, itm, itc, etc.)
  • unify some assembler constructs
  • unused page table levels are now optimized out in compile time
  • replace several ints (with boolean semantics) with bools
  • use specifically sized types instead of generic types where appropriate (size_t, uint32_t, btree_key_t)
  • improve comments
  • split asserts with conjuction into multiple independent asserts
File:
1 edited

Legend:

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

    r666f492 rda1bafb  
    9494{
    9595        fault_if_from_uspace(istate, "Unserviced interrupt: %d.", n);
    96 
     96       
    9797        decode_istate(istate);
    9898        panic("Unserviced interrupt: %d.", n);
     
    102102{
    103103        fault_if_from_uspace(istate, "Divide error.");
    104 
     104       
    105105        decode_istate(istate);
    106106        panic("Divide error.");
     
    111111{
    112112        if (TASK) {
    113                 size_t ver;
     113                irq_spinlock_lock(&TASK->lock, false);
     114                size_t ver = TASK->arch.iomapver;
     115                irq_spinlock_unlock(&TASK->lock, false);
    114116               
    115                 spinlock_lock(&TASK->lock);
    116                 ver = TASK->arch.iomapver;
    117                 spinlock_unlock(&TASK->lock);
    118        
    119117                if (CPU->arch.iomapver_copy != ver) {
    120118                        /*
     
    130128                fault_if_from_uspace(istate, "General protection fault.");
    131129        }
    132 
     130       
    133131        decode_istate(istate);
    134132        panic("General protection fault.");
     
    138136{
    139137        fault_if_from_uspace(istate, "Stack fault.");
    140 
     138       
    141139        decode_istate(istate);
    142140        panic("Stack fault.");
     
    146144{
    147145        uint32_t mxcsr;
    148         asm (
     146        asm volatile (
    149147                "stmxcsr %[mxcsr]\n"
    150148                : [mxcsr] "=m" (mxcsr)
    151149        );
     150       
    152151        fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zx.",
    153152            (unative_t) mxcsr);
     
    158157}
    159158
    160 static void nm_fault(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
    161 {
    162 #ifdef CONFIG_FPU_LAZY     
     159static void nm_fault(int n __attribute__((unused)),
     160    istate_t *istate __attribute__((unused)))
     161{
     162#ifdef CONFIG_FPU_LAZY
    163163        scheduler_fpu_lazy_request();
    164164#else
     
    169169
    170170#ifdef CONFIG_SMP
    171 static void tlb_shootdown_ipi(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
     171static void tlb_shootdown_ipi(int n __attribute__((unused)),
     172    istate_t *istate __attribute__((unused)))
    172173{
    173174        trap_virtual_eoi();
     
    191192                 * The IRQ handler was found.
    192193                 */
    193                  
     194               
    194195                if (irq->preack) {
    195196                        /* Send EOI before processing the interrupt */
     
    198199                }
    199200                irq->handler(irq);
    200                 spinlock_unlock(&irq->lock);
     201                irq_spinlock_unlock(&irq->lock, false);
    201202        } else {
    202203                /*
Note: See TracChangeset for help on using the changeset viewer.