Commit Graph

793 Commits

Author SHA1 Message Date
Sebastian Huber
6ac6a5c866 jffs2: Do not use command line defines
Update #3375.
2018-04-30 08:07:54 +02:00
Sebastian Huber
9e3691096e NFS: Remove support for cexp
Avoid use of RTEMS_RELLDFLAGS.

Close #3390.
2018-04-12 07:08:53 +02:00
Fan Deng
d869c1824a Fill in the correct d_off in rtems_rfs_dir_read.
rtems_rfs_dir_read searches the directory inode's entries list starting
at the specified offset until an empty entry (last entry) is encountered. It
fills in a struct dirent with the name of the entry, length of the name, ino of
the entry, and the absolute offset of the entry in the parent directory's
entries
list.

Unfortunately, the stock implementation of rtems_rfs_dir_read returns a
somewhat arbitrary offset (as dirent::d_off), while
rtems_rfs_dir_lookup_ino always returns the correct offset.

This change fixes that logic so the returned offset is accurate.

Tested by comparing the offset returned in dirent with the result of
rtems_rfs_dir_lookup_ino.
2018-04-11 11:51:57 +10:00
Fan Deng
64908df116 Fixes bitmap allocation accounting logic in rtems-rfs-bitmaps.c
The bitmap allocation accounting logic in rtems-rfs-bitmaps.c is flawed
around control->free. Specifically:

In rtems_rfs_bitmap_map_set():
control->free is only decremented when its corresponding search bit is
toggled. This is wrong and will miss on average 31/32 set updates.

In rtems_rfs_bitmap_map_clear():
control->free is incremented unconditionally.

The correct behavior is:
When updating the map, check if the bit is already set/clear. Only update
control->free when the bit is toggled.

This change enforced the correct behavior.

Tested by inspecting the internal data structure.
2018-04-11 11:51:57 +10:00
Fan Deng
095a807bc3 Reset free count properly in rtems_rfs_bitmap_map_clear_all().
In rtems_rfs_bitmap_map_clear_all(), control->free is set to 'elements',
which is the number of elements in the bitmap. This is incorrect, as
control->free should contain the number of free bits, not elements.

This change fixes the logic and resets control->free to a correct value.
2018-04-11 11:51:57 +10:00
Fan Deng
0c2241c0a9 Make bit addressing consistent in rtems_rfs_group.c
This change fixes https://devel.rtems.org/ticket/3089.

Briefly, rtems_rfs_group.c contains conflicting conversions between
block numbers and group number and bit offset pairs. This caused the
actual bit stored on the bitmask to be one bit displaced from its
intended location.

For more details, please see the associated ticket.

Tested by inspecting the written bitmasks with and without this change.
2018-04-11 11:51:57 +10:00
Sebastian Huber
2d0bc839ed build: Remove EXTRA_DIST
A "make dist" is not supported. So, it makes no sense to have pure "make
dist" related stuff in the Makefile.am.
2018-04-04 10:09:04 +02:00
Sebastian Huber
e16111b2cf NFS: Fix use of self-contained objects
Update #2843.
2018-02-07 08:58:22 +01:00
Sebastian Huber
03e5a7800d NFS: Use self-contained recursive mutex
Update #2843.
2018-02-02 15:01:23 +01:00
Sebastian Huber
8ddd92d56a pipe: Use self-contained mutex
Update #2843.
2018-02-02 15:01:23 +01:00
Sebastian Huber
0940648f6f RFS: Use self-contained recursive mutex
Update #2843.
2018-02-02 15:01:22 +01:00
Sebastian Huber
3b77417ba7 dosfs: Use self-contained recursive mutex
Update #2843.
2018-02-02 15:01:22 +01:00
Sebastian Huber
b17bcb3855 JFFS2: Use self-contained recursive mutex
Update #2843.
2018-02-02 15:01:22 +01:00
Chris Johns
2afb22b7e1 Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step.  It
copied header files from arbitrary locations into the build tree.  The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

* The make preinstall step itself needs time and disk space.

* Errors in header files show up in the build tree copy.  This makes it
  hard for editors to open the right file to fix the error.

* There is no clear relationship between source and build tree header
  files.  This makes an audit of the build process difficult.

* The visibility of all header files in the build tree makes it
  difficult to enforce API barriers.  For example it is discouraged to
  use BSP-specifics in the cpukit.

* An introduction of a new build system is difficult.

* Include paths specified by the -B option are system headers.  This
  may suppress warnings.

* The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step.   All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc.  Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

* cpukit/include

* cpukit/score/cpu/@RTEMS_CPU@/include

* cpukit/libnetworking

The new BSP include directories are:

* bsps/include

* bsps/@RTEMS_CPU@/include

* bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed.  The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.
2018-01-25 08:45:26 +01:00
Sebastian Huber
6bb9b3df7b rfs: Fix format warning
Update #3082.
2018-01-23 08:00:26 +01:00
Sebastian Huber
5fb838d181 rfs: Fix for 64-bit targets
The RTEMS_BLKIO_SETBLKSIZE IO control expects an uint32_t parameter and
not a size_t which is 64-bits on 64-bit targets.

Update #3082.
2018-01-22 15:24:13 +01:00
Sebastian Huber
295ca7ded0 RFS: Include <rtems/rtems-rfs-shell.h>
Prepare for header file move to common include directory.

