Commit Graph

1212 Commits

Author SHA1 Message Date
Sebastian Huber
66fac03fae libio: Fix deadlock in location management
Perform a context-dependent deferred location release to avoid a
deadlock on the file system instance locks, for example during a
chdir().

Update #2936.
2017-03-16 15:33:56 +01:00
Sebastian Huber
1f618ab00f posix_devctl: Fix for pre C99
Use __restrict just like in <devctl.h> to avoid compiler errors with
older GCC, e.g. 4.8 or 4.9.
2017-03-02 07:54:52 +01:00
Sebastian Huber
f71ccc345e termios: Simplify some calculations
Use the modular arithmetic addition rule.
2017-02-28 09:31:04 +01:00
Sebastian Huber
3663543392 termios: Implement non-blocking write 2017-02-28 09:09:23 +01:00
Sebastian Huber
a165a9607a termios: Make write POSIX compatible
Currently only blocking read/write operations are implemented.  A
blocking write must transfer at least one character.  It should not wait
for the device for the second character and so on.

Close #2917.
2017-02-28 09:09:19 +01:00
Sebastian Huber
c41b47e3e4 termios: Introduce doTransmit() 2017-02-28 09:05:47 +01:00
Sebastian Huber
5244d31ef7 termios: Simplify oproc()
Call rtems_termios_puts() only once.  Adjust column in one place.
2017-02-28 09:05:47 +01:00
Sebastian Huber
c80f6aa916 termios: Fix infinite loop in receive path
In canonical mode, the raw input buffer or the canonical buffer may
overflow without an end of line.  Avoid an infinite loop in this case.

Close #2915.
2017-02-28 09:05:47 +01:00
Sebastian Huber
9fa0f543ec termios: Change receive callback invocation
Call the receive callback in case a read will succeed without to block.
This enables the use of the receive callback for a poll() and select()
support.  Increase raw input buffer size to allow buffering of one line.

Close #2916.
2017-02-28 09:05:42 +01:00
Sebastian Huber
49d8f653fb termios: Change tty_rcvwakeup to bool
Optimize callout invocation check.
2017-02-28 08:51:31 +01:00
Sebastian Huber
9f69ac2a9d termios: Ignore carriage return early if desired
In case carriage return characters should be ignored in the input
(IGNCR), then drop them early before they reach the raw input buffer.
This makes it easier to calculate the content size of the raw input
buffer.
2017-02-28 08:51:31 +01:00
Sebastian Huber
bb087cb0f9 termios: Protect raw input buffer with device lock
Use the device lock to protect the raw input buffer management, e.g.
tail, head and buffer content updates.

Close #2914.
2017-02-28 08:51:27 +01:00
Sebastian Huber
d60c2d7943 termios: Simplify rtems_termios_read_tty()
Remove dead code.

Update #2914.
2017-02-28 08:51:15 +01:00
Sebastian Huber
5bfeddc0c2 termios: Add kqueue() and poll() support
Real implementation is provided by libbsd.
2017-02-23 07:27:43 +01:00
Sebastian Huber
85ed95ec48 termios: Fix static device initalization
This enables early printk() support.

Update #2838.
2017-02-03 10:49:13 +01:00
Sebastian Huber
e366f774a7 score: Add _Thread_queue_Object_name
Add the special thread queue name _Thread_queue_Object_name to mark
thread queues embedded in an object with identifier.  Using the special
thread state STATES_THREAD_QUEUE_WITH_IDENTIFIER is not reliable for
this purpose since the thread wait information and thread state are
protected by different SMP locks in separate critical sections.  Remove
STATES_THREAD_QUEUE_WITH_IDENTIFIER.

Add and use _Thread_queue_Object_initialize().

Update #2858.
2017-01-31 09:38:07 +01:00
Sebastian Huber
6b13287778 configure: Remove envlock support
This is provided by Newlib itself.
2017-01-13 11:28:35 +01:00
Sebastian Huber
3b784ba028 Fix documentation comment 2017-01-12 14:18:58 +01:00
Sebastian Huber
a3730b38cc Add and use rtems_assoc_thread_states_to_string() 2017-01-12 07:44:37 +01:00
Sebastian Huber
0c431303cc Add rtems_assoc_32_to_string() 2017-01-12 07:44:36 +01:00
Joel Sherrill
ef362818df Add support for posix_devctl() 2017-01-11 09:45:32 -06:00
Sebastian Huber
45ae4a89e7 sys/event.h: Update to FreeBSD head 2017-01-02 2017-01-09 14:53:26 +01:00
Sebastian Huber
0374ccd8ab libio: Use CONSOLE_DEVICE_NAME 2016-12-23 13:53:55 +01:00
Alexander Krutwig
e34fe384cb termios: Add TERMIOS_IRQ_SERVER_DRIVEN
Add a new interrupt server driven Termios mode (TERMIOS_IRQ_DRIVEN).
This mode is identical to the interrupt driven mode except that a mutex
is used for device level locking. The intended use case for this mode
are device drivers that use the interrupt server, e.g. SPI or I2C
connected devices.

Update #2839.
2016-12-16 09:04:58 +01:00
Sebastian Huber
c3764ce805 termios: Use mutex for task driven mode
Termios has a task driven mode (TERMIOS_TASK_DRIVEN). This mode aims to
avoid long sections with disabled interrupts. This is only partly
implemented since the device level state is still protected by disabled
interrupts. Use a mutex to protect the device level state in task driven
mode to fix this issue.

