summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libc')
-rw-r--r--c/src/lib/libc/malloc.c22
-rw-r--r--c/src/lib/libc/termios.c8
2 files changed, 29 insertions, 1 deletions
diff --git a/c/src/lib/libc/malloc.c b/c/src/lib/libc/malloc.c
index 08660d75cc..dc6824891a 100644
--- a/c/src/lib/libc/malloc.c
+++ b/c/src/lib/libc/malloc.c
@@ -418,5 +418,27 @@ void _free_r(
{
free( ptr );
}
+
+
+/*
+ * rtems_cache_aligned_malloc
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to allocate storage that spans an
+ * integral number of cache blocks.
+ */
+RTEMS_INLINE_ROUTINE void * rtems_cache_aligned_malloc (
+ size_t nbytes
+)
+{
+ /*
+ * Arrange to have the user storage start on the first cache
+ * block beyond the header.
+ */
+ return (void *) ((((unsigned long) malloc( nbytes + _CPU_DATA_CACHE_ALIGNMENT - 1 ))
+ + _CPU_DATA_CACHE_ALIGNMENT - 1 ) &(~(_CPU_DATA_CACHE_ALIGNMENT - 1)) );
+}
+
#endif
diff --git a/c/src/lib/libc/termios.c b/c/src/lib/libc/termios.c
index 7883e94b63..5052502e76 100644
--- a/c/src/lib/libc/termios.c
+++ b/c/src/lib/libc/termios.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
+#include <sys/filio.h>
/*
* FreeBSD does not support a full POSIX termios so we have to help it out
@@ -243,7 +244,7 @@ rtems_termios_open (
/*
* Set default parameters
*/
- tty->termios.c_iflag = BRKINT | ICRNL | IMAXBEL;
+ tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
@@ -474,6 +475,11 @@ rtems_termios_ioctl (void *arg)
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
break;
+
+ case FIONREAD:
+ /* Half guess that this is the right operation */
+ *(int *)args->buffer = tty->ccount - tty->cindex;
+ break;
}
rtems_semaphore_release (tty->osem);
args->ioctl_return = sc;