Changeset 501


Ignore:
Timestamp:
Feb 8, 2015, 9:13:56 PM (10 years ago)
Author:
alain
Message:

Introduce user-level, distributed barriers and locks (quad-tree based).

Location:
soft/giet_vm/giet_libs
Files:
2 added
2 deleted
3 edited

Legend:

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

    r487 r501  
    253253{
    254254    va_list args;
    255     const int channel = 0;
    256255    volatile unsigned int sr_save;
    257256
    258257    sys_call( SYSCALL_TTY_GET_LOCK,
    259               channel,
     258              0,
    260259              (unsigned int)&sr_save,
    261260              0, 0 );
    262261
    263262    va_start( args, format );
    264     int ret = __printf(format, channel, &args);
     263    int ret = __printf(format, 0, &args);
    265264    va_end( args );
    266265
    267266    sys_call( SYSCALL_TTY_RELEASE_LOCK,
    268               channel,
     267              0,
    269268              (unsigned int)&sr_save,
    270269              0, 0 );
     
    541540//////////////////////////////////////////////////////////////////////////////////
    542541
    543 ////////////////////////////////
    544 unsigned int giet_nic_rx_alloc()
     542////////////////////////////////////////////////////
     543unsigned int giet_nic_rx_alloc( unsigned int xmax,
     544                                unsigned int ymax )
    545545{
    546546    int channel = sys_call( SYSCALL_NIC_ALLOC,
    547547                            1,
    548                             0, 0, 0 );
     548                            xmax,
     549                            ymax,
     550                            0 );
    549551    if ( channel < 0 ) giet_exit("error in giet_nic_rx_alloc()");
    550552
     
    552554}
    553555
    554 ////////////////////////////////
    555 unsigned int giet_nic_tx_alloc()
     556////////////////////////////////////////////////////
     557unsigned int giet_nic_tx_alloc( unsigned int xmax,
     558                                unsigned int ymax )
    556559{
    557560    int channel = sys_call( SYSCALL_NIC_ALLOC,
    558                             0,
    559                             0, 0, 0 );
     561                            0,
     562                            xmax,
     563                            ymax,
     564                            0 );
    560565    if ( channel < 0 ) giet_exit("error in giet_nic_tx_alloc()");
    561566
     
    772777}
    773778
    774 ///////////////////////////////////////////////
    775 void giet_proc_number( unsigned int  cluster_id,
    776                        unsigned int* buffer )
    777 {
    778     if ( sys_call( SYSCALL_PROC_NUMBER,
    779                    cluster_id,
    780                    (unsigned int) buffer,
    781                    0, 0) )  giet_exit("ERROR in giet_proc_number()");
     779/////////////////////////////////////////////////
     780void giet_procs_number( unsigned int* x_size,
     781                        unsigned int* y_size,
     782                        unsigned int* nprocs )
     783{
     784    if ( sys_call( SYSCALL_PROCS_NUMBER,
     785                   (unsigned int)x_size,
     786                   (unsigned int)y_size,
     787                   (unsigned int)nprocs,
     788                   0 ) )  giet_exit("ERROR in giet_procs_number()");
    782789}
    783790
  • soft/giet_vm/giet_libs/stdio.h

    r487 r501  
    3131#define SYSCALL_FBF_CMA_STOP      0x0D
    3232#define SYSCALL_EXIT              0x0E
    33 #define SYSCALL_PROC_NUMBER       0x0F
     33#define SYSCALL_PROCS_NUMBER      0x0F
    3434
    3535#define SYSCALL_FBF_SYNC_WRITE    0x10
     
    212212//////////////////////////////////////////////////////////////////////////
    213213
    214 extern unsigned int giet_nic_rx_alloc();
    215 
    216 extern unsigned int giet_nic_tx_alloc();
     214extern unsigned int giet_nic_rx_alloc( unsigned int xmax, unsigned int ymax );
     215
     216extern unsigned int giet_nic_tx_alloc( unsigned int xmax, unsigned int ymax );
    217217
    218218extern void giet_nic_rx_start( unsigned int channel );
     
    272272extern void giet_context_switch();
    273273
    274 extern void giet_procnumber( unsigned int cluster_xy,
    275                              unsigned int buffer );
     274extern void giet_procs_number( unsigned int* x_size,
     275                               unsigned int* y_size,
     276                               unsigned int* nprocs );
    276277
    277278extern void giet_vobj_get_vbase( char*         vspace_name,
  • soft/giet_vm/giet_libs/user_lock.c

    r461 r501  
    7878void lock_release( user_lock_t* lock )
    7979{
    80     unsigned int current = lock->current;
     80    asm volatile( "sync" );
    8181
    82     if ( current == (GIET_LOCK_MAX_TICKET - 1) ) lock->current = 0;
    83     else                                         lock->current = current + 1;
     82    lock->current = lock->current + 1;
    8483
    8584#if GIET_DEBUG_USER_LOCK
Note: See TracChangeset for help on using the changeset viewer.