Update #3254.
2017-12-13 09:04:26 +01:00
Sebastian Huber
7d9455edfe pipe: Include <rtems/pipe.h>
Prepare for header file move to common include directory.

Update #3254.
2017-12-13 09:04:26 +01:00
Sebastian Huber
7683da88e4 dosfs: Include <rtems/dosfs.h>
Prepare for header file move to common include directory.

Update #3254.
2017-12-13 09:04:26 +01:00
Sebastian Huber
339069fc81 devfs: Include <rtems/devfs.h>
Prepare for header file move to common include directory.

Update #3254.
2017-12-13 09:04:25 +01:00
Sebastian Huber
a397c7d8bc IMFS: Include <rtems/imfs.h>
Prepare for header file move to common include directory.

Update #3254.
2017-12-13 09:04:25 +01:00
Christian Mauderer
2fe368787e dosfs: Allow creating a file with similar name.
If there is already a file with a long file name it isn't possible to
create a second file which has a name that ends on the first files name
(for example ets.beam and sets.beam). This patch fixes that.

Update #3258.
2017-12-07 07:30:16 +01:00
Christian Mauderer
ca835e5683 dosfs: Fix files with same name as volume name.
Take care that a file in the root directory with the same name as the
volume name can be found.

Update #3257.
2017-12-05 08:00:34 +01:00
Sebastian Huber
e2fe881a87 score: Simplify red-black tree debug support
Make the RBTree_Node layout independent of RTEMS_DEBUG (and all other
build configuration options).  This allows the use of this structure in
Newlib.

Update #3112.
2017-09-27 14:56:47 +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
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
856ede4f91 libio: Add iop set/clear flags
Update #3132.
2017-09-15 07:48:03 +02:00
Sebastian Huber
4d495cfd01 dosfs: Fix fat_file_update()
Do not update the non-existant meta-data of the root directory.

Update #2944.
2017-09-06 14:31:04 +02:00
Sebastian Huber
a2c204ebf8 dosfs: Fix find name next entry preparation
Update #2964.
2017-09-06 13:59:35 +02:00
Sebastian Huber
34dda6042a dosfs: Fix msdos_dir_read()
Set a proper name buffer length for each converter invocation.

Update #2987.
2017-09-06 13:21:41 +02:00
Sebastian Huber
fae59c9b42 dosfs: Support a cluster size of 64KiB
Close #3003.
2017-09-06 10:20:46 +02:00
Sebastian Huber
b2ed712d26 Include missing <string.h>
Update #2133.
2017-08-25 10:58:58 +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
Sebastian Huber
643b82026c Include missing <sys/param.h>
Some kernel-space header expect that <sys/param.h> is present.

Update #2833.
2017-06-07 13:02:19 +02:00
Sebastian Huber
787f51f5b3 Do not include <sys/ioctl.h> in kernel-space
Update #2833.
2017-06-07 13:02:08 +02:00
Chris Johns
a748603cb4 build-system: Parallel build all subdirs. 2017-05-24 19:59:22 +10:00
Joel Sherrill
54bdf0c7e5 rtems/inttypes.h: New file. Uses contents from cpukit
Provide extentions to <inttpes.h> PRIxxx constants for more POSIX types.
Start with existing definitions found in RTEMS Project owned code
in cpukit/.

updates #2983.
2017-04-18 11:24:44 -05:00
Sebastian Huber
d50ab07938 dosfs: Fix file name search
Do not use our long file name entry count to optimize the file name
search. The Unicode comparison must be taken into account.

Update #2939.
2017-03-16 15:33:59 +01:00
Sebastian Huber
dfd879fa42 dosfs: Fix race condition msdos_dir_read()
Obtain file system instance lock before member access.

Update #2937.
2017-03-16 15:33:58 +01:00
Sebastian Huber
6c988987f6 dosfs: Rename fat_entries to lfn_entries
The name "fat_entries" for long file name directory entries is quite
misleading.
2017-03-16 15:33:58 +01:00
Sebastian Huber
5f8ed0d8da dosfs: Fix long file name padding
Update #2934.
2017-03-16 15:33:58 +01:00
Sebastian Huber
e625a57ff8 dosfs: msdos_filename_utf8_to_short_name_for_save
Simplify.
2017-03-16 15:33:58 +01:00
Sebastian Huber
b1daf0f095 dosfs: Fix msdos_add_file()
Make sure that long file names work accross cluster boundaries.

Update #2929.
2017-03-16 15:33:58 +01:00
Sebastian Huber
1a9483e2db dosfs: Simplify msdos_add_file()
Update #2929.
2017-03-16 15:33:57 +01:00
Sebastian Huber
3efe74953f dosfs: Add and use msdos_lfn_checksum()
Update #2929.
2017-03-16 15:33:57 +01:00
Sebastian Huber
063eb574b9 dosfs: Simplify fat_file_open()
Update #2929.
2017-03-16 15:33:57 +01:00
Sebastian Huber
ccd4a7f397 dosfs: Simplify msdos_creat_node()
Update #2929.
2017-03-16 15:33:57 +01:00
Sebastian Huber
e69ee3629d dosfs: Fix fat_file_write()
Remove forced overwrite which leads to file data corruption.  The logic
to determine a forced overwrite was fundamentally broken.  For simplity,
disable this feature.

Update #2622.
2017-03-16 15:33:57 +01:00