Commit Graph

1267 Commits

Author SHA1 Message Date
Sebastian Huber
3f575da2f2 Remove obsolete network header files
Update #3254.
2017-12-07 07:23:59 +01:00
Sebastian Huber
bc5b56ad41 libio: Use API mutex 2017-12-06 07:13:04 +01:00
Sebastian Huber
15e19273b2 sapi: New implementation of rtems_panic()
The previous rtems_panic() implementation was quite heavy weight.  It
depended on _exit() which calls the global destructors.  It used
fprintf(stderr, ...) for output which depends on an initialized console
device and the complex fprintf().

Introduce a new fatal source RTEMS_FATAL_SOURCE_PANIC for rtems_panic()
and output via vprintk().

Update #3244.
2017-11-22 09:40:23 +01:00
Christian Mauderer
ddc339c51f cpukit: Add _arc4random_getentropy_fail.
Add a default implementation of _arc4random_getentropy_fail with an
internal error.

Update #3239.
2017-11-17 07:26:41 +01:00
Sebastian Huber
d4b99ae3f8 libio: Add assert to rtems_libio_iop_drop()
This assert helps to detect an invalid reference counting in RTEMS_DEBUG
configurations.

Update #3132.
2017-11-15 13:22:40 +01:00
Sebastian Huber
5f02a57478 score: Change _Timecounter_Time_uptime to int32_t
Move basic timecounter API shared with BSD network stack to
<machine/_timecounter.h>.

Update #3185.
2017-11-09 08:12:12 +01:00
Sebastian Huber
791469bd4f termios: Fix canonical mode
In canonical mode, input is made available line by line.  We must stop
the canonical buffer filling upon reception of an end-of-line character.

Close #3218.
2017-11-07 08:31:40 +01:00
Sebastian Huber
ac28f1588d Add simple console driver
Update #3170.
Update #3199.
2017-11-06 07:25:51 +01:00
Sebastian Huber
10827984c2 score: Add _IO_Printf() and _IO_Vprintf()
The previous vprintk() implementation had a questionable licence header,
lacks support for the 'z' and 'j' format specifiers, is not robust
against invalid format specifiers, uses a global variable for output.
Replace it with a stripped down version of the FreeBSD kernel kvprintf()
function.

The new implementation allows a low overhead rtems_snprintf() if
necessary.

Update #3199.
Close #3216.
2017-11-06 07:25:51 +01:00
Sebastian Huber
7bec7f2715 rtems: Add rtems_print_printer_fprintf_putc()
Update #3170.
Update #3199.
2017-10-28 13:33:55 +02:00
Sebastian Huber
f703e7f5c7 tests: Move rtems_test_printer definition
Statically initialize it to use printk().

Update #3170.
Update #3199.
2017-10-28 13:33:55 +02:00
Sebastian Huber
16db540a59 Use right time format in _times()
Update #2740.
Close #3179.
2017-10-12 07:24:44 +02:00
Konstantin Belousov
d310aa7c61 timecounter: Merge FreeBSD change r303382
Hide the boottime and bootimebin globals, provide the getboottime(9) and getboottimebin(9) KPI. Change consumers of boottime to use the KPI. The variables were renamed to avoid shadowing issues with local variables of the same name.

Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure.  As a
preparation, this commit only introduces the interface.

Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance.  Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.

Tested by:	pho (as part of the bigger patch)
Reviewed by:	jhb (same)
Discussed with:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
X-Differential revision:	https://reviews.freebsd.org/D7302

Update #3175.
2017-10-12 07:04:11 +02:00
Sebastian Huber
de59c065c5 posix: Implement self-contained POSIX mutex
POSIX mutexes are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3112.
2017-10-05 14:29:02 +02:00
Sebastian Huber
5222488573 posix: Implement self-contained POSIX condvar
POSIX condition variables are now available in all configurations and no
longer depend on --enable-posix.

Update #2514.
Update #3113.
2017-10-05 14:29:02 +02:00
Sebastian Huber
89fc9345de posix: Implement self-contained POSIX rwlocks
POSIX rwlocks are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3115.
2017-10-05 14:29:02 +02:00
Sebastian Huber
e67929c4c0 posix: Implement self-contained POSIX barriers
POSIX barriers are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3114.
2017-10-05 14:29:01 +02:00
Sebastian Huber
47b1e31f11 posix: Optimize pthread_once_t
Reduce size of pthread_once_t and make it zero-initialized.

Update #3142.
2017-10-05 14:29:01 +02:00
Sebastian Huber
a029230aec Add "\n" to "\r\n" translation to rtems_putc()
Update #3122.
2017-09-19 07:21:37 +02:00
Sebastian Huber
8fa75d35cb libio: Remove rtems_libio_t::driver
This member was apparently unused.

Close #3133.
2017-09-15 12:52:08 +02:00
Sebastian Huber
ac741625b0 libio: Use FIFO for iop free list
Update #3136.
2017-09-15 10:55:38 +02:00
Sebastian Huber
baef823cd5 libio: Add hold/drop iop reference
Check iop reference count in close() and return -1 with errno set to
EBUSY in case the file descriptor is still in use.

Update #3132.
2017-09-15 10:29:34 +02:00
Sebastian Huber
98041b685e libio: Unify readv() and writev()
Update #3132.
2017-09-15 10:27:13 +02:00
Sebastian Huber
9012db84f6 libio: LIBIO_GET_IOP() LIBIO_GET_IOP_WITH_ACCESS()
Replace rtems_libio_check_fd(), rtems_libio_iop(),
rtems_libio_check_open() and rtems_libio_check_permissions()
combinations with new LIBIO_GET_IOP() and LIBIO_GET_IOP_WITH_ACCESS()
macros.

