Ignore:
Timestamp:
Jul 31, 2014, 8:47:14 PM (10 years ago)
Author:
alain
Message:

1) Introducing the SBT barrier (Sliced Binary Tree)

in the barrier.h library.

2) Introducing a new remote_malloc.h library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/spin_lock.c

    r266 r368  
    44// Author   : alain greiner
    55// Copyright (c) UPMC-LIP6
    6 ///////////////////////////////////////////////////////////////////////////////////
    7 // The spin_lock.c and spin_lock.h files are part of the GIET nano-kernel.
    8 // This  middlewre implements a user-level lock (busy waiting mechanism,
    9 // because the GIET does not support task scheduling / descheduling).
    10 // It is a simple binary lock, without waiting queue.
    11 //
    12 // The lock_acquire() and lock_release() functions do not require a system call.
    13 // The barrier itself must have been allocated in a non cacheable segment,
    14 // if the platform does not provide hardwate cache coherence.
    15 //
    16 // ALL locks must be defined in the mapping_info data structure,
    17 // to be initialised by the GIET in the boot phase.
    18 // The vobj_get_vbase() system call (defined in stdio.c and stdio.h files)
    19 // can be used to get the virtual base address of the lock fro it's name.
    206///////////////////////////////////////////////////////////////////////////////////
    217
     
    2814// If the lock is already taken a random delay is introduced before retry.
    2915///////////////////////////////////////////////////////////////////////////////////
    30 void lock_acquire(giet_lock_t * lock) {
     16void lock_acquire(giet_lock_t * lock)
     17{
    3118    unsigned int * plock = &lock->value;
    3219    unsigned int delay = giet_rand();
     
    6249// lock_release()
    6350//////////////////////////////////////////////////////////////////////////////
    64 void lock_release(giet_lock_t * lock) {
     51void lock_release(giet_lock_t * lock)
     52{
    6553    unsigned int * plock = &lock->value;
    6654
Note: See TracChangeset for help on using the changeset viewer.