<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-07-01)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>

        * Makefile.am, configure.ac: Add test for task driven drivers.
        * termios05/.cvsignore, termios05/Makefile.am, termios05/init.c,
        termios05/termios05.doc, termios05/termios05.scn,
        termios05/termios_testdriver_taskdriven.c,
        termios05/termios_testdriver_taskdriven.h: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ChangeLog.diff?r1=text&tr1=1.193&r2=text&tr2=1.194&diff_format=h">M</a></td><td width='1%'>1.194</td><td width='100%'>testsuites/libtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/Makefile.am.diff?r1=text&tr1=1.32&r2=text&tr2=1.33&diff_format=h">M</a></td><td width='1%'>1.33</td><td width='100%'>testsuites/libtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/configure.ac.diff?r1=text&tr1=1.39&r2=text&tr2=1.40&diff_format=h">M</a></td><td width='1%'>1.40</td><td width='100%'>testsuites/libtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/termios05.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/termios05.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/termios05.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/termios05.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/termios_testdriver_taskdriven.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/termios_testdriver_taskdriven.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios05/termios_testdriver_taskdriven.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/termios05/termios_testdriver_taskdriven.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/libtests/ChangeLog:1.193 rtems/testsuites/libtests/ChangeLog:1.194
--- rtems/testsuites/libtests/ChangeLog:1.193   Mon Jun 28 12:15:44 2010
+++ rtems/testsuites/libtests/ChangeLog Thu Jul  1 09:34:59 2010
</font><font color='#997700'>@@ -1,3 +1,11 @@
</font><font color='#000088'>+2010-07-01    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * Makefile.am, configure.ac: Add test for task driven drivers.
+       * termios05/.cvsignore, termios05/Makefile.am, termios05/init.c,
+       termios05/termios05.doc, termios05/termios05.scn,
+       termios05/termios_testdriver_taskdriven.c,
+       termios05/termios_testdriver_taskdriven.h: New files.
+
</font> 2010-06-28        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * Makefile.am, configure.ac: Revert changes related to uncommitted test

<font color='#006600'>diff -u rtems/testsuites/libtests/Makefile.am:1.32 rtems/testsuites/libtests/Makefile.am:1.33
--- rtems/testsuites/libtests/Makefile.am:1.32  Mon Jun 28 12:15:44 2010
+++ rtems/testsuites/libtests/Makefile.am       Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -8,7 +8,7 @@
</font> 
 SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 malloc03 heapwalk \
     putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
<font color='#880000'>-    termios termios01 termios02 termios03 termios04 \
</font><font color='#000088'>+    termios termios01 termios02 termios03 termios04 termios05 \
</font>     rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
     block08 block09 block10 stringto01
 

<font color='#006600'>diff -u rtems/testsuites/libtests/configure.ac:1.39 rtems/testsuites/libtests/configure.ac:1.40
--- rtems/testsuites/libtests/configure.ac:1.39 Mon Jun 28 12:15:44 2010
+++ rtems/testsuites/libtests/configure.ac      Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -62,6 +62,7 @@
</font> termios02/Makefile
 termios03/Makefile
 termios04/Makefile
<font color='#000088'>+termios05/Makefile
</font> tztest/Makefile
 POSIX/Makefile
 ])

