Changeset 7fd5e89 in rtems for doc


Ignore:
Timestamp:
10/07/14 14:28:04 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
d5cc923f
Parents:
a830cb8
git-author:
Sebastian Huber <sebastian.huber@…> (10/07/14 14:28:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/07/14 14:35:13)
Message:

termios: Partially hide rtems_termios_tty

Move interrupt lock to device context and expose only this structure to
the read, write and set attributes device handler. This makes these
device handler independent of the general Termios infrastructure
suitable for direct use in printk() support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/bsp_howto/console.t

    ra830cb8 r7fd5e89  
    275275/* Low-level driver specific data structure */
    276276typedef struct @{
     277  rtems_termios_device_context base;
    277278  const char *device_name;
    278279  volatile module_register_block *regs;
     
    299300@group
    300301static void my_driver_poll_write(
    301   rtems_termios_tty *tty,
    302   const char        *buf,
    303   size_t             n
     302  rtems_termios_device_context *base,
     303  const char                   *buf,
     304  size_t                        n
    304305)
    305306@{
    306   my_driver_context *ctx = rtems_termios_get_device_context(tty);
     307  my_driver_context *ctx = (my_driver_context *) base;
    307308  size_t i;
    308309
     
    321322@example
    322323@group
    323 static int my_driver_poll_read(rtems_termios_tty *tty)
    324 @{
    325   my_driver_context *ctx = rtems_termios_get_device_context(tty);
     324static int my_driver_poll_read(rtems_termios_device_context *base)
     325@{
     326  my_driver_context *ctx = (my_driver_context *) base;
    326327
    327328  /* Check if a character is available */
     
    410411@group
    411412static void my_driver_interrupt_write(
    412   rtems_termios_tty *tty,
    413   const char        *buf,
    414   size_t             n
     413  rtems_termios_device_context  *base,
     414  const char                    *buf,
     415  size_t                         n
    415416)
    416417@{
    417   my_driver_context *ctx = rtems_termios_get_device_context(tty);
     418  my_driver_context *ctx = (my_driver_context *) base;
    418419
    419420  /*
     
    519520static bool my_driver_first_open(
    520521  rtems_termios_tty             *tty,
     522  rtems_termios_device_context  *base,
     523  struct termios                *term,
    521524  rtems_libio_open_close_args_t *args
    522525)
    523526@{
    524   my_driver_context *ctx = rtems_termios_get_device_context(tty);
     527  my_driver_context *ctx = (my_driver_context *) base;
    525528  rtems_status_code sc;
    526529  bool ok;
     
    543546   * Alternatively you can set the best baud.
    544547   */
    545   rtems_termios_set_best_baud(tty, MY_DRIVER_BAUD_RATE);
     548  rtems_termios_set_best_baud(term, MY_DRIVER_BAUD_RATE);
    546549
    547550  /*
     
    549552   * this.
    550553   */
    551   ok = my_driver_set_attributes(tty, rtems_termios_get_termios(tty));
     554  ok = my_driver_set_attributes(base, term);
    552555  if (!ok) @{
    553556    /* This is bad */
     
    575578static void my_driver_last_close(
    576579  rtems_termios_tty             *tty,
     580  rtems_termios_device_context  *base,
    577581  rtems_libio_open_close_args_t *args
    578582)
    579583@{
    580   my_driver_context *ctx = rtems_termios_get_device_context(tty);
     584  my_driver_context *ctx = (my_driver_context *) base;
    581585
    582586  /*
     
    619623@group
    620624static bool my_driver_set_attributes(
    621   rtems_termios_tty    *tty,
    622   const struct termios *term
     625  rtems_termios_device_context *base,
     626  const struct termios         *term
    623627)
    624628@{
    625   my_driver_context *ctx = rtems_termios_get_device_context(tty);
     629  my_driver_context *ctx = (my_driver_context *) base;
    626630
    627631  /*
Note: See TracChangeset for help on using the changeset viewer.