Commit Graph

179 Commits

Author SHA1 Message Date
Sebastian Huber
6b13287778 configure: Remove envlock support
This is provided by Newlib itself.
2017-01-13 11:28:35 +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
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
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
Chris Johns
24d0ee57a4 cpukit, testsuite: Add rtems_printf and rtems_printer support.
This change adds rtems_printf and related functions and wraps the
RTEMS print plugin support into a user API. All references to the
plugin are removed and replaced with the rtems_printer interface.

Printk and related functions are made to return a valid number of
characters formatted and output.

The function attribute to check printf functions has been added
to rtems_printf and printk. No changes to remove warrnings are part
of this patch set.

The testsuite has been moved over to the rtems_printer. The testsuite
has a mix of rtems_printer access and direct print control via the
tmacros.h header file. The support for begink/endk has been removed
as it served no purpose and only confused the code base. The testsuite
has not been refactored to use rtems_printf. This is future work.
2016-05-25 15:47:34 +10:00
Joel Sherrill
92b6f6e9c9 Move various driver interface definition headers file libcsupport/ to include/
These were in libcsupport for historical reasons and the placement
no longer made sense.

As part of this move, some of the files were placed under subdirectories
which reflect their installed location.

Thank you git for allowing us to move files. Years of CVS resulted
in files being somewhere they no longer belonged.
2016-03-30 09:32:33 -05:00
Sebastian Huber
9d1f394345 malloc: Add _Malloc_System_state()
Replace malloc_is_system_state_OK() with _Malloc_System_state() to allow
early allocations, e.g. in bsp_start().  Here the _Thread_Executing is
NULL, thus an _API_Mutex_Lock() would lead to a NULL pointer access.

Move malloc() support code to general case
rtems_heap_allocate_aligned_with_boundary().  Use
rtems_heap_allocate_aligned_with_boundary() to avoid duplicated code.
2016-02-25 11:35:54 +01:00
Sebastian Huber
ca4602e914 Use linker set for libio initialization
Update #2408.
2016-02-03 10:00:57 +01:00
Sebastian Huber
443c61ec94 Delete empty libc_init() 2015-11-27 07:24:51 +01:00
Sebastian Huber
c5d0ca91cf libcsupport: Workaround for GCC 5.1 and later
Disable an optimization which would lead to a recursive calloc() call in
calloc().
2015-07-15 08:46:36 +02:00
Joel Sherrill
1aa7b8beb1 Move contents of libcsupport/include/zilog into libbsp/shared
Only a few BSPs use this and it should not have been in libcsupport.
2015-03-09 16:15:14 -05:00
Joel Sherrill
6796d9cd69 Remove unused cpukit/libcsupport/include/zilog/z8536.h 2015-03-09 16:15:14 -05:00
Sebastian Huber
c625a64121 Filesystem: Delete node type operation
Use the fstat handler instead.
2015-01-22 07:52:40 +01:00
Sebastian Huber
01557b0c6e libcsupport: Delete malloc statistics
Use the heap handler statistics instead.  Add heap walk option to MALLOC
shell command.

close #1367
2014-11-28 11:23:53 +01:00
Sebastian Huber
038faca160 rtems: Add rtems_cache_coherent_allocate()
Add rtems_cache_coherent_free() and rtems_cache_coherent_add_area().
2014-11-27 10:33:30 +01:00
Sebastian Huber
7e5c9b895e rtems: Move rtems_cache_aligned_malloc()
Make sure also the size is cache aligned since otherwise we may have
some overlap with the next allocation block.  A cache invalidate on this
area would be fatal.
2014-11-25 16:08:16 +01:00
Sebastian Huber
b8bd90f68f Add supplementary groups to user environment 2014-11-20 10:30:23 +01:00
Sebastian Huber
395e5d4d7a libcsupport: Use POSIX key for getgrent() 2014-11-20 10:30:22 +01:00
Sebastian Huber
b471854bc2 libcsupport: Split passwd/group support 2014-11-20 10:30:21 +01:00
Chris Johns
ea9232d016 ilibcsupport: Add realpath call. 2014-10-24 16:05:59 -07:00
Joel Sherrill
f535fe5311 tod.h -> libcsupport like other driver and helper prototype files
This rippled into the handful of files that should have been using
<rtems/tod.h>.
2014-09-16 16:09:13 -05:00
Joel Sherrill
8fbe2e69b5 Use correct prototype of benchmark_timer_read()
This change starts with removing the effectively empty file
timerdrv.h. The prototypes for benchmark_timer_XXX() were in
btimer.h which was not universally used. Thus every use of
timerdrv.h had to be changed to btimer.h. Then the prototypes
for benchmark_timer_read() had to be adjusted to return
benchmark_timer_t rather than int or uint32_t.

