Ignore:
Timestamp:
Oct 1, 2015, 4:20:46 PM (9 years ago)
Author:
alain
Message:

Major release: Change the task model to implement the POSIX threads API.

  • The shell "exec" and "kill" commands can be used to activate/de-activate the applications.
  • The "pause", "resume", and "context" commands can be used to stop, restart, a single thtead or to display the thread context.

This version has been tested on the following multi-threaded applications,
that have been modified to use the POSIX threads:

  • classif
  • convol
  • transpose
  • gameoflife
  • raycast
Location:
soft/giet_vm/giet_drivers
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/bdv_driver.c

    r657 r709  
    3737spin_lock_t  _bdv_lock __attribute__((aligned(64)));
    3838
    39 // global index of the waiting task (only used in descheduling mode)
     39// global index of the waiting thread (only used in descheduling mode)
    4040__attribute__((section(".kdata")))
    41 unsigned int _bdv_gtid;
     41unsigned int _bdv_trdid;
    4242
    4343// BDV peripheral status (only used in descheduling mode)
     
    7575                          unsigned int       count)
    7676{
    77     unsigned int procid  = _get_procid();
    78     unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
    79     unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH) - 1);
    80     unsigned int p       = procid & ((1<<P_WIDTH)-1);
    81 
    82 #if GIET_DEBUG_IOC
     77
     78#if GIET_DEBUG_IOC
     79unsigned int procid  = _get_procid();
     80unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     81unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH) - 1);
     82unsigned int p       = procid & ((1<<P_WIDTH)-1);
    8383if ( _get_proctime() > GIET_DEBUG_IOC )
    8484_printf("\n[BDV DEBUG] P[%d,%d,%d] enters _bdv_access at cycle %d\n"
     
    9797    unsigned int status;
    9898
    99     // get the lock protecting BDV
     99    // get the BDV lock and register it in task context
     100    static_scheduler_t*  psched = _get_sched();
     101    unsigned int         ltid   = _get_thread_ltid();
    100102    _spin_lock_acquire( &_bdv_lock );
     103    _atomic_or( &psched->context[ltid].slot[CTX_LOCKS_ID] , LOCKS_MASK_BDV );
    101104
    102105    // set device registers
     
    149152
    150153    /////////////////////////////////////////////////////////////////
    151     // in descheduling mode, we deschedule the task
    152     // and use an interrupt to reschedule the task.
     154    // in descheduling mode, we deschedule the thread
     155    // and use an interrupt to reschedule the thread.
    153156    // We need a critical section, because we must reset the RUN bit
    154157        // before to launch the transfer, and we don't want to be
     
    158161    {
    159162        unsigned int save_sr;
    160         unsigned int ltid = _get_current_task_id();
    161163
    162164        // activates BDV interrupt
    163165        _bdv_set_register( BLOCK_DEVICE_IRQ_ENABLE, 1 );
    164166
    165         // set _bdv_gtid
    166         _bdv_gtid = (procid<<16) + ltid;
     167        // set _bdv_trdid
     168        _bdv_trdid = _get_thread_trdid();
    167169
    168170        // enters critical section
     
    170172
    171173        // Set NORUN_MASK_IOC bit
    172         static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
    173         _atomic_or( &psched->context[ltid][CTX_NORUN_ID] , NORUN_MASK_IOC );
     174        static_scheduler_t* psched  = (static_scheduler_t*)_get_sched();
     175        unsigned int ltid = psched->current;
     176        _atomic_or( &psched->context[ltid].slot[CTX_NORUN_ID] , NORUN_MASK_IOC );
    174177       
    175178        // launch transfer
     
    184187#endif
    185188
    186         // deschedule task
     189        // deschedule thread
    187190        _ctx_switch();                     
    188191
     
    201204    }
    202205
    203     // release lock
     206    // release BDV lock and clear task context
    204207    _spin_lock_release( &_bdv_lock );     
     208    _atomic_and( &psched->context[ltid].slot[CTX_LOCKS_ID] , ~LOCKS_MASK_BDV );
    205209
    206210#if GIET_DEBUG_IOC
     
    241245    _bdv_status = status;
    242246
    243     // identify task waiting on BDV
    244     unsigned int procid  = _bdv_gtid>>16;
    245     unsigned int ltid    = _bdv_gtid & 0xFFFF;
    246     unsigned int cluster = procid >> P_WIDTH;
    247     unsigned int x       = cluster >> Y_WIDTH;
    248     unsigned int y       = cluster & ((1<<Y_WIDTH)-1);
    249     unsigned int p       = procid & ((1<<P_WIDTH)-1);
     247    // identify thread waiting on BDV
     248    unsigned int x       = (_bdv_trdid >> 24) & 0xFF;
     249    unsigned int y       = (_bdv_trdid >> 16) & 0xFF;
     250    unsigned int p       = (_bdv_trdid >>  8) & 0xFF;
     251    unsigned int ltid    = (_bdv_trdid      ) & 0xFF;
    250252
    251253    // Reset NORUN_MASK_IOC bit
    252254    static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
    253     unsigned int*       ptr     = &psched->context[ltid][CTX_NORUN_ID];
     255    unsigned int*       ptr     = &psched->context[ltid].slot[CTX_NORUN_ID];
    254256    _atomic_and( ptr , ~NORUN_MASK_IOC );
    255257
    256     // send a WAKUP WTI to processor running the sleeping task
    257     _xcu_send_wti( cluster,   
     258    // send a WAKUP WTI to processor running the sleeping thread
     259    _xcu_send_wti( (x<<Y_WIDTH) + y,
    258260                   p,
    259261                   0 );          // don't force context switch
     
    266268if ( _get_proctime() > GIET_DEBUG_IOC )
    267269_printf("\n[BDV DEBUG] Processor[%d,%d,%d] enters _bdv_isr() at cycle %d\n"
    268         "  for task %d running on P[%d,%d,%d] / bdv_status = %x\n",
     270        "  for thread %d running on P[%d,%d,%d] / bdv_status = %x\n",
    269271        c_x , c_y , c_p , _get_proctime() ,
    270272        ltid , x , y , p , status );
  • soft/giet_vm/giet_drivers/bdv_driver.h

    r529 r709  
    7878
    7979///////////////////////////////////////////////////////////////////////////////////
    80 //            Access functions
     80//            Low level access function
    8181///////////////////////////////////////////////////////////////////////////////////
     82
     83unsigned int _bdv_get_register( unsigned int index );
     84
     85void _bdv_set_register( unsigned int index,
     86                        unsigned int value );
    8287
    8388///////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/giet_drivers/hba_driver.c

    r657 r709  
    4646sqt_lock_t          _hba_allocator_lock  __attribute__((aligned(64)));
    4747
    48 // state of each slot (allocated to a task or not)
     48// state of each slot (allocated to a thread or not)
    4949// access must be protected by the allocator_lock in descheduling mode
    5050__attribute__((section(".kdata")))
     
    5656unsigned int        _hba_active_cmd[32];
    5757
    58 // global index of the task, for each entry in the command list
    59 __attribute__((section(".kdata")))
    60 unsigned int        _hba_gtid[32];
     58// global index of the thread, for each entry in the command list
     59__attribute__((section(".kdata")))
     60unsigned int        _hba_trid[32];
    6161
    6262// status of HBA commands
     
    9797
    9898///////////////////////////////////////////////////////////////////////////////
    99 // This blocking fonction allocates a free command index to the task.
     99// This blocking fonction allocates a free command index to the thread.
    100100// The hba_allocator_lock is not used in boot mode.
    101101// It returns the allocated command index (between 0 and 31)
     
    132132///////////////////////////////////////////////////////////////////////////////
    133133// This function releases the command index in the hba_allocated_cmd table.
    134 // There is no need to take the lock because only the task which owns the
     134// There is no need to take the lock because only the thread which owns the
    135135// command can release it.
    136136// return 0 if success, -1 if error
     
    281281
    282282    /////////////////////////////////////////////////////////////////
    283     // in descheduling mode, we deschedule the task
    284     // and use an interrupt to reschedule the task.
     283    // in descheduling mode, we deschedule the thread
     284    // and use an interrupt to reschedule the thread.
    285285    // We need a critical section, because we must set the NORUN bit
    286286        // before to launch the transfer, and we don't want to be
     
    297297#endif
    298298        unsigned int save_sr;
    299         unsigned int ltid = _get_current_task_id();
     299        unsigned int ltid = _get_thread_ltid();
    300300
    301301        // activates HBA interrupts
    302302        _hba_set_register( HBA_PXIE , 0x00000001 );
    303303
    304         // set _hba_gtid[cmd_id]
    305         _hba_gtid[cmd_id] = (procid<<16) + ltid;
     304        // set _hba_trid[cmd_id]
     305        _hba_trid[cmd_id] = (x<<24) + (y<<16) + (p<<8) + ltid;
    306306
    307307        // enters critical section
     
    310310        // Set NORUN_MASK_IOC bit
    311311        static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
    312         unsigned int*       ptr     = &psched->context[ltid][CTX_NORUN_ID];
     312        unsigned int*       ptr     = &psched->context[ltid].slot[CTX_NORUN_ID];
    313313        _atomic_or( ptr , NORUN_MASK_IOC );
    314314     
     
    319319        _hba_active_cmd[cmd_id] = 1;
    320320
    321         // deschedule task
     321        // deschedule thread
    322322        _ctx_switch();                     
    323323
    324324#if GIET_DEBUG_IOC
    325325if (_get_proctime() > GIET_DEBUG_IOC)
    326 _printf("\n[DEBUG HBA] _hba_access() : task %d on P[%d,%d,%d] resume at cycle %d\n",
     326_printf("\n[DEBUG HBA] _hba_access() : thread %d on P[%d,%d,%d] resume at cycle %d\n",
    327327        ltid , x , y , p , _get_proctime() );
    328328#endif
     
    438438            _hba_active_cmd[cmd_id] = 0;
    439439
    440             // identify waiting task
    441             unsigned int procid  = _hba_gtid[cmd_id]>>16;
    442             unsigned int ltid    = _hba_gtid[cmd_id] & 0xFFFF;
    443             unsigned int cluster = procid >> P_WIDTH;
    444             unsigned int x       = cluster >> Y_WIDTH;
    445             unsigned int y       = cluster & ((1<<Y_WIDTH)-1);
    446             unsigned int p       = procid & ((1<<P_WIDTH)-1);
     440            // identify waiting thread
     441            unsigned int x       = (_hba_trid[cmd_id]>>24) & 0xFF;
     442            unsigned int y       = (_hba_trid[cmd_id]>>16) & 0xFF;
     443            unsigned int p       = (_hba_trid[cmd_id]>> 8) & 0xFF;
     444            unsigned int ltid    = (_hba_trid[cmd_id]    ) & 0xFF;
    447445 
    448446            // Reset NORUN_MASK_IOC bit
    449447            static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
    450             _atomic_and( &psched->context[ltid][CTX_NORUN_ID] , ~NORUN_MASK_IOC );
    451 
    452             // send a WAKUP WTI to processor running the waiting task
    453             _xcu_send_wti( cluster ,
     448            _atomic_and( &psched->context[ltid].slot[CTX_NORUN_ID] , ~NORUN_MASK_IOC );
     449
     450            // send a WAKUP WTI to processor running the waiting thread
     451            _xcu_send_wti( (x<<Y_WIDTH) + y,
    454452                           p ,
    455453                           0 );          // don't force context switch
     
    458456if (_get_proctime() > GIET_DEBUG_IOC)
    459457_printf("\n[DEBUG HBA] _hba_isr() : command %d completed at cycle %d\n"
    460         "  resume task %d running on P[%d,%d,%d]\n",
     458        "  resume thread %d running on P[%d,%d,%d]\n",
    461459        cmd_id , _get_proctime() ,
    462460        ltid , x , y , p );
  • soft/giet_vm/giet_drivers/mwr_driver.c

    r668 r709  
    7474unsigned int   _coproc_error[X_SIZE*Y_SIZE];
    7575
    76 // descheduled task gtid (for MODE_DMA_IRQ)
    77 __attribute__((section(".kdata")))
    78 unsigned int   _coproc_gtid[X_SIZE*Y_SIZE];
     76// descheduled thread trdid (for MODE_DMA_IRQ)
     77__attribute__((section(".kdata")))
     78unsigned int   _coproc_trdid[X_SIZE*Y_SIZE];
    7979
    8080/////////////////////////////////////////////////////////////////////////////
     
    205205    _coproc_error[cluster_id]  = error;
    206206
    207     // identify task waiting on coprocessor completion
    208     // this task can run in a remote cluster
    209     unsigned int r_gtid    = _coproc_gtid[cluster_id];
    210     unsigned int r_procid  = r_gtid>>16;
    211     unsigned int r_ltid    = r_gtid & 0xFFFF;
    212     unsigned int r_cluster = r_procid >> P_WIDTH;
    213     unsigned int r_x       = r_cluster >> Y_WIDTH;
    214     unsigned int r_y       = r_cluster & ((1<<Y_WIDTH)-1);
    215     unsigned int r_p       = r_procid & ((1<<P_WIDTH)-1);
     207    // identify thread waiting on coprocessor completion (can run in a remote cluster)
     208    unsigned int r_x       = (_coproc_trdid[cluster_id]>>24) & 0xFF;
     209    unsigned int r_y       = (_coproc_trdid[cluster_id]>>16) & 0xFF;
     210    unsigned int r_p       = (_coproc_trdid[cluster_id]>> 8) & 0xFF;
     211    unsigned int r_ltid    = (_coproc_trdid[cluster_id]    ) & 0xFF;
    216212
    217213    // Reset NORUN_MASK_IOC bit
    218214    static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[r_x][r_y][r_p];
    219     unsigned int*       ptr     = &psched->context[r_ltid][CTX_NORUN_ID];
     215    unsigned int*       ptr     = &psched->context[r_ltid].slot[CTX_NORUN_ID];
    220216    _atomic_and( ptr , ~NORUN_MASK_COPROC );
    221217
    222     // send a WAKUP WTI to processor running the sleeping task
    223     _xcu_send_wti( r_cluster,   
     218    // send a WAKUP WTI to processor running the sleeping thread
     219    _xcu_send_wti( (r_x<<Y_WIDTH) + r_y,
    224220                   r_p,
    225221                   0 );          // don't force context switch
     
    228224unsigned int p          = gpid & ((1<<P_WIDTH)-1);
    229225_printf("\n[GIET DEBUG COPROC] P[%d,%d,%d] executes _mwr_isr() at cycle %d\n"
    230         "  for task %d running on P[%d,%d,%d] / error = %d\n",
     226        "  for thread %d running on P[%d,%d,%d] / error = %d\n",
    231227        x , y , p , _get_proctime() , r_ltid , r_x , r_y , r_p , error );
    232228#endif
  • soft/giet_vm/giet_drivers/sdc_driver.c

    r657 r709  
    3232///////////////////////////////////////////////////////////////////////////////////
    3333
    34 // global index ot the task, for each entry in the command list
    35 __attribute__((section(".kdata")))
    36 unsigned int     _ahci_gtid[32];
     34// global index ot the thread, for each entry in the command list
     35__attribute__((section(".kdata")))
     36unsigned int     _ahci_trdid[32];
    3737
    3838// status of the command, for each entry in the command list
     
    406406
    407407    /////////////////////////////////////////////////////////////////
    408     // in descheduling mode, we deschedule the task
    409     // and use an interrupt to reschedule the task.
     408    // in descheduling mode, we deschedule the thread
     409    // and use an interrupt to reschedule the thread.
    410410    // We need a critical section, because we must set the NORUN bit
    411411        // before to launch the transfer, and we don't want to be
     
    422422#endif
    423423        unsigned int save_sr;
    424         unsigned int ltid = _get_current_task_id();
     424        unsigned int ltid = _get_thread_ltid();
    425425
    426426        // activates interrupt
    427427        _sdc_set_register( AHCI_PXIE , 0x00000001 );
    428428
    429         // set _ahci_gtid[ptw]
    430         _ahci_gtid[ptw] = (procid<<16) + ltid;
     429        // set _ahci_trdid[ptw]
     430        _ahci_trdid[ptw] = (x<<24) + (y<<16) + (p<<8) + ltid;
    431431
    432432        // enters critical section
     
    435435        // Set NORUN_MASK_IOC bit
    436436        static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
    437         unsigned int*       ptr     = &psched->context[ltid][CTX_NORUN_ID];
     437        unsigned int*       ptr     = &psched->context[ltid].slot[CTX_NORUN_ID];
    438438        _atomic_or( ptr , NORUN_MASK_IOC );
    439439       
     
    441441        _sdc_set_register( AHCI_PXCI, (1<<ptw) );
    442442
    443         // deschedule task
     443        // deschedule thread
    444444        _ctx_switch();                     
    445445
    446446#if GIET_DEBUG_IOC
    447447if (_get_proctime() > GIET_DEBUG_IOC)
    448 _printf("\n[DEBUG SDC] _sdc_access() : task %d on P[%d,%d,%d] resume at cycle %d\n",
     448_printf("\n[DEBUG SDC] _sdc_access() : thread %d on P[%d,%d,%d] resume at cycle %d\n",
    449449        ltid , x , y , p , _get_proctime() );
    450450#endif
     
    497497            _sdc_set_register( AHCI_PXIS , 0 );
    498498 
    499             // identify waiting task
    500             unsigned int procid  = _ahci_gtid[cmd_id]>>16;
    501             unsigned int ltid    = _ahci_gtid[cmd_id] & 0xFFFF;
    502             unsigned int cluster = procid >> P_WIDTH;
    503             unsigned int x       = cluster >> Y_WIDTH;
    504             unsigned int y       = cluster & ((1<<Y_WIDTH)-1);
    505             unsigned int p       = procid & ((1<<P_WIDTH)-1);
    506  
     499            // identify waiting thread
     500            unsigned int x       = (_ahci_trdid[cmd_id]>>24) & 0xFF;
     501            unsigned int y       = (_ahci_trdid[cmd_id]>>16) & 0xFF;
     502            unsigned int p       = (_ahci_trdid[cmd_id]>> 8) & 0xFF;
     503            unsigned int ltid    = (_ahci_trdid[cmd_id]    ) & 0xFF;
     504
    507505            // Reset NORUN_MASK_IOC bit
    508506            static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
    509             _atomic_and( &psched->context[ltid][CTX_NORUN_ID] , ~NORUN_MASK_IOC );
    510 
    511             // send a WAKUP WTI to processor running the waiting task
    512             _xcu_send_wti( cluster ,
     507            _atomic_and( &psched->context[ltid].slot[CTX_NORUN_ID] , ~NORUN_MASK_IOC );
     508
     509            // send a WAKUP WTI to processor running the waiting thread
     510            _xcu_send_wti( (x<<Y_WIDTH) + y,
    513511                           p ,
    514512                           0 );          // don't force context switch
     
    517515if (_get_proctime() > GIET_DEBUG_IOC)
    518516_printf("\n[DEBUG SDC] _sdc_isr() : command %d completed at cycle %d\n"
    519         "  resume task %d running on P[%d,%d,%d] / status = %x\n",
     517        "  resume thread %d running on P[%d,%d,%d] / status = %x\n",
    520518        cmd_id , _get_proctime() ,
    521519        ltid , x , y , p , _ahci_status[cmd_id] );
  • soft/giet_vm/giet_drivers/tty_driver.c

    r605 r709  
    1919
    2020////////////////////////////////////////////////////////////////////////////////////
     21//               extern variables
     22////////////////////////////////////////////////////////////////////////////////////
     23
     24// This variable is allocated in kernel_init.c file
     25extern static_scheduler_t* _schedulers[X_SIZE][Y_SIZE][NB_PROCS_MAX];
     26
     27////////////////////////////////////////////////////////////////////////////////////
    2128//               global variables
    2229////////////////////////////////////////////////////////////////////////////////////
    2330
     31__attribute__((section(".kdata")))
     32tty_fifo_t  _tty_rx_fifo[NB_TTY_CHANNELS];
     33
     34/*
    2435__attribute__((section(".kdata")))
    2536unsigned int   _tty_rx_buf[NB_TTY_CHANNELS];
     
    2738__attribute__((section(".kdata")))
    2839unsigned int   _tty_rx_full[NB_TTY_CHANNELS];
     40
     41__attribute__((section(".kdata")))
     42unsigned int   _tty_rx_trdid[NB_TTY_CHANNELS];
     43*/
    2944
    3045////////////////////////////////////////////////////////////////////////////////////
     
    5267void _tty_init( unsigned int channel )
    5368{
    54     _tty_rx_full[channel] = 0;
     69    _tty_rx_fifo[channel].sts = 0;
     70    _tty_rx_fifo[channel].ptr = 0;
     71    _tty_rx_fifo[channel].ptw = 0;
    5572}
    5673
     
    6077                  unsigned int channel )   // TTY channel
    6178{
    62     // transfer character to kernel buffer and acknowledge TTY IRQ
    63     _tty_rx_buf[channel]  = _tty_get_register( channel, TTY_READ );
     79    // get pointer on TTY_RX FIFO
     80    tty_fifo_t*   fifo = &_tty_rx_fifo[channel];
    6481
    65     // flush pending memory writes
    66     asm volatile( "sync" );
     82    // get character from TTY_RX channel and acknowledge IRQ
     83    unsigned int data = _tty_get_register( channel, TTY_READ );
    6784
    68     // set kernel buffer status
    69     _tty_rx_full[channel] = 1;
     85    // transfer character to FIFO if not full
     86    // discard incoming character if full
     87    if ( fifo->sts < TTY_FIFO_DEPTH )
     88    {
     89        // store data into FIFO
     90        fifo->data[fifo->ptw] = (char)data;
    7091
    71 #if GIET_DEBUG_IRQS  // we don't take the TTY lock to avoid deadlock
    72 unsigned int gpid           = _get_procid();
    73 unsigned int cluster_xy     = gpid >> P_WIDTH;
    74 unsigned int x              = cluster_xy >> Y_WIDTH;
    75 unsigned int y              = cluster_xy & ((1<<Y_WIDTH)-1);
    76 unsigned int lpid           = gpid & ((1<<P_WIDTH)-1);
    77 _puts("\n[IRQS DEBUG] Processor[");
    78 _putd(x );
    79 _puts(",");
    80 _putd(y );
    81 _puts(",");
    82 _putd(lpid );
    83 _puts("] enters _tty_rx_isr() at cycle ");
    84 _putd(_get_proctime() );
    85 _puts("\n  read byte = ");
    86 _putx(_tty_rx_buf[channel] );
    87 _puts("\n");
    88 #endif
     92        // avoid race
     93        asm volatile( "sync" );
    8994
     95        // update FIFO state
     96        fifo->ptw = (fifo->ptw + 1) % TTY_FIFO_DEPTH;
     97        fifo->sts = fifo->sts + 1;
     98    }
     99
     100    // get owner thread indexes
     101    unsigned int trdid          = fifo->trdid;
     102    unsigned int x              = (trdid >> 24) & 0xFF;
     103    unsigned int y              = (trdid >> 16) & 0xFF;
     104    unsigned int p              = (trdid >>  8) & 0xFF;
     105    unsigned int ltid           = (trdid      ) & 0xFF;
     106
     107    // Reset NORUN_MASK_TTY bit
     108    static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
     109    unsigned int*       ptr     = &psched->context[ltid].slot[CTX_NORUN_ID];
     110    _atomic_and( ptr , ~NORUN_MASK_TTY );
    90111}
    91112
     
    95116                  unsigned int channel )   // TTY channel
    96117{
    97     _puts("\n[GIET ERROR] the _tty_tx_isr() is not implemented\n");
     118    _printf("\n[GIET ERROR] the _tty_tx_isr() is not implemented\n");
    98119    _exit();
    99120}
  • soft/giet_vm/giet_drivers/tty_driver.h

    r496 r709  
    2727#include "kernel_locks.h"
    2828
     29
    2930///////////////////////////////////////////////////////////////////////////////////
    3031//                     registers offsets
     
    4142};
    4243
     44
     45//////////////////////////////////////////////////////////////////////////////////
     46//                    struct tty_fifo_t
     47//////////////////////////////////////////////////////////////////////////////////
     48
     49#define TTY_FIFO_DEPTH  16
     50
     51typedef struct tty_fifo_s     // 32 bytes
     52{
     53    char          data[TTY_FIFO_DEPTH];   // one char per slot
     54    unsigned int  trdid;                  // owner thread trdid
     55    unsigned int  ptr;                    // next free slot index
     56    unsigned int  ptw;                    // next full slot index
     57    unsigned int  sts;                    // number of full slots
     58} tty_fifo_t;
     59 
    4360//////////////////////////////////////////////////////////////////////////////////
    4461//                    access functions
Note: See TracChangeset for help on using the changeset viewer.