Ignore:
Timestamp:
Oct 4, 2018, 11:48:51 PM (3 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_txt.c

    r540 r565  
    22 * dev_txt.c - TXT (Text Terminal) generic device API implementation.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    2727#include <hal_drivers.h>
    2828#include <thread.h>
     29#include <remote_busylock.h>
    2930#include <chdev.h>
    3031#include <rpc.h>
     
    3839extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
    3940
     41
    4042#if (DEBUG_SYS_READ & 1)
    4143extern uint32_t enter_txt_read;
     
    4850#endif
    4951
    50 ////////////////////////////////////////
     52///////////////////////////////////////////////////
    5153const char * dev_txt_type_str( dev_txt_cmd_t type )
    5254{
     
    8183    txt->ext.txt.owner_xp = XPTR_NULL;
    8284    xlist_root_init( XPTR( local_cxy, &txt->ext.txt.root ) );
    83     remote_spinlock_init( XPTR( local_cxy , &txt->ext.txt.lock ) );
     85    remote_busylock_init( XPTR( local_cxy , &txt->ext.txt.lock ), LOCK_CHDEV_TXTLIST );
    8486   
    8587    // call driver init function
     
    257259}
    258260
    259 //////////////////////////////////////////////
    260 error_t dev_txt_sync_write( char    * buffer,
    261                             uint32_t   count )
     261////////////////////////////////////////////////
     262error_t dev_txt_sync_write( const char * buffer,
     263                            uint32_t     count )
    262264{
    263265    // get extended pointer on TXT[0] chdev
     
    269271    // get TXTO chdev cluster and local pointer
    270272    cxy_t    dev_cxy  = GET_CXY( dev_xp );
    271     chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
     273    chdev_t * dev_ptr = GET_PTR( dev_xp );
    272274
    273275    // get driver command function
Note: See TracChangeset for help on using the changeset viewer.