Update #2838.
2016-12-16 09:04:58 +01:00
Sebastian Huber
e203b65e51 Add INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED
Update #2825.
2016-12-12 08:03:30 +01:00
Sebastian Huber
a5ba08eb4f Add INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED
Update #2825.
2016-12-12 08:03:30 +01:00
Sebastian Huber
af8ced5e2d libio: Ensure proper std file descriptors 2016-12-12 08:03:30 +01:00
Sebastian Huber
9622f7796f Add INTERNAL_ERROR_LIBIO_SEM_CREATE_FAILED
Update #2825.
2016-12-12 08:03:30 +01:00
Sebastian Huber
8252968812 INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED
Update #2825.
2016-12-12 08:03:29 +01:00
Sebastian Huber
3a659b0481 score: Introduce _Internal_error() 2016-12-12 08:03:29 +01:00
Sebastian Huber
b6606e8d99 score: Remove fatal is internal indicator
The fatal is internal indicator is redundant since the fatal source and
error code uniquely identify a fatal error.  Keep the fatal user
extension is internal parameter for backward compatibility and set it to
false always.

Update #2825.
2016-12-09 08:47:51 +01:00
Sebastian Huber
c42be504c9 posix: Add self-contained pthread spinlock
Turn pthread_spinlock_t into a self-contained object.  On uni-processor
configurations, interrupts are disabled in the lock/trylock operations
and the previous interrupt status is restored in the corresponding
unlock operations.  On SMP configurations, a ticket lock is a acquired
and released in addition.

The self-contained pthread_spinlock_t object is defined by Newlib in
<sys/_pthreadtypes.h>.

typedef struct {
  struct _Ticket_lock_Control _lock;
  __uint32_t                  _interrupt_state;
} pthread_spinlock_t;

This implementation is simple and efficient.  However, this test case of
the Linux Test Project would fail due to call of printf() and sleep()
during spin lock ownership:

https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c

There is only limited support for profiling on SMP configurations.

Delete CORE spinlock implementation.

Update #2674.
2016-11-23 12:52:06 +01:00
Sebastian Huber
6de41c5fe9 Provide kernel space header files
These kernel space header files must be provided for Newlib
172e2050d95b41861db858dd9bc43a3fb4a28987.
2016-11-08 10:15:28 +01:00
Sebastian Huber
9597c4ed56 Size optimization for resource snapshots
Do not reference the objects information directly.
2016-11-04 10:54:52 +01:00
Sebastian Huber
d271c3bb78 rtems: Add rtems_task_iterate()
Update #2423.
2016-11-02 08:46:47 +01:00
Sebastian Huber
1aae680bec sys/sockio.h: Update to FreeBSD head 2016-05-03 2016-10-26 14:05:53 +02:00
Sebastian Huber
8b8d05f4ca sys/event.h: Update to FreeBSD head 2016-06-27 2016-10-26 14:05:44 +02:00
Sebastian Huber
e814a233ed termios: Add IO control handler
Update #2785.
2016-09-19 07:52:34 +02:00
Sebastian Huber
55e0be3606 termios: Use IMFS nodes for new Termios devices
This makes the new Termios devices independent of device major/minor
numbers.  It enables BSP independent Termios device drivers which may
reside in the cpukit domain.  These drivers require an IMFS and do not
work with the device file system.  However, the device file system
should go away in the future.
2016-09-19 07:52:33 +02:00
Sebastian Huber
059529e685 score: Add debug support to chains
This helps to detect

 * double insert, append, prepend errors, and
 * get from empty chain errors.
2016-07-22 09:13:07 +02:00
Pavel Pisa
0e507d5510 rtems+bsps/cache: Define cache manager operations for code synchronization and maximal alignment.
There is need for unambiguous named and defined cache function
which should be called when code is updated, loaded
or is self-modifying.

There should be function to obtain maximal cache line length
as well. This function can and should be used for allocations
which can be used for data and or code and ensures that
there are no partial cache lines overlaps on start and
end of allocated region.
2016-07-04 15:55:57 +02:00
Christian Mauderer
187a074404 libcsupport: Add dummy for setgroups().
The dummy for setgroups() allows applications using it to build (for example
civetweb webserver).
2016-06-28 13:01:37 +02:00
Sebastian Huber
22c3a54b8b Add printer task 2016-06-22 07:45:49 +02:00
Sebastian Huber
506bfc8580 Move printer initialization to separate header
The RTEMS print user need to know nothing about a particular printer
implementation.  In particular get rid of the <stdio.h> include which
would be visible via <rtems.h>.
2016-06-22 07:29:26 +02:00
Sebastian Huber
ede1a4182d Make rtems/print.h independent of rtems/bspIo.h 2016-06-22 07:29:26 +02:00
Sebastian Huber
5c370a5df4 Make rtems_fprintf_plugin() static 2016-06-22 07:29:26 +02:00
Sebastian Huber
1ce8fc32c3 Make rtems_printf_plugin() static 2016-06-22 07:29:26 +02:00
Sebastian Huber
97fd93c23e Make printk_plugin() static 2016-06-22 07:29:25 +02:00
Sebastian Huber
3242614d92 Fix rtems_print_printer_fprintf()
We must use vfprintf().
2016-05-31 10:10:36 +02:00