Changeset da1bafb in mainline for kernel/generic/src/syscall/syscall.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/generic/src/syscall/syscall.c

    r666f492 rda1bafb  
    5959    unative_t a4, unative_t a5, unative_t a6, unative_t id)
    6060{
    61         unative_t rc;
    62         ipl_t ipl;
    63 
    6461        /* Do userpace accounting */
    65         ipl = interrupts_disable();
    66         spinlock_lock(&THREAD->lock);
     62        irq_spinlock_lock(&THREAD->lock, true);
    6763        thread_update_accounting(true);
    68         spinlock_unlock(&THREAD->lock);
    69         interrupts_restore(ipl);
    70 
     64        irq_spinlock_unlock(&THREAD->lock, true);
     65       
    7166#ifdef CONFIG_UDEBUG
    7267        /*
    7368         * Early check for undebugged tasks. We do not lock anything as this
    7469         * test need not be precise in either direction.
     70         *
    7571         */
    76         if (THREAD->udebug.active) {
     72        if (THREAD->udebug.active)
    7773                udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false);
    78         }
    7974#endif
    8075       
     76        unative_t rc;
    8177        if (id < SYSCALL_END) {
    8278                rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
     
    9389        if (THREAD->udebug.active) {
    9490                udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true);
    95        
     91               
    9692                /*
    9793                 * Stopping point needed for tasks that only invoke
     
    10399        }
    104100#endif
    105 
     101       
    106102        /* Do kernel accounting */
    107         (void) interrupts_disable();
    108         spinlock_lock(&THREAD->lock);
     103        irq_spinlock_lock(&THREAD->lock, true);
    109104        thread_update_accounting(false);
    110         spinlock_unlock(&THREAD->lock);
    111         interrupts_restore(ipl);
     105        irq_spinlock_unlock(&THREAD->lock, true);
    112106       
    113107        return rc;
Note: See TracChangeset for help on using the changeset viewer.