Changeset 540 for trunk/kernel


Ignore:
Timestamp:
Sep 21, 2018, 10:22:02 PM (3 years ago)
Author:
nicolas.van.phan@…
Message:

TTY MUX 5/5 : Multiplex TTY character receiving

The multiplexing for receving chars is done by redirecting
the IRQs (when a char is received) to the right chdev (so the right
server DEV thread). When the user types an uppercase letter,
it is treated as a special char used to change the active tty
by redirecting the IRQs to the chdev corresponding to the appropriate
channel.

Add some documentation and example in the code.

Add mfences calls in spinlock_unlock_busy fix a bug on letty physical
hardware.

Location:
trunk/kernel
Files:
2 edited

Legend:

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

    r539 r540  
    8787
    8888    // no server thread and no IRQ routing for TXT0
     89    // except for LETI where there MUST be IRQ routing
    8990    // no server thread for IMPL_TXT_RS2 (multiplexed in software, not hardware)
    9091    if( channel != 0 && impl != IMPL_TXT_RS2 )
     
    9394        lid_t lid = cluster_select_local_core();
    9495
     96        // The unique IRQ from cluster 00's MTTY must be bound to a RX chdev
     97        // so that all IRQs are considered as RX IRQs and treated as such
     98        // Indeed, IRQs are raised by the MTTY only on user keystroke, so IRQs must
     99        // always be considered as RX IRQs.
     100        if ( ( impl != IMPL_TXT_MTY ) || ( channel == 1 && is_rx == 1 ) )
     101        {
    95102        // bind IRQ to the selected core
    96103        dev_pic_bind_irq( lid , txt );
     
    98105        // enable IRQ
    99106        dev_pic_enable_irq( lid , XPTR( local_cxy , txt ) );
     107        }
    100108
    101109        // create server thread
  • trunk/kernel/libk/spinlock.c

    r473 r540  
    9191#endif
    9292
     93    hal_fence();
    9394    lock->taken = 0;
    9495    this->local_locks--;
     
    181182list_unlink( &lock->list );
    182183#endif
    183 
     184    hal_fence();
    184185    lock->taken = 0;
    185186    this->local_locks--;
Note: See TracChangeset for help on using the changeset viewer.