I took this opportunity to also correct the file headers to
separate the copyright from the file description comments which
is needed to ensure the copyright isn't propagated into Doxygen
output.
2014-09-16 16:09:12 -05:00
Sebastian Huber
93726e5205 termios: Add rtems_termios_set_best_baud() 2014-07-09 15:56:43 +02:00
Daniel Ramirez
35b8f48a4b libcsupport: Refactor rtems_deviceio_errno
Renames rtems_deviceio_errno to rtems_status_code_to_errno and
integrates it into the Classic API Status Handler. This function
can now be called by including status.h
2014-01-08 15:24:09 -06:00
Daniel Ramirez
564ce0f42d libcsupport: implemented termios functions cfsetspeed and cfmakeraw 2014-01-07 10:34:31 -06:00
Sebastian Huber
b7cf1ff717 libcsupport: Delete libc_wrapup()
Add and use rtems_libio_exit_helper.  Add rtems_libio_exit().

The fclose(stdin) etc. makes no sense during exit.  This would use the
_REENT structure of the thread calling _exit().
2013-04-26 10:57:08 +02:00
Sebastian Huber
a290fbe946 libcsupport: Make LibIO helper const
Add and use rtems_libio_helper function type.  Add and use
rtems_libio_helper_null() instead of NULL pointer.
2013-04-26 10:57:08 +02:00
Sebastian Huber
c5d27600f9 libcsupport: Add rtems_resource_snapshot_take()
Add rtems_resource_rtems_api, rtems_resource_posix_api,
rtems_resource_snapshot, rtems_resource_snapshot_equal(), and
rtems_resource_snapshot_check().
2012-12-21 15:45:51 +01:00
Sebastian Huber
47a3cd8f73 score: Work area initialization API change
The work areas (RTEMS work space and C program heap) will be initialized
now in a separate step and are no longer part of
rtems_initialize_data_structures().  Initialization is performed with
tables of Heap_Area entries.  This allows usage of scattered memory
areas present on various small scale micro-controllers.

The sbrk() support API changes also.  The bsp_sbrk_init() must now deal
with a minimum size for the first memory chunk to take the configured
work space size into account.
2012-10-25 14:54:06 +02:00
Sebastian Huber
bd5a138629 libcsupport: Add and use rtems_putc()
This reduces code size and provides a function similar to fputc().
2012-08-20 10:10:25 +02:00
Sebastian Huber
b2cb8d6fb4 libcsupport: Add rtems_printf_plugin() 2012-06-04 17:30:21 +02:00
Sebastian Huber
fed66f9910 Filesystem: Add shared device IO support
The device IO file system support in IMFS, devFS, and RFS uses now a
shared implementation.
2012-05-15 10:01:42 +02:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Joel Sherrill
33a105fb69 Revert: Remove CVS Ids
See http://www.rtems.org/pipermail/rtems-devel/2012-May/001006.html
for details.
2012-05-07 11:08:48 -05:00
Ralf Corsépius
ee32f67a6f Remove CVS-Ids. 2012-05-04 09:36:25 +02:00
Sebastian Huber
58f665583e networking: socket to/from file descriptor
o Move rtems_bsdnet_fdToSocket() and rtems_bsdnet_makeFdForSocket() to
   "cpukit/libnetworking/rtems/rtems_syscall.c".
 o The rtems_bsdnet_makeFdForSocket() function is now static.
 o Check in rtems_bsdnet_fdToSocket() function that the file descriptor
   uses the socket handlers, otherwise an error status will be returned
   and errno set to ENOTSOCK.
 o New test libtests/syscall01.
