Commit Graph

664 Commits

Author SHA1 Message Date
Sebastian Huber
93b29f08f0 Filesystem: Use transient event 2012-10-30 18:03:29 +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
3b978e190d libcsupport: malloc_deferred_frees_initialize()
Remove this function and statically initialize RTEMS_Malloc_GC_list.
2012-10-25 14:54:05 +02:00
Sebastian Huber
78f417f897 Filesystem: Rename function
Rename rtems_filesystem_location_exists_in_same_fs_instance_as() into
rtems_filesystem_location_exists_in_same_instance_as() for consistency
with other file system instance related functions.
2012-10-07 17:17:27 +02:00
Sebastian Huber
8b65f389aa Filesystem: Rename function
Rename rtems_filesystem_location_is_root() into
rtems_filesystem_location_is_instance_root() to distinguish this from
the file system root directory of the current task environment.
2012-10-07 17:12:49 +02:00
Sebastian Huber
c17d0b315b Filesystem: Reject removal of root nodes
Reject the removal of file system instance root nodes in rmdir() and
unlink() and return the EBUSY error status.  File system instances can
be removed with unmount().  Remove root node special cases in IMFS,
DOSFS, and RFS.
2012-10-07 17:03:20 +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
317ee8d7ff score: Change greedy allocation API 2012-07-17 10:19:16 +02:00
Sebastian Huber
b2cb8d6fb4 libcsupport: Add rtems_printf_plugin() 2012-06-04 17:30:21 +02:00
Sebastian Huber
847ad441cd Filesystem: Wait for unmount() to finish 2012-05-29 12:25:34 +02:00
Sebastian Huber
502629707d libcsupport: Adjust malloc_walk() prototype
The header file <rtems/malloc.h> provides now also the malloc_walk()
prototype.

The malloc_walk() prototype reflects now the _Protected_heap_Walk() API.
The return status helps to print only in case of an error.
2012-05-16 12:38:21 +02:00
Sebastian Huber
0a95800a58 Filesystem: Change pathconf_limits_and_options
The pathconf_limits_and_options field of
rtems_filesystem_mount_table_entry_t is now a const pointer to reduce
the read-write memory demands of file system instances.
2012-05-15 10:37:00 +02:00
Sebastian Huber
da154e14f6 Filesystem: Move operations to mount table entry
The scope of the file system operations is the file system instance.
The scope of the file system node handlers is the file location.  The
benefit of moving the operations to the mount table entry is a size
reduction of the file location (rtems_filesystem_location_info_t).  The
code size is slightly increased due to additional load instructions.

Restructure rtems_filesystem_mount_table_entry_t to improve cache
efficiency.
2012-05-15 10:01:43 +02:00
Sebastian Huber
7666afc97a Filesystem: Add const qualifier to lock/unlock 2012-05-15 10:01:43 +02:00
Sebastian Huber
53da07e436 Filesystem: PR1255: Move offset update to handlers
It is now the responsibility of the read() and write() handler to update
the offset field of the IO descriptor (rtems_libio_t).  This change
makes it possible to protect the IO descriptor from concurrent access by
per file locks.
2012-05-15 10:01:42 +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
65c6425de9 Remove CVS Id Strings (manual edits after script)
These modifications were required by hand after running the script.
In some cases, the file names did not match patterns. In others,
the format of the file did not match any common patterns.
2012-05-11 08:44:14 -05: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
Sebastian Huber
30d412469c Filesystem: PR1398: Fix lseek() mechanic
According to POSIX the lseek() function shall not, by itself, extend the
size of a file.

Remove the size field of rtems_libio_t.  A file has only one size but
may have multiple open file descriptors.  Thus a file size field in the
file descriptor may lead to inconsistencies.

