summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2006-07-09 10:05:27 +0000
committerThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2006-07-09 10:05:27 +0000
commitc9b005a9d2ed95bb1ab16fbc0c823c12a5c58b26 (patch)
tree38738aceaf0b1d08e1e41cd0059a1b8ddac79409 /cpukit
parentSync from freebsd6.1 (diff)
downloadrtems-c9b005a9d2ed95bb1ab16fbc0c823c12a5c58b26.tar.bz2
applied patches for PR1117/1118/1119/1120
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libblock/include/rtems/bdbuf.h3
-rw-r--r--cpukit/libblock/src/bdbuf.c11
-rw-r--r--cpukit/libcsupport/include/sys/cdefs.h4
-rw-r--r--cpukit/libfs/src/imfs/imfs.h10
-rw-r--r--cpukit/libfs/src/imfs/imfs_initsupp.c38
-rw-r--r--cpukit/libmisc/shell/shell.c9
-rw-r--r--cpukit/libnetworking/netinet/tcp_var.h2
-rw-r--r--cpukit/libnetworking/sys/linker_set.h2
-rw-r--r--cpukit/sapi/include/confdefs.h75
9 files changed, 146 insertions, 8 deletions
diff --git a/cpukit/libblock/include/rtems/bdbuf.h b/cpukit/libblock/include/rtems/bdbuf.h
index 0a10636966..c966b2836e 100644
--- a/cpukit/libblock/include/rtems/bdbuf.h
+++ b/cpukit/libblock/include/rtems/bdbuf.h
@@ -91,6 +91,9 @@ typedef struct rtems_bdbuf_config {
extern rtems_bdbuf_config rtems_bdbuf_configuration[];
extern int rtems_bdbuf_configuration_size;
+#define SWAPOUT_TASK_DEFAULT_PRIORITY 15
+extern rtems_task_priority swapout_task_priority;
+
/* rtems_bdbuf_init --
* Prepare buffering layer to work - initialize buffer descritors
* and (if it is neccessary) buffers. Buffers will be allocated accoriding
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index e388e5cea0..8fb7d515be 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -28,8 +28,7 @@
#define BLKDEV_FATAL_BDBUF_SWAPOUT BLKDEV_FATAL_ERROR(2)
-#define SWAPOUT_PRIORITY 15
-#define SWAPOUT_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
+#define SWAPOUT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
#define READ_MULTIPLE
@@ -863,9 +862,11 @@ rtems_bdbuf_init(rtems_bdbuf_config *conf_table, int size)
/* Create and start swapout task */
rc = rtems_task_create(
- rtems_build_name('B', 'S', 'W', 'P'),
- SWAPOUT_PRIORITY,
- SWAPOUT_STACK_SIZE,
+ rtems_build_name('B', 'S', 'W', 'P'),
+ ((swapout_task_priority > 0)
+ ? swapout_task_priority
+ : SWAPOUT_TASK_DEFAULT_PRIORITY),
+ SWAPOUT_TASK_STACK_SIZE,
RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
RTEMS_DEFAULT_ATTRIBUTES,
&bd_ctx.swapout_task);
diff --git a/cpukit/libcsupport/include/sys/cdefs.h b/cpukit/libcsupport/include/sys/cdefs.h
index 26fb69ad3f..0cbc601929 100644
--- a/cpukit/libcsupport/include/sys/cdefs.h
+++ b/cpukit/libcsupport/include/sys/cdefs.h
@@ -116,6 +116,7 @@
#define __pure
#define __pure2
#define __unused
+#define __used
#define __attribute__(x)
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ < 5
@@ -124,6 +125,7 @@
#define __pure __const
#define __pure2
#define __unused
+#define __used
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
#define __dead
@@ -131,6 +133,7 @@
#define __pure
#define __pure2 __attribute__((__const__))
#define __unused
+#define __used
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3
#define __dead
@@ -138,6 +141,7 @@
#define __pure
#define __pure2 __attribute__((__const__))
#define __unused __attribute__((__unused__))
+#define __used __attribute__((__used__))
#endif
#ifdef __GNUC__
diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
index 67a154c0a2..a5e82a1579 100644
--- a/cpukit/libfs/src/imfs/imfs.h
+++ b/cpukit/libfs/src/imfs/imfs.h
@@ -80,7 +80,15 @@ typedef struct {
* max_filesize with blocks of 512 is 1,082,195,456
*/
-#define IMFS_MEMFILE_BYTES_PER_BLOCK 128
+#define IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK 128
+ extern int imfs_rq_memfile_bytes_per_block;
+ /*
+ * FIXME: make and use derivates from this,
+ * a shift count and a mask
+ */
+ extern int imfs_memfile_bytes_per_block;
+
+#define IMFS_MEMFILE_BYTES_PER_BLOCK imfs_memfile_bytes_per_block
#define IMFS_MEMFILE_BLOCK_SLOTS \
(IMFS_MEMFILE_BYTES_PER_BLOCK / sizeof(void *))
diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c
index 6cfae62438..29b014d374 100644
--- a/cpukit/libfs/src/imfs/imfs_initsupp.c
+++ b/cpukit/libfs/src/imfs/imfs_initsupp.c
@@ -31,6 +31,37 @@
#endif
/*
+ * IMFS_determine_bytes_per_block
+ */
+int imfs_memfile_bytes_per_block = 0;
+
+static int IMFS_determine_bytes_per_block(
+ int *dest_bytes_per_block,
+ int requested_bytes_per_block,
+ int default_bytes_per_block
+)
+{
+ rtems_boolean is_valid = FALSE;
+ int bit_mask;
+ /*
+ * check, whether requested bytes per block is valid
+ */
+ for (bit_mask = 16;
+ !is_valid && (bit_mask <= 512);
+ bit_mask <<= 1) {
+ if (bit_mask == requested_bytes_per_block) {
+ is_valid = TRUE;
+ }
+ }
+ *dest_bytes_per_block = ((is_valid)
+ ? requested_bytes_per_block
+ : default_bytes_per_block);
+ return 0;
+
+}
+
+
+/*
* IMFS_initialize
*/
@@ -45,6 +76,13 @@ int IMFS_initialize_support(
IMFS_jnode_t *jnode;
/*
+ * determine/check value for imfs_memfile_bytes_per_block
+ */
+ IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block,
+ imfs_rq_memfile_bytes_per_block,
+ IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK);
+
+ /*
* Create the root node
*
* NOTE: UNIX root is 755 and owned by root/root (0/0).
diff --git a/cpukit/libmisc/shell/shell.c b/cpukit/libmisc/shell/shell.c
index 01a9c36ec8..5a67d5dd24 100644
--- a/cpukit/libmisc/shell/shell.c
+++ b/cpukit/libmisc/shell/shell.c
@@ -543,6 +543,15 @@ rtems_task shell_shell(rtems_task_argument task_argument) {
rtems_current_user_env->euid=
rtems_current_user_env->egid=0;
+ /*
+ * newlib delays the creation of default stdio 'til the
+ * first I/O operation, therefore we must perform dummy
+ * operations before we redirect stdio
+ */
+ ftell(stdin);
+ ftell(stdout);
+ ftell(stderr);
+
stdin =fopen(devname,"r+");
if (!stdin) {
diff --git a/cpukit/libnetworking/netinet/tcp_var.h b/cpukit/libnetworking/netinet/tcp_var.h
index b7cd4ab655..4d5d9e6eaf 100644
--- a/cpukit/libnetworking/netinet/tcp_var.h
+++ b/cpukit/libnetworking/netinet/tcp_var.h
@@ -43,6 +43,7 @@
* Kernel variables for tcp.
*/
+#ifdef __BSD_VISIBLE
/*
* Tcp control block, one per tcp; fields:
*/
@@ -196,6 +197,7 @@ struct rmxp_tao {
#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
#define intotw(ip) ((struct tcptw *)(ip)->inp_ppcb)
#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
+#endif /* __BSD_VISIBLE */
/*
* The smoothed round-trip time and estimated variance
diff --git a/cpukit/libnetworking/sys/linker_set.h b/cpukit/libnetworking/sys/linker_set.h
index c79fe87f0b..a2354ed397 100644
--- a/cpukit/libnetworking/sys/linker_set.h
+++ b/cpukit/libnetworking/sys/linker_set.h
@@ -42,7 +42,7 @@
#ifdef __GNUC__
#define __MAKE_SET(set, sym) \
static void const * const __set_##set##_sym_##sym \
- __attribute((section("set_" #set))) __unused = &sym
+ __attribute((section("set_" #set))) __used = &sym
#else /* !__GNUC__ */
#ifndef lint
#error "This file needs to be compiled by GCC or lint"
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index d7dbc2ba1d..ae6ba1ada9 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -123,8 +123,15 @@ extern int rtems_telnetd_maximum_ptys;
#include <rtems/imfs.h>
+#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
+#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
+ IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
+#endif
#ifdef CONFIGURE_INIT
+ int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
+#endif /* CONFIGURE_INIT */
+#ifdef CONFIGURE_INIT
#ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
rtems_filesystem_mount_table_t configuration_mount_table = {
#ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
@@ -296,6 +303,18 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#include <rtems/devnull.h>
#endif
+#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
+ /* the ide driver needs the ATA driver */
+# ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
+# define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
+# endif
+#include <libchip/ide_ctrl.h>
+#endif
+
+#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
+#include <libchip/ata.h>
+#endif
+
#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
#ifdef CONFIGURE_INIT
@@ -312,12 +331,20 @@ rtems_driver_address_table Device_drivers[] = {
#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
DEVNULL_DRIVER_TABLE_ENTRY,
#endif
+#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
+ IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
+#endif
+#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
+ ATA_DRIVER_TABLE_ENTRY,
+#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
NULL_DRIVER_TABLE_ENTRY
#elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
!defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
- !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER)
+ !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
+ !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \
+ !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER)
NULL_DRIVER_TABLE_ENTRY
#endif
};
@@ -346,6 +373,52 @@ rtems_driver_address_table Device_drivers[] = {
#define CONFIGURE_MAXIMUM_DEVICES 20
#endif
+#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
+ /*
+ * configure the priority of the ATA driver task
+ */
+# ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
+# define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
+# endif
+# ifdef CONFIGURE_INIT
+ rtems_task_priority ata_driver_task_priority
+ = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
+# endif /* CONFIGURE_INIT */
+#endif
+
+/*
+ * add bdbuf configuration and values for swapout task priority
+ */
+#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
+#include <rtems/bdbuf.h>
+/*
+ * configure the priority of the bdbuf swapout task
+ */
+#ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
+#define CONFIGURE_SWAPOUT_TASK_PRIORITY SWAPOUT_TASK_DEFAULT_PRIORITY
+#endif
+#ifdef CONFIGURE_INIT
+ rtems_task_priority swapout_task_priority
+ = CONFIGURE_SWAPOUT_TASK_PRIORITY;
+#endif /* CONFIGURE_INIT */
+#ifndef CONFIGURE_HAS_OWN_BDBUF_TABLE
+
+#ifndef CONFIGURE_BDBUF_BUFFER_COUNT
+#define CONFIGURE_BDBUF_BUFFER_COUNT 64
+#endif /* CONFIGURE_BDBUF_BUFFER_COUNT */
+
+#ifndef CONFIGURE_BDBUF_BUFFER_SIZE
+#define CONFIGURE_BDBUF_BUFFER_SIZE 512
+#endif /* CONFIGURE_BDBUF_BUFFER_SIZE */
+#ifdef CONFIGURE_INIT
+rtems_bdbuf_config rtems_bdbuf_configuration[] = {
+ {CONFIGURE_BDBUF_BUFFER_SIZE,CONFIGURE_BDBUF_BUFFER_COUNT,NULL}
+};
+int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration)
+ /sizeof(rtems_bdbuf_configuration[0]));
+#endif /* CONFIGURE_INIT */
+#endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE */
+#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
/*
* Default Multiprocessing Configuration Table. The defaults are
* appropriate for most of the RTEMS Multiprocessor Test Suite. Each