[PATCH] dosfs: Fix files with same name as volume name.
From: Christian Mauderer Take care that a file in the root directory with the same name as the volume name can be found. --- cpukit/libfs/src/dosfs/msdos_misc.c | 3 +- testsuites/fstests/fsdosfsname01/init.c | 110 +++- 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 915b70..79aaa36520 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -1585,7 +1585,8 @@ msdos_find_file_in_directory ( printf ("MSFS:[9.2] checksum, entry_matched:%i, lfn_entry:%i, lfn_checksum:%02x/%02x\n", entry_matched, lfn_entry, lfn_checksum, msdos_lfn_checksum(entry)); #endif -} else { +} else if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_VOLUME_ID) + == 0) { bytes_in_entry = MSDOS_SHORT_NAME_LEN + 1; bytes_in_entry = msdos_short_entry_to_utf8_name ( converter, diff --git a/testsuites/fstests/fsdosfsname01/init.c b/testsuites/fstests/fsdosfsname01/init.c index b796dee40f..29d63484b3 100644 --- a/testsuites/fstests/fsdosfsname01/init.c +++ b/testsuites/fstests/fsdosfsname01/init.c @@ -38,6 +38,71 @@ const char rtems_test_name[] = "FSDOSFSNAME 1"; +#include +#define GRISP_PIN_CONFIG \ + /* Init everything but Console, SDRAM and Trace port to input pull up */\ + {0xFFE27FFE, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}, \ + {0x, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP}, \ + {0x00037F00, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP}, \ + {0xD97C1E0F, PIOD, ID_PIOD, PIO_INPUT, PIO_PULLUP}, \ + {0xFFC0, PIOE, ID_PIOE, PIO_INPUT, PIO_PULLUP}, \ + \ + /* Console */ \ + {PIO_PD25C_URXD2 | PIO_PD26C_UTXD2, \ + PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, \ + \ + /* SDRAM, EBI */\ + {0x00FF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* D0 .. D7 */ \ + {0x003F, PIOE, ID_PIOE, PIO_PERIPH_A, PIO_DEFAULT}, /* D8 .. D13 */ \ + {0x00018000, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}, /* D14 .. D15 */\ + {0xFFF8, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* (SAF_A1 .. SAF_A13) == (n.u., RAM_A0 .. RAM_A9, n.u., RAM_A11) */ \ + {0x2000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_A10 */ \ + {0x0004, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_A12 == SAF_A14 */ \ + {0x00180001, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}, /* (SAF_A15 .. SAF_A17) == (n.u., RAM_BA0, RAM_BA1) */ \ + {0x8000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* RAM_CS */\ + {0x0004, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* RAM_DQML / NBS0 */ \ + {0x8000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_DQMH / NBS1 */ \ + {0x4000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_CKE */ \ + {0x0001, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_RAS */ \ + {0x0002, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_CAS */ \ + {0x0080, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_CLK */ \ + {0x2000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}, /* RAM_WE */\ + {PIO_PA1,PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}, /* SAF_HC_DACK */ \ + {PIO_PC8A_NWE, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* SAF_WR */ \ + {PIO_PC11A_NRD, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* SAF_RD */ \ + {PIO_PC14A_NCS0, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}, /* SAF_CS */\ + {PIO_PD10, PIOD, ID_PIOD, PIO_INPUT,PIO_PULLUP }, /* SAF_DREQ */ \ + \ + /* Trace port */\ + {0x00F0, PIOD, ID_PIOC, PIO_PERIPH_C, PIO_DEFAULT}, /* TRACE0..3 */ \ + {0x0100, PIOD, ID_PIOC, PIO_PERIPH_D, PIO_DEFAULT}, /* TRACECLK */ \ + \ + /* SD-Card */ \ + {PIO_PA25D_MCCK, PIOA, ID_PIOA, PIO_PERIPH_D, PIO_DEFAULT}, \ + {PIO_PA26C_MCDA2 | PIO_PA27C_MCDA3 | PIO_PA28C_MCCDA | PIO_PA30C_MCDA0 |\ + PIO_PA31C_MCDA1, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}, \ + {PIO_PD18, PIOD, ID_PIOD, PIO_INPUT, PIO_DEFAULT}, /* DETECT
[PATCH] libdebugger: rtems_debugger_register_tcp_remote()
Always provide rtems_debugger_register_tcp_remote(). Header files are supplied by Newlib and not libnetworking. Get latest version from libbsd. Update #3252. --- cpukit/Makefile.am | 1 + cpukit/libdebugger/Makefile.am | 6 +- cpukit/libdebugger/preinstall.am | 2 -- cpukit/libdebugger/rtems-debugger-remote-tcp.c | 6 +++--- cpukit/preinstall.am | 4 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am index f6ee1bfbed..ea4fdb1204 100644 --- a/cpukit/Makefile.am +++ b/cpukit/Makefile.am @@ -106,6 +106,7 @@ endif if LIBDEBUGGER include_rtems_HEADERS += libdebugger/rtems-debugger.h +include_rtems_HEADERS += libdebugger/rtems-debugger-remote-tcp.h include_rtems_debuggerdir = $(includedir)/rtems/debugger include_rtems_debugger_HEADERS = include_rtems_debugger_HEADERS += libdebugger/rtems-debugger-server.h diff --git a/cpukit/libdebugger/Makefile.am b/cpukit/libdebugger/Makefile.am index 72a89447d7..36313312f7 100644 --- a/cpukit/libdebugger/Makefile.am +++ b/cpukit/libdebugger/Makefile.am @@ -10,12 +10,8 @@ libdebugger_a_SOURCES = \ rtems-debugger-server.c \ rtems-debugger-target.c \ rtems-debugger-threads.c \ - rtems-debugger-@RTEMS_CPU@.c - -if LIBNETWORKING -libdebugger_a_SOURCES += \ + rtems-debugger-@RTEMS_CPU@.c \ rtems-debugger-remote-tcp.c -endif endif diff --git a/cpukit/libdebugger/preinstall.am b/cpukit/libdebugger/preinstall.am index 695eb30912..dba6cc4d81 100644 --- a/cpukit/libdebugger/preinstall.am +++ b/cpukit/libdebugger/preinstall.am @@ -5,5 +5,3 @@ $(srcdir)/preinstall.am: Makefile.am $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am endif -if LIBDEBUGGER -endif diff --git a/cpukit/libdebugger/rtems-debugger-remote-tcp.c b/cpukit/libdebugger/rtems-debugger-remote-tcp.c index b62f3a1f52..696e2deb8c 100644 --- a/cpukit/libdebugger/rtems-debugger-remote-tcp.c +++ b/cpukit/libdebugger/rtems-debugger-remote-tcp.c @@ -1,6 +1,5 @@ /* - * Copyright (c) 2016 Chris Johns . - * All rights reserved. + * Copyright (c) 2016 Chris Johns . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,7 +37,7 @@ #include #include -#include "rtems-debugger-remote-tcp.h" +#include /** * Debugger default server port. 'RT' as ASCII. @@ -277,6 +276,7 @@ tcp_remote_disconnect(rtems_debugger_remote* remote) tcp = (rtems_debugger_remote_tcp*) remote->data; close(tcp->fd); + tcp->fd = -1; rtems_debugger_unlock(); diff --git a/cpukit/preinstall.am b/cpukit/preinstall.am index b687fb3ae5..a2e725a178 100644 --- a/cpukit/preinstall.am +++ b/cpukit/preinstall.am @@ -242,6 +242,10 @@ $(PROJECT_INCLUDE)/rtems/rtems-debugger.h: libdebugger/rtems-debugger.h $(PROJEC $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems-debugger.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems-debugger.h +$(PROJECT_INCLUDE)/rtems/rtems-debugger-remote-tcp.h: libdebugger/rtems-debugger-remote-tcp.h $(PROJECT_INCLUDE)/rtems/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems-debugger-remote-tcp.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems-debugger-remote-tcp.h + $(PROJECT_INCLUDE)/rtems/debugger/$(dirstamp): @$(MKDIR_P) $(PROJECT_INCLUDE)/rtems/debugger @: > $(PROJECT_INCLUDE)/rtems/debugger/$(dirstamp) -- 2.12.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
re [PATCH] dosfs: Fix files with same name as volume name.
Just noted that I sent the wrong patch. That version still contains some adaption for the target board. Please ignore v1 and only take a look at v2. Regards Christian ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2] dosfs: Fix files with same name as volume name.
From: Christian Mauderer Take care that a file in the root directory with the same name as the volume name can be found. --- cpukit/libfs/src/dosfs/msdos_misc.c | 3 ++- testsuites/fstests/fsdosfsname01/init.c | 45 - 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index dec894f133..addfd7fa84 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -1562,7 +1562,8 @@ msdos_find_file_in_directory ( printf ("MSFS:[9.2] checksum, entry_matched:%i, lfn_entry:%i, lfn_checksum:%02x/%02x\n", entry_matched, lfn_entry, lfn_checksum, msdos_lfn_checksum(entry)); #endif -} else { +} else if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_VOLUME_ID) + == 0) { bytes_in_entry = MSDOS_SHORT_NAME_LEN + 1; bytes_in_entry = msdos_short_entry_to_utf8_name ( converter, diff --git a/testsuites/fstests/fsdosfsname01/init.c b/testsuites/fstests/fsdosfsname01/init.c index f272945d89..d0c909877c 100644 --- a/testsuites/fstests/fsdosfsname01/init.c +++ b/testsuites/fstests/fsdosfsname01/init.c @@ -46,6 +46,7 @@ const char rtems_test_name[] = "FSDOSFSNAME 1"; #define RAMDISK_PATH "/dev/rda" #define BLOCK_NUM 47 #define BLOCK_SIZE 512 +#define VOLUME_LABEL "MyDisk" #define NUMBER_OF_DIRECTORIES 8 #define NUMBER_OF_FILES 13 @@ -78,7 +79,7 @@ static rtems_resource_snapshotbefore_mount; static const msdos_format_request_param_t rqdata = { .OEMName = "RTEMS", - .VolLabel= "RTEMSDisk", + .VolLabel= VOLUME_LABEL, .sectors_per_cluster = 2, .fat_num = 0, .files_per_root_dir = 0, @@ -1107,10 +1108,52 @@ static void test_full_8_3_name( void ) rtems_test_assert( rc == 0 ); } +static void test_dir_with_same_name_as_volume_label( void ) +{ + int rc; + DIR *dirp; + + rc = mkdir( MOUNT_DIR "/" VOLUME_LABEL, S_IRWXU | S_IRWXG | S_IRWXO ); + rtems_test_assert( rc == 0 ); + + dirp = opendir( MOUNT_DIR "/" VOLUME_LABEL ); + rtems_test_assert( NULL != dirp ); + + rc = closedir( dirp ); + rtems_test_assert( rc == 0 ); + + rc = unlink( MOUNT_DIR "/" VOLUME_LABEL ); + rtems_test_assert( rc == 0 ); +} + +static void test_file_with_same_name_as_volume_label( void ) +{ + int rc; + int fd; + + fd = open( MOUNT_DIR "/" VOLUME_LABEL, O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH ); + rtems_test_assert( fd >= 0 ); + + rc = close( fd ); + rtems_test_assert( rc == 0 ); + + fd = open( MOUNT_DIR "/" VOLUME_LABEL, O_RDWR ); + rtems_test_assert( fd >= 0 ); + + rc = close( fd ); + rtems_test_assert( rc == 0 ); + + rc = unlink( MOUNT_DIR "/" VOLUME_LABEL ); + rtems_test_assert( rc == 0 ); +} + static void test_special_cases( void ) { test_end_of_string_matches(); test_full_8_3_name(); + test_file_with_same_name_as_volume_label(); + test_dir_with_same_name_as_volume_label(); } /* -- 2.12.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] libdebugger: rtems_debugger_register_tcp_remote()
On 29/11/2017 00:59, Sebastian Huber wrote: > Always provide rtems_debugger_register_tcp_remote(). Header files are > supplied by Newlib and not libnetworking. Does this mean the version in libbsd can be removed? Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Many Warnings in Tests
Hi Some recent change has introduced a lot of warnings like the following where POSIX threads do not end with "return NULL;" or similar: og/arm-altcycv_devkit.log:../../../../../../../rtems/c/src/../../testsuites/psxtmtests/psxtmbarrier01/init.c:86:1: warning: control reaches end of non-void function [-Wreturn-type] My thought is that rtems_test_exit() should have been declared as noreturn. Anyone disagree? Thanks. --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: Many Warnings in Tests
On 29/11/2017 10:23, Joel Sherrill wrote: > > Some recent change has introduced a lot of warnings like the following where > POSIX threads do not end with "return NULL;" or similar: > > og/arm-altcycv_devkit.log:../../../../../../../rtems/c/src/../../testsuites/psxtmtests/psxtmbarrier01/init.c:86:1: > warning: control reaches end of non-void function [-Wreturn-type] > > My thought is that rtems_test_exit() should have been declared as noreturn. It should be the same as exit(). > > Anyone disagree? > Not me. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: Many Warnings in Tests
Ok. I will fix this and commit it tomorrow. Then look at other warnings. Thanks. --joel On Nov 28, 2017 5:26 PM, "Chris Johns" wrote: On 29/11/2017 10:23, Joel Sherrill wrote: > > Some recent change has introduced a lot of warnings like the following where > POSIX threads do not end with "return NULL;" or similar: > > og/arm-altcycv_devkit.log:../../../../../../../rtems/c/src/. ./../testsuites/psxtmtests/psxtmbarrier01/init.c:86:1: > warning: control reaches end of non-void function [-Wreturn-type] > > My thought is that rtems_test_exit() should have been declared as noreturn. It should be the same as exit(). > > Anyone disagree? > Not me. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: parallel make failure?
On 28/11/2017 17:27, Sebastian Huber wrote: > On 28/11/17 02:12, Chris Johns wrote: >> On 27/11/2017 18:07, Sebastian Huber wrote: >>> On 25/11/17 23:02, Chris Johns wrote: On 23/11/17 9:33 pm, Sebastian Huber wrote: > bsps/include > bsps/$arch/include > bsps/$arch/$bsp/include > cpukit/include > cpukit/libnetworking/include > cpukit/score/cpu/$arch/include >>> This generates a lot of header file moves that could be avoided with we use >> We are moving a lot of files. This specific change is around 140 moves and so >> not a big difference in the scale of things. > > These header files contain the implementation details of the CPU ports. I > looked > at the history of these files quite regularly. This is something that effects all the files we move so I am not sure this is a good reason to leave some files in place. Git log has --follow option so you can walk the files history backwards. We should be looking to get the files into places we want and I like the 'include' being last on all paths. > >> >>> cpukit/score/cpu/$arch as an include directory. >> We need to handle libdl's headers as well as these arch specific score >> headers. >> I suggest: >> >> cpukit/include >> cpukit/@RTEMS_CPU@/include >> cpukit/libnetworking/include >> bsps/include >> bsps/@RTEMS_CPU@/include >> bsps/@RTEMS_CPU@/@RTEMS_BSP@/include >> >> I have used the automake defines values in the build system rather than $arch >> and $bsp. The `cpukit/@RTEMS_CPU@` may be misleading. >> >> The other solution is to move the libdl headers into the score. > > I would move the CPU-specific headers of libdl to cpukit/score/cpu. > I am ok with this happening, they can be placed where ever the other CPU headers end up. >> >> Also we cannot use the actual BSP's name we have to use the base name and >> not an >> alias. I am not sure if @RTEMS_BSP@ is the aliased name or not. > > With $bsp I mean the @RTEMS_BSP@, the BSP base directory, not the actual BSP > name. > Great. This makes sense. >> This is looking sensible but I am not sure how to handle the install phase. Do we have per ARCH and/or BSP makefile .in files that list the headers for that ARCH or BSP in that part of the tree and we have the Makefile.am subst to include the specific file, for example `include @RTEMS_CPU@/@RTEMS_BSP@.am? We cannot use .am files because the subst is during configure and not during bootstrap. If we did this would we have these file generated by the contents of the directory, that is all headers are installed? I just hope we do not fall into an Automake hole here. >>> I would one bsps/Makefile.am which includes >>> >>> bsps/$arch/$arch.am >> I am not sure what you mean here with `$arch`. Do you mean we have a number >> of >> explicitly named files or some form of macro replacement? > > arch is one of { arm, bfin, epiphany, i386, lm32, m32c, m68k, mips, moxie, > nios2, no_cpu, or1k, powerpc, riscv, sh, sparc, sparc64, v850 }. For example: > > bsps/lm32/lm32.am > OK. >> >>> to keep the file reasonably small. Then I would introduce >>> >>> AM_CONDITIONAL(BSPS_$arch, ...) >>> AM_CONDITIONAL(BSPS_$arch_$bspdir) >> Where are the BSP headers listed? > > In bsps/lm32/lm32.am: > > if BSPS_LM32_MILKYMIST > include_HEADERS += bsps/lm32/milkymist/include/bsp.h > include_HEADERS += bsps/lm32/milkymist/include/tm27.h > ... > endif > > In Makefile.am or bsps/Makefile.am: > > include $(srcdir)/lm32/lm32.am > OK. > I don't know if this AM_CONDITIONAL() stuff works well, but can we make it > worse > than it is? This will work. > > A general question, why do we need more than one configure.ac to build RTEMS, > the BSPs and the testsuites? > It was split to support a separate CpuKit and multilibs. A change would be hard given it is far to fragile to change. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] libdebugger: rtems_debugger_register_tcp_remote()
On 28/11/17 23:02, Chris Johns wrote: On 29/11/2017 00:59, Sebastian Huber wrote: Always provide rtems_debugger_register_tcp_remote(). Header files are supplied by Newlib and not libnetworking. Does this mean the version in libbsd can be removed? Yes, but there is an issue with the library dependencies. The debugger stuff is in librtemscpu.a which is present via bsp_specs. The socket() stuff is in libbsd. I had to use: -Wl,--start-group -lbsd -lrtemscpu -Wl,--end-group libbsd.a defines strong _Watchdog_Ticks_since_boot alias. So, this library must be first. Maybe we should add a libdebugger.a. -- 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