change log for rtems (2011-05-13)
rtems-vc at rtems.org
rtems-vc at rtems.org
Fri May 13 14:12:09 UTC 2011
*sh*:
2011-05-13 Sebastian Huber <sebastian.huber at embedded-brains.de>
* libmisc/devnull/devzero.c, libmisc/devnull/devzero.h: New files.
* libmisc/Makefile.am, Makefile.am, preinstall.am: Reflect changes
above.
M 1.107 cpukit/Makefile.am
M 1.90 cpukit/libmisc/Makefile.am
A 1.1 cpukit/libmisc/devnull/devzero.h
A 1.1 cpukit/libmisc/devnull/devzero.c
M 1.51 cpukit/preinstall.am
diff -u rtems/cpukit/Makefile.am:1.106 rtems/cpukit/Makefile.am:1.107
--- rtems/cpukit/Makefile.am:1.106 Thu Mar 24 06:21:58 2011
+++ rtems/cpukit/Makefile.am Fri May 13 08:46:43 2011
@@ -140,7 +140,8 @@
include_rtems_HEADERS += libmisc/cpuuse/cpuuse.h
## devnull
-include_rtems_HEADERS += libmisc/devnull/devnull.h
+include_rtems_HEADERS += libmisc/devnull/devnull.h \
+ libmisc/devnull/devzero.h
## dumpbuf
include_rtems_HEADERS += libmisc/dumpbuf/dumpbuf.h
diff -u rtems/cpukit/libmisc/Makefile.am:1.89 rtems/cpukit/libmisc/Makefile.am:1.90
--- rtems/cpukit/libmisc/Makefile.am:1.89 Mon Mar 14 09:56:07 2011
+++ rtems/cpukit/libmisc/Makefile.am Fri May 13 08:46:43 2011
@@ -30,7 +30,8 @@
## devnull
noinst_LIBRARIES += libdevnull.a
-libdevnull_a_SOURCES = devnull/devnull.c devnull/devnull.h
+libdevnull_a_SOURCES = devnull/devnull.c devnull/devnull.h \
+ devnull/devzero.c devnull/devzero.h
## dummy
EXTRA_DIST += dummy/README
diff -u /dev/null rtems/cpukit/libmisc/devnull/devzero.h:1.1
--- /dev/null Fri May 13 09:12:08 2011
+++ rtems/cpukit/libmisc/devnull/devzero.h Fri May 13 08:46:43 2011
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 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.
+ *
+ * $Id$
+ */
+
+#ifndef _RTEMS_DEVZERO_H
+#define _RTEMS_DEVZERO_H
+
+#include <rtems/io.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define DEVZERO_DEVICE_NAME "/dev/zero"
+
+#define DEVZERO_DRIVER_TABLE_ENTRY \
+ { \
+ dev_zero_initialize, \
+ dev_zero_open, \
+ dev_zero_close, \
+ dev_zero_read, \
+ dev_zero_write, \
+ dev_zero_control \
+ }
+
+rtems_device_driver dev_zero_initialize(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+);
+
+rtems_device_driver dev_zero_open(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+);
+
+rtems_device_driver dev_zero_close(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+);
+
+rtems_device_driver dev_zero_read(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+);
+
+rtems_device_driver dev_zero_write(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+);
+
+rtems_device_driver dev_zero_control(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
+);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_DEVZERO_H */
diff -u /dev/null rtems/cpukit/libmisc/devnull/devzero.c:1.1
--- /dev/null Fri May 13 09:12:08 2011
+++ rtems/cpukit/libmisc/devnull/devzero.c Fri May 13 08:46:42 2011
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 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.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/devzero.h>
+
+#include <string.h>
+
+#include <rtems/libio.h>
+
+rtems_device_driver dev_zero_initialize(
+ rtems_device_major_number major,
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *arg __attribute__((unused))
+)
+{
+ return rtems_io_register_name(DEVZERO_DEVICE_NAME, major, 0);
+}
+
+rtems_device_driver dev_zero_open(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *arg __attribute__((unused))
+)
+{
+ return RTEMS_SUCCESSFUL;
+}
+
+rtems_device_driver dev_zero_close(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *arg __attribute__((unused))
+)
+{
+ return RTEMS_SUCCESSFUL;
+}
+
+rtems_device_driver dev_zero_read(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *arg __attribute__((unused))
+)
+{
+ rtems_libio_rw_args_t *rw = arg;
+
+ rw->bytes_moved = rw->count;
+ memset(rw->buffer, 0, rw->count);
+
+ return RTEMS_SUCCESSFUL;
+}
+
+rtems_device_driver dev_zero_write(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *arg
+)
+{
+ rtems_libio_rw_args_t *rw = arg;
+
+ rw->bytes_moved = rw->count;
+
+ return RTEMS_SUCCESSFUL;
+}
+
+rtems_device_driver dev_zero_control(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *arg __attribute__((unused))
+)
+{
+ return RTEMS_IO_ERROR;
+}
diff -u rtems/cpukit/preinstall.am:1.50 rtems/cpukit/preinstall.am:1.51
--- rtems/cpukit/preinstall.am:1.50 Thu Mar 24 06:22:08 2011
+++ rtems/cpukit/preinstall.am Fri May 13 08:46:43 2011
@@ -309,6 +309,10 @@
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/devnull.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/devnull.h
+$(PROJECT_INCLUDE)/rtems/devzero.h: libmisc/devnull/devzero.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/devzero.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/devzero.h
+
$(PROJECT_INCLUDE)/rtems/dumpbuf.h: libmisc/dumpbuf/dumpbuf.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/dumpbuf.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/dumpbuf.h
*sh*:
2011-05-13 Sebastian Huber <sebastian.huber at embedded-brains.de>
* sapi/include/confdefs.h: Added "/dev/zero" driver.
M 1.2821 cpukit/ChangeLog
M 1.164 cpukit/sapi/include/confdefs.h
diff -u rtems/cpukit/ChangeLog:1.2820 rtems/cpukit/ChangeLog:1.2821
--- rtems/cpukit/ChangeLog:1.2820 Thu May 12 08:54:29 2011
+++ rtems/cpukit/ChangeLog Fri May 13 08:49:15 2011
@@ -1,3 +1,10 @@
+2011-05-13 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * libmisc/devnull/devzero.c, libmisc/devnull/devzero.h: New files.
+ * libmisc/Makefile.am, Makefile.am, preinstall.am: Reflect changes
+ above.
+ * sapi/include/confdefs.h: Added "/dev/zero" driver.
+
2011-05-12 Joel Sherrill <joel.sherrilL at OARcorp.com>
* score/include/rtems/score/schedulersimple.h,
diff -u rtems/cpukit/sapi/include/confdefs.h:1.163 rtems/cpukit/sapi/include/confdefs.h:1.164
--- rtems/cpukit/sapi/include/confdefs.h:1.163 Mon Apr 11 12:23:05 2011
+++ rtems/cpukit/sapi/include/confdefs.h Fri May 13 08:49:16 2011
@@ -971,6 +971,10 @@
#include <rtems/devnull.h>
#endif
+#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
+ #include <rtems/devzero.h>
+#endif
+
#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
/* the ide driver needs the ATA driver */
#ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
@@ -1008,6 +1012,9 @@
#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
DEVNULL_DRIVER_TABLE_ENTRY,
#endif
+ #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
+ DEVZERO_DRIVER_TABLE_ENTRY,
+ #endif
#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
#endif
@@ -1026,6 +1033,7 @@
!defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
+ !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \
*sh*:
2011-05-13 Sebastian Huber <sebastian.huber at embedded-brains.de>
* sp21/init.c, sp21/sp21.doc sp21/sp21.scn: New test cases.
M 1.451 testsuites/sptests/ChangeLog
M 1.14 testsuites/sptests/sp21/init.c
M 1.8 testsuites/sptests/sp21/sp21.doc
M 1.5 testsuites/sptests/sp21/sp21.scn
diff -u rtems/testsuites/sptests/ChangeLog:1.450 rtems/testsuites/sptests/ChangeLog:1.451
--- rtems/testsuites/sptests/ChangeLog:1.450 Fri May 6 12:29:35 2011
+++ rtems/testsuites/sptests/ChangeLog Fri May 13 08:50:51 2011
@@ -1,3 +1,7 @@
+2011-05-13 Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+ * sp21/init.c, sp21/sp21.doc sp21/sp21.scn: New test cases.
+
2011-05-06 Joel Sherrill <joel.sherrill at oarcorp.com>
* sp39/init.c: Fix tests broken in warning pass.
diff -u rtems/testsuites/sptests/sp21/init.c:1.13 rtems/testsuites/sptests/sp21/init.c:1.14
--- rtems/testsuites/sptests/sp21/init.c:1.13 Tue Feb 22 01:36:59 2011
+++ rtems/testsuites/sptests/sp21/init.c Fri May 13 08:50:51 2011
@@ -15,12 +15,14 @@
#include <tmacros.h>
#include <rtems/devnull.h>
-
+#include <rtems/devzero.h>
+#include <rtems/libio.h>
#define PRIurtems_device_major_number PRIu32
#define STUB_DRIVER_MAJOR 0x2
-#define NO_DRIVER_MAJOR 0x3
+#define ZERO_DRIVER_MAJOR 0x3
+#define NO_DRIVER_MAJOR 0x4
#define INVALID_DRIVER_MAJOR \
(rtems_configuration_get_number_of_device_drivers() + 1)
@@ -204,6 +206,45 @@
directive_failed( sc, "lookup /dev/null" );
}
+void do_test_zero_driver(void)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ char in = 'I';
+ rtems_libio_rw_args_t rw_in = {
+ .buffer = &in,
+ .count = sizeof(in)
+ };
+ char out = 'O';
+ rtems_libio_rw_args_t rw_out = {
+ .buffer = &out,
+ .count = sizeof(out)
+ };
+
+ puts( "----- TESTING THE ZERO DRIVER CHECKS -----" );
+
+ sc = rtems_io_initialize( ZERO_DRIVER_MAJOR, 0, NULL );
+ rtems_test_assert( sc == RTEMS_TOO_MANY );
+
+ sc = rtems_io_open( ZERO_DRIVER_MAJOR, 0, NULL );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+ sc = rtems_io_close( ZERO_DRIVER_MAJOR, 0, NULL );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+ sc = rtems_io_read( ZERO_DRIVER_MAJOR, 0, &rw_in );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( in == 0 );
+ rtems_test_assert( rw_in.bytes_moved == sizeof(in) );
+
+ sc = rtems_io_write( ZERO_DRIVER_MAJOR, 0, &rw_out );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( out == 'O' );
+ rtems_test_assert( rw_out.bytes_moved == sizeof(out) );
+
+ sc = rtems_io_control( ZERO_DRIVER_MAJOR, 0, NULL );
+ rtems_test_assert( sc == RTEMS_IO_ERROR );
+}
+
rtems_task Init(
rtems_task_argument argument
)
@@ -214,6 +255,8 @@
do_test_io_lookup_name();
+ do_test_zero_driver();
+
puts( "*** END OF TEST 21 ***" );
rtems_test_exit( 0 );
}
@@ -223,6 +266,7 @@
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
diff -u rtems/testsuites/sptests/sp21/sp21.doc:1.7 rtems/testsuites/sptests/sp21/sp21.doc:1.8
--- rtems/testsuites/sptests/sp21/sp21.doc:1.7 Thu Sep 4 13:53:48 2003
+++ rtems/testsuites/sptests/sp21/sp21.doc Fri May 13 08:50:51 2011
@@ -25,3 +25,5 @@
b. Verifies all I/O manager directives call and return from the driver
entry points in the driver address table.
+
+ c. Check that zero driver works.
diff -u rtems/testsuites/sptests/sp21/sp21.scn:1.4 rtems/testsuites/sptests/sp21/sp21.scn:1.5
--- rtems/testsuites/sptests/sp21/sp21.scn:1.4 Tue Jul 6 17:56:48 2010
+++ rtems/testsuites/sptests/sp21/sp21.scn Fri May 13 08:50:51 2011
@@ -28,4 +28,5 @@
rtems_io_lookup_name( "", &info ) - RTEMS_UNSATISFIED
rtems_io_lookup_name( "/dev", &info ) - RTEMS_UNSATISFIED
rtems_io_lookup_name( "/dev/null", &info ) - RTEMS_SUCCESSFUL
+----- TESTING THE ZERO DRIVER CHECKS -----
*** END OF TEST 21 ***
--
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/20110513/2be250ba/attachment.html>
More information about the vc
mailing list