<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/.cvsignore:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/.cvsignore      Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/Makefile.am:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/Makefile.am     Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,28 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = termios05
+termios05_SOURCES = init.c ../termios04/termios_testdriver_intr.c
+
+dist_rtems_tests_DATA = termios05.scn
+dist_rtems_tests_DATA += termios05.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/termios04
+AM_CPPFLAGS += -DTASK_DRIVEN
+
+LINK_OBJS = $(termios05_OBJECTS) $(termios05_LDADD)
+LINK_LIBS = $(termios05_LDLIBS)
+
+termios05$(EXEEXT): $(termios05_OBJECTS) $(termios05_DEPENDENCIES)
+       @rm -f termios05$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/init.c:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/init.c  Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,158 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+#include "termios_testdriver_intr.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <termios.h>
+#include <rtems/dumpbuf.h>
+
+void write_helper(
+  int        fd,
+  const char *c
+)
+{
+  size_t   len;
+  int      rc;
+<span style="background-color: #FF0000">  </span>
+  len = strlen( c );
+  printf( "Writing: %s", c );
+
+  rc = write( fd, c, len );
+  rtems_test_assert( rc == len );
+
+  termios_test_driver_dump_tx("Transmitted");
+}
+
+uint8_t read_helper_buffer[256];
+
+void read_helper(
+  int         fd,
+  const char *expected
+)
+{
+  int    rc;
+  size_t len;
+
+  len = strlen( expected );
+
+  termios_test_driver_set_rx( expected, len );
+  printf( "\nReading (expected):\n" );
+  rtems_print_buffer( (unsigned char *)expected, len-1 );
+
+  rc = read( fd, read_helper_buffer, sizeof(read_helper_buffer) );
+  rtems_test_assert( rc != -1 );
+
+  printf( "Read %d bytes from read(2)\n", rc );
+  rtems_print_buffer( read_helper_buffer, rc );
+
+  termios_test_driver_dump_tx("Echoed");
+}
+
+int Test_fd;
+
+void open_it(void)
+{
+  /* open the file */
+  puts( "open(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+  Test_fd = open( TERMIOS_TEST_DRIVER_DEVICE_NAME, O_RDWR );
+  rtems_test_assert( Test_fd != -1 );
+}
+
+void close_it(void)
+{
+  int rc;
+
+  puts( "close(" TERMIOS_TEST_DRIVER_DEVICE_NAME ") - OK " );
+  rc = close( Test_fd );
+  rtems_test_assert( rc == 0 );
+}
+
+void change_iflag( const char *desc, int mask, int new )
+{
+  int            rc;
+  struct termios attr;
+
+  printf( "Changing c_iflag to: %s\n", desc );
+  rc = tcgetattr( Test_fd, &attr );
+  rtems_test_assert( rc == 0 );
+
+  attr.c_iflag &= ~mask;
+  attr.c_iflag |= new;
+
+  rc = tcsetattr( Test_fd, TCSANOW, &attr );
+  rtems_test_assert( rc == 0 );
+}
+
+const char ExpectedOutput_1[] = "This is test output.\n";
+const char ExpectedInput_1[] = "Test input this is.\n";
+const char ExpectedInput_2[] = "1235\b456.\n";
+const char ExpectedInput_3[] = "tab\ttab.\n";
+const char ExpectedInput_4[] = "cr\r.";
+const char ExpectedInput_5[] = "aBcDeFgH.\n";
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  puts( "\n\n*** TEST TERMIOS05 ***" );
+
+  open_it();
+
+  /* some basic cases */
+  write_helper( Test_fd, ExpectedOutput_1 );
+  read_helper( Test_fd, ExpectedInput_1 );
+  read_helper( Test_fd, ExpectedInput_2 );
+  read_helper( Test_fd, ExpectedInput_3 );
+  read_helper( Test_fd, ExpectedInput_4 );
+
+  /* test to lower case input mapping */
+  read_helper( Test_fd, ExpectedInput_5 );
+  change_iflag( "Enable to lower case mapping on input", IUCLC, IUCLC );
+  read_helper( Test_fd, ExpectedInput_5 );
+  change_iflag( "Disable to lower case mapping on input", IUCLC, 0 );
+
+  close_it();
+
+  puts( "*** END OF TEST TERMIOS05 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_EXTRA_DRIVERS \
+  TERMIOS_TEST_DRIVER_TABLE_ENTRY
+
+/* include an extra slot for registering the termios one dynamically */
+#define CONFIGURE_MAXIMUM_DRIVERS 3
+
+/* one for the console and one for the test port */
+#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 3
+
+/* we need to be able to open the test device */
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
+
+#define CONFIGURE_MAXIMUM_TASKS             4
+#define CONFIGURE_MAXIMUM_TIMERS            2
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/termios05.doc:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/termios05.doc   Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2010.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  termios05
+
+directives:
+
+  various termios services related to task driven IO
+
+concepts:
+
++ task driven IO
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/termios05.scn:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/termios05.scn   Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,59 @@
</font><font color='#000088'>+*** TEST TERMIOS05 ***
+open(/dev/test) - OK<span style="background-color: #FF0000"> </span>
+Writing: This is test output.
+Transmitted 20 characters
+54 68 69 73 20 69 73 20 74 65 73 74 20 6f 75 74 |This is test out|
+70 75 74 2e                                     |put.            |
+
+Reading (expected):
+54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this |
+69 73 2e                                        |is.             |
+Read 20 bytes from read(2)
+54 65 73 74 20 69 6e 70 75 74 20 74 68 69 73 20 |Test input this |
+69 73 2e 0a                                     |is..            |
+Echoed 23 characters
+0d 0a 54 65 73 74 20 69 6e 70 75 74 20 74 68 69 |..Test input thi|
+73 20 69 73 2e 0d 0a                            |s is...         |
+
+Reading (expected):
+31 32 33 35 08 34 35 36 2e                      |1235.456.       |
+Read 10 bytes from read(2)
+31 32 33 35 08 34 35 36 2e 0a                   |1235.456..      |
+Echoed 24 characters
+31 00 00 00 00 00 00 00 00 00 00 00 54 68 69 73 |1...........This|
+20 69 73 20 74 65 73 74                         | is test        |
+
+Reading (expected):
+74 61 62 09 74 61 62 2e                         |tab.tab.        |
+Read 9 bytes from read(2)
+74 61 62 09 74 61 62 2e 0a                      |tab.tab..       |
+Echoed 25 characters
+20 6f 75 74 70 75 74 2e 0d 0a 54 65 73 74 20 69 | output...Test i|
+6e 70 75 74 20 74 68 69 73                      |nput this       |
+
+Reading (expected):
+63 72 0d                                        |cr.             |
+Read 3 bytes from read(2)
+63 72 0a                                        |cr.             |
+Echoed 22 characters
+20 69 73 2e 0d 0a 31 32 33 35 5e 48 34 35 36 2e | is...1235^H456.|
+0d 0a 74 61 62 20                               |..tab           |
+
+Reading (expected):
+61 42 63 44 65 46 67 48 2e                      |aBcDeFgH.       |
+Read 11 bytes from read(2)
+2e 61 42 63 44 65 46 67 48 2e 0a                |.aBcDeFgH..     |
+Echoed 25 characters
+20 20 20 20 74 61 62 2e 0d 0a 63 72 0d 0a 2e 61 |    tab...cr...a|
+42 63 44 65 46 67 48 2e 0d                      |BcDeFgH..       |
+Changing c_iflag to: Enable to lower case mapping on input
+
+Reading (expected):
+61 42 63 44 65 46 67 48 2e                      |aBcDeFgH.       |
+Read 10 bytes from read(2)
+61 62 63 64 65 66 67 68 2e 0a                   |abcdefgh..      |
+Echoed 12 characters
+0a 61 62 63 64 65 66 67 68 2e 0d 0a             |.abcdefgh...    |
+Changing c_iflag to: Disable to lower case mapping on input
+close(/dev/test) - OK<span style="background-color: #FF0000"> </span>
+*** END OF TEST TERMIOS05 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/termios_testdriver_taskdriven.h:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/termios_testdriver_taskdriven.h Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,164 @@
</font><font color='#000088'>+/**
+ * @file termios_testdriver.h
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2009.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _TERMIOS_TESTDRIVER_H
+#define _TERMIOS_TESTDRIVER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void termios_test_driver_set_rx(
+  const void *p,
+  size_t      len
+);
+
+void termios_test_driver_dump_tx(const char *c);
+
+/**
+ *  This macro defines the standard name for the Termios Test device
+ *  that is available to applications.
+ */
+#define TERMIOS_TEST_DRIVER_DEVICE_NAME "/dev/test"
+
+/**
+ *  This macro defines the standard device driver table entry for
+ *  a Termios Test device driver.
+ */
+#define TERMIOS_TEST_DRIVER_TABLE_ENTRY \
+  { termios_test_driver_initialize, termios_test_driver_open, \
+    termios_test_driver_close, termios_test_driver_read, \
+    termios_test_driver_write, termios_test_driver_control }
+
+/**
+ *  @brief Console Initialization Entry Point
+ *
+ *  This method initializes the Termios Test device driver.
+ *
+ *  @param[in] major is the device driver major number
+ *  @param[in] minor is the device driver minor number
+ *  @param[in] arg is the parameters to this call
+ *
+ *  @return This method returns RTEMS_SUCCESSFUL when
+ *          the device driver is successfully initialized.
+ */
+rtems_device_driver termios_test_driver_initialize(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+);
+
+/**
+ *  @brief Console Open Entry Point
+ *
+ *  This method opens a specific device supported by the
+ *  Termios Test device driver.
+ *
+ *  @param[in] major is the device driver major number
+ *  @param[in] minor is the device driver minor number
+ *  @param[in] arg is the parameters to this call
+ *
+ *  @return This method returns RTEMS_SUCCESSFUL when
+ *          the device driver is successfully opened.
+ */
+rtems_device_driver termios_test_driver_open(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+);
+
+/**
+ *  @brief Console Close Entry Point
+ *
+ *  This method closes a specific device supported by the
+ *  Termios Test device driver.
+ *
+ *  @param[in] major is the device driver major number
+ *  @param[in] minor is the device driver minor number
+ *  @param[in] arg is the parameters to this call
+ *
+ *  @return This method returns RTEMS_SUCCESSFUL when
+ *          the device is successfully closed.
+ */
+rtems_device_driver termios_test_driver_close(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+);
+
+/**
+ *  @brief Console Read Entry Point
+ *
+ *  This method reads from a specific device supported by the
+ *  Termios Test device driver.
+ *
+ *  @param[in] major is the device driver major number
+ *  @param[in] minor is the device driver minor number
+ *  @param[in] arg is the parameters to this call
+ *
+ *  @return This method returns RTEMS_SUCCESSFUL when
+ *          the device is successfully read from.
+ */
+rtems_device_driver termios_test_driver_read(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+);
+
+/**
+ *  @brief Console Write Entry Point
+ *
+ *  This method writes to a specific device supported by the
+ *  Termios Test device driver.
+ *
+ *  @param[in] major is the device driver major number
+ *  @param[in] minor is the device driver minor number
+ *  @param[in] arg is the parameters to this call
+ *
+ *  @return This method returns RTEMS_SUCCESSFUL when
+ *          the device is successfully written.
+ */
+rtems_device_driver termios_test_driver_write(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+);
+
+/**
+ *  @brief Console IO Control Entry Point
+ *
+ *  This method performs an IO Control operation on a
+ *  specific device supported by the Termios Test device driver.
+ *
+ *  @param[in] major is the device driver major number
+ *  @param[in] minor is the device driver minor number
+ *  @param[in] arg is the parameters to this call
+ *
+ *  @return This method returns RTEMS_SUCCESSFUL when
+ *          the device driver IO control operation is
+ *          successfully performed.
+ */
+rtems_device_driver termios_test_driver_control(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/termios05/termios_testdriver_taskdriven.c:1.1
--- /dev/null   Thu Jul  1 10:13:57 2010
+++ rtems/testsuites/libtests/termios05/termios_testdriver_taskdriven.c Thu Jul  1 09:35:00 2010
</font><font color='#997700'>@@ -0,0 +1,171 @@
</font><font color='#000088'>+/*
+ *  This file contains a test fixture termios device driver
+ *
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include "tmacros.h"
+#include <rtems/libio.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <rtems/termiostypes.h>
+#include <rtems/dumpbuf.h>
+#include "termios_testdriver_taskdriven.h"
+
+#define TX_MAX 1024
+uint8_t Tx_Buffer[TX_MAX];
+int     Tx_Index = 0;
+
+void termios_test_driver_dump_tx(const char *c)
+{
+  printf( "%s %d characters\n", c, Tx_Index );
+  rtems_print_buffer( Tx_Buffer, Tx_Index );
+  Tx_Index = 0;
+}
+<span style="background-color: #FF0000">  </span>
+const uint8_t *Rx_Buffer;
+int            Rx_Index;
+int            Rx_Length;
+bool           Rx_FirstTime = true;
+
+void termios_test_driver_set_rx(
+  const void *p,
+  size_t      len
+)
+{
+  Rx_Buffer = p;
+  Rx_Length = len;
+  Rx_Index  = 0;
+}
+
+int termios_test_driver_inbyte_nonblocking( int port )
+{
+  if ( Rx_FirstTime == true ) {
+    Rx_FirstTime = false;
+    return -1;
+  }
+  if ( Rx_Index >= Rx_Length )
+    return -1;
+  return Rx_Buffer[ Rx_Index++ ];
+}
+
+void termios_test_driver_outbyte_polled(
+  int  port,
+  char ch
+)
+{
+  Tx_Buffer[Tx_Index++] = (uint8_t) ch;
+}
+
+ssize_t termios_test_driver_write_support (int minor, const char *buf, size_t len)
+{
+  size_t nwrite = 0;
+
+  while (nwrite < len) {
+    termios_test_driver_outbyte_polled( minor, *buf++ );
+    nwrite++;
+  }
+  return nwrite;
+}
+
+
+/*
+ *  Set Attributes Handler
+ */
+int termios_test_driver_set_attributes(
+  int                   minor,
+  const struct termios *t
+)
+{
+  return 0;
+}
+
+/*
+ *  Test Device Driver Entry Points
+ */
+rtems_device_driver termios_test_driver_initialize(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+)
+{
+  rtems_termios_initialize();
+
+  /*
+   *  Register Device Names
+   */
+  (void) rtems_io_register_name( TERMIOS_TEST_DRIVER_DEVICE_NAME, major, 0 );
+
+  return RTEMS_SUCCESSFUL;
+}
+
+rtems_device_driver termios_test_driver_open(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  rtems_status_code sc;
+  static const rtems_termios_callbacks Callbacks = {
+    NULL,                                    /* firstOpen */
+    NULL,                                    /* lastClose */
+    termios_test_driver_inbyte_nonblocking,  /* pollRead */
+    termios_test_driver_write_support,       /* write */
+    termios_test_driver_set_attributes,      /* setAttributes */
+    NULL,                                    /* stopRemoteTx */
+    NULL,                                    /* startRemoteTx */
+    TERMIOS_TASK_DRIVEN                      /* outputUsesInterrupts */
+  };
+
+  if ( minor > 2 ) {
+    puts( "ERROR - Termios_testdriver - only 1 minor supported" );
+    rtems_test_exit(0);
+  }
+
+  sc = rtems_termios_open (major, minor, arg, &Callbacks);
+
+  return RTEMS_SUCCESSFUL;
+}
+
+rtems_device_driver termios_test_driver_close(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return rtems_termios_close (arg);
+}
+
+rtems_device_driver termios_test_driver_read(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return rtems_termios_read (arg);
+}
+
+rtems_device_driver termios_test_driver_write(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return rtems_termios_write (arg);
+}
+
+rtems_device_driver termios_test_driver_control(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void                    * arg
+)
+{
+  return rtems_termios_ioctl (arg);
+}
</font></pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>

        * termios04/termios_testdriver_intr.c: Task driven IO now works.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ChangeLog.diff?r1=text&tr1=1.194&r2=text&tr2=1.195&diff_format=h">M</a></td><td width='1%'>1.195</td><td width='100%'>testsuites/libtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/termios04/termios_testdriver_intr.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/libtests/termios04/termios_testdriver_intr.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/libtests/ChangeLog:1.194 rtems/testsuites/libtests/ChangeLog:1.195
--- rtems/testsuites/libtests/ChangeLog:1.194   Thu Jul  1 09:34:59 2010
+++ rtems/testsuites/libtests/ChangeLog Thu Jul  1 09:35:53 2010
</font><font color='#997700'>@@ -1,5 +1,9 @@
</font> 2010-07-01        Joel Sherrill <joel.sherrill@oarcorp.com>
 
<font color='#000088'>+   * termios04/termios_testdriver_intr.c: Task driven IO now works.
+
+2010-07-01     Joel Sherrill <joel.sherrill@oarcorp.com>
+
</font>   * Makefile.am, configure.ac: Add test for task driven drivers.
        * termios05/.cvsignore, termios05/Makefile.am, termios05/init.c,
        termios05/termios05.doc, termios05/termios05.scn,

<font color='#006600'>diff -u rtems/testsuites/libtests/termios04/termios_testdriver_intr.c:1.1 rtems/testsuites/libtests/termios04/termios_testdriver_intr.c:1.2
--- rtems/testsuites/libtests/termios04/termios_testdriver_intr.c:1.1   Mon Jun 28 09:23:19 2010
+++ rtems/testsuites/libtests/termios04/termios_testdriver_intr.c       Thu Jul  1 09:35:54 2010
</font><font color='#997700'>@@ -19,15 +19,23 @@
</font> #include <rtems/dumpbuf.h>
 #include "termios_testdriver_intr.h"
 
<font color='#880000'>-rtems_id Timer;
</font><font color='#000088'>+rtems_id Rx_Timer;
+rtems_id Tx_Timer;
</font> 
 #define TX_MAX 1024
<font color='#880000'>-uint8_t Tx_Buffer[TX_MAX];
-int     Tx_Index = 0;
</font><font color='#000088'>+uint8_t                   Tx_Buffer[TX_MAX];
+int                       Tx_Index = 0;
</font> struct rtems_termios_tty *Ttyp;
 
<font color='#000088'>+void termios_test_driver_wait_for_tx_to_complete(void)
+{
+  rtems_task_wake_after( 2 * rtems_clock_get_ticks_per_second() );
+}
+
</font> void termios_test_driver_dump_tx(const char *c)
 {
<font color='#000088'>+  termios_test_driver_wait_for_tx_to_complete();
+
</font>   printf( "%s %d characters\n", c, Tx_Index );
   rtems_print_buffer( Tx_Buffer, Tx_Index );
   Tx_Index = 0;
<font color='#997700'>@@ -39,6 +47,19 @@
</font> bool           Rx_FirstTime = true;
 bool           Rx_EnqueueNow = false;
 
<font color='#000088'>+#if defined(TASK_DRIVEN)
+  int termios_test_driver_inbyte_nonblocking( int port )
+  {
+    if ( Rx_FirstTime == true ) {
+      Rx_FirstTime = false;
+      return -1;
+    }
+    if ( Rx_Index >= Rx_Length )
+      return -1;
+    return Rx_Buffer[ Rx_Index++ ];
+  }
+#endif
+
</font> rtems_timer_service_routine Rx_ISR(
   rtems_id  ignored_id,
   void     *ignored_address
<font color='#997700'>@@ -51,8 +72,21 @@
</font> 
   ch = Rx_Buffer[ Rx_Index++ ];
   rtems_termios_enqueue_raw_characters (Ttyp, (char *)&ch, 1);
<font color='#000088'>+  #if defined(TASK_DRIVEN)
+    rtems_termios_rxirq_occured(Ttyp);
+  #endif
+
+  (void) rtems_timer_fire_after( Rx_Timer, 10, Rx_ISR, NULL );
+}
+
+rtems_timer_service_routine Tx_ISR(
+  rtems_id  ignored_id,
+  void     *ignored_address
+)
+{
+  rtems_termios_dequeue_characters (Ttyp, 1);
</font> 
<font color='#880000'>-  (void) rtems_timer_fire_after( Timer, 10, Rx_ISR, NULL );
</font><font color='#000088'>+  (void) rtems_timer_fire_after( Tx_Timer, 10, Tx_ISR, NULL );
</font> }
 
 void termios_test_driver_set_rx_enqueue_now(
<font color='#997700'>@@ -72,7 +106,7 @@
</font>   Rx_Index  = 0;
 
   if ( Rx_EnqueueNow == false) {
<font color='#880000'>-    (void) rtems_timer_fire_after( Timer, 10, Rx_ISR, NULL );
</font><font color='#000088'>+    (void) rtems_timer_fire_after( Rx_Timer, 10, Rx_ISR, NULL );
</font>     return;
   }
 
<font color='#997700'>@@ -89,12 +123,9 @@
</font>   size_t      len
 )
 {
<font color='#880000'>-  size_t  i;
-
-  for (i=0 ; i<len ; i++ )
-    Tx_Buffer[Tx_Index++] = (uint8_t) buf[i];
-
-  return len;
</font><font color='#000088'>+  Tx_Buffer[Tx_Index++] = buf[0];
+  (void) rtems_timer_fire_after( Tx_Timer, 10, Tx_ISR, NULL );
+  return 1;
</font> }
 
 /*
<font color='#997700'>@@ -126,7 +157,11 @@
</font>    */
   (void) rtems_io_register_name( TERMIOS_TEST_DRIVER_DEVICE_NAME, major, 0 );
 
<font color='#880000'>-  status = rtems_timer_create( rtems_build_name('T', 'M', '0', '1'), &Timer );
</font><font color='#000088'>+  status = rtems_timer_create(rtems_build_name('T', 'M', 'R', 'X'), &Rx_Timer);
+  if ( status )
+    rtems_fatal_error_occurred(1);;
+
+  status = rtems_timer_create(rtems_build_name('T', 'M', 'T', 'X'), &Tx_Timer);
</font>   if ( status )
     rtems_fatal_error_occurred(1);;
 
<font color='#997700'>@@ -144,12 +179,20 @@
</font>   static const rtems_termios_callbacks Callbacks = {
     NULL,                                    /* firstOpen */
     NULL,                                    /* lastClose */
<font color='#880000'>-    NULL,                                    /* pollRead */
</font><font color='#000088'>+    #if defined(TASK_DRIVEN)
+      termios_test_driver_inbyte_nonblocking,/* pollRead */
+    #else
+      NULL,                                  /* pollRead */
+    #endif
</font>     termios_test_driver_write_helper,        /* write */
     termios_test_driver_set_attributes,      /* setAttributes */
     NULL,                                    /* stopRemoteTx */
     NULL,                                    /* startRemoteTx */
<font color='#880000'>-    0                                        /* outputUsesInterrupts */
</font><font color='#000088'>+    #if defined(TASK_DRIVEN)
+      TERMIOS_TASK_DRIVEN                    /* outputUsesInterrupts */
+    #else
+      0                                      /* outputUsesInterrupts */
+    #endif
</font>   };
 
   if ( minor > 2 ) {
</pre>
<p> </p>
<a name='cs3'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>

        * Makefile.am, configure.ac: Add test for GCC C++ library helpers.
        * gxx01/.cvsignore, gxx01/Makefile.am, gxx01/gxx01.doc,
        gxx01/gxx01.scn, gxx01/gxx_wrappers.h, gxx01/init.c: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/ChangeLog.diff?r1=text&tr1=1.195&r2=text&tr2=1.196&diff_format=h">M</a></td><td width='1%'>1.196</td><td width='100%'>testsuites/libtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/Makefile.am.diff?r1=text&tr1=1.33&r2=text&tr2=1.34&diff_format=h">M</a></td><td width='1%'>1.34</td><td width='100%'>testsuites/libtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/configure.ac.diff?r1=text&tr1=1.40&r2=text&tr2=1.41&diff_format=h">M</a></td><td width='1%'>1.41</td><td width='100%'>testsuites/libtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/gxx01/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/gxx01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/gxx01/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/gxx01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/gxx01/gxx01.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/gxx01/gxx01.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/gxx01/gxx01.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/gxx01/gxx01.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/gxx01/gxx_wrappers.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/gxx01/gxx_wrappers.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/libtests/gxx01/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/libtests/gxx01/init.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/libtests/ChangeLog:1.195 rtems/testsuites/libtests/ChangeLog:1.196
--- rtems/testsuites/libtests/ChangeLog:1.195   Thu Jul  1 09:35:53 2010
+++ rtems/testsuites/libtests/ChangeLog Thu Jul  1 09:37:35 2010
</font><font color='#997700'>@@ -1,5 +1,11 @@
</font> 2010-07-01        Joel Sherrill <joel.sherrill@oarcorp.com>
 
<font color='#000088'>+   * Makefile.am, configure.ac: Add test for GCC C++ library helpers.
+       * gxx01/.cvsignore, gxx01/Makefile.am, gxx01/gxx01.doc,
+       gxx01/gxx01.scn, gxx01/gxx_wrappers.h, gxx01/init.c: New files.
+
+2010-07-01     Joel Sherrill <joel.sherrill@oarcorp.com>
+
</font>   * termios04/termios_testdriver_intr.c: Task driven IO now works.
 
 2010-07-01     Joel Sherrill <joel.sherrill@oarcorp.com>

<font color='#006600'>diff -u rtems/testsuites/libtests/Makefile.am:1.33 rtems/testsuites/libtests/Makefile.am:1.34
--- rtems/testsuites/libtests/Makefile.am:1.33  Thu Jul  1 09:35:00 2010
+++ rtems/testsuites/libtests/Makefile.am       Thu Jul  1 09:37:36 2010
</font><font color='#997700'>@@ -6,7 +6,7 @@
</font> 
 SUBDIRS = POSIX
 
<font color='#880000'>-SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 malloc03 heapwalk \
</font><font color='#000088'>+SUBDIRS += bspcmdline01 cpuuse gxx01 malloctest malloc02 malloc03 heapwalk \
</font>     putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
     termios termios01 termios02 termios03 termios04 termios05 \
     rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \

<font color='#006600'>diff -u rtems/testsuites/libtests/configure.ac:1.40 rtems/testsuites/libtests/configure.ac:1.41
--- rtems/testsuites/libtests/configure.ac:1.40 Thu Jul  1 09:35:00 2010
+++ rtems/testsuites/libtests/configure.ac      Thu Jul  1 09:37:37 2010
</font><font color='#997700'>@@ -45,6 +45,7 @@
</font> block10/Makefile
 bspcmdline01/Makefile
 cpuuse/Makefile
<font color='#000088'>+gxx01/Makefile
</font> heapwalk/Makefile
 malloctest/Makefile
 malloc02/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/gxx01/.cvsignore:1.1
--- /dev/null   Thu Jul  1 10:13:58 2010
+++ rtems/testsuites/libtests/gxx01/.cvsignore  Thu Jul  1 09:37:38 2010
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/gxx01/Makefile.am:1.1
--- /dev/null   Thu Jul  1 10:13:58 2010
+++ rtems/testsuites/libtests/gxx01/Makefile.am Thu Jul  1 09:37:39 2010
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = gxx01
+gxx01_SOURCES = init.c
+
+dist_rtems_tests_DATA = gxx01.scn
+dist_rtems_tests_DATA += gxx01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(gxx01_OBJECTS) $(gxx01_LDADD)
+LINK_LIBS = $(gxx01_LDLIBS)
+
+gxx01$(EXEEXT): $(gxx01_OBJECTS) $(gxx01_DEPENDENCIES)
+       @rm -f gxx01$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/gxx01/gxx01.doc:1.1
--- /dev/null   Thu Jul  1 10:13:58 2010
+++ rtems/testsuites/libtests/gxx01/gxx01.doc   Thu Jul  1 09:37:40 2010
</font><font color='#997700'>@@ -0,0 +1,37 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2010.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  gxx01
+
+directives:
+
+  rtems_gxx_once
+  rtems_gxx_key_create<span style="background-color: #FF0000"> </span>
+  rtems_gxx_key_dtor<span style="background-color: #FF0000"> </span>
+  rtems_gxx_key_delete<span style="background-color: #FF0000"> </span>
+  rtems_gxx_getspecific
+  rtems_gxx_setspecific
+  rtems_gxx_mutex_init<span style="background-color: #FF0000"> </span>
+  rtems_gxx_mutex_lock<span style="background-color: #FF0000"> </span>
+  rtems_gxx_mutex_destroy<span style="background-color: #FF0000"> </span>
+  rtems_gxx_mutex_trylock<span style="background-color: #FF0000"> </span>
+  rtems_gxx_mutex_unlock<span style="background-color: #FF0000"> </span>
+  rtems_gxx_recursive_mutex_init
+  rtems_gxx_recursive_mutex_lock
+  rtems_gxx_recursive_mutex_trylock
+  rtems_gxx_recursive_mutex_unlock
+
+concepts:
+
++ Fully exercise wrappers provided by RTEMS for GCC's C++ library's
+  mutual exclusion implementation.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/gxx01/gxx01.scn:1.1
--- /dev/null   Thu Jul  1 10:13:58 2010
+++ rtems/testsuites/libtests/gxx01/gxx01.scn   Thu Jul  1 09:37:43 2010
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+*** TEST GXX 01 ***
+rtems_gxx_mutex_init() - OK
+rtems_gxx_mutex_trylock() - OK
+rtems_gxx_mutex_unlock() - OK
+rtems_gxx_mutex_lock() - OK
+rtems_gxx_mutex_unlock() - OK
+
+rtems_gxx_recursive_mutex_init() - OK
+rtems_gxx_recursive_mutex_trylock() - OK
+rtems_gxx_recursive_mutex_trylock() - Nest
+rtems_gxx_recursive_mutex_unlock() - Unnest
+rtems_gxx_recursive_mutex_unlock() - OK
+rtems_gxx_recursive_mutex_lock() - OK
+rtems_gxx_recursive_mutex_unlock() - OK
+
+Call once method the first time
+Running once method
+Call once method the second time
+
+rtems_gxx_key_create(&key, NULL) - OK
+rtems_gxx_key_delete(key) - OK
+rtems_gxx_key_create(&key, key_dtor) - OK
+rtems_gxx_setspecific() - OK
+rtems_gxx_petspecific() - OK
+rtems_gxx_key_delete(key) - OK
+*** END OF TEST GXX 01 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/gxx01/gxx_wrappers.h:1.1
--- /dev/null   Thu Jul  1 10:13:58 2010
+++ rtems/testsuites/libtests/gxx01/gxx_wrappers.h      Thu Jul  1 09:37:45 2010
</font><font color='#997700'>@@ -0,0 +1,58 @@
</font><font color='#000088'>+/*
+ * RTEMS threads compatibily routines for libgcc2.
+ *
+ * $Id$
+ */
+
+#ifndef __GCC_WRAPPERS_h<span style="background-color: #FF0000"> </span>
+#define __GCC_WRAPPERS_h
+
+/*
+ * These typedefs should match with the ones defined in the file
+ * gcc/gthr-rtems.h in the gcc distribution.
+ * FIXME: T.S, 2007/01/31: -> gcc/gthr-rtems.h still declares
+ *                            void * __gthread_key_t;
+ */
+typedef struct __gthread_key_ {
+       void *val;<span style="background-color: #FF0000"> </span>                   /* this is switched with the task      */
+       void (*dtor)(void*);   /* this remains in place for all tasks */
+} __gthread_key, *__gthread_key_t;
+
+typedef int   __gthread_once_t;
+typedef void *__gthread_mutex_t;
+typedef void *__gthread_recursive_mutex_t;
+
+int rtems_gxx_once(__gthread_once_t *once, void (*func) (void));
+
+int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *));
+
+int rtems_gxx_key_dtor (__gthread_key_t key, void *ptr);
+
+int rtems_gxx_key_delete (__gthread_key_t key);
+
+void *rtems_gxx_getspecific(__gthread_key_t key);
+
+int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
+
+/*
+ * MUTEX support
+ */
+void rtems_gxx_mutex_init (__gthread_mutex_t *mutex);
+
+int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex);
+
+int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex);
+
+int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex);
+
+int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex);
+
+void rtems_gxx_recursive_mutex_init(__gthread_recursive_mutex_t *mutex);
+
+int rtems_gxx_recursive_mutex_lock(__gthread_recursive_mutex_t *mutex);
+
+int rtems_gxx_recursive_mutex_trylock(__gthread_recursive_mutex_t *mutex);
+
+int rtems_gxx_recursive_mutex_unlock(__gthread_recursive_mutex_t *mutex);
+
+#endif
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/libtests/gxx01/init.c:1.1
--- /dev/null   Thu Jul  1 10:13:58 2010
+++ rtems/testsuites/libtests/gxx01/init.c      Thu Jul  1 09:37:46 2010
</font><font color='#997700'>@@ -0,0 +1,179 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+#include "gxx_wrappers.h"
+
+void test_recursive_mutex(void)
+{
+  int                sc;
+   __gthread_mutex_t mutex;
+
+  mutex = 0;
+  puts( "rtems_gxx_recursive_mutex_init() - OK" );
+  rtems_gxx_recursive_mutex_init(&mutex);
+  rtems_test_assert( mutex != 0 );
+
+  puts( "rtems_gxx_recursive_mutex_trylock() - OK" );
+  sc = rtems_gxx_recursive_mutex_trylock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_recursive_mutex_trylock() - Nest" );
+  sc = rtems_gxx_recursive_mutex_trylock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_recursive_mutex_unlock() - Unnest" );
+  sc = rtems_gxx_recursive_mutex_unlock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_recursive_mutex_unlock() - OK" );
+  sc = rtems_gxx_recursive_mutex_unlock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_recursive_mutex_lock() - OK" );
+  sc = rtems_gxx_recursive_mutex_lock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_recursive_mutex_unlock() - OK" );
+  sc = rtems_gxx_recursive_mutex_unlock(&mutex);
+  rtems_test_assert( sc == 0 );
+}
+
+void test_mutex(void)
+{
+  int                sc;
+   __gthread_mutex_t mutex;
+
+  mutex = 0;
+  puts( "rtems_gxx_mutex_init() - OK" );
+  rtems_gxx_mutex_init(&mutex);
+  rtems_test_assert( mutex != 0 );
+
+  puts( "rtems_gxx_mutex_trylock() - OK" );
+  sc = rtems_gxx_mutex_trylock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_mutex_unlock() - OK" );
+  sc = rtems_gxx_mutex_unlock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_mutex_lock() - OK" );
+  sc = rtems_gxx_mutex_lock(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_mutex_unlock() - OK" );
+  sc = rtems_gxx_mutex_unlock(&mutex);
+  rtems_test_assert( sc == 0 );
+}
+
+void once_function(void)
+{
+  puts( "Running once method" );
+}
+
+void test_once(void)
+{
+  __gthread_once_t once;
+  int              sc;
+
+  once = 0;
+
+  puts( "Call once method the first time" );
+  sc = rtems_gxx_once(&once, once_function);
+  rtems_test_assert( sc == 0 );
+
+  puts( "Call once method the second time" );
+  sc = rtems_gxx_once(&once, once_function);
+  rtems_test_assert( sc == 0 );
+}
+
+volatile bool key_dtor_ran;
+
+void key_dtor(void *ptr)
+{
+  key_dtor_ran = true;
+}
+
+void test_key(void)
+{
+  int              sc;
+  __gthread_key_t  key;
+  void            *p;
+
+  puts( "rtems_gxx_key_create(&key, NULL) - OK" );
+  sc = rtems_gxx_key_create(&key, NULL);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_key_delete(key) - OK" );
+  sc = rtems_gxx_key_delete(key);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_key_create(&key, key_dtor) - OK" );
+  sc = rtems_gxx_key_create(&key, key_dtor);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_setspecific() - OK" );
+  sc = rtems_gxx_setspecific(key, (void *)0x1234);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_petspecific() - OK" );
+  p = rtems_gxx_getspecific(key);
+  rtems_test_assert( p == (void *)0x1234 );
+
+  puts( "rtems_gxx_key_delete(key) - OK" );
+  sc = rtems_gxx_key_delete(key);
+  rtems_test_assert( sc == 0 );
+  rtems_test_assert( key_dtor_ran == true );
+
+#if 0
+
+void *rtems_gxx_getspecific(__gthread_key_t key);
+
+int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
+#endif
+}
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  puts( "\n\n*** TEST GXX 01 ***" );
+
+  test_mutex();
+  puts( "" );
+
+  test_recursive_mutex();
+  puts( "" );
+
+  test_once();
+  puts( "" );
+
+  test_key();
+
+  puts( "*** END OF TEST GXX 01 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS        1
+#define CONFIGURE_MAXIMUM_SEMAPHORES   2
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font></pre>
<p> </p>
<a name='cs4'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>

        * Makefile.am, configure.ac: Add tests for file lock stubs as well as
        various POSIX methods that access UID, PID, and GID.
        * psxfilelock01/.cvsignore, psxfilelock01/Makefile.am,
        psxfilelock01/init.c, psxfilelock01/psxfilelock01.doc,
        psxfilelock01/psxfilelock01.scn, psxid01/.cvsignore,
        psxid01/Makefile.am, psxid01/init.c, psxid01/psxid01.doc,
        psxid01/psxid01.scn: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.277&r2=text&tr2=1.278&diff_format=h">M</a></td><td width='1%'>1.278</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/Makefile.am.diff?r1=text&tr1=1.62&r2=text&tr2=1.63&diff_format=h">M</a></td><td width='1%'>1.63</td><td width='100%'>testsuites/psxtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/configure.ac.diff?r1=text&tr1=1.66&r2=text&tr2=1.67&diff_format=h">M</a></td><td width='1%'>1.67</td><td width='100%'>testsuites/psxtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfilelock01/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfilelock01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfilelock01/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfilelock01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfilelock01/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfilelock01/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfilelock01/psxfilelock01.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfilelock01/psxfilelock01.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxfilelock01/psxfilelock01.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxfilelock01/psxfilelock01.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxid01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxid01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxid01/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/psxid01.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxid01/psxid01.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxid01/psxid01.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxid01/psxid01.scn</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.277 rtems/testsuites/psxtests/ChangeLog:1.278
--- rtems/testsuites/psxtests/ChangeLog:1.277   Wed Jun 30 09:41:56 2010
+++ rtems/testsuites/psxtests/ChangeLog Thu Jul  1 09:40:08 2010
</font><font color='#997700'>@@ -1,3 +1,13 @@
</font><font color='#000088'>+2010-07-01    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * Makefile.am, configure.ac: Add tests for file lock stubs as well as
+       various POSIX methods that access UID, PID, and GID.
+       * psxfilelock01/.cvsignore, psxfilelock01/Makefile.am,
+       psxfilelock01/init.c, psxfilelock01/psxfilelock01.doc,
+       psxfilelock01/psxfilelock01.scn, psxid01/.cvsignore,
+       psxid01/Makefile.am, psxid01/init.c, psxid01/psxid01.doc,
+       psxid01/psxid01.scn: New files.
+
</font> 2010-06-30        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        * psximfs01/init.c: Fix warning introduced.

<font color='#006600'>diff -u rtems/testsuites/psxtests/Makefile.am:1.62 rtems/testsuites/psxtests/Makefile.am:1.63
--- rtems/testsuites/psxtests/Makefile.am:1.62  Mon Jun 28 13:48:19 2010
+++ rtems/testsuites/psxtests/Makefile.am       Thu Jul  1 09:40:09 2010
</font><font color='#997700'>@@ -19,8 +19,8 @@
</font> endif
 
 ## File IO tests
<font color='#880000'>-SUBDIRS += psxfile01 psxfile02 psximfs01 psxreaddir psxstat psxmount psx13 \
-  psxchroot01 psxpasswd01
</font><font color='#000088'>+SUBDIRS += psxfile01 psxfile02 psxfilelock01 psxid01 psximfs01 psxreaddir \
+    psxstat psxmount psx13 psxchroot01 psxpasswd01
</font> 
 ## Until sys/uio.h is moved to libcsupport, we have to have networking
 ## enabled to support readv and writev.  Hopefully this is a temporary

<font color='#006600'>diff -u rtems/testsuites/psxtests/configure.ac:1.66 rtems/testsuites/psxtests/configure.ac:1.67
--- rtems/testsuites/psxtests/configure.ac:1.66 Mon Jun 28 14:53:00 2010
+++ rtems/testsuites/psxtests/configure.ac      Thu Jul  1 09:40:09 2010
</font><font color='#997700'>@@ -88,7 +88,9 @@
</font> psxfatal02/Makefile
 psxfile01/Makefile
 psxfile02/Makefile
<font color='#000088'>+psxfilelock01/Makefile
</font> psxhdrs/Makefile
<font color='#000088'>+psxid01/Makefile
</font> psximfs01/Makefile
 psxintrcritical01/Makefile
 psxitimer/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfilelock01/.cvsignore:1.1
--- /dev/null   Thu Jul  1 10:13:59 2010
+++ rtems/testsuites/psxtests/psxfilelock01/.cvsignore  Thu Jul  1 09:40:09 2010
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfilelock01/Makefile.am:1.1
--- /dev/null   Thu Jul  1 10:13:59 2010
+++ rtems/testsuites/psxtests/psxfilelock01/Makefile.am Thu Jul  1 09:40:10 2010
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxfilelock01
+psxfilelock01_SOURCES = init.c
+
+dist_rtems_tests_DATA = psxfilelock01.scn
+dist_rtems_tests_DATA += psxfilelock01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxfilelock01_OBJECTS) $(psxfilelock01_LDADD)
+LINK_LIBS = $(psxfilelock01_LDLIBS)
+
+psxfilelock01$(EXEEXT): $(psxfilelock01_OBJECTS) $(psxfilelock01_DEPENDENCIES)
+       @rm -f psxfilelock01$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfilelock01/init.c:1.1
--- /dev/null   Thu Jul  1 10:13:59 2010
+++ rtems/testsuites/psxtests/psxfilelock01/init.c      Thu Jul  1 09:40:11 2010
</font><font color='#997700'>@@ -0,0 +1,60 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+#include <errno.h>
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  FILE *fd;
+  int   sc;
+
+  puts( "\n\n*** TEST FILE LOCK 01 ***" );
+
+  puts( "Open /testfile" );
+  fd = fopen( "/testfile", "w+" );
+  rtems_test_assert( fd );
+
+  puts( "flockfile /testfile" );
+  flockfile( fd );
+<span style="background-color: #FF0000">  </span>
+  puts( "ftrylockfile /testfile" );
+  sc = ftrylockfile( fd );
+  rtems_test_assert( sc == -1 );
+  rtems_test_assert( errno == ENOTSUP );
+<span style="background-color: #FF0000">  </span>
+  puts( "flockfile /testfile" );
+  flockfile( fd );
+<span style="background-color: #FF0000">  </span>
+  puts( "funlockfile /testfile" );
+  funlockfile( fd );
+<span style="background-color: #FF0000">  </span>
+  puts( "*** END OF TEST FILE LOCK 01 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
+#define CONFIGURE_MAXIMUM_TASKS             1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfilelock01/psxfilelock01.doc:1.1
--- /dev/null   Thu Jul  1 10:13:59 2010
+++ rtems/testsuites/psxtests/psxfilelock01/psxfilelock01.doc   Thu Jul  1 09:40:13 2010
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2010.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxfilelock01
+
+directives:
+
+  XXX list them
+
+concepts:
+
++ XXX list them
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxfilelock01/psxfilelock01.scn:1.1
--- /dev/null   Thu Jul  1 10:13:59 2010
+++ rtems/testsuites/psxtests/psxfilelock01/psxfilelock01.scn   Thu Jul  1 09:40:13 2010
</font><font color='#997700'>@@ -0,0 +1,7 @@
</font><font color='#000088'>+*** TEST FILE LOCK 01 ***
+Open /testfile
+flockfile /testfile
+ftrylockfile /testfile
+flockfile /testfile
+funlockfile /testfile
+*** END OF TEST FILE LOCK 01 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxid01/.cvsignore:1.1
--- /dev/null   Thu Jul  1 10:13:59 2010
+++ rtems/testsuites/psxtests/psxid01/.cvsignore        Thu Jul  1 09:40:13 2010
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxid01/Makefile.am:1.1
--- /dev/null   Thu Jul  1 10:14:00 2010
+++ rtems/testsuites/psxtests/psxid01/Makefile.am       Thu Jul  1 09:40:13 2010
</font><font color='#997700'>@@ -0,0 +1,26 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxid01
+psxid01_SOURCES = init.c
+
+dist_rtems_tests_DATA = psxid01.scn
+dist_rtems_tests_DATA += psxid01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxid01_OBJECTS) $(psxid01_LDADD)
+LINK_LIBS = $(psxid01_LDLIBS)
+
+psxid01$(EXEEXT): $(psxid01_OBJECTS) $(psxid01_DEPENDENCIES)
+       @rm -f psxid01$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxid01/init.c:1.1
--- /dev/null   Thu Jul  1 10:14:00 2010
+++ rtems/testsuites/psxtests/psxid01/init.c    Thu Jul  1 09:40:14 2010
</font><font color='#997700'>@@ -0,0 +1,126 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+
+void test_gid(void)
+{
+  gid_t gid;
+  int sc;
+
+  gid = getegid();
+  printf( "getegid = %d\n", gid );
+
+  gid = getgid();
+  printf( "getgid = %d\n", gid );
+
+  puts( "setgid(5)" );
+  sc = setgid(5);
+  rtems_test_assert( sc == 0 );
+
+  gid = getegid();
+  printf( "getegid = %d\n", gid );
+
+  gid = getgid();
+  printf( "getgid = %d\n", gid );
+
+  puts( "setpgid(getpid(), 10) - ENOSYS" );
+  sc = setpgid( getpid(), 10 );
+  rtems_test_assert( sc == -1 );
+  rtems_test_assert( errno == ENOSYS );
+}
+
+void test_uid(void)
+{
+  uid_t uid;
+  int sc;
+
+  uid = geteuid();
+  printf( "geteuid = %d\n", uid );
+
+  uid = getuid();
+  printf( "getuid = %d\n", uid );
+
+  puts( "setuid(5)" );
+  sc = setuid(5);
+  rtems_test_assert( sc == 0 );
+
+  uid = geteuid();
+  printf( "geteuid = %d\n", uid );
+
+  uid = getuid();
+  printf( "getuid = %d\n", uid );
+
+}
+
+pid_t __getpid(void);
+int issetugid(void);
+
+void test_pid(void)
+{
+  pid_t pid;
+  int   sc;
+
+  pid = getpid();
+  printf( "getpid = %d\n", pid );
+
+  pid = __getpid();
+  printf( "__getpid = %d\n", pid );
+
+  pid = getppid();
+  printf( "getppid = %d\n", pid );
+
+  puts( "setsid - EPERM" );
+  pid = setsid();
+  rtems_test_assert( pid == -1 );
+  rtems_test_assert( errno == EPERM );
+
+  sc = issetugid();
+  rtems_test_assert( sc == 0 );
+}
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  puts( "\n\n*** TEST ID 01 ***" );
+
+  test_gid();
+  puts( "" );
+
+  test_uid();
+  puts( "" );
+
+  test_pid();
+  puts( "" );
+
+  puts( "*** END OF TEST ID 01 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS             1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxid01/psxid01.doc:1.1
--- /dev/null   Thu Jul  1 10:14:00 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.doc       Thu Jul  1 09:40:14 2010
</font><font color='#997700'>@@ -0,0 +1,34 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2010.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxid01
+
+directives:
+
+  getegid
+  getgid
+  setgid
+  setpgid
+  geteuid
+  getuid
+  setuid
+  geteuid
+  getuid
+  getpid
+  __getpid
+  getppid
+  setsid
+
+concepts:
+
++ Fully exercise the above listed methods
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxid01/psxid01.scn:1.1
--- /dev/null   Thu Jul  1 10:14:00 2010
+++ rtems/testsuites/psxtests/psxid01/psxid01.scn       Thu Jul  1 09:40:14 2010
</font><font color='#997700'>@@ -0,0 +1,20 @@
</font><font color='#000088'>+*** TEST ID 01 ***
+getegid = 0
+getgid = 0
+setgid(5)
+getegid = 0
+getgid = 5
+setpgid(getpid(), 10) - ENOSYS
+
+geteuid = 0
+getuid = 0
+setuid(5)
+geteuid = 0
+getuid = 5
+
+getpid = 1
+__getpid = 1
+getppid = 0
+setsid - EPERM
+
+*** END OF TEST ID 01 ***
</font></pre>
<p> </p>
<a name='cs5'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-08 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/include/rtems/libio.h: Documentation.

2010-06-08      Sebastian Huber <sebastian.huber@embedded-brains.de>

        PR 1524/filesystem
        * libcsupport/src/rtems_mkdir.c: New file.
        * libcsupport/src/Makefile.am: Reflect change above.
        * libcsupport/include/rtems/libio.h: Added rtems_mkdir().
        * libmisc/fsmount/fsmount.h, libmisc/fsmount/fsmount.c,
        libblock/src/bdpart-mount.c, libnetworking/rtems/mkrootfs.h,
        libnetworking/rtems/mkrootfs.c: Use rtems_mkdir().  Removed
        rtems_fsmount_create_mount_point() and rtems_rootfs_mkdir().
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.50&r2=text&tr2=1.2346.2.51&diff_format=h">M</a></td><td width='1%'>1.2346.2.51</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libblock/src/bdpart-mount.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.2.2.1&diff_format=h">M</a></td><td width='1%'>1.2.2.1</td><td width='100%'>cpukit/libblock/src/bdpart-mount.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/Makefile.am.diff?r1=text&tr1=1.118.2.1&r2=text&tr2=1.118.2.2&diff_format=h">M</a></td><td width='1%'>1.118.2.2</td><td width='100%'>cpukit/libcsupport/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/include/rtems/libio.h.diff?r1=text&tr1=1.65.2.1&r2=text&tr2=1.65.2.2&diff_format=h">M</a></td><td width='1%'>1.65.2.2</td><td width='100%'>cpukit/libcsupport/include/rtems/libio.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/rtems_mkdir.c.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>cpukit/libcsupport/src/rtems_mkdir.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/fsmount/fsmount.h.diff?r1=text&tr1=1.7&r2=text&tr2=1.7.2.1&diff_format=h">M</a></td><td width='1%'>1.7.2.1</td><td width='100%'>cpukit/libmisc/fsmount/fsmount.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/fsmount/fsmount.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.12.2.1&diff_format=h">M</a></td><td width='1%'>1.12.2.1</td><td width='100%'>cpukit/libmisc/fsmount/fsmount.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/rtems/mkrootfs.h.diff?r1=text&tr1=1.8.4.3&r2=text&tr2=1.8.4.4&diff_format=h">M</a></td><td width='1%'>1.8.4.4</td><td width='100%'>cpukit/libnetworking/rtems/mkrootfs.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/rtems/mkrootfs.c.diff?r1=text&tr1=1.11.2.1&r2=text&tr2=1.11.2.2&diff_format=h">M</a></td><td width='1%'>1.11.2.2</td><td width='100%'>cpukit/libnetworking/rtems/mkrootfs.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.50 rtems/cpukit/ChangeLog:1.2346.2.51
--- rtems/cpukit/ChangeLog:1.2346.2.50  Thu Jul  1 09:10:47 2010
+++ rtems/cpukit/ChangeLog      Thu Jul  1 09:28:50 2010
</font><font color='#997700'>@@ -207,6 +207,21 @@
</font>   * configure.ac: Remove c4x (dead port).
        * score/cpu/Makefile.am: Remove c4x (dead port).
 
<font color='#000088'>+2010-06-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libcsupport/include/rtems/libio.h: Documentation.
+
+2010-06-08     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       PR 1524/filesystem
+       * libcsupport/src/rtems_mkdir.c: New file.
+       * libcsupport/src/Makefile.am: Reflect change above.
+       * libcsupport/include/rtems/libio.h: Added rtems_mkdir().
+       * libmisc/fsmount/fsmount.h, libmisc/fsmount/fsmount.c,
+       libblock/src/bdpart-mount.c, libnetworking/rtems/mkrootfs.h,
+       libnetworking/rtems/mkrootfs.c: Use rtems_mkdir().  Removed
+       rtems_fsmount_create_mount_point() and rtems_rootfs_mkdir().
+
</font> 2010-06-07        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
        * libcsupport/include/rtems/libio_.h: Declare

<font color='#006600'>diff -u rtems/cpukit/libblock/src/bdpart-mount.c:1.2 rtems/cpukit/libblock/src/bdpart-mount.c:1.2.2.1
--- rtems/cpukit/libblock/src/bdpart-mount.c:1.2        Mon May 31 08:56:36 2010
+++ rtems/cpukit/libblock/src/bdpart-mount.c    Thu Jul  1 09:28:55 2010
</font><font color='#997700'>@@ -29,7 +29,7 @@
</font> 
 #include <rtems.h>
 #include <rtems/bdpart.h>
<font color='#880000'>-#include <rtems/fsmount.h>
</font><font color='#000088'>+#include <rtems/libio.h>
</font> 
 rtems_status_code rtems_bdpart_mount(
   const char *disk_name,
<font color='#997700'>@@ -90,7 +90,7 @@
</font> 
     /* Create mount point */
     strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
<font color='#880000'>-    rv = rtems_fsmount_create_mount_point( mount_point);
</font><font color='#000088'>+    rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
</font>     if (rv != 0) {
       esc = RTEMS_IO_ERROR;
       goto cleanup;

<font color='#006600'>diff -u rtems/cpukit/libcsupport/Makefile.am:1.118.2.1 rtems/cpukit/libcsupport/Makefile.am:1.118.2.2
--- rtems/cpukit/libcsupport/Makefile.am:1.118.2.1      Thu Jul  1 09:10:50 2010
+++ rtems/cpukit/libcsupport/Makefile.am        Thu Jul  1 09:28:56 2010
</font><font color='#997700'>@@ -46,7 +46,7 @@
</font> BASE_FS_C_FILES = src/base_fs.c src/mount.c src/unmount.c src/libio.c \
     src/mount-mgr.c src/libio_init.c \
     src/libio_sockets.c src/eval.c src/fs_null_handlers.c src/privateenv.c \
<font color='#880000'>-    src/open_dev_console.c src/__usrenv.c
</font><font color='#000088'>+    src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c
</font> 
 TERMIOS_C_FILES = src/cfgetispeed.c src/cfgetospeed.c src/cfsetispeed.c \
     src/cfsetospeed.c src/tcgetattr.c src/tcsetattr.c src/tcdrain.c \

<font color='#006600'>diff -u rtems/cpukit/libcsupport/include/rtems/libio.h:1.65.2.1 rtems/cpukit/libcsupport/include/rtems/libio.h:1.65.2.2
--- rtems/cpukit/libcsupport/include/rtems/libio.h:1.65.2.1     Thu Jul  1 09:10:51 2010
+++ rtems/cpukit/libcsupport/include/rtems/libio.h      Thu Jul  1 09:28:58 2010
</font><font color='#997700'>@@ -1,15 +1,12 @@
</font> /**
<font color='#880000'>- * @file rtems/libio.h
</font><font color='#000088'>+ * @file
+ *
+ * @ingroup LibIO
+ *
+ * @brief Basic IO API.
</font>  */
 
 /*
<font color='#880000'>- *  System call and file system interface definition
- *
- *  General purpose communication channel for RTEMS to allow UNIX/POSIX
- *  system call behavior under RTEMS.  Initially this supported only
- *  IO to devices but has since been enhanced to support networking
- *  and support for mounted file systems.
- *
</font>  *  COPYRIGHT (c) 1989-2008.
  *  On-Line Applications Research Corporation (OAR).
  *
<font color='#997700'>@@ -23,41 +20,63 @@
</font> #ifndef _RTEMS_RTEMS_LIBIO_H
 #define _RTEMS_RTEMS_LIBIO_H
 
<font color='#880000'>-#include <rtems.h>
-#include <rtems/chain.h>
</font> #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/statvfs.h>
 
<font color='#880000'>-/*
- *  Define data types which must be constructed using forward references.
- */
</font><font color='#000088'>+#include <unistd.h>
+#include <termios.h>
</font> 
<font color='#000088'>+#include <rtems.h>
</font> #include <rtems/fs.h>
<font color='#000088'>+#include <rtems/chain.h>
</font> 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
<font color='#880000'>-/*
- * A 64bit file offset for internal use by RTEMS. Based on the newlib type.
</font><font color='#000088'>+/**
+ * @defgroup LibIO IO Library
+ *
+ * @brief Provides system call and file system interface definitions.
+ *
+ * General purpose communication channel for RTEMS to allow UNIX/POSIX
+ * system call behavior under RTEMS.  Initially this supported only
+ * IO to devices but has since been enhanced to support networking
+ * and support for mounted file systems.
+ *
+ * @{
+ */
+
+/**
+ * @brief A 64-bit file offset for internal use by RTEMS. Based on the Newlib
+ * type.
</font>  */
 typedef _off64_t rtems_off64_t;
 
<font color='#880000'>-/*
- * Valid RTEMS file types.
</font><font color='#000088'>+/**
+ * @name File system node types.
+ *
+ * @{
</font>  */
<font color='#000088'>+
</font> #define RTEMS_FILESYSTEM_DIRECTORY   1
 #define RTEMS_FILESYSTEM_DEVICE      2
 #define RTEMS_FILESYSTEM_HARD_LINK   3
 #define RTEMS_FILESYSTEM_SYM_LINK    4
 #define RTEMS_FILESYSTEM_MEMORY_FILE 5
<font color='#000088'>+
+/** @} */
+
</font> typedef int rtems_filesystem_node_types_t;
 
<font color='#880000'>-/*
- *  File Handler Operations Table
</font><font color='#000088'>+/**
+ * @name File System Node Operations
+ *
+ * @{
</font>  */
<font color='#000088'>+
</font> typedef int (*rtems_filesystem_open_t)(
   rtems_libio_t *iop,
   const char    *pathname,
<font color='#997700'>@@ -131,6 +150,11 @@
</font>  rtems_filesystem_location_info_t      *pathloc       /* IN */
 );
 
<font color='#000088'>+/** @} */
+
+/**
+ * @brief File system node operations table.
+ */
</font> struct _rtems_filesystem_file_handlers_r {
     rtems_filesystem_open_t         open_h;
     rtems_filesystem_close_t        close_h;
<font color='#997700'>@@ -148,8 +172,10 @@
</font>     rtems_filesystem_rmnod_t        rmnod_h;
 };
 
<font color='#880000'>-/*
- *  File System Operations Table
</font><font color='#000088'>+/**
+ * @name File System Operations
+ *
+ * @{
</font>  */
 
 /*
<font color='#997700'>@@ -261,12 +287,10 @@
</font>  struct statvfs                    *buf      /* OUT */
 );
 
<font color='#880000'>-/*
- * operations table that must be defined for every file system.
- */
</font><font color='#000088'>+/** @} */
</font> 
<font color='#880000'>-/*
- * File system types
</font><font color='#000088'>+/**
+ * @brief File system operations table.
</font>  */
 struct _rtems_filesystem_operations_table {
     rtems_filesystem_evalpath_t      evalpath_h;
<font color='#997700'>@@ -307,7 +331,10 @@
</font> /**
  * @brief Per file system table entry routine type.
  *
<font color='#880000'>- * Return @c true to continue the iteration, and @c false to stop.
</font><font color='#000088'>+ * @see rtems_filesystem_iterate().
+ *
+ * @retval true Continue the iteration.
+ * @retval false Stop the iteration.
</font>  */
 typedef bool (*rtems_per_filesystem_routine)(
   const rtems_filesystem_table_t *entry,
<font color='#997700'>@@ -327,7 +354,9 @@
</font> );
 
 /**
<font color='#880000'>- * @brief Returns the file system mount handler associated with the @a type, or
</font><font color='#000088'>+ * @brief Gets the mount handler for the file system @a type.
+ *
+ * @return The file system mount handler associated with the @a type, or
</font>  * @c NULL if no such association exists.
  */
 rtems_filesystem_fsmount_me_t
<font color='#997700'>@@ -364,9 +393,9 @@
</font>   const char *type
 );
 
<font color='#880000'>-/*
- *  Structure used to contain file system specific information which
- *  is required to support fpathconf().
</font><font color='#000088'>+/**
+ * @brief Contain file system specific information which is required to support
+ * fpathconf().
</font>  */
 typedef struct {
   int    link_max;                 /* count */
<font color='#997700'>@@ -383,15 +412,16 @@
</font>   int    posix_vdisable;           /* special char processing, 0=no, 1=yes */
 } rtems_filesystem_limits_and_options_t;
 
<font color='#880000'>-/*
- * Default pathconf settings. Override in a filesystem.
</font><font color='#000088'>+/**
+ * @brief Default pathconf settings.
+ *
+ * Override in a filesystem.
</font>  */
 extern const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf;
 
<font color='#880000'>-/*
- * Structure for a mount table entry.
</font><font color='#000088'>+/**
+ * @brief Mount table entry.
</font>  */
<font color='#880000'>-
</font> struct rtems_filesystem_mount_table_entry_tt {
   rtems_chain_node                       Node;
   rtems_filesystem_location_info_t       mt_point_node;
<font color='#997700'>@@ -422,27 +452,27 @@
</font> };
 
 /**
<font color='#880000'>- * The pathconf setting for a file system.
</font><font color='#000088'>+ * @brief The pathconf setting for a file system.
</font>  */
 #define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
 
 /**
<font color='#880000'>- * The type of file system. Its name.
</font><font color='#000088'>+ * @brief The type of file system. Its name.
</font>  */
 #define rtems_filesystem_type(_mte) ((_mte)->type)
 
 /**
<font color='#880000'>- * The mount point of a file system.
</font><font color='#000088'>+ * @brief The mount point of a file system.
</font>  */
 #define rtems_filesystem_mount_point(_mte) ((_mte)->target)
 
 /**
<font color='#880000'>- * The device entry of a file system.
</font><font color='#000088'>+ * @brief The device entry of a file system.
</font>  */
 #define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
 
<font color='#880000'>-/*
- *  Valid RTEMS file systems options
</font><font color='#000088'>+/**
+ * @brief File systems options.
</font>  */
 typedef enum {
   RTEMS_FILESYSTEM_READ_ONLY,
<font color='#997700'>@@ -450,12 +480,13 @@
</font>   RTEMS_FILESYSTEM_BAD_OPTIONS
 } rtems_filesystem_options_t;
 
<font color='#880000'>-
-/*
- *  An open file data structure, indexed by 'fd'
- *  TODO:
- *     should really have a separate per/file data structure that this
- *     points to (eg: size, offset, driver, pathname should be in that)
</font><font color='#000088'>+/**
+ * @brief An open file data structure.
+ *
+ * It will be indexed by 'fd'.
+ *
+ * @todo Should really have a separate per/file data structure that this points
+ * to (eg: size, offset, driver, pathname should be in that)
</font>  */
 struct rtems_libio_tt {
   rtems_driver_name_t                    *driver;
<font color='#997700'>@@ -470,10 +501,11 @@
</font>   const rtems_filesystem_file_handlers_r *handlers;  /* type specific handlers */
 };
 
<font color='#880000'>-/*
- *  param block for read/write
- *  Note: it must include 'offset' instead of using iop's offset since
- *        we can have multiple outstanding i/o's on a device.
</font><font color='#000088'>+/**
+ * @brief Paramameter block for read/write.
+ *
+ * It must include 'offset' instead of using iop's offset since we can have
+ * multiple outstanding i/o's on a device.
</font>  */
 typedef struct {
   rtems_libio_t          *iop;
<font color='#997700'>@@ -484,8 +516,8 @@
</font>   uint32_t                bytes_moved;
 } rtems_libio_rw_args_t;
 
<font color='#880000'>-/*
- *  param block for open/close
</font><font color='#000088'>+/**
+ * @brief Parameter block for open/close.
</font>  */
 typedef struct {
   rtems_libio_t          *iop;
<font color='#997700'>@@ -493,8 +525,8 @@
</font>   uint32_t                mode;
 } rtems_libio_open_close_args_t;
 
<font color='#880000'>-/*
- *  param block for ioctl
</font><font color='#000088'>+/**
+ * @brief Parameter block for ioctl.
</font>  */
 typedef struct {
   rtems_libio_t          *iop;
<font color='#997700'>@@ -503,9 +535,12 @@
</font>   uint32_t                ioctl_return;
 } rtems_libio_ioctl_args_t;
 
<font color='#880000'>-/*
- *  Values for 'flag'
</font><font color='#000088'>+/**
+ * @name Flag Values
+ *
+ * @{
</font>  */
<font color='#000088'>+
</font> #define LIBIO_FLAGS_NO_DELAY      0x0001  /* return immediately if no data */
 #define LIBIO_FLAGS_READ          0x0002  /* reading */
 #define LIBIO_FLAGS_WRITE         0x0004  /* writing */
<font color='#997700'>@@ -515,10 +550,14 @@
</font> #define LIBIO_FLAGS_CLOSE_ON_EXEC 0x0800  /* close on process exec() */
 #define LIBIO_FLAGS_READ_WRITE    (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
 
<font color='#000088'>+/** @} */
+
</font> void rtems_libio_init(void);
 
<font color='#880000'>-/*
- *  External I/O handlers
</font><font color='#000088'>+/**
+ * @name External I/O Handlers
+ *
+ * @{
</font>  */
 
 typedef int (*rtems_libio_open_t)(
<font color='#997700'>@@ -555,6 +594,14 @@
</font>   int           whence
 );
 
<font color='#000088'>+/** @} */
+
+/**
+ * @name Permission Macros
+ *
+ * @{
+ */
+
</font> /*
  *  The following macros are used to build up the permissions sets
  *  used to check permissions.  These are similar in style to the
<font color='#997700'>@@ -567,11 +614,7 @@
</font> #define RTEMS_LIBIO_PERMS_SEARCH RTEMS_LIBIO_PERMS_EXEC
 #define RTEMS_LIBIO_PERMS_RWX    S_IRWXO
 
<font color='#880000'>-/*
- *  Macros
- */
-
-#include <unistd.h>
</font><font color='#000088'>+/** @} */
</font> 
 union __rtems_dev_t {
   dev_t device;
<font color='#997700'>@@ -632,10 +675,65 @@
</font> 
 void rtems_filesystem_initialize( void );
 
<font color='#000088'>+int unmount(
+  const char *mount_path
+);
+
+int mount(
+  const char                 *source,
+  const char                 *target,
+  const char                 *filesystemtype,
+  rtems_filesystem_options_t options,
+  const void                 *data
+);
+
</font> /*
<font color='#880000'>- * Callbacks from TERMIOS routines to device-dependent code
</font><font color='#000088'>+ *  Boot Time Mount Table Structure
+ */
+
+typedef struct {
+  const char                              *type;
+  rtems_filesystem_options_t               fsoptions;
+  const char                              *device;
+  const char                              *mount_point;
+} rtems_filesystem_mount_table_t;
+
+extern const rtems_filesystem_mount_table_t *rtems_filesystem_mount_table;
+extern const int                             rtems_filesystem_mount_table_size;
+
+typedef void (*rtems_libio_init_functions_t)(void);
+extern  rtems_libio_init_functions_t rtems_libio_init_helper;
+
+void    open_dev_console(void);
+
+typedef void (*rtems_libio_supp_functions_t)(void);
+extern  rtems_libio_supp_functions_t rtems_libio_supp_helper;
+
+typedef void (*rtems_fs_init_functions_t)(void);
+extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
+
+/**
+ * @brief Creates a directory and all its parrent directories according to
+ * @a path.
+ *
+ * The @a mode value selects the access permissions of the directory.
+ *
+ * @retval 0 Successful operation.
+ * @retval -1 An error occured.  @c errno indicates the error.
+ */
+extern int rtems_mkdir(const char *path, mode_t mode);
+
+/** @} */
+
+/**
+ * @defgroup Termios Termios
+ *
+ * @ingroup LibIO
+ *
+ * @brief Termios
+ *
+ * @{
</font>  */
<font color='#880000'>-#include <termios.h>
</font> 
 typedef struct rtems_termios_callbacks {
   int    (*firstOpen)(int major, int minor, void *arg);
<font color='#997700'>@@ -648,9 +746,6 @@
</font>   int    outputUsesInterrupts;
 } rtems_termios_callbacks;
 
<font color='#880000'>-/*
- *  Device-independent TERMIOS routines
- */
</font> void rtems_termios_initialize (void);
 
 /*
<font color='#997700'>@@ -698,42 +793,7 @@
</font>   int   len
 );
 
<font color='#880000'>-int unmount(
-  const char *mount_path
-);
-
-int mount(
-  const char                 *source,
-  const char                 *target,
-  const char                 *filesystemtype,
-  rtems_filesystem_options_t options,
-  const void                 *data
-);
-
-/*
- *  Boot Time Mount Table Structure
- */
-
-typedef struct {
-  const char                              *type;
-  rtems_filesystem_options_t               fsoptions;
-  const char                              *device;
-  const char                              *mount_point;
-} rtems_filesystem_mount_table_t;
-
-extern const rtems_filesystem_mount_table_t *rtems_filesystem_mount_table;
-extern const int                             rtems_filesystem_mount_table_size;
-
-typedef void (*rtems_libio_init_functions_t)(void);
-extern  rtems_libio_init_functions_t rtems_libio_init_helper;
-
-void    open_dev_console(void);
-
-typedef void (*rtems_libio_supp_functions_t)(void);
-extern  rtems_libio_supp_functions_t rtems_libio_supp_helper;
-
-typedef void (*rtems_fs_init_functions_t)(void);
-extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
</font><font color='#000088'>+/** @} */
</font> 
 #ifdef __cplusplus
 }

<font color='#006600'>diff -u /dev/null rtems/cpukit/libcsupport/src/rtems_mkdir.c:1.1.2.2
--- /dev/null   Thu Jul  1 10:14:01 2010
+++ rtems/cpukit/libcsupport/src/rtems_mkdir.c  Thu Jul  1 09:29:00 2010
</font><font color='#997700'>@@ -0,0 +1,141 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup LibIO
+ *
+ * @brief rtems_mkdir() implementation.
+ *
+ * The implementation is based on FreeBSD 'bin/mkdir/mkdir.c' revision 163213.
+ */
+
+/*-
+ * Copyright (c) 2010 embedded brains GmbH.
+ *
+ * Copyright (c) 1983, 1992, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <rtems/libio.h>
+
+/*
+ * Returns 1 if a directory has been created,
+ * 2 if it already existed, and 0 on failure.
+ */
+static int
+build(char *path, mode_t omode)
+{
+       struct stat sb;
+       mode_t numask, oumask;
+       int first, last, retval;
+       char *p;
+
+       p = path;
+       oumask = 0;
+       retval = 1;
+       if (p[0] == '/')                /* Skip leading '/'. */
+               ++p;
+       for (first = 1, last = 0; !last ; ++p) {
+               if (p[0] == '\0')
+                       last = 1;
+               else if (p[0] != '/')
+                       continue;
+               *p = '\0';
+               if (!last && p[1] == '\0')
+                       last = 1;
+               if (first) {
+                       /*
+                        * POSIX 1003.2:
+                        * For each dir operand that does not name an existing
+                        * directory, effects equivalent to those caused by the
+                        * following command shall occcur:
+                        *
+                        * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
+                        *    mkdir [-m mode] dir
+                        *
+                        * We change the user's umask and then restore it,
+                        * instead of doing chmod's.
+                        */
+                       oumask = umask(0);
+                       numask = oumask & ~(S_IWUSR | S_IXUSR);
+                       (void)umask(numask);
+                       first = 0;
+               }
+               if (last)
+                       (void)umask(oumask);
+               if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
+                       if (errno == EEXIST || errno == EISDIR) {
+                               if (stat(path, &sb) < 0) {
+                                       retval = 0;
+                                       break;
+                               } else if (!S_ISDIR(sb.st_mode)) {
+                                       if (last)
+                                               errno = EEXIST;
+                                       else
+                                               errno = ENOTDIR;
+                                       retval = 0;
+                                       break;
+                               }
+                               if (last)
+                                       retval = 2;
+                       } else {
+                               retval = 0;
+                               break;
+                       }
+               }
+               if (!last)
+                   *p = '/';
+       }
+       if (!first && !last)
+               (void)umask(oumask);
+       return (retval);
+}
+
+int
+rtems_mkdir(const char *path, mode_t mode)
+{
+       int success = 0;
+       char *dup_path = strdup(path);
+
+       if (dup_path != NULL) {
+               success = build(dup_path, mode);
+               free(dup_path);
+       }
+
+       return success != 0 ? 0 : -1;
+}
</font>
<font color='#006600'>diff -u rtems/cpukit/libmisc/fsmount/fsmount.h:1.7 rtems/cpukit/libmisc/fsmount/fsmount.h:1.7.2.1
--- rtems/cpukit/libmisc/fsmount/fsmount.h:1.7  Mon May 31 08:56:37 2010
+++ rtems/cpukit/libmisc/fsmount/fsmount.h      Thu Jul  1 09:29:05 2010
</font><font color='#997700'>@@ -121,24 +121,14 @@
</font> } rtems_fstab_entry;
 
 /**
<font color='#880000'>- * Creates the mount point with path @a mount_point.
- *
- * On success, zero is returned.  On error, -1 is returned, and @c errno is set
- * appropriately.
- *
- * @see rtems_fsmount().
- */
-int rtems_fsmount_create_mount_point(const char *mount_point);
-
-/**
</font>  * Mounts the file systems listed in the file system mount table @a fstab of
  * size @a size.
  *
  * Each file system will be mounted according to its table entry parameters.
  * In case of an abort condition the corresponding table index will be reported
  * in @a abort_index.  The pointer @a abort_index may be @c NULL.  The mount
<font color='#880000'>- * point paths will be created with rtems_fsmount_create_mount_point() and need
- * not exist beforehand.
</font><font color='#000088'>+ * point paths will be created with rtems_mkdir() and need not exist
+ * beforehand.
</font>  *
  * On success, zero is returned.  On error, -1 is returned, and @c errno is set
  * appropriately.

<font color='#006600'>diff -u rtems/cpukit/libmisc/fsmount/fsmount.c:1.12 rtems/cpukit/libmisc/fsmount/fsmount.c:1.12.2.1
--- rtems/cpukit/libmisc/fsmount/fsmount.c:1.12 Mon May 31 08:56:37 2010
+++ rtems/cpukit/libmisc/fsmount/fsmount.c      Thu Jul  1 09:29:02 2010
</font><font color='#997700'>@@ -34,83 +34,11 @@
</font> 
 #include <rtems.h>
 #include <rtems/fsmount.h>
<font color='#000088'>+#include <rtems/libio.h>
</font> #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
<font color='#880000'>-#include <rtems/imfs.h>
-#include <sys/stat.h>
-
-/*=========================================================================*\
-| Function:                                                                 |
-\*-------------------------------------------------------------------------*/
-int rtems_fsmount_create_mount_point
-(
-/*-------------------------------------------------------------------------*\
-| Purpose:                                                                  |
-|  This function will create the mount point given                          |
-+---------------------------------------------------------------------------+
-| Input Parameters:                                                         |
-\*-------------------------------------------------------------------------*/
- const char *mount_point
- )
-/*-------------------------------------------------------------------------*\
-| Return Value:                                                             |
-|    0, if success, -1 and errno if failed                                  |
-\*=========================================================================*/
-{
-  int rc = 0;
-  char *tok_buffer = NULL;
-  char *token = NULL;
-  int    token_len;
-  size_t total_len;
-  IMFS_token_types token_type;
-  struct stat file_info;
-  /*
-   * allocate temp memory to rebuild path name
-   */
-  tok_buffer = calloc(strlen(mount_point)+1,sizeof(char));
-  if ( !tok_buffer )
-    return -1;
-  token = tok_buffer;
-  total_len = 0;
-  do {
-    /*
-     * scan through given string, one segment at a time
-     */
-    token_type = IMFS_get_token(
-      mount_point+total_len,
-      strlen(mount_point+total_len),
-      token,
-      &token_len
-    );
-    total_len += token_len;
-    strncpy(tok_buffer,mount_point,total_len);
-    tok_buffer[total_len] = '\0';
-
-    if ((token_type != IMFS_NO_MORE_PATH) &&
-       (token_type != IMFS_CURRENT_DIR)  &&
-       (token_type != IMFS_INVALID_TOKEN)) {
-      /*
-       * check, whether segment exists
-       */
-      if (0 != stat(tok_buffer,&file_info)) {
-       /*
-        * if not, create directory
-        */
-       rc = mknod(tok_buffer,S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR,0);
-      }
-    }
-  } while ((rc == 0) &&
-          (token_type != IMFS_NO_MORE_PATH) &&
-          (token_type != IMFS_INVALID_TOKEN));
-
-  /*
-   * return token buffer to heap. Verified to be non-NULL when calloc'ed.
-   */
-  free(tok_buffer);
-  return rc;
-}
</font> 
 /*=========================================================================*\
 | Function:                                                                 |
<font color='#997700'>@@ -148,7 +76,7 @@
</font>      * create mount point
      */
     if (tmp_rc == 0) {
<font color='#880000'>-      tmp_rc = rtems_fsmount_create_mount_point(fstab_ptr->target);
</font><font color='#000088'>+      tmp_rc = rtems_mkdir(fstab_ptr->target, S_IRWXU | S_IRWXG | S_IRWXO);
</font>       if (tmp_rc != 0) {
         if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
           fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",

<font color='#006600'>diff -u rtems/cpukit/libnetworking/rtems/mkrootfs.h:1.8.4.3 rtems/cpukit/libnetworking/rtems/mkrootfs.h:1.8.4.4
--- rtems/cpukit/libnetworking/rtems/mkrootfs.h:1.8.4.3 Fri Jun 18 05:03:49 2010
+++ rtems/cpukit/libnetworking/rtems/mkrootfs.h Thu Jul  1 09:29:09 2010
</font><font color='#997700'>@@ -30,13 +30,6 @@
</font> extern "C" {
 #endif
 
<font color='#880000'>-/*
- *  Builds the complete path, like "mkdir -p".
- */
-
-int
-rtems_rootfs_mkdir (const char *path, mode_t omode);
-
</font> /**
  *  Appends the lines to the a file. Create the file
  *  and builds the path if it does not exist.

<font color='#006600'>diff -u rtems/cpukit/libnetworking/rtems/mkrootfs.c:1.11.2.1 rtems/cpukit/libnetworking/rtems/mkrootfs.c:1.11.2.2
--- rtems/cpukit/libnetworking/rtems/mkrootfs.c:1.11.2.1        Wed Jun 16 08:52:04 2010
+++ rtems/cpukit/libnetworking/rtems/mkrootfs.c Thu Jul  1 09:29:07 2010
</font><font color='#997700'>@@ -68,96 +68,6 @@
</font> #define MKDIR_MODE  (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
 
 /*
<font color='#880000'>- * Build a path. Taken from the BSD `mkdir' command.
- */
-
-int
-rtems_rootfs_mkdir (const char *path_orig, mode_t omode)
-{
-  struct stat sb;
-  mode_t      numask, oumask;
-  int         first, last, retval;
-  char        path[128];
-  char        *p = path;
-
-  if (strlen (path_orig) >= sizeof path)
-  {
-    printf ("root fs: mkdir path too long `%s'\n", path);
-    return -1;
-  }
-
-  strcpy (path, path_orig);
-  oumask = 0;
-  retval = 0;
-  if (p[0] == '/')    /* Skip leading '/'. */
-    ++p;
-  for (first = 1, last = 0; !last ; ++p)
-  {
-    if (p[0] == '\0')
-      last = 1;
-    else if (p[0] != '/')
-      continue;
-    *p = '\0';
-    if (p[1] == '\0')
-      last = 1;
-    if (first)
-    {
-      /*
-       * POSIX 1003.2:
-       * For each dir operand that does not name an existing
-       * directory, effects equivalent to those cased by the
-       * following command shall occcur:
-       *
-       * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
-       *    mkdir [-m mode] dir
-       *
-       * We change the user's umask and then restore it,
-       * instead of doing chmod's.
-       */
-      oumask = umask(0);
-      numask = oumask & ~(S_IWUSR | S_IXUSR);
-      umask(numask);
-      first = 0;
-    }
-    if (last)
-      umask(oumask);
-    if (stat(path, &sb))
-    {
-      if (errno != ENOENT)
-      {
-        printf ("root fs: error stat'ing path `%s', %s\n",
-                path, strerror (errno));
-        retval = 1;
-        break;
-      }
-      if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0)
-      {
-        printf ("root fs: error building path `%s', %s\n",
-                path, strerror (errno));
-        retval = 1;
-        break;
-      }
-    }
-    else if ((sb.st_mode & S_IFMT) != S_IFDIR)
-    {
-      if (last)
-        errno = EEXIST;
-      else
-        errno = ENOTDIR;
-      printf ("root fs: path `%s' contains a file, %s\n",
-              path, strerror (errno));
-      retval = 1;
-      break;
-    }
-    if (!last)
-      *p = '/';
-  }
-  if (!first && !last)
-    umask(oumask);
-  return retval;
-}
-
-/*
</font>  * Create enough files to support the networking stack.
  * Points to a table of strings.
  */
<font color='#997700'>@@ -205,7 +115,7 @@
</font>           strncpy (path, file, i);
           path[i] = '\0';
 
<font color='#880000'>-          if (rtems_rootfs_mkdir (path, MKDIR_MODE))
</font><font color='#000088'>+          if (rtems_mkdir (path, MKDIR_MODE))
</font>             return -1;
           break;
         }
<font color='#997700'>@@ -310,7 +220,7 @@
</font>   for (i = 0;
        i < (sizeof (default_directories) / sizeof (rtems_rootfs_dir_table));
        i++)
<font color='#880000'>-    if (rtems_rootfs_mkdir (default_directories[i].name,
</font><font color='#000088'>+    if (rtems_mkdir (default_directories[i].name,
</font>                             default_directories[i].mode))
       return -1;
 
</pre>
<p> </p>
<a name='cs6'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/src/unmount.c: Removed obsolete declarations.  Fixed
        invalid memory free.

2010-06-10      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Removed
        rtems_ftpfs_mount().

2010-06-10      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/src/mount-mktgt.c: New file.
        * libcsupport/Makefile.am: Reflect change above.
        * libcsupport/include/rtems/libio.h: Declare
        mount_and_make_target_path().

2010-06-09      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Added
        rtems_ftpfs_mount() again.  Documentation.

2010-06-09      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added
        and use defines for file system types.

2010-06-09      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/src/mount.c: Fixed NULL pointer access.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.51&r2=text&tr2=1.2346.2.52&diff_format=h">M</a></td><td width='1%'>1.2346.2.52</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/Makefile.am.diff?r1=text&tr1=1.118.2.2&r2=text&tr2=1.118.2.3&diff_format=h">M</a></td><td width='1%'>1.118.2.3</td><td width='100%'>cpukit/libcsupport/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/include/rtems/libio.h.diff?r1=text&tr1=1.65.2.2&r2=text&tr2=1.65.2.3&diff_format=h">M</a></td><td width='1%'>1.65.2.3</td><td width='100%'>cpukit/libcsupport/include/rtems/libio.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/mount-mktgt.c.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>cpukit/libcsupport/src/mount-mktgt.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/mount.c.diff?r1=text&tr1=1.33.2.1&r2=text&tr2=1.33.2.2&diff_format=h">M</a></td><td width='1%'>1.33.2.2</td><td width='100%'>cpukit/libcsupport/src/mount.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/unmount.c.diff?r1=text&tr1=1.25&r2=text&tr2=1.25.2.1&diff_format=h">M</a></td><td width='1%'>1.25.2.1</td><td width='100%'>cpukit/libcsupport/src/unmount.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/lib/ftpfs.c.diff?r1=text&tr1=1.29&r2=text&tr2=1.29.2.1&diff_format=h">M</a></td><td width='1%'>1.29.2.1</td><td width='100%'>cpukit/libnetworking/lib/ftpfs.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/rtems/ftpfs.h.diff?r1=text&tr1=1.10&r2=text&tr2=1.10.2.1&diff_format=h">M</a></td><td width='1%'>1.10.2.1</td><td width='100%'>cpukit/libnetworking/rtems/ftpfs.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/include/confdefs.h.diff?r1=text&tr1=1.135.2.3&r2=text&tr2=1.135.2.4&diff_format=h">M</a></td><td width='1%'>1.135.2.4</td><td width='100%'>cpukit/sapi/include/confdefs.h</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.51 rtems/cpukit/ChangeLog:1.2346.2.52
--- rtems/cpukit/ChangeLog:1.2346.2.51  Thu Jul  1 09:28:50 2010
+++ rtems/cpukit/ChangeLog      Thu Jul  1 09:39:30 2010
</font><font color='#997700'>@@ -197,6 +197,37 @@
</font>   libfs/src/rfs/rtems-rfs-group.h, libfs/src/rfs/rtems-rfs-inode.h:
        Fix broken doxygen commands.
 
<font color='#000088'>+2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libcsupport/src/unmount.c: Removed obsolete declarations.  Fixed
+       invalid memory free.
+
+2010-06-10     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Removed
+       rtems_ftpfs_mount().
+
+2010-06-10     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libcsupport/src/mount-mktgt.c: New file.
+       * libcsupport/Makefile.am: Reflect change above.
+       * libcsupport/include/rtems/libio.h: Declare
+       mount_and_make_target_path().
+
+2010-06-09     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Added
+       rtems_ftpfs_mount() again.  Documentation.
+
+2010-06-09     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added
+       and use defines for file system types.
+
+2010-06-09     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libcsupport/src/mount.c: Fixed NULL pointer access.
+
</font> 2010-06-09        Ralf Corsépius <ralf.corsepius@rtems.org>
 
        * configure.ac: Remove nios2 (unsupported, no toolchain).

<font color='#006600'>diff -u rtems/cpukit/libcsupport/Makefile.am:1.118.2.2 rtems/cpukit/libcsupport/Makefile.am:1.118.2.3
--- rtems/cpukit/libcsupport/Makefile.am:1.118.2.2      Thu Jul  1 09:28:56 2010
+++ rtems/cpukit/libcsupport/Makefile.am        Thu Jul  1 09:39:31 2010
</font><font color='#997700'>@@ -44,7 +44,7 @@
</font>     src/assocremotebylocal.c src/assocremotebyname.c
 
 BASE_FS_C_FILES = src/base_fs.c src/mount.c src/unmount.c src/libio.c \
<font color='#880000'>-    src/mount-mgr.c src/libio_init.c \
</font><font color='#000088'>+    src/mount-mgr.c src/mount-mktgt.c src/libio_init.c \
</font>     src/libio_sockets.c src/eval.c src/fs_null_handlers.c src/privateenv.c \
     src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c
 

<font color='#006600'>diff -u rtems/cpukit/libcsupport/include/rtems/libio.h:1.65.2.2 rtems/cpukit/libcsupport/include/rtems/libio.h:1.65.2.3
--- rtems/cpukit/libcsupport/include/rtems/libio.h:1.65.2.2     Thu Jul  1 09:28:58 2010
+++ rtems/cpukit/libcsupport/include/rtems/libio.h      Thu Jul  1 09:39:32 2010
</font><font color='#997700'>@@ -56,7 +56,7 @@
</font> typedef _off64_t rtems_off64_t;
 
 /**
<font color='#880000'>- * @name File system node types.
</font><font color='#000088'>+ * @name File System Node Types
</font>  *
  * @{
  */
<font color='#997700'>@@ -669,6 +669,23 @@
</font> #define rtems_libio_is_valid_perms( _perm )     \
  (~ ((~RTEMS_LIBIO_PERMS_RWX) & _perm ))
 
<font color='#000088'>+/**
+ * @name File System Types
+ *
+ * @{
+ */
+
+#define RTEMS_FILESYSTEM_TYPE_IMFS "imfs"
+#define RTEMS_FILESYSTEM_TYPE_MINIIMFS "mimfs"
+#define RTEMS_FILESYSTEM_TYPE_DEVFS "devfs"
+#define RTEMS_FILESYSTEM_TYPE_FTPFS "ftpfs"
+#define RTEMS_FILESYSTEM_TYPE_TFTPFS "tftpfs"
+#define RTEMS_FILESYSTEM_TYPE_NFS "nfs"
+#define RTEMS_FILESYSTEM_TYPE_DOSFS "dosfs"
+#define RTEMS_FILESYSTEM_TYPE_RFS "rfs"
+
+/** @} */
+
</font> /*
  *  Prototypes for filesystem
  */
<font color='#997700'>@@ -687,6 +704,25 @@
</font>   const void                 *data
 );
 
<font color='#000088'>+/**
+ * @brief Mounts a file system and makes the @a target path.
+ *
+ * The @a target path will be created with rtems_mkdir() and must not be
+ * @c NULL.
+ *
+ * @see mount().
+ *
+ * @retval 0 Successful operation.
+ * @retval -1 An error occured.  The @c errno indicates the error.
+ */
+int mount_and_make_target_path(
+  const char                 *source,
+  const char                 *target,
+  const char                 *filesystemtype,
+  rtems_filesystem_options_t options,
+  const void                 *data
+);
+
</font> /*
  *  Boot Time Mount Table Structure
  */
<font color='#997700'>@@ -719,7 +755,7 @@
</font>  * The @a mode value selects the access permissions of the directory.
  *
  * @retval 0 Successful operation.
<font color='#880000'>- * @retval -1 An error occured.  @c errno indicates the error.
</font><font color='#000088'>+ * @retval -1 An error occured.  The @c errno indicates the error.
</font>  */
 extern int rtems_mkdir(const char *path, mode_t mode);
 

<font color='#006600'>diff -u /dev/null rtems/cpukit/libcsupport/src/mount-mktgt.c:1.1.2.2
--- /dev/null   Thu Jul  1 10:14:02 2010
+++ rtems/cpukit/libcsupport/src/mount-mktgt.c  Thu Jul  1 09:39:33 2010
</font><font color='#997700'>@@ -0,0 +1,56 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup LibIO
+ *
+ * @brief mount_and_make_target_path() implementation.
+ */
+
+/*
+ * Copyright (c) 2010
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * D-82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <errno.h>
+
+#include <rtems/libio.h>
+
+int mount_and_make_target_path(
+  const char *source,
+  const char *target,
+  const char *filesystemtype,
+  rtems_filesystem_options_t options,
+  const void *data
+)
+{
+  int rv = -1;
+
+  if (target != NULL) {
+    rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
+    if (rv == 0) {
+      rv = mount(
+        source,
+        target,
+        filesystemtype,
+        options,
+        data
+      );
+    }
+  } else {
+    errno = EINVAL;
+  }
+
+  return rv;
+}
</font>
<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/mount.c:1.33.2.1 rtems/cpukit/libcsupport/src/mount.c:1.33.2.2
--- rtems/cpukit/libcsupport/src/mount.c:1.33.2.1       Thu Jul  1 09:10:52 2010
+++ rtems/cpukit/libcsupport/src/mount.c        Thu Jul  1 09:39:34 2010
</font><font color='#997700'>@@ -93,30 +93,31 @@
</font> }
 
 static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
<font color='#880000'>-  const char *source,
-  const char *target,
</font><font color='#000088'>+  const char *source_or_null,
+  const char *target_or_null,
</font>   const char *filesystemtype,
   size_t *target_length_ptr
 )
 {
<font color='#880000'>-  const char *target_str = target ? target : "/";
</font><font color='#000088'>+  const char *target = target_or_null != NULL ? target_or_null : "/";
</font>   size_t filesystemtype_size = strlen( filesystemtype ) + 1;
<font color='#880000'>-  size_t source_size = source ? strlen( source ) + 1 : 0;
-  size_t target_length = strlen( target_str );
</font><font color='#000088'>+  size_t source_size = source_or_null != NULL ?
+    strlen( source_or_null ) + 1 : 0;
+  size_t target_length = strlen( target );
</font>   size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
     + filesystemtype_size + source_size + target_length + 1;
   rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
 
<font color='#880000'>-  if ( mt_entry ) {
</font><font color='#000088'>+  if ( mt_entry != NULL ) {
</font>     char *str = (char *) mt_entry + sizeof( *mt_entry );
 
     mt_entry->type = str;
     strcpy( str, filesystemtype );
 
<font color='#880000'>-    if ( source ) {
</font><font color='#000088'>+    if ( source_or_null != NULL ) {
</font>       str += filesystemtype_size;
       mt_entry->dev = str;
<font color='#880000'>-      strcpy( str, source );
</font><font color='#000088'>+      strcpy( str, source_or_null );
</font>     }
 
     str += source_size;

<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/unmount.c:1.25 rtems/cpukit/libcsupport/src/unmount.c:1.25.2.1
--- rtems/cpukit/libcsupport/src/unmount.c:1.25 Mon May 31 08:56:36 2010
+++ rtems/cpukit/libcsupport/src/unmount.c      Thu Jul  1 09:39:34 2010
</font><font color='#997700'>@@ -33,16 +33,6 @@
</font> #include <rtems/libio_.h>
 #include <rtems/seterr.h>
 
<font color='#880000'>-/*
- *  Data structures and routines private to mount/unmount pair.
- */
-
-extern rtems_chain_control rtems_filesystem_mount_table_control;
-
-int search_mt_for_mount_point(
-  rtems_filesystem_location_info_t *location_of_mount_point
-);
-
</font> bool rtems_filesystem_nodes_equal(
   const rtems_filesystem_location_info_t   *loc1,
   const rtems_filesystem_location_info_t   *loc2
<font color='#997700'>@@ -213,7 +203,6 @@
</font>    */
 
   rtems_filesystem_freenode( fs_mount_loc );
<font color='#880000'>-  free( (void*) mt_entry->target );
</font>   free( mt_entry );
 
   return 0;

<font color='#006600'>diff -u rtems/cpukit/libnetworking/lib/ftpfs.c:1.29 rtems/cpukit/libnetworking/lib/ftpfs.c:1.29.2.1
--- rtems/cpukit/libnetworking/lib/ftpfs.c:1.29 Mon May 31 08:56:37 2010
+++ rtems/cpukit/libnetworking/lib/ftpfs.c      Thu Jul  1 09:39:34 2010
</font><font color='#997700'>@@ -99,6 +99,8 @@
</font>   struct timeval timeout;
 } rtems_ftpfs_mount_entry;
 
<font color='#000088'>+static const rtems_filesystem_operations_table rtems_ftpfs_ops;
+
</font> static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers;
 
 static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers;
<font color='#997700'>@@ -130,36 +132,6 @@
</font>   return 0;
 }
 
<font color='#880000'>-#if 0
-CCJ_REMOVE_MOUNT
-rtems_status_code rtems_ftpfs_mount(const char *mount_point)
-{
-  int rv = 0;
-
-  if (mount_point == NULL) {
-    mount_point = RTEMS_FTPFS_MOUNT_POINT_DEFAULT;
-  }
-
-  rv = mkdir(mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
-  if (rv != 0) {
-    return RTEMS_IO_ERROR;
-  }
-
-  rv = mount(
-    NULL,
-    &rtems_ftpfs_ops,
-    RTEMS_FILESYSTEM_READ_WRITE,
-    NULL,
-    mount_point
-  );
-  if (rv != 0) {
-    return RTEMS_IO_ERROR;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
-#endif
-
</font> static rtems_status_code rtems_ftpfs_do_ioctl(
   const char *mount_point,
   ioctl_command_t req,
<font color='#997700'>@@ -1318,7 +1290,7 @@
</font>   return 0;
 }
 
<font color='#880000'>-const rtems_filesystem_operations_table rtems_ftpfs_ops = {
</font><font color='#000088'>+static const rtems_filesystem_operations_table rtems_ftpfs_ops = {
</font>   .evalpath_h = rtems_ftpfs_eval_path,
   .evalformake_h = NULL,
   .link_h = NULL,

<font color='#006600'>diff -u rtems/cpukit/libnetworking/rtems/ftpfs.h:1.10 rtems/cpukit/libnetworking/rtems/ftpfs.h:1.10.2.1
--- rtems/cpukit/libnetworking/rtems/ftpfs.h:1.10       Mon May 31 08:56:37 2010
+++ rtems/cpukit/libnetworking/rtems/ftpfs.h    Thu Jul  1 09:39:35 2010
</font><font color='#997700'>@@ -1,7 +1,7 @@
</font> /**
  * @file
  *
<font color='#880000'>- * File Transfer Protocol file system (FTP client).
</font><font color='#000088'>+ * @brief File Transfer Protocol file system (FTP client).
</font>  */
 
 /*
<font color='#997700'>@@ -46,12 +46,15 @@
</font> /**
  * @defgroup rtems_ftpfs File Transfer Protocol File System
  *
<font color='#880000'>- * The FTP file system (FTP client) can be used to transfer files from or to
- * remote hosts.
</font><font color='#000088'>+ * @brief The FTP file system (FTP client) can be used to transfer files from
+ * or to remote hosts.
</font>  *
<font color='#880000'>- * You can mount the FTP file system with a call to rtems_ftpfs_mount().
- * Alternatively you can use mount() with the @ref rtems_ftpfs_ops operations
- * table.
</font><font color='#000088'>+ * You can mount the FTP file system with a call to mount() or
+ * mount_and_make_target_path() with the @ref RTEMS_FILESYSTEM_TYPE_FTPFS file
+ * system type.
+ *
+ * You have to add @ref CONFIGURE_FILESYSTEM_FTPFS to your application
+ * configuration.
</font>  *
  * You can open files either read-only or write-only.  A seek is not allowed.
  * A close terminates the control and data connections.
<font color='#997700'>@@ -74,17 +77,17 @@
</font>  */
 
 /**
<font color='#880000'>- * Well-known port number for FTP control connection.
</font><font color='#000088'>+ * @brief Well-known port number for FTP control connection.
</font>  */
 #define RTEMS_FTPFS_CTRL_PORT 21
 
 /**
<font color='#880000'>- * Default mount point for FTP file system.
</font><font color='#000088'>+ * @brief Default mount point for FTP file system.
</font>  */
 #define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
 
 /**
<font color='#880000'>- * FTP file system IO control requests.
</font><font color='#000088'>+ * @brief FTP file system IO control requests.
</font>  */
 typedef enum {
   RTEMS_FTPFS_IOCTL_GET_VERBOSE = _IOR( 'd', 1, bool *),
<font color='#997700'>@@ -94,13 +97,8 @@
</font> } rtems_ftpfs_ioctl_numbers;
 
 /**
<font color='#880000'>- * FTP file system operations table.
- */
-extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
-
-/**
- * Returns in @a verbose if the verbose mode is enabled or disabled for the
- * file system at @a mount_point.
</font><font color='#000088'>+ * @brief Returns in @a verbose if the verbose mode is enabled or disabled for
+ * the file system at @a mount_point.
</font>  *
  * If @a mount_point is @c NULL the default mount point
  * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
<font color='#997700'>@@ -108,7 +106,7 @@
</font> rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbose);
 
 /**
<font color='#880000'>- * Enables or disables the verbose mode if @a verbose is @c true or
</font><font color='#000088'>+ * @brief Enables or disables the verbose mode if @a verbose is @c true or
</font>  * @c false respectively for the file system at @a mount_point.
  *
  * In the enabled verbose mode the commands and replies of the FTP control
<font color='#997700'>@@ -120,8 +118,8 @@
</font> rtems_status_code rtems_ftpfs_set_verbose( const char *mount_point, bool verbose);
 
 /**
<font color='#880000'>- * Returns the current timeout value in @a timeout for the file system at
- * @a mount_point.
</font><font color='#000088'>+ * @brief Returns the current timeout value in @a timeout for the file system
+ * at @a mount_point.
</font>  *
  * If @a mount_point is @c NULL the default mount point
  * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
<font color='#997700'>@@ -132,7 +130,8 @@
</font> );
 
 /**
<font color='#880000'>- * Sets the timeout value to @a timeout for the file system at @a mount_point.
</font><font color='#000088'>+ * @brief Sets the timeout value to @a timeout for the file system at
+ * @a mount_point.
</font>  *
  * The timeout value will be used during connection establishment of active
  * data connections.  It will be also used for send and receive operations on
<font color='#997700'>@@ -149,13 +148,12 @@
</font> /** @} */
 
 /**
<font color='#880000'>- * Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT and
- * mounts the FTP file system. Do not call directly, use mount.xs
- *
- * It is mounted with read and write access.
</font><font color='#000088'>+ * @brief Do not call directly, use mount().
</font>  */
<font color='#880000'>-int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *e,
-                           const void                           *d);
</font><font color='#000088'>+int rtems_ftpfs_initialize(
+  rtems_filesystem_mount_table_entry_t *mt_entry,
+  const void *data
+);
</font> 
 #ifdef __cplusplus
 }

<font color='#006600'>diff -u rtems/cpukit/sapi/include/confdefs.h:1.135.2.3 rtems/cpukit/sapi/include/confdefs.h:1.135.2.4
--- rtems/cpukit/sapi/include/confdefs.h:1.135.2.3      Thu Jul  1 09:10:54 2010
+++ rtems/cpukit/sapi/include/confdefs.h        Thu Jul  1 09:39:39 2010
</font><font color='#997700'>@@ -284,7 +284,8 @@
</font>  */<span style="background-color: #FF0000"> </span>
 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
     defined(CONFIGURE_FILESYSTEM_miniIMFS)
<font color='#880000'>-#define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS { "mimfs", miniIMFS_initialize }
</font><font color='#000088'>+  #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \
+    { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize }
</font> #endif
 
 /**
<font color='#997700'>@@ -301,7 +302,8 @@
</font> #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
     defined(CONFIGURE_FILESYSTEM_DEVFS)
 #include <rtems/devfs.h>
<font color='#880000'>-#define CONFIGURE_FILESYSTEM_ENTRY_DEVFS { "devfs", devFS_initialize }
</font><font color='#000088'>+  #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \
+    { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize }
</font> #endif
 
 #ifdef RTEMS_NETWORKING
<font color='#997700'>@@ -311,7 +313,8 @@
</font>   #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \
       defined(CONFIGURE_FILESYSTEM_FTPFS)<span style="background-color: #FF0000"> </span>
     #include <rtems/ftpfs.h>
<font color='#880000'>-    #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS { "ftpfs", rtems_ftpfs_initialize }
</font><font color='#000088'>+    #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \
+      { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize }
</font>   #endif
 
   /**
<font color='#997700'>@@ -320,7 +323,8 @@
</font>   #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \
       defined(CONFIGURE_FILESYSTEM_TFTPFS)
     #include <rtems/tftp.h>
<font color='#880000'>-    #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS { "tftpfs", rtems_tftpfs_initialize }
</font><font color='#000088'>+    #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \
+      { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize }
</font>   #endif
 
   /**
<font color='#997700'>@@ -329,7 +333,8 @@
</font>   #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS) && \
       defined(CONFIGURE_FILESYSTEM_NFSFS)
     #include <librtemsNfs.h>
<font color='#880000'>-    #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS { "nfs", rtems_nfsfs_initialize }
</font><font color='#000088'>+    #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS \
+      { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfsfs_initialize }
</font>   #endif
 #endif
 
<font color='#997700'>@@ -339,7 +344,8 @@
</font> #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \
     defined(CONFIGURE_FILESYSTEM_DOSFS)
   #include <rtems/dosfs.h>
<font color='#880000'>-  #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS { "dosfs", rtems_dosfs_initialize }
</font><font color='#000088'>+  #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \
+    { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize }
</font> #endif
 
 /**
<font color='#997700'>@@ -348,7 +354,8 @@
</font> #if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \
     defined(CONFIGURE_FILESYSTEM_RFS)
   #include <rtems/rtems-rfs.h>
<font color='#880000'>-  #define CONFIGURE_FILESYSTEM_ENTRY_RFS { "rfs", rtems_rfs_rtems_initialise }
</font><font color='#000088'>+  #define CONFIGURE_FILESYSTEM_ENTRY_RFS \
+    { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise }
</font> #endif
 
 #ifdef CONFIGURE_INIT
<font color='#997700'>@@ -440,11 +447,11 @@
</font>   #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
     const rtems_filesystem_mount_table_t configuration_mount_table = {
       #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
<font color='#880000'>-        "devfs",
</font><font color='#000088'>+        RTEMS_FILESYSTEM_TYPE_DEVFS,
</font>       #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
<font color='#880000'>-        "mimfs",
</font><font color='#000088'>+        RTEMS_FILESYSTEM_TYPE_MINIIMFS,
</font>       #else  /* using IMFS as base filesystem */
<font color='#880000'>-        "imfs",
</font><font color='#000088'>+        RTEMS_FILESYSTEM_TYPE_IMFS,
</font>       #endif
       RTEMS_FILESYSTEM_READ_WRITE,
       NULL,
</pre>
<p> </p>
<a name='cs7'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>

        PR 1555/cpukit
        * Makefile.am, preinstall.am: Install md4.h and md5.h headers.

2010-06-14      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * sapi/include/confdefs.h: Do not define a filesystem if
        CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.52&r2=text&tr2=1.2346.2.53&diff_format=h">M</a></td><td width='1%'>1.2346.2.53</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/Makefile.am.diff?r1=text&tr1=1.94.2.1&r2=text&tr2=1.94.2.2&diff_format=h">M</a></td><td width='1%'>1.94.2.2</td><td width='100%'>cpukit/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/preinstall.am.diff?r1=text&tr1=1.44.2.1&r2=text&tr2=1.44.2.2&diff_format=h">M</a></td><td width='1%'>1.44.2.2</td><td width='100%'>cpukit/preinstall.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/include/confdefs.h.diff?r1=text&tr1=1.135.2.4&r2=text&tr2=1.135.2.5&diff_format=h">M</a></td><td width='1%'>1.135.2.5</td><td width='100%'>cpukit/sapi/include/confdefs.h</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.52 rtems/cpukit/ChangeLog:1.2346.2.53
--- rtems/cpukit/ChangeLog:1.2346.2.52  Thu Jul  1 09:39:30 2010
+++ rtems/cpukit/ChangeLog      Thu Jul  1 09:51:03 2010
</font><font color='#997700'>@@ -154,6 +154,16 @@
</font>   Include <inttypes.h>.
        Misc. 64bit-compatibility fixes.
 
<font color='#000088'>+2010-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       PR 1555/cpukit
+       * Makefile.am, preinstall.am: Install md4.h and md5.h headers.
+
+2010-06-14     Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * sapi/include/confdefs.h: Do not define a filesystem if
+       CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined.
+
</font> 2010-06-14        Ralf Corsépius <ralf.corsepius@rtems.org>
 
        * libnetworking/rtems/mkrootfs.h,

<font color='#006600'>diff -u rtems/cpukit/Makefile.am:1.94.2.1 rtems/cpukit/Makefile.am:1.94.2.2
--- rtems/cpukit/Makefile.am:1.94.2.1   Sat Jun 12 22:38:42 2010
+++ rtems/cpukit/Makefile.am    Thu Jul  1 09:51:13 2010
</font><font color='#997700'>@@ -52,7 +52,9 @@
</font> include_sysdir = $(includedir)/sys
 include_sys_HEADERS =
 
<font color='#880000'>-include_HEADERS += libnetworking/memory.h
</font><font color='#000088'>+include_HEADERS += libnetworking/memory.h \
+    libmd/md4.h \
+    libmd/md5.h
</font> 
 include_sys_HEADERS += libcsupport/include/sys/ioccom.h \
     libcsupport/include/sys/filio.h libcsupport/include/sys/ioctl.h \

<font color='#006600'>diff -u rtems/cpukit/preinstall.am:1.44.2.1 rtems/cpukit/preinstall.am:1.44.2.2
--- rtems/cpukit/preinstall.am:1.44.2.1 Sat Jun 12 22:39:35 2010
+++ rtems/cpukit/preinstall.am  Thu Jul  1 09:51:22 2010
</font><font color='#997700'>@@ -60,6 +60,14 @@
</font>   $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/memory.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/memory.h
 
<font color='#000088'>+$(PROJECT_INCLUDE)/md4.h: libmd/md4.h $(PROJECT_INCLUDE)/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/md4.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/md4.h
+
+$(PROJECT_INCLUDE)/md5.h: libmd/md5.h $(PROJECT_INCLUDE)/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/md5.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/md5.h
+
</font> $(PROJECT_INCLUDE)/sys/ioccom.h: libcsupport/include/sys/ioccom.h $(PROJECT_INCLUDE)/sys/$(dirstamp)
        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/ioccom.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/ioccom.h

<font color='#006600'>diff -u rtems/cpukit/sapi/include/confdefs.h:1.135.2.4 rtems/cpukit/sapi/include/confdefs.h:1.135.2.5
--- rtems/cpukit/sapi/include/confdefs.h:1.135.2.4      Thu Jul  1 09:39:39 2010
+++ rtems/cpukit/sapi/include/confdefs.h        Thu Jul  1 09:51:25 2010
</font><font color='#997700'>@@ -253,12 +253,14 @@
</font>    * If the base filesystem is DEVFS define it else define IMFS.
    * We will have either DEVFS or IMFS defined after this.
    */
<font color='#880000'>-  #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
-    #define CONFIGURE_FILESYSTEM_DEVFS
-  #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
-    #define CONFIGURE_FILESYSTEM_miniIMFS
-  #elif !defined(CONFIGURE_FILESYSTEM_IMFS)
-    #define CONFIGURE_FILESYSTEM_IMFS
</font><font color='#000088'>+  #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
+    #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
+      #define CONFIGURE_FILESYSTEM_DEVFS
+    #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
+      #define CONFIGURE_FILESYSTEM_miniIMFS
+    #elif !defined(CONFIGURE_FILESYSTEM_IMFS)
+      #define CONFIGURE_FILESYSTEM_IMFS
+    #endif
</font>   #endif
 
 #endif
</pre>
<p> </p>
<a name='cs8'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-22 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/src/mount.c: Fixed string assignment in mount entry
        allocation.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.53&r2=text&tr2=1.2346.2.54&diff_format=h">M</a></td><td width='1%'>1.2346.2.54</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/mount.c.diff?r1=text&tr1=1.33.2.2&r2=text&tr2=1.33.2.3&diff_format=h">M</a></td><td width='1%'>1.33.2.3</td><td width='100%'>cpukit/libcsupport/src/mount.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.53 rtems/cpukit/ChangeLog:1.2346.2.54
--- rtems/cpukit/ChangeLog:1.2346.2.53  Thu Jul  1 09:51:03 2010
+++ rtems/cpukit/ChangeLog      Thu Jul  1 09:56:34 2010
</font><font color='#997700'>@@ -22,6 +22,11 @@
</font> 
        * rtems/Makefile.am: Remove the stray 'c' file.
 
<font color='#000088'>+2010-06-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libcsupport/src/mount.c: Fixed string assignment in mount entry
+       allocation.
+
</font> 2010-06-21        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        PR 1581/cpukit

<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/mount.c:1.33.2.2 rtems/cpukit/libcsupport/src/mount.c:1.33.2.3
--- rtems/cpukit/libcsupport/src/mount.c:1.33.2.2       Thu Jul  1 09:39:34 2010
+++ rtems/cpukit/libcsupport/src/mount.c        Thu Jul  1 09:57:08 2010
</font><font color='#997700'>@@ -111,18 +111,18 @@
</font>   if ( mt_entry != NULL ) {
     char *str = (char *) mt_entry + sizeof( *mt_entry );
 
<font color='#880000'>-    mt_entry->type = str;
</font>     strcpy( str, filesystemtype );
<font color='#000088'>+    mt_entry->type = str;
+    str += filesystemtype_size;
</font> 
     if ( source_or_null != NULL ) {
<font color='#880000'>-      str += filesystemtype_size;
-      mt_entry->dev = str;
</font>       strcpy( str, source_or_null );
<font color='#000088'>+      mt_entry->dev = str;
+      str += source_size;
</font>     }
 
<font color='#880000'>-    str += source_size;
-    mt_entry->target = str;
</font>     strcpy( str, target );
<font color='#000088'>+    mt_entry->target = str;
</font>   }
 
   *target_length_ptr = target_length;
</pre>
<p> </p>
<a name='cs9'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-06-29 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libnetworking/lib/tftpDriver.c: rtems_tftp_ops and
        rtems_tftp_handlers are now const and static.
        * libnetworking/rtems/tftp.h: Removed
        rtems_bsdnet_initialize_tftp_filesystem and rtems_tftp_ops.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.54&r2=text&tr2=1.2346.2.55&diff_format=h">M</a></td><td width='1%'>1.2346.2.55</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/lib/tftpDriver.c.diff?r1=text&tr1=1.38&r2=text&tr2=1.38.2.1&diff_format=h">M</a></td><td width='1%'>1.38.2.1</td><td width='100%'>cpukit/libnetworking/lib/tftpDriver.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/rtems/tftp.h.diff?r1=text&tr1=1.7&r2=text&tr2=1.7.2.1&diff_format=h">M</a></td><td width='1%'>1.7.2.1</td><td width='100%'>cpukit/libnetworking/rtems/tftp.h</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.54 rtems/cpukit/ChangeLog:1.2346.2.55
--- rtems/cpukit/ChangeLog:1.2346.2.54  Thu Jul  1 09:56:34 2010
+++ rtems/cpukit/ChangeLog      Thu Jul  1 10:01:11 2010
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-06-29    Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libnetworking/lib/tftpDriver.c: rtems_tftp_ops and
+       rtems_tftp_handlers are now const and static.
+       * libnetworking/rtems/tftp.h: Removed
+       rtems_bsdnet_initialize_tftp_filesystem and rtems_tftp_ops.
+
</font> 2010-06-24        Bharath Suri <bharath.s.jois@gmail.com>
 
        PR 1542/filesystem

<font color='#006600'>diff -u rtems/cpukit/libnetworking/lib/tftpDriver.c:1.38 rtems/cpukit/libnetworking/lib/tftpDriver.c:1.38.2.1
--- rtems/cpukit/libnetworking/lib/tftpDriver.c:1.38    Mon May 31 08:56:37 2010
+++ rtems/cpukit/libnetworking/lib/tftpDriver.c Thu Jul  1 10:01:11 2010
</font><font color='#997700'>@@ -171,8 +171,8 @@
</font>  */
 
 typedef const char *tftp_node;
<font color='#880000'>-extern rtems_filesystem_operations_table  rtems_tftp_ops;
-extern rtems_filesystem_file_handlers_r   rtems_tftp_handlers;
</font><font color='#000088'>+static const rtems_filesystem_operations_table  rtems_tftp_ops;
+static const rtems_filesystem_file_handlers_r   rtems_tftp_handlers;
</font> 
 int rtems_tftpfs_initialize(
   rtems_filesystem_mount_table_entry_t *mt_entry,
<font color='#997700'>@@ -1082,7 +1082,7 @@
</font> }
 
 
<font color='#880000'>-rtems_filesystem_operations_table  rtems_tftp_ops = {
</font><font color='#000088'>+static const rtems_filesystem_operations_table  rtems_tftp_ops = {
</font>     rtems_tftp_eval_path,            /* eval_path */
     rtems_tftp_evaluate_for_make,    /* evaluate_for_make */
     NULL,                            /* link */
<font color='#997700'>@@ -1101,7 +1101,7 @@
</font>     NULL,                            /* readlin */
 };
 
<font color='#880000'>-rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
</font><font color='#000088'>+static const rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
</font>     rtems_tftp_open,      /* open */
     rtems_tftp_close,     /* close */
     rtems_tftp_read,      /* read */

<font color='#006600'>diff -u rtems/cpukit/libnetworking/rtems/tftp.h:1.7 rtems/cpukit/libnetworking/rtems/tftp.h:1.7.2.1
--- rtems/cpukit/libnetworking/rtems/tftp.h:1.7 Mon May 31 08:56:37 2010
+++ rtems/cpukit/libnetworking/rtems/tftp.h     Thu Jul  1 10:01:11 2010
</font><font color='#997700'>@@ -38,18 +38,6 @@
</font>  */
 int rtems_tftpfs_initialize(rtems_filesystem_mount_table_entry_t *temp_mt_entry);
 
<font color='#880000'>-/*
- * Filesystem initialization routine
- */
-
-int rtems_bsdnet_initialize_tftp_filesystem( void );
-
-/*
- * TFTP file system operations table.
- */
-
-extern rtems_filesystem_operations_table  rtems_tftp_ops;
-
</font> #ifdef __cplusplus
 }
 #endif
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>