change log for rtems (2010-07-01)
rtems-vc at rtems.org
rtems-vc at rtems.org
Thu Jul 1 15:14:04 UTC 2010
*joel*:
2010-07-01 Joel Sherrill <joel.sherrill at 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.
M 1.194 testsuites/libtests/ChangeLog
M 1.33 testsuites/libtests/Makefile.am
M 1.40 testsuites/libtests/configure.ac
A 1.1 testsuites/libtests/termios05/.cvsignore
A 1.1 testsuites/libtests/termios05/Makefile.am
A 1.1 testsuites/libtests/termios05/init.c
A 1.1 testsuites/libtests/termios05/termios05.doc
A 1.1 testsuites/libtests/termios05/termios05.scn
A 1.1 testsuites/libtests/termios05/termios_testdriver_taskdriven.h
A 1.1 testsuites/libtests/termios05/termios_testdriver_taskdriven.c
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
@@ -1,3 +1,11 @@
+2010-07-01 Joel Sherrill <joel.sherrill at 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.
+
2010-06-28 Joel Sherrill <joel.sherrill at oarcorp.com>
* Makefile.am, configure.ac: Revert changes related to uncommitted test
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
@@ -8,7 +8,7 @@
SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 malloc03 heapwalk \
putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
- termios termios01 termios02 termios03 termios04 \
+ termios termios01 termios02 termios03 termios04 termios05 \
rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
block08 block09 block10 stringto01
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
@@ -62,6 +62,7 @@
termios02/Makefile
termios03/Makefile
termios04/Makefile
+termios05/Makefile
tztest/Makefile
POSIX/Makefile
])
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
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
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
@@ -0,0 +1,28 @@
+##
+## $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 at .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
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
@@ -0,0 +1,158 @@
+/*
+ * 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;
+
+ 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 */
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
@@ -0,0 +1,22 @@
+#
+# $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
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
@@ -0,0 +1,59 @@
+*** TEST TERMIOS05 ***
+open(/dev/test) - OK
+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
+*** END OF TEST TERMIOS05 ***
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
@@ -0,0 +1,164 @@
+/**
+ * @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 */
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
@@ -0,0 +1,171 @@
+/*
+ * 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;
+}
+
+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);
+}
*joel*:
2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
* termios04/termios_testdriver_intr.c: Task driven IO now works.
M 1.195 testsuites/libtests/ChangeLog
M 1.2 testsuites/libtests/termios04/termios_testdriver_intr.c
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
@@ -1,5 +1,9 @@
2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
+ * termios04/termios_testdriver_intr.c: Task driven IO now works.
+
+2010-07-01 Joel Sherrill <joel.sherrill at 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,
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
@@ -19,15 +19,23 @@
#include <rtems/dumpbuf.h>
#include "termios_testdriver_intr.h"
-rtems_id Timer;
+rtems_id Rx_Timer;
+rtems_id Tx_Timer;
#define TX_MAX 1024
-uint8_t Tx_Buffer[TX_MAX];
-int Tx_Index = 0;
+uint8_t Tx_Buffer[TX_MAX];
+int Tx_Index = 0;
struct rtems_termios_tty *Ttyp;
+void termios_test_driver_wait_for_tx_to_complete(void)
+{
+ rtems_task_wake_after( 2 * rtems_clock_get_ticks_per_second() );
+}
+
void termios_test_driver_dump_tx(const char *c)
{
+ termios_test_driver_wait_for_tx_to_complete();
+
printf( "%s %d characters\n", c, Tx_Index );
rtems_print_buffer( Tx_Buffer, Tx_Index );
Tx_Index = 0;
@@ -39,6 +47,19 @@
bool Rx_FirstTime = true;
bool Rx_EnqueueNow = false;
+#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
+
rtems_timer_service_routine Rx_ISR(
rtems_id ignored_id,
void *ignored_address
@@ -51,8 +72,21 @@
ch = Rx_Buffer[ Rx_Index++ ];
rtems_termios_enqueue_raw_characters (Ttyp, (char *)&ch, 1);
+ #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);
- (void) rtems_timer_fire_after( Timer, 10, Rx_ISR, NULL );
+ (void) rtems_timer_fire_after( Tx_Timer, 10, Tx_ISR, NULL );
}
void termios_test_driver_set_rx_enqueue_now(
@@ -72,7 +106,7 @@
Rx_Index = 0;
if ( Rx_EnqueueNow == false) {
- (void) rtems_timer_fire_after( Timer, 10, Rx_ISR, NULL );
+ (void) rtems_timer_fire_after( Rx_Timer, 10, Rx_ISR, NULL );
return;
}
@@ -89,12 +123,9 @@
size_t len
)
{
- size_t i;
-
- for (i=0 ; i<len ; i++ )
- Tx_Buffer[Tx_Index++] = (uint8_t) buf[i];
-
- return len;
+ Tx_Buffer[Tx_Index++] = buf[0];
+ (void) rtems_timer_fire_after( Tx_Timer, 10, Tx_ISR, NULL );
+ return 1;
}
/*
@@ -126,7 +157,11 @@
*/
(void) rtems_io_register_name( TERMIOS_TEST_DRIVER_DEVICE_NAME, major, 0 );
- status = rtems_timer_create( rtems_build_name('T', 'M', '0', '1'), &Timer );
+ 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);
if ( status )
rtems_fatal_error_occurred(1);;
@@ -144,12 +179,20 @@
static const rtems_termios_callbacks Callbacks = {
NULL, /* firstOpen */
NULL, /* lastClose */
- NULL, /* pollRead */
+ #if defined(TASK_DRIVEN)
+ termios_test_driver_inbyte_nonblocking,/* pollRead */
+ #else
+ NULL, /* pollRead */
+ #endif
termios_test_driver_write_helper, /* write */
termios_test_driver_set_attributes, /* setAttributes */
NULL, /* stopRemoteTx */
NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
+ #if defined(TASK_DRIVEN)
+ TERMIOS_TASK_DRIVEN /* outputUsesInterrupts */
+ #else
+ 0 /* outputUsesInterrupts */
+ #endif
};
if ( minor > 2 ) {
*joel*:
2010-07-01 Joel Sherrill <joel.sherrill at 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.
M 1.196 testsuites/libtests/ChangeLog
M 1.34 testsuites/libtests/Makefile.am
M 1.41 testsuites/libtests/configure.ac
A 1.1 testsuites/libtests/gxx01/.cvsignore
A 1.1 testsuites/libtests/gxx01/Makefile.am
A 1.1 testsuites/libtests/gxx01/gxx01.doc
A 1.1 testsuites/libtests/gxx01/gxx01.scn
A 1.1 testsuites/libtests/gxx01/gxx_wrappers.h
A 1.1 testsuites/libtests/gxx01/init.c
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
@@ -1,5 +1,11 @@
2010-07-01 Joel Sherrill <joel.sherrill at 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.
+
+2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
+
* termios04/termios_testdriver_intr.c: Task driven IO now works.
2010-07-01 Joel Sherrill <joel.sherrill at oarcorp.com>
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
@@ -6,7 +6,7 @@
SUBDIRS = POSIX
-SUBDIRS += bspcmdline01 cpuuse malloctest malloc02 malloc03 heapwalk \
+SUBDIRS += bspcmdline01 cpuuse gxx01 malloctest malloc02 malloc03 heapwalk \
putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
termios termios01 termios02 termios03 termios04 termios05 \
rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
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
@@ -45,6 +45,7 @@
block10/Makefile
bspcmdline01/Makefile
cpuuse/Makefile
+gxx01/Makefile
heapwalk/Makefile
malloctest/Makefile
malloc02/Makefile
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
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
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
@@ -0,0 +1,26 @@
+##
+## $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 at .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
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
@@ -0,0 +1,37 @@
+#
+# $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
+ rtems_gxx_key_dtor
+ rtems_gxx_key_delete
+ rtems_gxx_getspecific
+ rtems_gxx_setspecific
+ rtems_gxx_mutex_init
+ rtems_gxx_mutex_lock
+ rtems_gxx_mutex_destroy
+ rtems_gxx_mutex_trylock
+ rtems_gxx_mutex_unlock
+ 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.
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
@@ -0,0 +1,26 @@
+*** 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 ***
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
@@ -0,0 +1,58 @@
+/*
+ * RTEMS threads compatibily routines for libgcc2.
+ *
+ * $Id$
+ */
+
+#ifndef __GCC_WRAPPERS_h
+#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; /* 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
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
@@ -0,0 +1,179 @@
+/*
+ * 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 */
*joel*:
2010-07-01 Joel Sherrill <joel.sherrill at 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.
M 1.278 testsuites/psxtests/ChangeLog
M 1.63 testsuites/psxtests/Makefile.am
M 1.67 testsuites/psxtests/configure.ac
A 1.1 testsuites/psxtests/psxfilelock01/.cvsignore
A 1.1 testsuites/psxtests/psxfilelock01/Makefile.am
A 1.1 testsuites/psxtests/psxfilelock01/init.c
A 1.1 testsuites/psxtests/psxfilelock01/psxfilelock01.doc
A 1.1 testsuites/psxtests/psxfilelock01/psxfilelock01.scn
A 1.1 testsuites/psxtests/psxid01/.cvsignore
A 1.1 testsuites/psxtests/psxid01/Makefile.am
A 1.1 testsuites/psxtests/psxid01/init.c
A 1.1 testsuites/psxtests/psxid01/psxid01.doc
A 1.1 testsuites/psxtests/psxid01/psxid01.scn
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
@@ -1,3 +1,13 @@
+2010-07-01 Joel Sherrill <joel.sherrill at 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.
+
2010-06-30 Joel Sherrill <joel.sherrilL at OARcorp.com>
* psximfs01/init.c: Fix warning introduced.
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
@@ -19,8 +19,8 @@
endif
## File IO tests
-SUBDIRS += psxfile01 psxfile02 psximfs01 psxreaddir psxstat psxmount psx13 \
- psxchroot01 psxpasswd01
+SUBDIRS += psxfile01 psxfile02 psxfilelock01 psxid01 psximfs01 psxreaddir \
+ psxstat psxmount psx13 psxchroot01 psxpasswd01
## Until sys/uio.h is moved to libcsupport, we have to have networking
## enabled to support readv and writev. Hopefully this is a temporary
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
@@ -88,7 +88,9 @@
psxfatal02/Makefile
psxfile01/Makefile
psxfile02/Makefile
+psxfilelock01/Makefile
psxhdrs/Makefile
+psxid01/Makefile
psximfs01/Makefile
psxintrcritical01/Makefile
psxitimer/Makefile
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
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
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
@@ -0,0 +1,26 @@
+##
+## $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 at .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
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
@@ -0,0 +1,60 @@
+/*
+ * 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 );
+
+ puts( "ftrylockfile /testfile" );
+ sc = ftrylockfile( fd );
+ rtems_test_assert( sc == -1 );
+ rtems_test_assert( errno == ENOTSUP );
+
+ puts( "flockfile /testfile" );
+ flockfile( fd );
+
+ puts( "funlockfile /testfile" );
+ funlockfile( fd );
+
+ 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 */
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
@@ -0,0 +1,22 @@
+#
+# $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
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
@@ -0,0 +1,7 @@
+*** TEST FILE LOCK 01 ***
+Open /testfile
+flockfile /testfile
+ftrylockfile /testfile
+flockfile /testfile
+funlockfile /testfile
+*** END OF TEST FILE LOCK 01 ***
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
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
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
@@ -0,0 +1,26 @@
+##
+## $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 at .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
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
@@ -0,0 +1,126 @@
+/*
+ * 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 */
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
@@ -0,0 +1,34 @@
+#
+# $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
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
@@ -0,0 +1,20 @@
+*** 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 ***
*sh* (on branch rtems-4-10-branch):
2010-06-08 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libcsupport/include/rtems/libio.h: Documentation.
2010-06-08 Sebastian Huber <sebastian.huber at 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().
M 1.2346.2.51 cpukit/ChangeLog
M 1.2.2.1 cpukit/libblock/src/bdpart-mount.c
M 1.118.2.2 cpukit/libcsupport/Makefile.am
M 1.65.2.2 cpukit/libcsupport/include/rtems/libio.h
M 1.1.2.2 cpukit/libcsupport/src/rtems_mkdir.c
M 1.7.2.1 cpukit/libmisc/fsmount/fsmount.h
M 1.12.2.1 cpukit/libmisc/fsmount/fsmount.c
M 1.8.4.4 cpukit/libnetworking/rtems/mkrootfs.h
M 1.11.2.2 cpukit/libnetworking/rtems/mkrootfs.c
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
@@ -207,6 +207,21 @@
* configure.ac: Remove c4x (dead port).
* score/cpu/Makefile.am: Remove c4x (dead port).
+2010-06-08 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * libcsupport/include/rtems/libio.h: Documentation.
+
+2010-06-08 Sebastian Huber <sebastian.huber at 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().
+
2010-06-07 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Declare
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
@@ -29,7 +29,7 @@
#include <rtems.h>
#include <rtems/bdpart.h>
-#include <rtems/fsmount.h>
+#include <rtems/libio.h>
rtems_status_code rtems_bdpart_mount(
const char *disk_name,
@@ -90,7 +90,7 @@
/* Create mount point */
strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
- rv = rtems_fsmount_create_mount_point( mount_point);
+ rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
if (rv != 0) {
esc = RTEMS_IO_ERROR;
goto cleanup;
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
@@ -46,7 +46,7 @@
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 \
- src/open_dev_console.c src/__usrenv.c
+ src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c
TERMIOS_C_FILES = src/cfgetispeed.c src/cfgetospeed.c src/cfsetispeed.c \
src/cfsetospeed.c src/tcgetattr.c src/tcsetattr.c src/tcdrain.c \
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
@@ -1,15 +1,12 @@
/**
- * @file rtems/libio.h
+ * @file
+ *
+ * @ingroup LibIO
+ *
+ * @brief Basic IO API.
*/
/*
- * 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.
- *
* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
@@ -23,41 +20,63 @@
#ifndef _RTEMS_RTEMS_LIBIO_H
#define _RTEMS_RTEMS_LIBIO_H
-#include <rtems.h>
-#include <rtems/chain.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/statvfs.h>
-/*
- * Define data types which must be constructed using forward references.
- */
+#include <unistd.h>
+#include <termios.h>
+#include <rtems.h>
#include <rtems/fs.h>
+#include <rtems/chain.h>
#ifdef __cplusplus
extern "C" {
#endif
-/*
- * A 64bit file offset for internal use by RTEMS. Based on the newlib type.
+/**
+ * @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.
*/
typedef _off64_t rtems_off64_t;
-/*
- * Valid RTEMS file types.
+/**
+ * @name File system node types.
+ *
+ * @{
*/
+
#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
+
+/** @} */
+
typedef int rtems_filesystem_node_types_t;
-/*
- * File Handler Operations Table
+/**
+ * @name File System Node Operations
+ *
+ * @{
*/
+
typedef int (*rtems_filesystem_open_t)(
rtems_libio_t *iop,
const char *pathname,
@@ -131,6 +150,11 @@
rtems_filesystem_location_info_t *pathloc /* IN */
);
+/** @} */
+
+/**
+ * @brief File system node operations table.
+ */
struct _rtems_filesystem_file_handlers_r {
rtems_filesystem_open_t open_h;
rtems_filesystem_close_t close_h;
@@ -148,8 +172,10 @@
rtems_filesystem_rmnod_t rmnod_h;
};
-/*
- * File System Operations Table
+/**
+ * @name File System Operations
+ *
+ * @{
*/
/*
@@ -261,12 +287,10 @@
struct statvfs *buf /* OUT */
);
-/*
- * operations table that must be defined for every file system.
- */
+/** @} */
-/*
- * File system types
+/**
+ * @brief File system operations table.
*/
struct _rtems_filesystem_operations_table {
rtems_filesystem_evalpath_t evalpath_h;
@@ -307,7 +331,10 @@
/**
* @brief Per file system table entry routine type.
*
- * Return @c true to continue the iteration, and @c false to stop.
+ * @see rtems_filesystem_iterate().
+ *
+ * @retval true Continue the iteration.
+ * @retval false Stop the iteration.
*/
typedef bool (*rtems_per_filesystem_routine)(
const rtems_filesystem_table_t *entry,
@@ -327,7 +354,9 @@
);
/**
- * @brief Returns the file system mount handler associated with the @a type, or
+ * @brief Gets the mount handler for the file system @a type.
+ *
+ * @return The file system mount handler associated with the @a type, or
* @c NULL if no such association exists.
*/
rtems_filesystem_fsmount_me_t
@@ -364,9 +393,9 @@
const char *type
);
-/*
- * Structure used to contain file system specific information which
- * is required to support fpathconf().
+/**
+ * @brief Contain file system specific information which is required to support
+ * fpathconf().
*/
typedef struct {
int link_max; /* count */
@@ -383,15 +412,16 @@
int posix_vdisable; /* special char processing, 0=no, 1=yes */
} rtems_filesystem_limits_and_options_t;
-/*
- * Default pathconf settings. Override in a filesystem.
+/**
+ * @brief Default pathconf settings.
+ *
+ * Override in a filesystem.
*/
extern const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf;
-/*
- * Structure for a mount table entry.
+/**
+ * @brief Mount table entry.
*/
-
struct rtems_filesystem_mount_table_entry_tt {
rtems_chain_node Node;
rtems_filesystem_location_info_t mt_point_node;
@@ -422,27 +452,27 @@
};
/**
- * The pathconf setting for a file system.
+ * @brief The pathconf setting for a file system.
*/
#define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
/**
- * The type of file system. Its name.
+ * @brief The type of file system. Its name.
*/
#define rtems_filesystem_type(_mte) ((_mte)->type)
/**
- * The mount point of a file system.
+ * @brief The mount point of a file system.
*/
#define rtems_filesystem_mount_point(_mte) ((_mte)->target)
/**
- * The device entry of a file system.
+ * @brief The device entry of a file system.
*/
#define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
-/*
- * Valid RTEMS file systems options
+/**
+ * @brief File systems options.
*/
typedef enum {
RTEMS_FILESYSTEM_READ_ONLY,
@@ -450,12 +480,13 @@
RTEMS_FILESYSTEM_BAD_OPTIONS
} rtems_filesystem_options_t;
-
-/*
- * 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)
+/**
+ * @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)
*/
struct rtems_libio_tt {
rtems_driver_name_t *driver;
@@ -470,10 +501,11 @@
const rtems_filesystem_file_handlers_r *handlers; /* type specific handlers */
};
-/*
- * 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.
+/**
+ * @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.
*/
typedef struct {
rtems_libio_t *iop;
@@ -484,8 +516,8 @@
uint32_t bytes_moved;
} rtems_libio_rw_args_t;
-/*
- * param block for open/close
+/**
+ * @brief Parameter block for open/close.
*/
typedef struct {
rtems_libio_t *iop;
@@ -493,8 +525,8 @@
uint32_t mode;
} rtems_libio_open_close_args_t;
-/*
- * param block for ioctl
+/**
+ * @brief Parameter block for ioctl.
*/
typedef struct {
rtems_libio_t *iop;
@@ -503,9 +535,12 @@
uint32_t ioctl_return;
} rtems_libio_ioctl_args_t;
-/*
- * Values for 'flag'
+/**
+ * @name Flag Values
+ *
+ * @{
*/
+
#define LIBIO_FLAGS_NO_DELAY 0x0001 /* return immediately if no data */
#define LIBIO_FLAGS_READ 0x0002 /* reading */
#define LIBIO_FLAGS_WRITE 0x0004 /* writing */
@@ -515,10 +550,14 @@
#define LIBIO_FLAGS_CLOSE_ON_EXEC 0x0800 /* close on process exec() */
#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
+/** @} */
+
void rtems_libio_init(void);
-/*
- * External I/O handlers
+/**
+ * @name External I/O Handlers
+ *
+ * @{
*/
typedef int (*rtems_libio_open_t)(
@@ -555,6 +594,14 @@
int whence
);
+/** @} */
+
+/**
+ * @name Permission Macros
+ *
+ * @{
+ */
+
/*
* The following macros are used to build up the permissions sets
* used to check permissions. These are similar in style to the
@@ -567,11 +614,7 @@
#define RTEMS_LIBIO_PERMS_SEARCH RTEMS_LIBIO_PERMS_EXEC
#define RTEMS_LIBIO_PERMS_RWX S_IRWXO
-/*
- * Macros
- */
-
-#include <unistd.h>
+/** @} */
union __rtems_dev_t {
dev_t device;
@@ -632,10 +675,65 @@
void rtems_filesystem_initialize( void );
+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
+);
+
/*
- * Callbacks from TERMIOS routines to device-dependent code
+ * 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
+ *
+ * @{
*/
-#include <termios.h>
typedef struct rtems_termios_callbacks {
int (*firstOpen)(int major, int minor, void *arg);
@@ -648,9 +746,6 @@
int outputUsesInterrupts;
} rtems_termios_callbacks;
-/*
- * Device-independent TERMIOS routines
- */
void rtems_termios_initialize (void);
/*
@@ -698,42 +793,7 @@
int len
);
-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;
+/** @} */
#ifdef __cplusplus
}
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
@@ -0,0 +1,141 @@
+/**
+ * @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;
+}
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
@@ -121,24 +121,14 @@
} rtems_fstab_entry;
/**
- * 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);
-
-/**
* 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
- * point paths will be created with rtems_fsmount_create_mount_point() and need
- * not exist beforehand.
+ * point paths will be created with rtems_mkdir() and need not exist
+ * beforehand.
*
* On success, zero is returned. On error, -1 is returned, and @c errno is set
* appropriately.
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
@@ -34,83 +34,11 @@
#include <rtems.h>
#include <rtems/fsmount.h>
+#include <rtems/libio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#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;
-}
/*=========================================================================*\
| Function: |
@@ -148,7 +76,7 @@
* create mount point
*/
if (tmp_rc == 0) {
- tmp_rc = rtems_fsmount_create_mount_point(fstab_ptr->target);
+ tmp_rc = rtems_mkdir(fstab_ptr->target, S_IRWXU | S_IRWXG | S_IRWXO);
if (tmp_rc != 0) {
if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",
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
@@ -30,13 +30,6 @@
extern "C" {
#endif
-/*
- * Builds the complete path, like "mkdir -p".
- */
-
-int
-rtems_rootfs_mkdir (const char *path, mode_t omode);
-
/**
* Appends the lines to the a file. Create the file
* and builds the path if it does not exist.
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
@@ -68,96 +68,6 @@
#define MKDIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
/*
- * 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;
-}
-
-/*
* Create enough files to support the networking stack.
* Points to a table of strings.
*/
@@ -205,7 +115,7 @@
strncpy (path, file, i);
path[i] = '\0';
- if (rtems_rootfs_mkdir (path, MKDIR_MODE))
+ if (rtems_mkdir (path, MKDIR_MODE))
return -1;
break;
}
@@ -310,7 +220,7 @@
for (i = 0;
i < (sizeof (default_directories) / sizeof (rtems_rootfs_dir_table));
i++)
- if (rtems_rootfs_mkdir (default_directories[i].name,
+ if (rtems_mkdir (default_directories[i].name,
default_directories[i].mode))
return -1;
*sh* (on branch rtems-4-10-branch):
2010-06-10 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libcsupport/src/unmount.c: Removed obsolete declarations. Fixed
invalid memory free.
2010-06-10 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Removed
rtems_ftpfs_mount().
2010-06-10 Sebastian Huber <sebastian.huber at 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 at embedded-brains.de>
* libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added
rtems_ftpfs_mount() again. Documentation.
2010-06-09 Sebastian Huber <sebastian.huber at 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 at embedded-brains.de>
* libcsupport/src/mount.c: Fixed NULL pointer access.
M 1.2346.2.52 cpukit/ChangeLog
M 1.118.2.3 cpukit/libcsupport/Makefile.am
M 1.65.2.3 cpukit/libcsupport/include/rtems/libio.h
M 1.1.2.2 cpukit/libcsupport/src/mount-mktgt.c
M 1.33.2.2 cpukit/libcsupport/src/mount.c
M 1.25.2.1 cpukit/libcsupport/src/unmount.c
M 1.29.2.1 cpukit/libnetworking/lib/ftpfs.c
M 1.10.2.1 cpukit/libnetworking/rtems/ftpfs.h
M 1.135.2.4 cpukit/sapi/include/confdefs.h
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
@@ -197,6 +197,37 @@
libfs/src/rfs/rtems-rfs-group.h, libfs/src/rfs/rtems-rfs-inode.h:
Fix broken doxygen commands.
+2010-06-10 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * libcsupport/src/unmount.c: Removed obsolete declarations. Fixed
+ invalid memory free.
+
+2010-06-10 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Removed
+ rtems_ftpfs_mount().
+
+2010-06-10 Sebastian Huber <sebastian.huber at 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 at embedded-brains.de>
+
+ * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added
+ rtems_ftpfs_mount() again. Documentation.
+
+2010-06-09 Sebastian Huber <sebastian.huber at 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 at embedded-brains.de>
+
+ * libcsupport/src/mount.c: Fixed NULL pointer access.
+
2010-06-09 Ralf Corsépius <ralf.corsepius at rtems.org>
* configure.ac: Remove nios2 (unsupported, no toolchain).
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
@@ -44,7 +44,7 @@
src/assocremotebylocal.c src/assocremotebyname.c
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/mount-mgr.c src/mount-mktgt.c src/libio_init.c \
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
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
@@ -56,7 +56,7 @@
typedef _off64_t rtems_off64_t;
/**
- * @name File system node types.
+ * @name File System Node Types
*
* @{
*/
@@ -669,6 +669,23 @@
#define rtems_libio_is_valid_perms( _perm ) \
(~ ((~RTEMS_LIBIO_PERMS_RWX) & _perm ))
+/**
+ * @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"
+
+/** @} */
+
/*
* Prototypes for filesystem
*/
@@ -687,6 +704,25 @@
const void *data
);
+/**
+ * @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
+);
+
/*
* Boot Time Mount Table Structure
*/
@@ -719,7 +755,7 @@
* 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.
+ * @retval -1 An error occured. The @c errno indicates the error.
*/
extern int rtems_mkdir(const char *path, mode_t mode);
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
@@ -0,0 +1,56 @@
+/**
+ * @file
+ *
+ * @ingroup LibIO
+ *
+ * @brief mount_and_make_target_path() implementation.
+ */
+
+/*
+ * Copyright (c) 2010
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * D-82178 Puchheim
+ * Germany
+ * <rtems at 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;
+}
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
@@ -93,30 +93,31 @@
}
static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
- const char *source,
- const char *target,
+ const char *source_or_null,
+ const char *target_or_null,
const char *filesystemtype,
size_t *target_length_ptr
)
{
- const char *target_str = target ? target : "/";
+ const char *target = target_or_null != NULL ? target_or_null : "/";
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
- size_t source_size = source ? strlen( source ) + 1 : 0;
- size_t target_length = strlen( target_str );
+ size_t source_size = source_or_null != NULL ?
+ strlen( source_or_null ) + 1 : 0;
+ size_t target_length = strlen( target );
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 );
- if ( mt_entry ) {
+ if ( mt_entry != NULL ) {
char *str = (char *) mt_entry + sizeof( *mt_entry );
mt_entry->type = str;
strcpy( str, filesystemtype );
- if ( source ) {
+ if ( source_or_null != NULL ) {
str += filesystemtype_size;
mt_entry->dev = str;
- strcpy( str, source );
+ strcpy( str, source_or_null );
}
str += source_size;
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
@@ -33,16 +33,6 @@
#include <rtems/libio_.h>
#include <rtems/seterr.h>
-/*
- * 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
-);
-
bool rtems_filesystem_nodes_equal(
const rtems_filesystem_location_info_t *loc1,
const rtems_filesystem_location_info_t *loc2
@@ -213,7 +203,6 @@
*/
rtems_filesystem_freenode( fs_mount_loc );
- free( (void*) mt_entry->target );
free( mt_entry );
return 0;
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
@@ -99,6 +99,8 @@
struct timeval timeout;
} rtems_ftpfs_mount_entry;
+static const rtems_filesystem_operations_table rtems_ftpfs_ops;
+
static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers;
static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers;
@@ -130,36 +132,6 @@
return 0;
}
-#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
-
static rtems_status_code rtems_ftpfs_do_ioctl(
const char *mount_point,
ioctl_command_t req,
@@ -1318,7 +1290,7 @@
return 0;
}
-const rtems_filesystem_operations_table rtems_ftpfs_ops = {
+static const rtems_filesystem_operations_table rtems_ftpfs_ops = {
.evalpath_h = rtems_ftpfs_eval_path,
.evalformake_h = NULL,
.link_h = NULL,
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
@@ -1,7 +1,7 @@
/**
* @file
*
- * File Transfer Protocol file system (FTP client).
+ * @brief File Transfer Protocol file system (FTP client).
*/
/*
@@ -46,12 +46,15 @@
/**
* @defgroup rtems_ftpfs File Transfer Protocol File System
*
- * The FTP file system (FTP client) can be used to transfer files from or to
- * remote hosts.
+ * @brief The FTP file system (FTP client) can be used to transfer files from
+ * or to remote hosts.
*
- * 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.
+ * 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.
*
* You can open files either read-only or write-only. A seek is not allowed.
* A close terminates the control and data connections.
@@ -74,17 +77,17 @@
*/
/**
- * Well-known port number for FTP control connection.
+ * @brief Well-known port number for FTP control connection.
*/
#define RTEMS_FTPFS_CTRL_PORT 21
/**
- * Default mount point for FTP file system.
+ * @brief Default mount point for FTP file system.
*/
#define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
/**
- * FTP file system IO control requests.
+ * @brief FTP file system IO control requests.
*/
typedef enum {
RTEMS_FTPFS_IOCTL_GET_VERBOSE = _IOR( 'd', 1, bool *),
@@ -94,13 +97,8 @@
} rtems_ftpfs_ioctl_numbers;
/**
- * 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.
+ * @brief Returns in @a verbose if the verbose mode is enabled or disabled for
+ * the file system at @a mount_point.
*
* If @a mount_point is @c NULL the default mount point
* @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
@@ -108,7 +106,7 @@
rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbose);
/**
- * Enables or disables the verbose mode if @a verbose is @c true or
+ * @brief Enables or disables the verbose mode if @a verbose is @c true or
* @c false respectively for the file system at @a mount_point.
*
* In the enabled verbose mode the commands and replies of the FTP control
@@ -120,8 +118,8 @@
rtems_status_code rtems_ftpfs_set_verbose( const char *mount_point, bool verbose);
/**
- * Returns the current timeout value in @a timeout for the file system at
- * @a mount_point.
+ * @brief Returns the current timeout value in @a timeout for the file system
+ * at @a mount_point.
*
* If @a mount_point is @c NULL the default mount point
* @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
@@ -132,7 +130,8 @@
);
/**
- * Sets the timeout value to @a timeout for the file system at @a mount_point.
+ * @brief Sets the timeout value to @a timeout for the file system at
+ * @a mount_point.
*
* The timeout value will be used during connection establishment of active
* data connections. It will be also used for send and receive operations on
@@ -149,13 +148,12 @@
/** @} */
/**
- * 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.
+ * @brief Do not call directly, use mount().
*/
-int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *e,
- const void *d);
+int rtems_ftpfs_initialize(
+ rtems_filesystem_mount_table_entry_t *mt_entry,
+ const void *data
+);
#ifdef __cplusplus
}
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
@@ -284,7 +284,8 @@
*/
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
defined(CONFIGURE_FILESYSTEM_miniIMFS)
-#define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS { "mimfs", miniIMFS_initialize }
+ #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \
+ { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize }
#endif
/**
@@ -301,7 +302,8 @@
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
defined(CONFIGURE_FILESYSTEM_DEVFS)
#include <rtems/devfs.h>
-#define CONFIGURE_FILESYSTEM_ENTRY_DEVFS { "devfs", devFS_initialize }
+ #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \
+ { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize }
#endif
#ifdef RTEMS_NETWORKING
@@ -311,7 +313,8 @@
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \
defined(CONFIGURE_FILESYSTEM_FTPFS)
#include <rtems/ftpfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS { "ftpfs", rtems_ftpfs_initialize }
+ #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \
+ { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize }
#endif
/**
@@ -320,7 +323,8 @@
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \
defined(CONFIGURE_FILESYSTEM_TFTPFS)
#include <rtems/tftp.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS { "tftpfs", rtems_tftpfs_initialize }
+ #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \
+ { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize }
#endif
/**
@@ -329,7 +333,8 @@
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS) && \
defined(CONFIGURE_FILESYSTEM_NFSFS)
#include <librtemsNfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS { "nfs", rtems_nfsfs_initialize }
+ #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS \
+ { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfsfs_initialize }
#endif
#endif
@@ -339,7 +344,8 @@
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \
defined(CONFIGURE_FILESYSTEM_DOSFS)
#include <rtems/dosfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS { "dosfs", rtems_dosfs_initialize }
+ #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \
+ { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize }
#endif
/**
@@ -348,7 +354,8 @@
#if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \
defined(CONFIGURE_FILESYSTEM_RFS)
#include <rtems/rtems-rfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_RFS { "rfs", rtems_rfs_rtems_initialise }
+ #define CONFIGURE_FILESYSTEM_ENTRY_RFS \
+ { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise }
#endif
#ifdef CONFIGURE_INIT
@@ -440,11 +447,11 @@
#ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
const rtems_filesystem_mount_table_t configuration_mount_table = {
#if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- "devfs",
+ RTEMS_FILESYSTEM_TYPE_DEVFS,
#elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
- "mimfs",
+ RTEMS_FILESYSTEM_TYPE_MINIIMFS,
#else /* using IMFS as base filesystem */
- "imfs",
+ RTEMS_FILESYSTEM_TYPE_IMFS,
#endif
RTEMS_FILESYSTEM_READ_WRITE,
NULL,
*sh* (on branch rtems-4-10-branch):
2010-06-14 Sebastian Huber <sebastian.huber at embedded-brains.de>
PR 1555/cpukit
* Makefile.am, preinstall.am: Install md4.h and md5.h headers.
2010-06-14 Sebastian Huber <sebastian.huber at embedded-brains.de>
* sapi/include/confdefs.h: Do not define a filesystem if
CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined.
M 1.2346.2.53 cpukit/ChangeLog
M 1.94.2.2 cpukit/Makefile.am
M 1.44.2.2 cpukit/preinstall.am
M 1.135.2.5 cpukit/sapi/include/confdefs.h
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
@@ -154,6 +154,16 @@
Include <inttypes.h>.
Misc. 64bit-compatibility fixes.
+2010-06-14 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ PR 1555/cpukit
+ * Makefile.am, preinstall.am: Install md4.h and md5.h headers.
+
+2010-06-14 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * sapi/include/confdefs.h: Do not define a filesystem if
+ CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined.
+
2010-06-14 Ralf Corsépius <ralf.corsepius at rtems.org>
* libnetworking/rtems/mkrootfs.h,
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
@@ -52,7 +52,9 @@
include_sysdir = $(includedir)/sys
include_sys_HEADERS =
-include_HEADERS += libnetworking/memory.h
+include_HEADERS += libnetworking/memory.h \
+ libmd/md4.h \
+ libmd/md5.h
include_sys_HEADERS += libcsupport/include/sys/ioccom.h \
libcsupport/include/sys/filio.h libcsupport/include/sys/ioctl.h \
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
@@ -60,6 +60,14 @@
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/memory.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/memory.h
+$(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
+
$(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
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
@@ -253,12 +253,14 @@
* If the base filesystem is DEVFS define it else define IMFS.
* We will have either DEVFS or IMFS defined after this.
*/
- #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
+ #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
#endif
#endif
*sh* (on branch rtems-4-10-branch):
2010-06-22 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libcsupport/src/mount.c: Fixed string assignment in mount entry
allocation.
M 1.2346.2.54 cpukit/ChangeLog
M 1.33.2.3 cpukit/libcsupport/src/mount.c
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
@@ -22,6 +22,11 @@
* rtems/Makefile.am: Remove the stray 'c' file.
+2010-06-22 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * libcsupport/src/mount.c: Fixed string assignment in mount entry
+ allocation.
+
2010-06-21 Joel Sherrill <joel.sherrilL at OARcorp.com>
PR 1581/cpukit
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
@@ -111,18 +111,18 @@
if ( mt_entry != NULL ) {
char *str = (char *) mt_entry + sizeof( *mt_entry );
- mt_entry->type = str;
strcpy( str, filesystemtype );
+ mt_entry->type = str;
+ str += filesystemtype_size;
if ( source_or_null != NULL ) {
- str += filesystemtype_size;
- mt_entry->dev = str;
strcpy( str, source_or_null );
+ mt_entry->dev = str;
+ str += source_size;
}
- str += source_size;
- mt_entry->target = str;
strcpy( str, target );
+ mt_entry->target = str;
}
*target_length_ptr = target_length;
*sh* (on branch rtems-4-10-branch):
2010-06-29 Sebastian Huber <sebastian.huber at 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.
M 1.2346.2.55 cpukit/ChangeLog
M 1.38.2.1 cpukit/libnetworking/lib/tftpDriver.c
M 1.7.2.1 cpukit/libnetworking/rtems/tftp.h
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
@@ -1,3 +1,10 @@
+2010-06-29 Sebastian Huber <sebastian.huber at 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.
+
2010-06-24 Bharath Suri <bharath.s.jois at gmail.com>
PR 1542/filesystem
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
@@ -171,8 +171,8 @@
*/
typedef const char *tftp_node;
-extern rtems_filesystem_operations_table rtems_tftp_ops;
-extern rtems_filesystem_file_handlers_r rtems_tftp_handlers;
+static const rtems_filesystem_operations_table rtems_tftp_ops;
+static const rtems_filesystem_file_handlers_r rtems_tftp_handlers;
int rtems_tftpfs_initialize(
rtems_filesystem_mount_table_entry_t *mt_entry,
@@ -1082,7 +1082,7 @@
}
-rtems_filesystem_operations_table rtems_tftp_ops = {
+static const rtems_filesystem_operations_table rtems_tftp_ops = {
rtems_tftp_eval_path, /* eval_path */
rtems_tftp_evaluate_for_make, /* evaluate_for_make */
NULL, /* link */
@@ -1101,7 +1101,7 @@
NULL, /* readlin */
};
-rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
+static const rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
rtems_tftp_open, /* open */
rtems_tftp_close, /* close */
rtems_tftp_read, /* read */
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
@@ -38,18 +38,6 @@
*/
int rtems_tftpfs_initialize(rtems_filesystem_mount_table_entry_t *temp_mt_entry);
-/*
- * Filesystem initialization routine
- */
-
-int rtems_bsdnet_initialize_tftp_filesystem( void );
-
-/*
- * TFTP file system operations table.
- */
-
-extern rtems_filesystem_operations_table rtems_tftp_ops;
-
#ifdef __cplusplus
}
#endif
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100701/fa70f3ce/attachment-0001.html>
More information about the vc
mailing list