forked from Imagelibrary/rtems
termios: Add TERMIOS_IRQ_SERVER_DRIVEN
Add a new interrupt server driven Termios mode (TERMIOS_IRQ_DRIVEN). This mode is identical to the interrupt driven mode except that a mutex is used for device level locking. The intended use case for this mode are device drivers that use the interrupt server, e.g. SPI or I2C connected devices. Update #2839.
This commit is contained in:
committed by
Sebastian Huber
parent
c3764ce805
commit
e34fe384cb
@@ -57,7 +57,8 @@ struct rtems_termios_rawbuf {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
TERMIOS_POLLED,
|
TERMIOS_POLLED,
|
||||||
TERMIOS_IRQ_DRIVEN,
|
TERMIOS_IRQ_DRIVEN,
|
||||||
TERMIOS_TASK_DRIVEN
|
TERMIOS_TASK_DRIVEN,
|
||||||
|
TERMIOS_IRQ_SERVER_DRIVEN
|
||||||
} rtems_termios_device_mode;
|
} rtems_termios_device_mode;
|
||||||
|
|
||||||
struct rtems_termios_tty;
|
struct rtems_termios_tty;
|
||||||
@@ -74,7 +75,7 @@ typedef struct rtems_termios_device_context {
|
|||||||
/* Used for TERMIOS_POLLED and TERMIOS_IRQ_DRIVEN */
|
/* Used for TERMIOS_POLLED and TERMIOS_IRQ_DRIVEN */
|
||||||
rtems_interrupt_lock interrupt;
|
rtems_interrupt_lock interrupt;
|
||||||
|
|
||||||
/* Used for TERMIOS_TASK_DRIVEN */
|
/* Used for TERMIOS_IRQ_SERVER_DRIVEN or TERMIOS_TASK_DRIVEN */
|
||||||
rtems_id mutex;
|
rtems_id mutex;
|
||||||
} lock;
|
} lock;
|
||||||
|
|
||||||
@@ -161,8 +162,9 @@ typedef struct {
|
|||||||
/**
|
/**
|
||||||
* @brief Polled read.
|
* @brief Polled read.
|
||||||
*
|
*
|
||||||
* In case mode is TERMIOS_IRQ_DRIVEN or TERMIOS_TASK_DRIVEN, then data is
|
* In case mode is TERMIOS_IRQ_DRIVEN, TERMIOS_IRQ_SERVER_DRIVEN or
|
||||||
* received via rtems_termios_enqueue_raw_characters().
|
* TERMIOS_TASK_DRIVEN, then data is received via
|
||||||
|
* rtems_termios_enqueue_raw_characters().
|
||||||
*
|
*
|
||||||
* @param[in] context The Termios device context.
|
* @param[in] context The Termios device context.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -275,7 +275,8 @@ drainOutput (struct rtems_termios_tty *tty)
|
|||||||
static bool
|
static bool
|
||||||
needDeviceMutex (rtems_termios_tty *tty)
|
needDeviceMutex (rtems_termios_tty *tty)
|
||||||
{
|
{
|
||||||
return tty->handler.mode == TERMIOS_TASK_DRIVEN;
|
return tty->handler.mode == TERMIOS_IRQ_SERVER_DRIVEN
|
||||||
|
|| tty->handler.mode == TERMIOS_TASK_DRIVEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user