New default handlers rtems_filesystem_default_lseek_file() and
rtems_filesystem_default_lseek_directory().
2012-05-11 13:58:43 +02:00
Sebastian Huber
5a4bb758c0 Filesystem: Remove per file descriptor semaphore
The per file descriptor semaphore (field of rtems_libio_t) is unused in
RTEMS.  There is a considerable memory overhead due to that.  A
semaphore needs roughly 124 bytes which is huge compared to the
approximately 72 bytes for the file descriptor structure itself.  Device
drivers can create their own synchronization primitives in the open
handler on demand.
2012-05-04 10:53:51 +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
5b045eb6f8 Filesystem: Change type of ioctl_return
Change the ioctl_return type of rtems_libio_ioctl_args_t to match the
ioctl() return value type.
2012-04-03 15:03:18 +02:00
Sebastian Huber
2563410019 Filesystem: Rename defines
o Removed RTEMS_LIBIO_PERMS_SEARCH.
 o Renamed RTEMS_LIBIO_PERMS_READ in RTEMS_FS_PERMS_READ.
 o Renamed RTEMS_LIBIO_PERMS_WRITE in RTEMS_FS_PERMS_WRITE.
 o Renamed RTEMS_LIBIO_PERMS_EXEC in RTEMS_FS_PERMS_EXEC.
 o Renamed RTEMS_LIBIO_FOLLOW_HARD_LINK in RTEMS_FS_FOLLOW_HARD_LINK.
 o Renamed RTEMS_LIBIO_FOLLOW_SYM_LINK in RTEMS_FS_FOLLOW_SYM_LINK.
 o Renamed RTEMS_LIBIO_MAKE in RTEMS_FS_MAKE.
 o Renamed RTEMS_LIBIO_EXCLUSIVE in RTEMS_FS_EXCLUSIVE.
 o Renamed RTEMS_LIBIO_ACCEPT_RESIDUAL_DELIMITERS in
   RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS.
 o Renamed RTEMS_LIBIO_REJECT_TERMINAL_DOT in
 RTEMS_FS_REJECT_TERMINAL_DOT.
2012-03-13 12:24:10 +01:00
Sebastian Huber
4116fce629 Filesystem: New defaults fsync_h and fdatasync_h
New defaults rtems_filesystem_default_fsync_or_fdatasync() and
rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and
fdatasync_h.  The rtems_filesystem_default_fsync_or_fdatasync() sets now
errno to EINVAL according to POSIX.
2012-03-13 12:23:45 +01:00
Sebastian Huber
3ba4f828e4 Filesystem: Read-only file system checks
o Make sure EROFS is indicated for write operations on a read-only file
   system.
 o Add error indication for read-only file systems in fchmod() and
   fchown() according to POSIX.
2012-03-13 12:23:44 +01: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
Ralf Corsépius
692aefeb63 2012-02-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/assocnamebad.c:
	Add #define INSIDE_ASSOC.
2012-02-22 10:02:48 +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
3538e191ab 2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/termios_setinitialbaud.c: Fixed typo.
2011-12-14 09:22:43 +00:00
Sebastian Huber
40f8b21ef4 2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/termiostypes.h,
	libcsupport/src/termios_baud2num.c,
	libcsupport/src/termios_baudtable.c,
	libcsupport/src/termios_num2baud.c,
	libcsupport/src/termios_setinitialbaud.c: Added const qualifier to
	baud associations.  Fixed integer types.
2011-12-14 08:50:49 +00:00
Ralf Corsepius
66496446db 2011-12-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Check for getrusage.h decl.
	* libcsupport/src/getrusage.c:
	Apply HAVE_DECL_GETRUSAGE (Missing prototypes).
2011-12-13 06:47:21 +00:00
Ralf Corsepius
4b41d3d4d5 2011-12-08 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/termios.c: Make rtems_termios_refill_transmitter
	static.
2011-12-08 14:12:27 +00:00
Ralf Corsepius
c4e1e32eda 2011-12-07 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/sup_fs_is_separator.c:
	Include <rtems/libio_.h> (Missing protypes).
2011-12-07 17:21:35 +00:00
Ralf Corsepius
39bcf257b9 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/pipe.c: Include <unistd.h>.
	Include <rtems/pipe.h>.
2011-12-06 15:42:00 +00:00
Ralf Corsepius
ee89b319e4 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/flockfile.c, libcsupport/src/ftrylockfile.c,
	libcsupport/src/funlockfile.c:
	Add __attribute__((unused)) to unused function parameters.
2011-12-06 13:39:12 +00:00
Ralf Corsepius
3e0a98a756 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/envlock.c: Build conditionally.
2011-12-06 13:35:12 +00:00
Ralf Corsepius
16ef51ee2b 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/envlock.c: Rename define ENVLOCK_DEDIDCATED_MUTEX
	into ENVLOCK_DEDICATED_MUTEX (Typo).
2011-12-06 08:05:34 +00:00
Ralf Corsepius
96d3f26e1d 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/malloc_sbrk_helpers.c: Make
	malloc_sbrk_initialize, malloc_sbrk_extend_and_allocate static.
2011-12-06 07:57:10 +00:00
Ralf Corsepius
df4669fb1e 2011-12-05 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/chown.c, libcsupport/src/lchown.c:
	Include <unistd.h>. Cleanup included headers.
2011-12-05 14:20:38 +00:00
Ralf Corsepius
7f0c1fd534 2011-12-05 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/termios.c: Remove unnecessary cast.
2011-12-05 05:06:50 +00:00
Ralf Corsepius
bbc0615e09 2011-12-03 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/termios.c: Make FL_* defines unsigned.
2011-12-03 05:45:58 +00:00
Ralf Corsepius
2cb8f5acea 2011-12-03 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/getgid.c: Include <unistd.h>.
	* libcsupport/src/setgid.c: Include <unistd.h>.
	* libcsupport/src/getpgrp.c: Include <unistd.h>.
	Remove unnecessary includes.
2011-12-03 05:13:59 +00:00
Ralf Corsepius
cadea7923e 2011-12-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/open.c: Use va_arg(..., mode_t) to retrieve mode.
2011-12-01 08:01:40 +00:00
Sebastian Huber
b4f635e9d0 2011-11-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1924/cpukit
	* sapi/include/rtems/config.h: New fields stack_space_size,
	unified_work_area, and stack_allocator_avoids_work_space in
	rtems_configuration_table.
	* sapi/include/confdefs.h: Removed rtems_unified_work_area (this is
	now part of the Configuration).  Separate work space and stack space
	estimate.  Added CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
	configuration option.
	* libmisc/shell/main_wkspaceinfo.c, score/src/wkspace.c,
	libcsupport/src/malloc_initialize.c: Update due to API changes.
2011-11-10 14:40:13 +00:00
Ralf Corsepius
9bdb4292fa 2011-10-30 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/newlibc_exit.c: Don't undef __USE_INIT_FINI__.
2011-10-30 05:33:01 +00:00
Ralf Corsepius
1e54c69910 2011-10-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/utimes.c (utimes): Remove casts to time_t.
2011-10-23 06:54:41 +00:00
Ralf Corsepius
96406152d9 2011-10-18 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/rtems/libio.h, libcsupport/src/termios.c:
	Use size_t for sizes.
2011-10-18 14:37:47 +00:00
Ralf Corsepius
764d531b3b 2011-10-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/termios.c,
	libcsupport/include/rtems/termiostypes.h (rtems_termios_puts):
	Use size_t for buffer size.
2011-10-11 07:57:46 +00:00
Ralf Corsepius
87f4e9ba56 2011-10-10 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/termios.c: Remove meaningless typecast.
2011-10-10 03:47:56 +00:00
Sebastian Huber
1f3585d1cb 2011-08-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/newlibc_exit.c, score/src/threadhandler.c: Added
	init/fini array support for ARM EABI.  The __libc_init_array() and
	__libc_fini_array() functions are provided by Newlib.
2011-08-15 08:23:49 +00:00