Ignore:
Timestamp:
2010-05-24T18:57:31Z (14 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/sparc64/src/trap/sun4u/interrupt.c

    r666f492 rda1bafb  
    5555void interrupt(int n, istate_t *istate)
    5656{
    57         uint64_t status;
    58         uint64_t intrcv;
    59         uint64_t data0;
    60         status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
     57        uint64_t status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0);
    6158        if (status & (!INTR_DISPATCH_STATUS_BUSY))
    6259                panic("Interrupt Dispatch Status busy bit not set\n");
    63 
    64         intrcv = asi_u64_read(ASI_INTR_RECEIVE, 0);
     60       
     61        uint64_t intrcv = asi_u64_read(ASI_INTR_RECEIVE, 0);
    6562#if defined (US)
    66         data0 = asi_u64_read(ASI_INTR_R, ASI_UDB_INTR_R_DATA_0);
     63        uint64_t data0 = asi_u64_read(ASI_INTR_R, ASI_UDB_INTR_R_DATA_0);
    6764#elif defined (US3)
    68         data0 = asi_u64_read(ASI_INTR_R, VA_INTR_R_DATA_0);
     65        uint64_t data0 = asi_u64_read(ASI_INTR_R, VA_INTR_R_DATA_0);
    6966#endif
    70 
     67       
    7168        irq_t *irq = irq_dispatch_and_lock(data0);
    7269        if (irq) {
     
    7572                 */
    7673                irq->handler(irq);
     74               
    7775                /*
    7876                 * See if there is a clear-interrupt-routine and call it.
    7977                 */
    80                 if (irq->cir) {
     78                if (irq->cir)
    8179                        irq->cir(irq->cir_arg, irq->inr);
    82                 }
    83                 spinlock_unlock(&irq->lock);
     80               
     81                irq_spinlock_unlock(&irq->lock, false);
    8482        } else if (data0 > config.base) {
    8583                /*
     
    9088                 */
    9189#ifdef CONFIG_SMP
    92                 if (data0 == (uintptr_t) tlb_shootdown_ipi_recv) {
     90                if (data0 == (uintptr_t) tlb_shootdown_ipi_recv)
    9391                        tlb_shootdown_ipi_recv();
    94                 }
    9592#endif
    9693        } else {
     
    10198                printf("cpu%u: spurious interrupt (intrcv=%#" PRIx64
    10299                    ", data0=%#" PRIx64 ")\n", CPU->id, intrcv, data0);
     100#else
     101                (void) intrcv;
    103102#endif
    104103        }
    105 
     104       
    106105        membar();
    107106        asi_u64_write(ASI_INTR_RECEIVE, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.