[PATCH] fs: Add struct dirent::d_type support
--- cpukit/libfs/src/dosfs/msdos_dir.c| 11 cpukit/libfs/src/imfs/imfs_dir_default.c | 3 ++ cpukit/libfs/src/jffs2/include/linux/fs.h | 5 ++ cpukit/libfs/src/jffs2/src/fs-rtems.c | 11 ++-- cpukit/libfs/src/nfsclient/src/nfs.c | 3 ++ testsuites/fstests/fsscandir01/init.c | 89 +-- 6 files changed, 91 insertions(+), 31 deletions(-) diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c index a13caafa7e..fee6491c7d 100644 --- a/cpukit/libfs/src/dosfs/msdos_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_dir.c @@ -236,6 +236,17 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) continue; } +#ifdef DT_DIR +if ((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_DIRECTORY) +{ +tmp_dirent.d_type = DT_DIR; +} +else +{ +tmp_dirent.d_type = DT_REG; +} +#endif + /* * Move the entry to the return buffer * diff --git a/cpukit/libfs/src/imfs/imfs_dir_default.c b/cpukit/libfs/src/imfs/imfs_dir_default.c index 03ef115301..7bb4f378e1 100644 --- a/cpukit/libfs/src/imfs/imfs_dir_default.c +++ b/cpukit/libfs/src/imfs/imfs_dir_default.c @@ -74,6 +74,9 @@ static ssize_t IMFS_dir_read( dir_ent->d_off = current_entry; dir_ent->d_reclen = sizeof( *dir_ent ); dir_ent->d_ino = IMFS_node_to_ino( imfs_node ); +#ifdef DT_DIR + dir_ent->d_type = IFTODT( imfs_node->st_mode ); +#endif dir_ent->d_namlen = MIN( imfs_node->namelen, sizeof( dir_ent->d_name ) - 1 ); dir_ent->d_name[ dir_ent->d_namlen ] = '\0'; diff --git a/cpukit/libfs/src/jffs2/include/linux/fs.h b/cpukit/libfs/src/jffs2/include/linux/fs.h index 8da9880b13..a638e7b6bf 100644 --- a/cpukit/libfs/src/jffs2/include/linux/fs.h +++ b/cpukit/libfs/src/jffs2/include/linux/fs.h @@ -3,12 +3,17 @@ #include #include +#include #include +#ifdef DT_DIR +#define RTEMS_JFFS2_HAVE_D_TYPE +#else #define DT_UNKNOWN 0 #define DT_DIR 4 #define DT_REG 8 #define DT_LNK 10 +#endif #define ATTR_MODE (1U << 0) #define ATTR_UID (1U << 1) diff --git a/cpukit/libfs/src/jffs2/src/fs-rtems.c b/cpukit/libfs/src/jffs2/src/fs-rtems.c index 17a4985607..aae208ccef 100644 --- a/cpukit/libfs/src/jffs2/src/fs-rtems.c +++ b/cpukit/libfs/src/jffs2/src/fs-rtems.c @@ -423,7 +423,7 @@ static int rtems_jffs2_fstat( return 0; } -static int rtems_jffs2_fill_dirent(struct dirent *de, off_t off, uint32_t ino, const char *name) +static int rtems_jffs2_fill_dirent(struct dirent *de, off_t off, uint32_t ino, const char *name, unsigned char type) { int eno = 0; size_t len; @@ -433,6 +433,9 @@ static int rtems_jffs2_fill_dirent(struct dirent *de, off_t off, uint32_t ino, c de->d_off = off * sizeof(*de); de->d_reclen = sizeof(*de); de->d_ino = ino; +#ifdef RTEMS_JFFS2_HAVE_D_TYPE + de->d_type = type; +#endif len = strlen(name); de->d_namlen = len; @@ -466,14 +469,14 @@ static ssize_t rtems_jffs2_dir_read(rtems_libio_t *iop, void *buf, size_t len) off = begin; if (off == 0 && off < end) { - eno = rtems_jffs2_fill_dirent(de, off, inode->i_ino, "."); + eno = rtems_jffs2_fill_dirent(de, off, inode->i_ino, ".", DT_DIR); assert(eno == 0); ++off; ++de; } if (off == 1 && off < end) { - eno = rtems_jffs2_fill_dirent(de, off, inode->i_parent->i_ino, ".."); + eno = rtems_jffs2_fill_dirent(de, off, inode->i_parent->i_ino, "..", DT_DIR); assert(eno == 0); ++off; ++de; @@ -482,7 +485,7 @@ static ssize_t rtems_jffs2_dir_read(rtems_libio_t *iop, void *buf, size_t len) while (eno == 0 && off < end && fd != NULL) { if (fd->ino != 0) { if (off == fd_off) { - eno = rtems_jffs2_fill_dirent(de, off, fd->ino, fd->name); + eno = rtems_jffs2_fill_dirent(de, off, fd->ino, fd->name, fd->type); ++off; ++de; } diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index ddb4dda313..bb338d58ca 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -327,6 +327,9 @@ nfscookie *pcookie; pde->d_ino= fileid; pde->d_namlen = nlen; pde->d_off= di->ptr - di->buf; +#ifdef DT_UNKNOWN + pde->d_type = DT_UNKNOWN; +#endif if (name == dummy.nambuf) { memcpy(pde->d_name, dummy
Re: [PATCH v2] rtems-record: New program
On 31/1/19 5:36 pm, Sebastian Huber wrote: > On 30/01/2019 22:11, Chris Johns wrote: >> On 30/1/19 9:31 pm, Sebastian Huber wrote: >>> Update #3665. >>> --- >>> misc/record/record-client.c | 448 ++ >> What about placing this in: >> >> trace/record-client.c >> >> ? >> >> For important parts of the tools, for example linkers and tester, there is a >> separate directory. I am sure there will be more trace tools overtime. > > I placed it here to avoid some copy and paste in the wscript file. Are these > sub-directory wscript files really necessary? > We should look at what makes sense long term then update the waf support to handle the structure. I think a place to collect all eco-system trace code is important. It encourages a collective rather than separate misc commands. If we are starting to have repeated patterns then maybe we should refactor those into a python module and import it. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
How can I check if a function exists in waf?
Hello, how can I check if a function exists in waf (similar to AC_CHECK_FUNC)? Currently, we get this output from the RTEMS tools waf configure (please note the "Invalid argument 'function_name' in test"): ./waf configure Setting top to : /scratch/git-rtems-tools Setting out to : /scratch/git-rtems-tools/build Version : 5.551ce0825375-modified (5) Checking for program 'python' : /usr/bin/python Checking for python version >= 2.6.6 : 2.7.14 Checking for program 'python' : /usr/bin/python Checking for program 'python2' : /usr/bin/python2 Checking for program 'python3' : /usr/bin/python3 Checking for 'gcc' (C compiler) : /usr/bin/gcc Checking for 'g++' (C++ compiler) : /usr/bin/g++ Checking for header alloca.h : yes Checking for header fcntl.h : yes Checking for header process.h : not found Checking for header stdlib.h : yes Checking for header string.h : yes Checking for header strings.h : yes Checking for header sys/file.h : yes Checking for header sys/stat.h : yes Checking for header sys/time.h : yes Checking for header sys/types.h : yes Checking for header sys/wait.h : yes Checking for header unistd.h : yes Checking for header vfork.h : not found Invalid argument 'function_name' in test Checking for header sys/time.h sys/resource.h : yes Checking for program 'm4' : /usr/bin/m4 Checking for header sys/wait.h : yes Invalid argument 'function_name' in test Checking for header signal.h : yes Checking for 'gcc' (C compiler) : /usr/bin/gcc Checking for 'g++' (C++ compiler) : /usr/bin/g++ Checking for 'gcc' (C compiler) : /usr/bin/gcc Invalid argument 'function_name' in test Checking for header string.h : yes Checking for 'g++' (C++ compiler) : /usr/bin/g++ Invalid argument 'function_name' in test Checking for header stdlib.h : yes Invalid argument 'function_name' in test Checking for header stdlib.h : yes 'configure' finished successfully (1.058s) -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] Add rtems_board_support_package()
--- bsps/shared/rtems-version.c | 6 ++ cpukit/include/rtems/version.h| 7 +++ testsuites/sptests/spversion01/init.c | 1 + 3 files changed, 14 insertions(+) diff --git a/bsps/shared/rtems-version.c b/bsps/shared/rtems-version.c index 16f74070bc..99b98966e6 100644 --- a/bsps/shared/rtems-version.c +++ b/bsps/shared/rtems-version.c @@ -7,6 +7,7 @@ * http://www.rtems.org/license/LICENSE. */ +#include #include #include @@ -27,3 +28,8 @@ const char _RTEMS_version[] = "rtems-" RTEMS_VERSION " (" CPU_NAME "/" CPU_MODEL_NAME "/" RTEMS_XSTRING( RTEMS_BSP ) ")"; + +const char *rtems_board_support_package( void ) +{ + return RTEMS_XSTRING( RTEMS_BSP ); +} diff --git a/cpukit/include/rtems/version.h b/cpukit/include/rtems/version.h index b806cb8c2f..9bee2e8d10 100644 --- a/cpukit/include/rtems/version.h +++ b/cpukit/include/rtems/version.h @@ -67,6 +67,13 @@ int rtems_version_revision( void ); */ const char *rtems_version_control_key( void ); +/** + * @brief Returns the board support package name. + * + * @return The board support package name. + */ +const char *rtems_board_support_package( void ); + /** @} */ #ifdef __cplusplus diff --git a/testsuites/sptests/spversion01/init.c b/testsuites/sptests/spversion01/init.c index f4edcb2cdc..fc38577691 100644 --- a/testsuites/sptests/spversion01/init.c +++ b/testsuites/sptests/spversion01/init.c @@ -29,6 +29,7 @@ static rtems_task Init( printf("Minor: %d\n", rtems_version_minor()); printf("Revision : %d\n", rtems_version_revision()); printf("VC Key : %s\n", rtems_version_control_key()); + printf("BSP : %s\n", rtems_board_support_package()); TEST_END(); -- 2.16.4 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
coverage : not getting coverage for leon3-sis-cov
Hi, I'm attempting to run covoar for leon3-sis-cov with the following commands. === $HOME/development/rtems/rtems-tools/tester/rtems-test \ --rtems-tools=$HOME/development/rtems/5 \ --rtems-bsp=leon3-sis-cov \ sparc-rtems5/c/leon3/testsuites/samples /home/lunatic/development/rtems/5/share/rtems/tester/bin/covoar \ -v -f TSIM \ -S /home/lunatic/development/rtems/5/share/rtems/tester/rtems/testing/coverage/score-symbols.ini \ -E /home/lunatic/development/rtems/rtems-tools/tester/rtems/testing/coverage/Explanations.txt \ -p RTEMS-5 \ sparc-rtems5/c/leon3/testsuites/samples/*.exe === I'm getting and "unknown option -cov" error like the one given below. == ] ] SIS - SPARC instruction simulator 2.8, copyright Jiri Gaisler 1995 ] Bug-reports to j...@gaisler.se ] ] unknown option -cov ] usage: sis [-uart1 uart_device1] [-uart2 uart_device2] ] [-sparclite] [-dumbio] [-v] ] [-nfp] [-freq frequency] [-c batch_file] [files] [12/13] p:1 f:0 u:0 e:0 I:0 B:0 t:0 i:7 W:0 | sparc/leon3: ticker.exe Result: invalidTime: 0:00:01.011465 ticker.exe => run: /home/lunatic/development/rtems/5/bin/sparc-rtems5-sis -leon3 -nouartrx -r -tlim 200 s -cov sparc-rtems5/c/leon3/testsuites/samples/ticker.exe = the test results are 'invalid'. When I remove the `-cov` from the bsp ini file, then the tests pass without any error. However, I'm not getting any coverage. Here's the summary.txt generated: Bytes Analyzed : 26376 Bytes Not Executed : 26376 Percentage Executed : 0 Percentage Not Executed : 100 Uncovered ranges found : 173 No branch information available Am I missing something? --vijay ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel