Commit Graph

333 Commits

Author SHA1 Message Date
Alex Ivanov
cc390b62c4 libcsupport: Doxygen enhancement GCI task #6
http://www.google-melange.com/gci/task/view/google/gci2012/7992212
2012-12-11 17:35:30 -05:00
Alex Ivanov
17c6ad6a01 libcsupport: Doxygen enhancement GCI task #4
http://www.google-melange.com/gci/task/view/google/gci2012/8009205
2012-12-11 16:51:08 -05:00
Alex Ivanov
c9bb60a94c libcsupport: GCI Doxygen Task #7
http://www.google-melange.com/gci/task/view/google/gci2012/7975223
2012-12-11 06:49:45 -05:00
Alex Ivanov
37509959b2 libcsupport: Doxygen enhancement task #5
http://www.google-melange.com/gci/task/view/google/gci2012/7992211
2012-12-10 14:51:23 -05:00
Alex Ivanov
bcd0ea6409 libcsupport: Doxygen enhancement task #2
http://www.google-melange.com/gci/task/view/google/gci2012/8017203
2012-12-09 17:55:17 -05:00
Sebastian Huber
7e731815e5 libcsupport: Fix documentation 2012-12-09 14:26:02 +01:00
Sebastian Huber
9090c0af6e Filesystem: Revert documentation change 2012-12-09 14:25:16 +01:00
Mathew Kallada
ceaa99964f libcsupport: Doxygen Enhancement Task #3
http://www.google-melange.com/gci/task/view/google/gci2012/7992210
2012-12-08 15:43:29 -05:00
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
ca9f2e639e libcsupport: Spelling 2012-10-15 14:58:08 +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
317ee8d7ff score: Change greedy allocation API 2012-07-17 10:19:16 +02:00
Sebastian Huber
c8a86d4d6f libcsupport: C++ compatibility 2012-07-02 16:21:46 +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
e37ed99c99 Filesystem: Add missing include file <stdint.h> 2012-05-15 16:27:51 +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
Sebastian Huber
df01da6707 Filesystem: Use ioctl_command_t 2012-05-15 10:01:42 +02:00
Sebastian Huber
52c0db28a1 Filesystem: Remove duplicate prototype 2012-05-14 16:57:58 +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
Joel Sherrill
cfaa3662ee General - Remove extraneous blank line in license message
Many files had an extra blank line in the license text
found in the file header.  This patch removes that line.

 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *
 *  http://www.rtems.com/license/LICENSE.

The script that did this also turned off execute permission
when it was turned on incorrectly.
2012-05-03 12:55:58 -05: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
bea7043c80 Filesystem: Change node type enum values
Move the RTEMS_FILESYSTEM_INVALID_NODE_TYPE to the end.  This makes it
possible to use this enum easily as an array index.  Most comparisons
are made against RTEMS_FILESYSTEM_DIRECTORY.  A value of zero allows on
some architectures simpler branch operations.
2012-03-13 12:23:45 +01:00
Sebastian Huber
a76c23738b Filesystem: Change error indication
Change error indication to ESPIPE in rtems_filesystem_default_lseek().
2012-03-13 12:23:45 +01:00
Sebastian Huber
adef4e4696 Filesystem: New function
New function rtems_filesystem_default_lseek_success().
2012-03-13 12:23:45 +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
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
1052242d23 Removed fpathconf file system node handler.
There existed no calling function for this handler.
2012-02-02 15:55:33 +01: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
145c934384 2011-12-06 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/rtems/libio.h:
	Make LIBIO_FLAGS_* defined unsigned (Avoid implicit sign
	conversions).
2011-12-06 06:39:03 +00:00
Ralf Corsepius
7f46921e1d 2011-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/rtems/libcsupport.h:
	Add prototype of malloc_info().
2011-12-02 17:29:07 +00:00
Joel Sherrill
d54fd8fd4d 2011-12-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/include/sys/termios.h: Add _POSIX_VDISABLE.
2011-12-02 16:42:42 +00:00
Joel Sherrill
89926c95c4 Revert. 2011-11-07 21:41:45 +00:00
Joel Sherrill
4485c9a89d 2011-11-07 Ralf Corsepius <ralf.corsepius@rtems.org>
PR 1952/cpukit
	* libcsupport/include/rtems/libio.h: Add return code for failure when
	unable to write file.
2011-11-07 21:40:26 +00:00
Ralf Corsepius
b799e4ebc1 2011-11-06 Ralf Corsépius <ralf.corsepius@rtems.org>
PR1945/cpukit
	* libcsupport/include/rtems/libio.h: Mark rtems_off64_t as
	deprecated.
	Replace rtems_off64_t with off_t.
2011-11-06 11:50:21 +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
Joel Sherrill
58f3fab959 2011-07-22 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1839/filesystem
	* libcsupport/include/rtems/libio_.h, libcsupport/src/fchdir.c,
	libcsupport/src/fdatasync.c, libcsupport/src/fpathconf.c,
	libcsupport/src/fsync.c, libcsupport/src/ftruncate.c,
	libcsupport/src/read.c, libcsupport/src/readv.c,
	libcsupport/src/write.c, libcsupport/src/writev.c: Some calls did not
	return proper status for permission errors or incorrectly permissions
	at all.
2011-07-22 16:04:38 +00:00
Sebastian Huber
a2900a8b4b 2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Added
	rtems_filesystem_is_root_location().
	* libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs_eval.c,
	libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_eval.c: Use
	rtems_filesystem_is_root_location().
2011-07-21 12:03:26 +00:00