2012-04-03 16:21:23 +02:00
Sebastian Huber
3b7c123c8d Filesystem: Reference counting for locations
o A new data structure rtems_filesystem_global_location_t was
   introduced to be used for
    o the mount point location in the mount table entry,
    o the file system root location in the mount table entry,
    o the root directory location in the user environment, and
    o the current directory location in the user environment.
   During the path evaluation global start locations are obtained to
   ensure that the current file system instance will be not unmounted in
   the meantime.
 o The user environment uses now reference counting and is protected
   from concurrent access.
 o The path evaluation process was completely rewritten and simplified.
   The IMFS, RFS, NFS, and DOSFS use now a generic path evaluation
   method.  Recursive calls in the path evaluation have been replaced
   with iteration to avoid stack overflows.  Only the evaluation of
   symbolic links is recursive.  No dynamic memory allocations and
   intermediate buffers are used in the high level path evaluation.  No
   global locks are held during the file system instance specific path
   evaluation process.
 o Recursive symbolic link evaluation is now limited by
   RTEMS_FILESYSTEM_SYMLOOP_MAX.  Applications can retrieve this value
   via sysconf().
 o The device file system (devFS) uses now no global variables and
   allocation from the workspace.  Node names are allocated from the
   heap.
 o The upper layer lseek() performs now some parameter checks.
 o The upper layer ftruncate() performs now some parameter checks.
 o unmask() is now restricted to the RWX flags and protected from
   concurrent access.
 o The fchmod_h and rmnod_h file system node handlers are now a file
   system operation.
 o The unlink_h operation has been removed.  All nodes are now destroyed
   with the rmnod_h operation.
 o New lock_h, unlock_h, clonenod_h, and are_nodes_equal_h file system
   operations.
 o The path evaluation and file system operations are now protected by
   per file system instance lock and unlock operations.
 o Fix and test file descriptor duplicate in fcntl().
 o New test fstests/fsnofs01.
2012-03-13 12:23:37 +01:00
Sebastian Huber
28a08877ea Added support functions for greedy heap allocation
Various tests must check program paths that result due to failed memory
allocations from the heap.  To avoid tinkering with internal heap
structures throughout the test code these functions should be used.
2012-02-10 10:42:58 +01:00
Sebastian Huber
b9d56ea7cb Fixed typo (setegid.c was missing) 2012-02-08 15:52:38 +01:00
Ralf Corsepius
fc432589d1 2011-05-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/Makefile.am: Reformat.
2011-05-16 14:30:23 +00:00
Ralf Corsepius
f154804273 2011-02-25 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/sleep_noposix.c: Remove.
	* libcsupport/Makefile.am: Reflect changes above.
	* posix/src/sleep.c, posix/src/usleep.c: Remove.
	* posix/Makefile.am: Reflect changes above.
	* configure.ac: Error out if libc doesn't provide sleep, usleep.
2011-02-25 10:20:02 +00:00
Ralf Corsepius
0111c50d8e 2011-02-25 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/creat.c: Remove.
	* libcsupport/Makefile.am: Reflect changes above.
	* configure.ac: Error out if libc doesn't provide creat.
2011-02-25 02:52:54 +00:00
Ralf Corsepius
bbc1a10935 2011-02-25 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/opendir.c, libcsupport/src/closedir.c,
	libcsupport/src/readdir.c, libcsupport/src/rewinddir.c,
	libcsupport/src/scandir.c, libcsupport/src/seekdir.c,
	libcsupport/src/telldir.c: Remove.
	* libcsuppport/Makefile.am: Reflect changes above.
	* configure.ac: Error out if libc doesn't provide
	opendir, closedir, readdir, rewinddir, scandir, seekdir,
	telldir.
2011-02-25 02:13:21 +00:00
Sebastian Huber
ddb29e37c9 2011-02-17 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/rtems_heap_extend.c: New file.
	* libcsupport/Makefile.am: Reflect change from above.
	* libcsupport/include/rtems/malloc.h: Declare rtems_heap_extend().
	* score/include/rtems/score/heap.h: Documentation.
2011-02-17 14:17:09 +00:00
Sebastian Huber
4b9ddca40c 2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1671/cpukit
	* libcsupport/include/rtems/gxx_wrappers.h: New file.
	* libcsupport/Makefile.am, libcsupport/preinstall.am: Reflect change
	above.
	* libcsupport/src/gxx_wrappers.c: Include <rtems/gxx_wrappers.h>.  Use
	_Internal_error_Occurred() instead of rtems_panic().
	* score/include/rtems/score/interr.h: Added
	INTERNAL_ERROR_GXX_KEY_ADD_FAILED and
	INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED.
2010-08-23 07:59:38 +00:00
Joel Sherrill
bad55939df 2010-08-10 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1661/testing
	* libcsupport/Makefile.am, libcsupport/include/rtems/libcsupport.h: Add
	public methods to get/set malloc heap pointer so the tests do not
	have to peer behind the API.
	* libcsupport/src/mallocgetheapptr.c,
	libcsupport/src/mallocsetheapptr.c: New files.
2010-08-10 13:15:30 +00:00
Joel Sherrill
51276d205e 2010-08-03 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1649/cpukit
	* libcsupport/Makefile.am, libcsupport/src/getgid.c: Make sure all get
	and set gid and egid routines are present and in their own files.
	* libcsupport/src/setegid.c, libcsupport/src/setgid.c: New files.
2010-08-03 15:46:52 +00:00