Changes in / [da154e14:a7d1992c] in rtems


Ignore:
Files:
35 added
14 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/shared/startup/linkcmds.base

    rda154e14 ra7d1992c  
    307307                *(_bsd_set_sysctl_set);
    308308                _bsd__stop_set_sysctl_set = .;
     309                __start_pcpu_set = .;
     310                *(set_pcpu);
     311                __stop_pcpu_set = .;
     312                _bsd__start_set_ieee80211_ioctl_getset = .;
     313                *(_bsd_set_ieee80211_ioctl_getset);
     314                _bsd__stop_set_ieee80211_ioctl_getset = .;
     315                _bsd__start_set_ieee80211_ioctl_setset = .;
     316                *(_bsd_set_ieee80211_ioctl_setset);
     317                _bsd__stop_set_ieee80211_ioctl_setset = .;
    309318
    310319                bsp_section_rodata_end = .;
  • c/src/lib/libbsp/sparc/erc32/make/custom/erc32.cfg

    rda154e14 ra7d1992c  
    1313
    1414# optimize flag: typically -O2
    15 CFLAGS_OPTIMIZE_V = -O2 -g
     15CFLAGS_OPTIMIZE_V = -O0 -g
  • c/src/lib/libbsp/sparc/shared/startup/linkcmds.base

    rda154e14 ra7d1992c  
    121121  .rela.dyn       :
    122122    {
     123      data_start = .;
     124      _data_start = .;
     125      _sdata = . ;
    123126      *(.rela.init)
    124127      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
     
    133136      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    134137    } >ram
     138  .robsdsets : {
     139    /* Special FreeBSD linker set sections */
     140    __start_set_sysctl_set = .;
     141    *(set_sysctl_*);
     142    __stop_set_sysctl_set = .;
     143    *(set_domain_*);
     144    *(set_pseudo_*);
     145    _bsd__start_set_modmetadata_set = .;
     146    *(_bsd_set_modmetadata_set);
     147    _bsd__stop_set_modmetadata_set = .;
     148    _bsd__start_set_sysctl_set = .;
     149    *(_bsd_set_sysctl_set);
     150    _bsd__stop_set_sysctl_set = .;
     151    __start_pcpu_set = .;
     152    *(set_pcpu);
     153    __stop_pcpu_set = .;
     154    _bsd__start_set_ieee80211_ioctl_getset = .;
     155    *(_bsd_set_ieee80211_ioctl_getset);
     156    _bsd__stop_set_ieee80211_ioctl_getset = .;
     157    _bsd__start_set_ieee80211_ioctl_setset = .;
     158    *(_bsd_set_ieee80211_ioctl_setset);
     159    _bsd__stop_set_ieee80211_ioctl_setset = .;
     160  } >ram
     161  .rwbsdsets : {
     162    /* Special FreeBSD linker set sections */
     163    _bsd__start_set_sysinit_set = .;
     164    *(_bsd_set_sysinit_set);
     165    _bsd__stop_set_sysinit_set = .;
     166  } >ram
    135167  .data :
    136168  {
    137     data_start = .;
    138     _data_start = .;
    139     _sdata = . ;
    140169    *(.data*)
    141170    *(.gnu.linkonce.d*)
  • c/src/make/Makefile.am

    rda154e14 ra7d1992c  
    1919
    2020rtems_bsp_makedir = $(rtems_bspdir)/make
    21 rtems_bsp_make_DATA = bsp.cfg target.cfg
     21rtems_bsp_make_DATA = bsp.cfg target.cfg bsp.mk
    2222
    2323bsp.cfg: bsp.cfg.in Makefile
  • c/src/make/configure.ac

    rda154e14 ra7d1992c  
    7979# Explicitly list all Makefiles here
    8080AC_CONFIG_FILES([Makefile
     81bsp.mk
    8182])
    8283AC_OUTPUT
  • cpukit/Makefile.am

    rda154e14 ra7d1992c  
    2121SUBDIRS += pppd
    2222SUBDIRS += mghttpd
     23SUBDIRS += gtest
    2324
    2425noinst_DATA = preinstall-stamp
  • cpukit/configure.ac

    rda154e14 ra7d1992c  
    1111AM_MAINTAINER_MODE
    1212
     13RTEMS_ENABLE_CXX
    1314RTEMS_ENABLE_MULTILIB
    1415RTEMS_ENABLE_MULTIPROCESSING
     
    1617RTEMS_ENABLE_RTEMS_DEBUG
    1718RTEMS_ENABLE_NETWORKING
     19
     20AM_CONDITIONAL(HAS_CXX,test "$RTEMS_HAS_CPLUSPLUS" = "yes")
    1821
    1922RTEMS_ENV_RTEMSCPU
     
    2932
    3033RTEMS_PROG_CC_FOR_TARGET
     34RTEMS_PROG_CXX_FOR_TARGET
    3135RTEMS_PROG_CCAS
    3236RTEMS_CANONICALIZE_TOOLS
     
    384388pppd/Makefile
    385389mghttpd/Makefile
     390gtest/Makefile
    386391wrapup/Makefile])
    387392
  • cpukit/libcsupport/include/sys/ioccom.h

    rda154e14 ra7d1992c  
    3434#define _SYS_IOCCOM_H_
    3535
    36 #include <sys/types.h>
     36#include <rtems.h>
    3737
    3838/*
     
    7474#define       RTEMS_IO_SNDWAKEUP      5
    7575
     76typedef enum {
     77  RTEMS_IOCTL_SELECT_OTHER,
     78  RTEMS_IOCTL_SELECT_READ,
     79  RTEMS_IOCTL_SELECT_WRITE
     80} rtems_ioctl_select_kind;
     81
     82/**
     83 * @brief IO control request for select() support.
     84 *
     85 * The driver shall return
     86 *   - 1, when the request can be fullfilled immediately,
     87 *   - 0, when the request task must wait, and
     88 *   - -1, in case of an error.
     89 */
     90typedef struct {
     91  rtems_ioctl_select_kind kind;
     92  rtems_id request_task_id;
     93} rtems_ioctl_select_request;
     94
     95#define RTEMS_IOCTL_SELECT _IOW('R', 0, rtems_ioctl_select_request)
     96
     97#define RTEMS_IOCTL_SELECT_EVENT RTEMS_EVENT_24
     98
    7699/* copied from libnetworking/sys/filio.h and commented out there */
    77100/* Generic file-descriptor ioctl's. */
  • cpukit/libcsupport/src/termios.c

    rda154e14 ra7d1992c  
    508508}
    509509
     510static bool
     511rtems_termios_can_read (const struct rtems_termios_tty *tty)
     512{
     513  if (tty->cindex == tty->ccount) {
     514    if (tty->device.outputUsesInterrupts == TERMIOS_IRQ_DRIVEN) {
     515      return tty->rawInBuf.Head != tty->rawInBuf.Tail;
     516    } else {
     517      return true;
     518    }
     519  } else {
     520    return tty->cindex < tty->ccount;
     521  }
     522}
     523
     524static bool
     525rtems_termios_can_write (const struct rtems_termios_tty *tty)
     526{
     527  /*
     528   * Termios has no non-blocking writes.  In case the raw output buffer is
     529   * full, we wait for the interrupt or poll.
     530   */
     531  return true;
     532}
     533
     534static void
     535rtems_termios_select_wakeup (struct termios *tty, void *arg)
     536{
     537  rtems_id task_id = (rtems_id) arg;
     538  rtems_status_code sc = rtems_event_send (task_id, RTEMS_IOCTL_SELECT_EVENT);
     539  if (sc != RTEMS_SUCCESSFUL)
     540    rtems_fatal_error_occurred (sc);
     541}
     542
     543static int
     544rtems_termios_select (struct rtems_termios_tty *tty,
     545                      const rtems_ioctl_select_request *request)
     546{
     547  int rv = 0;
     548
     549  rtems_interrupt_level level;
     550  rtems_interrupt_disable(level);
     551  switch (request->kind) {
     552    case RTEMS_IOCTL_SELECT_READ:
     553      if (rtems_termios_can_read (tty)) {
     554        rv = 1;
     555      } else {
     556        tty->tty_rcvwakeup = 0;
     557        tty->tty_rcv.sw_pfn = rtems_termios_select_wakeup;
     558        tty->tty_rcv.sw_arg = (void *) request->request_task_id;
     559      }
     560      break;
     561    case RTEMS_IOCTL_SELECT_WRITE:
     562      if (rtems_termios_can_write (tty)) {
     563        rv = 1;
     564      } else {
     565        tty->tty_snd.sw_pfn = rtems_termios_select_wakeup;
     566        tty->tty_snd.sw_arg = (void *) request->request_task_id;
     567      }
     568      break;
     569    default:
     570      break;
     571  }
     572  rtems_interrupt_enable(level);
     573
     574  return rv;
     575}
     576
    510577rtems_status_code
    511578rtems_termios_ioctl (void *arg)
     
    529596      sc = RTEMS_INVALID_NUMBER;
    530597    }
     598    break;
     599
     600  case RTEMS_IOCTL_SELECT:
     601    args->ioctl_return = rtems_termios_select (tty, args->buffer);
    531602    break;
    532603
  • cpukit/libfs/src/pipe/fifo.c

    rda154e14 ra7d1992c  
    6767#include <rtems/score/thread.h>
    6868
     69static void pipe_select_wakeup(rtems_id *id_ptr)
     70{
     71  rtems_id id = *id_ptr;
     72
     73  *id_ptr = 0;
     74
     75  if (id != 0) {
     76    rtems_status_code sc = rtems_event_send(id, RTEMS_IOCTL_SELECT_EVENT);
     77
     78    if (sc != RTEMS_SUCCESSFUL) {
     79      rtems_fatal_error_occurred(sc);
     80    }
     81  }
     82}
     83
    6984/* Set barriers to be interruptible by signals. */
    7085static void pipe_interruptible(pipe_control_t *pipe)
     
    93108  int err = -ENOMEM;
    94109
    95   pipe = malloc(sizeof(pipe_control_t));
     110  pipe = calloc(1, sizeof(pipe_control_t));
    96111  if (pipe == NULL)
    97112    return err;
    98   memset(pipe, 0, sizeof(pipe_control_t));
    99113
    100114  pipe->Size = PIPE_BUF;
     
    446460      pipe->Start = 0;
    447461
     462    pipe_select_wakeup(&pipe->select_write_task_id);
    448463    if (pipe->waitingWriters > 0)
    449464      PIPE_WAKEUPWRITERS(pipe);
     
    524539
    525540    pipe->Length += chunk;
     541    pipe_select_wakeup(&pipe->select_read_task_id);
    526542    if (pipe->waitingReaders > 0)
    527543      PIPE_WAKEUPREADERS(pipe);
     
    546562}
    547563
     564static int pipe_register_select_wakeup(
     565  rtems_id *id_ptr,
     566  const rtems_ioctl_select_request *request
     567)
     568{
     569  int rv = 0;
     570  rtems_id current_id = *id_ptr;
     571  rtems_id request_id = request->request_task_id;
     572
     573  if (current_id == 0 || current_id == request_id) {
     574    *id_ptr = request_id;
     575  } else {
     576    rv = -EINVAL;
     577  }
     578
     579  return rv;
     580}
     581
     582static int pipe_select(
     583  pipe_control_t *pipe,
     584  const rtems_ioctl_select_request *request
     585)
     586{
     587  int rv = 0;
     588
     589  switch (request->kind) {
     590    case RTEMS_IOCTL_SELECT_READ:
     591      if (!PIPE_EMPTY(pipe)) {
     592        rv = 1;
     593      } else {
     594        rv = pipe_register_select_wakeup(&pipe->select_read_task_id, request);
     595      }
     596      break;
     597    case RTEMS_IOCTL_SELECT_WRITE:
     598      if (PIPE_SPACE(pipe) > 0) {
     599        rv = 1;
     600      } else {
     601        rv = pipe_register_select_wakeup(&pipe->select_write_task_id, request);
     602      }
     603      break;
     604    default:
     605      break;
     606  }
     607
     608  return rv;
     609}
     610
    548611/*
    549612 * Interface to file system ioctl.
     
    556619)
    557620{
    558   if (cmd == FIONREAD) {
    559     if (buffer == NULL)
    560       return -EFAULT;
    561 
    562     if (! PIPE_LOCK(pipe))
    563       return -EINTR;
    564 
    565     /* Return length of pipe */
    566     *(unsigned int *)buffer = pipe->Length;
     621  int rv = 0;
     622
     623  if (PIPE_LOCK(pipe)) {
     624    switch (cmd) {
     625      case RTEMS_IOCTL_SELECT:
     626        rv = pipe_select(pipe, buffer);
     627        break;
     628      case FIONREAD:
     629        /* Return length of pipe */
     630        *(unsigned int *) buffer = pipe->Length;
     631        break;
     632      default:
     633        rv = -EINVAL;
     634        break;
     635    }
     636
    567637    PIPE_UNLOCK(pipe);
    568     return 0;
    569   }
    570 
    571   return -EINVAL;
    572 }
     638  } else {
     639    rv = -EINTR;
     640  }
     641
     642  return rv;
     643}
  • cpukit/libfs/src/pipe/pipe.h

    rda154e14 ra7d1992c  
    3838  rtems_id readBarrier;   /* wait queues */
    3939  rtems_id writeBarrier;
     40  rtems_id select_read_task_id;
     41  rtems_id select_write_task_id;
    4042#if 0
    4143  boolean Anonymous;      /* anonymous pipe or FIFO */
  • cpukit/libnetworking/rtems/rtems_select.c

    rda154e14 ra7d1992c  
    2626#include <net/if.h>
    2727#include <net/route.h>
     28
     29RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_OTHER == 0, other);
     30RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_READ == FREAD, fread);
     31RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_WRITE == FWRITE, fwrite);
     32RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_EVENT == SBWAIT_EVENT, sbwait_event);
    2833
    2934/*
     
    8590        int n = 0;
    8691        static int flag[3] = { FREAD, FWRITE, 0 };
     92        int update_obits;
     93        int rv;
     94        rtems_ioctl_select_request select_request;
     95
     96        select_request.request_task_id = tid;
    8797
    8898        for (msk = 0; msk < 3; msk++) {
     
    95105                                        continue;
    96106                                bits &= ~bit;
     107                                update_obits = 0;
    97108                                so = rtems_bsdnet_fdToSocket (fd);
    98                                 if (so == NULL)
    99                                         return (EBADF);
    100                                 if (socket_select (so, flag[msk], tid)) {
     109                                if (so != NULL) {
     110                                        if (socket_select (so, flag[msk], tid)) {
     111                                                update_obits = 1;
     112                                        }
     113                                } else {
     114                                        select_request.kind = flag[msk];
     115
     116                                        rtems_bsdnet_semaphore_release();
     117                                        rv = ioctl (fd, RTEMS_IOCTL_SELECT, &select_request);
     118                                        rtems_bsdnet_semaphore_obtain();
     119                                        if (rv == 1) {
     120                                                update_obits = 1;
     121                                        } else if (rv != 0) {
     122                                                return (EBADF);
     123                                        }
     124                                }
     125
     126                                if (update_obits) {
    101127                                        obits[msk][fd/NFDBITS] |=
    102128                                                        (1 << (fd % NFDBITS));
  • testsuites/libtests/flashdisk01/test-file-system.c

    rda154e14 ra7d1992c  
    597597  if (pos != (off_t) -1) {
    598598    size_t buf_size = sizeof(fs->buf);
     599    size_t offset = HEADER_SIZE + 1;
    599600    long random = lrand48();
    600     size_t out = get_bucket_with_random(buf_size, random) + 1;
     601    size_t out = get_bucket_with_random(buf_size - offset, random) + offset;
    601602    ssize_t out_actual = 0;
    602603    uint8_t *buf = fs->buf;
     
    605606    size_t word_count = 0;
    606607    size_t w = 0;
    607 
    608     /* Must be big enough for the header */
    609     out = out >= HEADER_SIZE ? out : HEADER_SIZE;
    610608
    611609    /*
  • testsuites/sptests/spfifo04/init.c

    rda154e14 ra7d1992c  
    5151  rtems_test_assert( errno == ESPIPE );
    5252
    53   puts( "Init - ioctl: FIONBIO -- Expected EFAULT" );
    54   status = ioctl( fd, FIONBIO, NULL );
    55   rtems_test_assert( status == -1 );
    56   rtems_test_assert( errno == EFAULT );
    57 
    5853  puts( "Init - ioctl: FIONBIO -- OK" );
    5954  status = ioctl( fd, FIONBIO, &flag );
     
    6661
    6762  puts( "Init - ioctl: Dummy Command -- Expected EINVAL" );
    68   status = ioctl( fd, -1, NULL );
     63  status = ioctl( fd, -1 );
    6964  rtems_test_assert( status == -1 );
    7065  rtems_test_assert( errno == EINVAL );
    71 
    72   puts( "Init - ioctl: FIONREAD -- Expected EFAULT" );
    73   status = ioctl( fd, FIONREAD, NULL );
    74   rtems_test_assert( status == -1 );
    75   rtems_test_assert( errno == EFAULT );
    7666
    7767  puts( "Init - ioctl: FIONREAD -- OK" );
Note: See TracChangeset for help on using the changeset viewer.