Update #3132.
2017-09-15 10:27:13 +02:00
Sebastian Huber
d4c54416b7 libio: Add rtems_libio_iop_is_append()
Update #3132.
2017-09-15 10:27:12 +02:00
Sebastian Huber
3cffd66d76 libio: Add rtems_libio_iop_is_writeable()
Update #3132.
2017-09-15 10:27:12 +02:00
Sebastian Huber
a937a5a534 libio: Add rtems_libio_iop_is_readable()
Update #3132.
2017-09-15 10:27:12 +02:00
Sebastian Huber
bbcdc302cd libio: Add rtems_libio_iop_is_no_delay()
Update #3132.
2017-09-15 10:27:12 +02:00
Sebastian Huber
e2b1db2311 libio: Add rtems_libio_iop_flags()
Update #3132.
2017-09-15 10:27:12 +02:00
Sebastian Huber
ca90c6c1db libio: Add rtems_libio_iop_flags_initialize()
Update #3132.
2017-09-15 10:27:08 +02:00
Sebastian Huber
856ede4f91 libio: Add iop set/clear flags
Update #3132.
2017-09-15 07:48:03 +02:00
Sebastian Huber
ec10d266ba libio: rtems_libio_check_permissions_with_error()
Rename rtems_libio_check_permissions_with_error() in
rtems_libio_check_permissions().

Update #3132.
2017-09-15 07:47:46 +02:00
Sebastian Huber
48dbb6cf16 libio: Remove rtems_libio_check_permissions()
Remove rtems_libio_check_permissions() and convert single user to
rtems_libio_check_permissions_with_error().

Update #3132.
2017-09-15 07:34:03 +02:00
Sebastian Huber
0169e90e84 libio: Do simple parameter checks early
This simplifies error handling later.

Update #3132.
2017-09-15 07:33:43 +02:00
Sebastian Huber
7b4520258d libio: Simplify rtems_libio_iop()
Remove the file descriptor validation.  This is the job of
rtems_libio_check_fd().  Use an inline function instread of a macro.

Update #3132.
2017-09-14 07:02:29 +02:00
Sebastian Huber
5eb67f3ad0 libio: Remove LIBIO_FLAGS_CREATE
Close #3134.
2017-09-14 07:02:29 +02:00
Sebastian Huber
694e946dbd libio: Remove special-case reference count
The top-level IO library structures should contain no special-case data.

Update #2859.
2017-09-14 07:02:28 +02:00
Sebastian Huber
1bc0ad2e12 Simplify and unify BSP_output_char
The BSP_output_char should output a char and not mingle with high level
processing, e.g. '\n' to '\r\n' translation.  Move this translation to
rtems_putc().  Remove it from all the BSP_output_char implementations.

Close #3122.
2017-09-12 09:57:53 +02:00
Sebastian Huber
bdbf1ffa6e Implement clock()
Newlib uses _times_r() in clock().  The problem is that the _times_r()
clock frequency is defined by sysconf(_SC_CLK_TCK).  The clock frequency
of clock() is the constant CLOCKS_PER_SEC.

FreeBSD uses getrusage() for clock().  Since RTEMS has only one process,
the implementation can be simplified.

Update #3121.
2017-09-07 07:40:19 +02:00
Sebastian Huber
731e68a39a Fix integer overflow problems in times()
An integer overflow may still happen, however, only after 68 years of
system uptime.

Close #2135.
2017-09-06 07:42:25 +02:00
Sebastian Huber
b2ed712d26 Include missing <string.h>
Update #2133.
2017-08-25 10:58:58 +02:00
Sebastian Huber
9d1522ed32 Fix IO control request type 2017-07-28 13:28:11 +02:00
Kevin Kirspel
c6bb1c33bc posix/mmap: Add support for file handler and MAP_ANON
Added a mmap file handler to struct _rtems_filesystem_file_handlers_r.
Updated each file handler object to support the default mmap handler.
Updated mmap() to call the mmap handler for MAP_SHARED.
Added a mmap file handler for shm

Added support for MAP_ANON in mmap().

Updates #2859
2017-07-14 16:04:05 -04:00
Joel Sherrill
d8b548160f sys/utsname.h: Increase buffer to avoid overflow 2017-06-21 12:50:31 -05:00
Sebastian Huber
d4ab0aef96 network: Move RTEMS specifics
Move RTEMS specifics to <rtems/rtems_bsdnet.h>.

Introduce rtems_tap_ifreq.  The interface tap support is RTEMS-specific
and only available in the legacy network stack.

Update #2833.
2017-06-07 13:02:20 +02:00
Sebastian Huber
787f51f5b3 Do not include <sys/ioctl.h> in kernel-space
Update #2833.
2017-06-07 13:02:08 +02:00
Sebastian Huber
93531e9b08 Move RTEMS-specific Termios API content
Remove obsolete support for OFILL, OFDEL, NLDLY, CRDLY, BSDLY, VTDLY,
and FFDLY which is not present on FreeBSD and not implemented in Linux.

Update #2833.
2017-06-07 12:57:39 +02:00
Sebastian Huber
64ecfc17b7 Do not use deprecated <sys/termios.h>
Update #2833.
2017-06-07 12:57:39 +02:00
Sebastian Huber
d60bc7c889 Provide kernel space headers used by Newlib
Update #2833.
2017-06-07 12:57:27 +02:00
Gedare Bloom
87de70a298 posix/mman: add mmap support for shm objects
Update #2859.
2017-05-05 10:34:08 -04:00