Re: Current Warnings Report
The code is awful, but c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:48: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized] is a false positive. On which target and GCC version do you get this warning? -- 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] dosfs: Check error status
--- cpukit/libfs/src/dosfs/msdos_misc.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index c09aa19..03ec38f 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -2001,20 +2001,22 @@ msdos_find_name_in_fat_file ( retval = -1; break; } -retval = msdos_add_file ( -buffer, -name_type, -fs_info, -fat_fd, -bts2rd, -fat_entries, -name_dir_entry, -dir_pos, -dir_offset, -empty_space_offset, -empty_space_entry, -empty_space_count -); + +if (retval == RC_OK) +retval = msdos_add_file ( +buffer, +name_type, +fs_info, +fat_fd, +bts2rd, +fat_entries, +name_dir_entry, +dir_pos, +dir_offset, +empty_space_offset, +empty_space_entry, +empty_space_count +); } return retval; -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] dosfs: Check error status
Assuming this fixes a warning, commit it. I will review the logs and answer your other question when I get to the workshop this morning. That requires a computer. I will also revert my change to rfs and start another build sweep so please commit this. On September 11, 2014 7:06:17 AM EDT, Sebastian Huber wrote: >--- >cpukit/libfs/src/dosfs/msdos_misc.c | 30 -- > 1 file changed, 16 insertions(+), 14 deletions(-) > >diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c >b/cpukit/libfs/src/dosfs/msdos_misc.c >index c09aa19..03ec38f 100644 >--- a/cpukit/libfs/src/dosfs/msdos_misc.c >+++ b/cpukit/libfs/src/dosfs/msdos_misc.c >@@ -2001,20 +2001,22 @@ msdos_find_name_in_fat_file ( > retval = -1; > break; > } >-retval = msdos_add_file ( >-buffer, >-name_type, >-fs_info, >-fat_fd, >-bts2rd, >-fat_entries, >-name_dir_entry, >-dir_pos, >-dir_offset, >-empty_space_offset, >-empty_space_entry, >-empty_space_count >-); >+ >+if (retval == RC_OK) >+retval = msdos_add_file ( >+buffer, >+name_type, >+fs_info, >+fat_fd, >+bts2rd, >+fat_entries, >+name_dir_entry, >+dir_pos, >+dir_offset, >+empty_space_offset, >+empty_space_entry, >+empty_space_count >+); > } > > return retval; ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] smptests/smpcache01: Remove invalidation of data cache lines from test
On 10/09/14 15:12, Daniel Cederman wrote: Invalidation of data cache lines might cause data written to the stack to get lost. --- testsuites/smptests/smpcache01/init.c | 45 +++ testsuites/smptests/smpcache01/smpcache01.doc | 2 -- testsuites/smptests/smpcache01/smpcache01.scn | 18 --- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/testsuites/smptests/smpcache01/init.c b/testsuites/smptests/smpcache01/init.c index dd2f9f1..99df974 100644 --- a/testsuites/smptests/smpcache01/init.c +++ b/testsuites/smptests/smpcache01/init.c @@ -20,6 +20,8 @@ const char rtems_test_name[] = "SMPCACHE 1"; +const char data_to_flush[1024]; + Please use static variables whenever possible. #define CPU_COUNT 32 #define WORKER_PRIORITY 100 @@ -44,6 +46,11 @@ static test_context ctx = { .barrier = SMP_BARRIER_CONTROL_INITIALIZER, }; +static void function_to_flush( void ) +{ + /* Does nothing. Used to give a pointer to instruction address space. */ +} + static void test_cache_message( const void *d_addr, size_t n_bytes ) { rtems_test_assert(n_bytes == 123); @@ -52,22 +59,20 @@ static void test_cache_message( const void *d_addr, size_t n_bytes ) ctx.count[rtems_get_current_processor()]++; } -static void all_cache_manager_smp_functions( size_t set_size, +static void cache_manager_smp_functions( size_t set_size, cpu_set_t *cpu_set ) { - rtems_cache_flush_multiple_data_lines_processor_set( 0, 10, set_size, - cpu_set ); - rtems_cache_invalidate_multiple_data_lines_processor_set( 0, 10, set_size, - cpu_set ); There is nothing wrong with rtems_cache_invalidate_multiple_data_lines_processor_set() provided you use the right data area. + rtems_cache_flush_multiple_data_lines_processor_set( &data_to_flush, + sizeof(data_to_flush), set_size, cpu_set ); rtems_cache_flush_entire_data_processor_set( set_size, cpu_set ); - rtems_cache_invalidate_entire_data_processor_set( set_size, cpu_set ); Yes, this one is problematic since it may kill your stack frame. rtems_cache_invalidate_entire_instruction(); - rtems_cache_invalidate_multiple_instruction_lines( 0, 10 ); + rtems_cache_invalidate_multiple_instruction_lines( &function_to_flush, + 4 /* arbitrary size */ ); } -- 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
Re: NFS nfsStBlksize and buffer overflows (NFS RPC: Timed out)
On Sep 10, 2014, at 09:53 , Peter Dufault wrote: > My client is having problems similar to that described here: > > http://www.rtems.org/rtems/maillistArchives/rtems-users/2011/march/msg00228.html > > I don't understand the details, or why one needs to limit the I/O size based > on the ethernet chip set, but I did verify that > cpukit/libfs/src/nfsclient/src/nfs.c does not have changes described in the > email and that changing nfs.c and then setting nfsStBlksize to 4096 before > calling nfsInit() works around the issue. This is on the phycore_mpc5554 BSP > with the smc9 ethernet chip. According to http://osr507doc.sco.com/en/PERFORM/NFS_tuning.html mounting the file system with a smaller rsize and wsize should address the problem: "If the network adapter on an NFS client cannot handle full frames and back-to-back packets, reduce the NFS read and write transfer sizes below the default of 8KB. To do this, specify the mount(ADM) option modifiersrsize and wsize for each mounted filesystem. These must be added to the options defined for the mntopts keyword in the file /etc/default/filesys (see filesys(F) for more information). The following is an example of such an entry reducing the read and write transfer sizes to 1KB (1024 bytes): " bdev=nfs_svr:/remote \ mountdir=/remote_mnt fstyp=NFS \ fsck=no fsckflags= \ init=yes initcmd="sleep 2" \ mntopts="bg,soft,rsize=1024,wsize=1024" \ rcmount=yes rcfsck=no mountflags=..." Note that nfs.c already sets the blocksize based on nfsStBlksize: /* Set to "preferred size" of this NFS client implementation */ buf->st_blksize = nfsStBlksize ? nfsStBlksize : fa->blocksize; The existing code limits I/O transfers to nfsStBlksize or NFS_MAXDATA and not the file system blocks size. Is there a way to get back to the buf->st_blksize given the "rtems_libio_t *iop" in the NFS I/O routines? Then the file system blocksize could be used as the limit. The above code-quote has an additional bug. nfsStBlksize has a default value of DEFAULT_NFS_ST_BLKSIZE which is NFS_MAXDATA which is 8K, so the default RTEMS behavior is that buf->st_blksize is always 8K even if fa->blocksize is 4K. So currently: - I/O is not limited to the file system block size; - The mounted block size is ignored and nfsStBlksize is used, which defaults to 4K. The first problem can be fixed by getting from the iop back to the block size and then limiting the transfer at that size. The second can be fixed by initializing nfsStBlksize to 0 instead of NFS_MAXDATA. Peter - Peter Dufault HD Associates, Inc. Software and System Engineering ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: Current Warnings Report
On 9/11/2014 5:21 AM, Sebastian Huber wrote: > The code is awful, but > > c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:48: warning: 'c' may be > used uninitialized in this function [-Wmaybe-uninitialized] > > is a false positive. On which target and GCC version do you get this warning? > $ grep "cpukit/libfs/src/dosfs/msdos_conv.c:452" log/* log/arm-rtl22xx.log:../../../../../../rtems/c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:48: warning: 'c' may be used uninitialized in this function [-Wm Interesting that it is only one BSP. What is different about the compilation flags for that BSP? And a quick check pointed out that it uses -mapcs-frame which no other ARM BSP appears to use. Could that be it? And asking here.. why does it use that? What is the impact of removing it? Sounds like a gcc PR but our fix may be to review the BSP CFLAGS and reduce them. It is a very long list and I question them. -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherr...@oarcorp.comOn-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available(256) 722-9985 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] bsps/arm: Delete obsolete compiler flags
These flags are obsolete with the EABI based ARM tool chain. --- c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg| 2 +- c/src/lib/libbsp/arm/csb337/make/custom/csb337.cfg| 2 +- c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg | 2 +- c/src/lib/libbsp/arm/gba/make/custom/gba.cfg | 3 +-- c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm1136jfs.cfg | 1 - c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm920.cfg | 3 +-- c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg| 2 +- c/src/lib/libbsp/arm/gumstix/make/custom/gumstix.cfg | 2 +- c/src/lib/libbsp/arm/nds/make/custom/nds.cfg | 3 +-- c/src/lib/libbsp/arm/rtl22xx/make/custom/rtl22xx.cfg | 2 +- c/src/lib/libbsp/arm/rtl22xx/make/custom/rtl22xx_t.cfg| 3 +-- c/src/lib/libbsp/arm/smdk2410/make/custom/smdk2410.cfg| 2 +- 12 files changed, 11 insertions(+), 16 deletions(-) diff --git a/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg b/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg index 5375948..3693770 100644 --- a/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg +++ b/c/src/lib/libbsp/arm/csb336/make/custom/csb336.cfg @@ -9,7 +9,7 @@ RTEMS_CPU_MODEL=mc9328mxl # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -CPU_CFLAGS = -mstructure-size-boundary=8 -mcpu=arm920 -mfpu=vfp -mfloat-abi=soft +CPU_CFLAGS = -mcpu=arm920 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g diff --git a/c/src/lib/libbsp/arm/csb337/make/custom/csb337.cfg b/c/src/lib/libbsp/arm/csb337/make/custom/csb337.cfg index 7575a83..29dfaf7 100644 --- a/c/src/lib/libbsp/arm/csb337/make/custom/csb337.cfg +++ b/c/src/lib/libbsp/arm/csb337/make/custom/csb337.cfg @@ -9,7 +9,7 @@ RTEMS_CPU_MODEL=at91rm9200 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -CPU_CFLAGS = -mstructure-size-boundary=8 -mcpu=arm920 -mfpu=vfp -mfloat-abi=soft +CPU_CFLAGS = -mcpu=arm920 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g diff --git a/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg b/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg index b2290ea..bc596aa 100644 --- a/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg +++ b/c/src/lib/libbsp/arm/edb7312/make/custom/edb7312.cfg @@ -10,7 +10,7 @@ RTEMS_CPU_MODEL=arm7tdmi # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. # -CPU_CFLAGS = -mstructure-size-boundary=8 -mcpu=$(RTEMS_CPU_MODEL) -mfpu=vfp -mfloat-abi=soft +CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g diff --git a/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg b/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg index 1ae2fb8..71ed375 100644 --- a/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg +++ b/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg @@ -10,8 +10,7 @@ RTEMS_CPU_MODEL=arm7tdmi # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. # -#CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) -mthumb -mthumb-interwork -msoft-float -mstructure-size-boundary=8 -CPU_CFLAGS = -mstructure-size-boundary=8 -mcpu=$(RTEMS_CPU_MODEL) -mfpu=vfp -mfloat-abi=soft +CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g diff --git a/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm1136jfs.cfg b/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm1136jfs.cfg index f5afd61..efa7a9e 100644 --- a/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm1136jfs.cfg +++ b/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm1136jfs.cfg @@ -9,7 +9,6 @@ RTEMS_CPU_MODEL=arm1136 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -# CPU_CFLAGS = -mcpu=arm920 -mstructure-size-boundary=8 CPU_CFLAGS = -mcpu=arm1136jf-s # optimize flag: typically -O2 diff --git a/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm920.cfg b/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm920.cfg index 297f7ee..8d30b17 100644 --- a/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm920.cfg +++ b/c/src/lib/libbsp/arm/gdbarmsim/make/custom/arm920.cfg @@ -9,8 +9,7 @@ RTEMS_CPU_MODEL=arm920 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -# CPU_CFLAGS = -mcpu=arm920 -mstructure-size-boundary=8 -CPU_CFLAGS = -mcpu=arm920 -mfloat-abi=soft -mfpu=vfp +CPU_CFLAGS = -mcpu=arm920 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g diff --git a/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg b/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg index a558362..be48c0d 100644 --- a/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg +++ b/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg @@ -10,7 +10,7 @@ RTEMS_CPU_MODEL=s3c2400 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize
Re: NFS nfsStBlksize and buffer overflows (NFS RPC: Timed out)
On Sep 11, 2014, at 07:47 , Peter Dufault wrote: > So currently: > - I/O is not limited to the file system block size; > - The mounted block size is ignored and nfsStBlksize is used, which defaults > to 4K. I meant 8K above. Anyway, looking through the code and the associated change log this behavior is intentional, apparently the newlib file system blocksize used to default to something small like 512 bytes and increasing the default reported size to 8K improved performance (no buffer cache on NFS). The value I'm getting now is a 4K file system blocksize on my NFS file system, I'm not sure if that's in newlib or somewhere in the NFS code, I don't see 4K there. Changing the code to go back to using the file system block size would hurt performance for everyone unless more work is done to get the default to 8K for NFS mounts. I'm just going to change the code to limit it to nfsStBlksize and put a comment about why it is the way it is. If someone understands the state of the file system code today and how it's changed over the years and wants to suggest a better fix I'll listen. So: - Default for nfsStBlksize will be 8192. - Default behavior is to ignore the file system block size (nfsStBlksize not 0), nfsStBlksize will be reported. - nfsStBlksize set to 0 will pay attention to the file system block size and limit I/O at that. I think that's the author's original intention. Peter - Peter Dufault HD Associates, Inc. Software and System Engineering ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
msdos_conv.c warning - Re: Current Warnings Report
Hi Replying to myself. I grabbed the preprocessed source and used shorter command lines on it. It is -Os vs -O2 on multiple but not all targets. [joel@rtbf64a libfs]$ arm-rtems4.11-gcc -Wall -O2 -c unused.c [joel@rtbf64a libfs]$ arm-rtems4.11-gcc -Wall -Os -c unused.c ../../../../../../rtems/c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c: In function 'msdos_filename_utf8_to_long_name_for_save': ../../../../../../rtems/c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:34: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized] if ( name_size == UTF16_NULL_SIZE && c == UTF16_NULL ) { ^ Sounds like a bug report in the making. Sebastian ..I filed a PR, can you add commentary on why this is a false positive? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63224 --joel On 9/11/2014 7:55 AM, Joel Sherrill wrote: > On 9/11/2014 5:21 AM, Sebastian Huber wrote: >> The code is awful, but >> >> c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:48: warning: 'c' may be >> used uninitialized in this function [-Wmaybe-uninitialized] >> >> is a false positive. On which target and GCC version do you get this >> warning? >> > $ grep "cpukit/libfs/src/dosfs/msdos_conv.c:452" log/* > log/arm-rtl22xx.log:../../../../../../rtems/c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:48: > warning: 'c' may be used uninitialized in this function [-Wm > > Interesting that it is only one BSP. > > What is different about the compilation flags for that BSP? And a quick > check > pointed out that it uses -mapcs-frame which no other ARM BSP appears to > use. Could that be it? > > And asking here.. why does it use that? What is the impact of removing it? > > Sounds like a gcc PR but our fix may be to review the BSP CFLAGS and reduce > them. It is a very long list and I question them. > -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherr...@oarcorp.comOn-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available(256) 722-9985 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 3/4] Revert: rtems-rfs-buffer.c: Correct printf() format specifiers to eliminate warnings
This may actually be a problem in inttypes.h. --- cpukit/libfs/src/rfs/rtems-rfs-buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpukit/libfs/src/rfs/rtems-rfs-buffer.c b/cpukit/libfs/src/rfs/rtems-rfs-buffer.c index 4192b21..3d89f5f 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-buffer.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-buffer.c @@ -52,12 +52,13 @@ rtems_rfs_scan_chain (rtems_chain_control* chain, buffer = (rtems_rfs_buffer*) node; if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS)) - printf ("%p ", buffer->user); + printf ("%" PRIuPTR " ", ((intptr_t) buffer->user)); if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block) { if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS)) -printf (": found block=%p\n", buffer->user); +printf (": found block=%" PRIuPTR "\n", +((intptr_t)(buffer->user))); (*count)--; rtems_chain_extract_unprotected (node); -- 1.9.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 1/4] Use correct prototype of benchmark_timer_read()
This change starts with removing the effectively empty file timerdrv.h. The prototypes for benchmark_timer_XXX() were in btimer.h which was not universally used. Thus every use of timerdrv.h had to be changed to btimer.h. Then the prototypes for benchmark_timer_read() had to be adjusted to return benchmark_timer_t rather than int or uint32_t. I took this opportunity to also correct the file headers to separate the copyright from the file description comments which is needed to ensure the copyright isn't propagated into Doxygen output. --- c/src/lib/libbsp/arm/edb7312/timer/timer.c | 2 +- c/src/lib/libbsp/arm/gba/timer/timer.c | 2 +- .../arm/lpc176x/benchmark_timer/benchmark_timer.c | 4 +-- c/src/lib/libbsp/arm/lpc24xx/misc/timer.c | 3 +- c/src/lib/libbsp/arm/lpc32xx/misc/timer.c | 3 +- c/src/lib/libbsp/arm/raspberrypi/misc/timer.c | 4 +-- .../lib/libbsp/arm/tms570/clock/benchmark_timer.c | 3 +- c/src/lib/libbsp/i386/pc386/timer/timer.c | 6 ++-- .../lib/libbsp/lm32/shared/milkymist_timer/timer.c | 2 +- c/src/lib/libbsp/lm32/shared/timer/timer.c | 2 +- c/src/lib/libbsp/m32c/m32cbsp/timer/timer.c| 2 +- c/src/lib/libbsp/m68k/gen68302/timer/timer.c | 2 +- c/src/lib/libbsp/m68k/idp/timer/timer.c| 2 +- c/src/lib/libbsp/m68k/mcf52235/timer/timer.c | 2 +- c/src/lib/libbsp/m68k/mcf5225x/timer/timer.c | 2 +- c/src/lib/libbsp/m68k/mcf5329/timer/timer.c| 2 +- c/src/lib/libbsp/m68k/mrm332/timer/timer.c | 2 +- c/src/lib/libbsp/m68k/mvme136/timer/timer.c| 2 +- c/src/lib/libbsp/m68k/mvme147/timer/timer.c| 2 +- c/src/lib/libbsp/m68k/mvme162/timer/timer.c| 2 +- c/src/lib/libbsp/m68k/mvme167/timer/timer.c| 34 -- c/src/lib/libbsp/m68k/mvme167/timer/timerisr.S | 13 - c/src/lib/libbsp/m68k/ods68302/timer/timer.c | 2 +- c/src/lib/libbsp/mips/csb350/timer/timer.c | 2 +- c/src/lib/libbsp/mips/genmongoosev/timer/timer.c | 2 +- c/src/lib/libbsp/mips/jmr3904/timer/timer.c| 2 +- c/src/lib/libbsp/nios2/nios2_iss/timer/timer.c | 2 +- c/src/lib/libbsp/no_cpu/no_bsp/timer/timer.c | 2 +- c/src/lib/libbsp/no_cpu/no_bsp/timer/timerisr.c| 14 + c/src/lib/libbsp/or1k/or1ksim/timer/timer.c| 2 +- c/src/lib/libbsp/powerpc/score603e/timer/timer.c | 2 +- c/src/lib/libbsp/powerpc/tqm8xx/timer/timer.c | 2 +- c/src/lib/libbsp/shared/timerstub.c| 2 +- c/src/lib/libbsp/sparc/erc32/timer/timer.c | 2 +- c/src/lib/libbsp/sparc/leon2/timer/timer.c | 2 +- c/src/lib/libbsp/sparc/leon3/timer/timer.c | 2 +- c/src/lib/libcpu/arm/at91rm9200/timer/timer.c | 25 +++- c/src/lib/libcpu/arm/lpc22xx/timer/timer.c | 34 ++ c/src/lib/libcpu/arm/mc9328mxl/timer/timer.c | 23 ++- c/src/lib/libcpu/arm/pxa255/timer/timer.c | 25 +++- c/src/lib/libcpu/arm/s3c24xx/timer/timer.c | 31 +--- c/src/lib/libcpu/bfin/timer/timer.c| 22 -- c/src/lib/libcpu/m68k/mcf5206/timer/timer.c| 12 +--- c/src/lib/libcpu/m68k/mcf5206/timer/timerisr.S | 11 --- c/src/lib/libcpu/m68k/mcf5272/timer/timer.c| 11 --- c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S | 12 c/src/lib/libcpu/mips/timer/timer.c| 30 +++ c/src/lib/libcpu/powerpc/mpc505/timer/timer.c | 15 ++ c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c | 20 ++--- c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c | 17 ++- c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c | 19 ++-- c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c | 18 ++-- c/src/lib/libcpu/powerpc/ppc403/timer/timer.c | 16 +- c/src/lib/libcpu/sh/sh7032/timer/timer.c | 18 +--- c/src/lib/libcpu/sh/sh7045/timer/timer.c | 18 +--- c/src/lib/libcpu/sh/sh7750/timer/timer.c | 18 +--- cpukit/libcsupport/Makefile.am | 1 - cpukit/libcsupport/include/timerdrv.h | 34 -- cpukit/libcsupport/preinstall.am | 4 --- cpukit/sapi/include/confdefs.h | 2 +- doc/bsp_howto/timer.t | 2 +- testsuites/psxtmtests/psxtmbarrier01/init.c| 2 +- testsuites/psxtmtests/psxtmbarrier02/init.c| 2 +- testsuites/psxtmtests/psxtmbarrier03/init.c| 2 +- testsuites/psxtmtests/psxtmbarrier04/init.c| 2 +- testsuites/psxtmtests/psxtmcond01/init.c | 2 +- testsuites/psxtmtests/psxtmcond02/init.c | 2 +- testsuites/psxtmtests/psxtmcond03/init.c | 2 +- testsuites/psxtmtests/psxtmcond04/init.c | 2 +- testsuites/psxtmtests/psxtmcond05/init
[PATCH 4/4] tod.h -> libcsupport like other driver and helper prototype files
This rippled into the handful of files that should have been using . --- c/src/lib/libbsp/m68k/mvme162/tod/tod.c | 2 +- c/src/lib/libbsp/shared/tod.c | 1 + c/src/lib/libbsp/shared/tod.h | 71 - c/src/lib/libcpu/bfin/clock/rtc.c | 2 +- cpukit/libcsupport/Makefile.am | 1 + cpukit/libcsupport/include/rtems/tod.h | 70 cpukit/libcsupport/preinstall.am| 4 ++ 7 files changed, 78 insertions(+), 73 deletions(-) delete mode 100644 c/src/lib/libbsp/shared/tod.h create mode 100644 cpukit/libcsupport/include/rtems/tod.h diff --git a/c/src/lib/libbsp/m68k/mvme162/tod/tod.c b/c/src/lib/libbsp/m68k/mvme162/tod/tod.c index 58e964f..3475979 100644 --- a/c/src/lib/libbsp/m68k/mvme162/tod/tod.c +++ b/c/src/lib/libbsp/m68k/mvme162/tod/tod.c @@ -16,7 +16,7 @@ */ #include -#include +#include #definetod ((volatile unsigned char *)0xfffc1ff8) diff --git a/c/src/lib/libbsp/shared/tod.c b/c/src/lib/libbsp/shared/tod.c index e074569..64007d6 100644 --- a/c/src/lib/libbsp/shared/tod.c +++ b/c/src/lib/libbsp/shared/tod.c @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/c/src/lib/libbsp/shared/tod.h b/c/src/lib/libbsp/shared/tod.h deleted file mode 100644 index 605cef2..000 --- a/c/src/lib/libbsp/shared/tod.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * - * @ingroup shared_tod - * - * @brief Real Time Clock (MK48T08) for RTEMS on Score603e - */ - -/* - * - * Based on MVME162 TOD by: - *COPYRIGHT (C) 1997 - *by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN - *ALL RIGHTS RESERVED - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#ifndef TOD_H -#define TOD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup shared_tod RTC - * - * @ingroup bsp_shared - * - * @brief Set the RTC - */ - -int setRealTime( - const rtems_time_of_day *tod -); - -/* - * Get the time from the RTC. - */ - -void getRealTime( - rtems_time_of_day *tod -); - -/* - * Read real time from RTC and set it to RTEMS' clock manager - */ - -void setRealTimeToRTEMS(void); - -/* - * Read time from RTEMS' clock manager and set it to RTC - */ - -void setRealTimeFromRTEMS(void); - -/* - * Return the difference between RTC and RTEMS' clock manager time in minutes. - * If the difference is greater than 1 day, this returns . - */ - -int checkRealTime(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/c/src/lib/libcpu/bfin/clock/rtc.c b/c/src/lib/libcpu/bfin/clock/rtc.c index 6e57cb2..17f2cf7 100644 --- a/c/src/lib/libcpu/bfin/clock/rtc.c +++ b/c/src/lib/libcpu/bfin/clock/rtc.c @@ -11,7 +11,7 @@ #include -#include "tod.h" +#include #include #include #include diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index 835f96e..d39f8f9 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -11,6 +11,7 @@ include_rtems_HEADERS += include/rtems/framebuffer.h include_rtems_HEADERS += include/iosupp.h include_rtems_HEADERS += include/ringbuf.h include_rtems_HEADERS += include/rtc.h +include_rtems_HEADERS += include/rtems/tod.h include_rtems_HEADERS += include/spurious.h include_rtems_HEADERS += include/vmeintr.h diff --git a/cpukit/libcsupport/include/rtems/tod.h b/cpukit/libcsupport/include/rtems/tod.h new file mode 100644 index 000..971e854 --- /dev/null +++ b/cpukit/libcsupport/include/rtems/tod.h @@ -0,0 +1,70 @@ +/** + * @file + * + * @ingroup shared_tod + * + * @brief Real Time Clock Time of Day API Definition + */ + +/* + * + * Based on MVME162 TOD by: + *COPYRIGHT (C) 1997 + *by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN + *ALL RIGHTS RESERVED + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#ifndef TOD_H +#define TOD_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup shared_tod RTC + * + * @ingroup bsp_shared + * + * @brief Set the RTC + */ +int setRealTime( + const rtems_time_of_day *tod +); + +/* + * Get the time from the RTC. + */ + +void getRealTime( + rtems_time_of_day *tod +); + +/* + * Read real time from RTC and set it to RTEMS' clock manager + */ + +void setRealTimeToRTEMS(void); + +/* + * Read time from RTEMS' clock manager and set it to RTC + */ + +void setRealTimeFromRTEMS(void); + +/* + * Return the difference between RTC and RTEMS' clock manager time in minutes. + * If the difference is greater than 1 day, this returns . + */ + +int checkRealTime(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/cpukit/libcsupport/preinstall.am b/cpukit/libcsupport/preinstall.am index c4286ba..e56d946 100644 --- a/cpukit/libcsupport/
[PATCH] rtems-rfs-buffer.c: Correct printf() format specifiers to eliminate warnings
--- cpukit/libfs/src/rfs/rtems-rfs-buffer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpukit/libfs/src/rfs/rtems-rfs-buffer.c b/cpukit/libfs/src/rfs/rtems-rfs-buffer.c index 3d89f5f..4192b21 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-buffer.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-buffer.c @@ -52,13 +52,12 @@ rtems_rfs_scan_chain (rtems_chain_control* chain, buffer = (rtems_rfs_buffer*) node; if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS)) - printf ("%" PRIuPTR " ", ((intptr_t) buffer->user)); + printf ("%p ", buffer->user); if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block) { if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS)) -printf (": found block=%" PRIuPTR "\n", -((intptr_t)(buffer->user))); +printf (": found block=%p\n", buffer->user); (*count)--; rtems_chain_extract_unprotected (node); -- 1.9.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 2/4] pc386/.../bsp.h: Do not include crt.h
crt.h defines such lovely constants as "RED" and "GREEN" which have a nasty habit of conflicting with non-BSP code. There is no reason to include this private .h from bsp.h and pollute the namespace for applications. --- c/src/lib/libbsp/i386/pc386/include/bsp.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h index cb9555a..ef16b4a 100644 --- a/c/src/lib/libbsp/i386/pc386/include/bsp.h +++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h @@ -113,12 +113,6 @@ extern int rtems_3c509_driver_attach(struct rtems_bsdnet_ifconfig *config); +--*/ /*-+ -| Video (console) related constants. -+--*/ - -#include - -/*-+ | Constants relating to the 8254 (or 8253) programmable interval timers. +--*/ #define IO_TIMER1 0x40 -- 1.9.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 3/4] Revert: rtems-rfs-buffer.c: Correct printf() format specifiers to eliminate warnings
On 11/09/14 15:28, Joel Sherrill wrote: + printf ("%" PRIuPTR " ", ((intptr_t) buffer->user)); Typo, PRIuPTR vs. PRIiPTR? -- 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
Known (So Far) False Positive Warnings
Hi Since Sebastian investigated the msdos_conv.c and says it is a false positive, I wanted to pass along that that makes the third set of warnings that are upstream issues. msdos_conv.c - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63224 This one is new. No feedback. mathf - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35649 This is a false positive on floating point printf() format string checking on targets where sizeof(float) == sizeof(double). Should be fixed in 4.9. uintptr_t printf format warnings - Newlib inttypes.h bug which has a solution proposed but needs to be implemented. As I said earlier, please help look at the warnings and help try to resolve them. Some of these are really interesting and turn out to be things that impact the larger FOSS community. Newlib is also used by Cygwin for example. Thanks. -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherr...@oarcorp.comOn-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available(256) 722-9985 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
In nfs_dir_read() count used before and after limiting?
In nfs_dir_read() I see: /* align + round down the buffer */ count &= ~ (DIRENT_HEADER_SIZE - 1); di->len = count; Then later: if (count > NFS_MAXDATA) count = NFS_MAXDATA; di->readdirargs.count = count; Can someone who understands this comment on it? Peter - Peter Dufault HD Associates, Inc. Software and System Engineering ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: In nfs_dir_read() count used before and after limiting?
On 11/09/14 15:58, Peter Dufault wrote: In nfs_dir_read() I see: /* align + round down the buffer */ count &= ~ (DIRENT_HEADER_SIZE - 1); di->len = count; Then later: if (count > NFS_MAXDATA) count = NFS_MAXDATA; di->readdirargs.count = count; Can someone who understands this comment on it? Sorry, Peter. I don't have time to look at this at the moment. The NFS code is hard to understand. Since it works for me I have no urgent need to spend time on this. -- 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-V2] smptests/smpcache01: Remove invalidation of data cache lines from test
Invalidation of entire data cache might cause data written to the stack to get lost. --- testsuites/smptests/smpcache01/init.c | 47 +++ testsuites/smptests/smpcache01/smpcache01.doc | 1 - testsuites/smptests/smpcache01/smpcache01.scn | 18 -- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/testsuites/smptests/smpcache01/init.c b/testsuites/smptests/smpcache01/init.c index dd2f9f1..39808b3 100644 --- a/testsuites/smptests/smpcache01/init.c +++ b/testsuites/smptests/smpcache01/init.c @@ -20,6 +20,8 @@ const char rtems_test_name[] = "SMPCACHE 1"; +CPU_STRUCTURE_ALIGNMENT static int data_to_flush[1024]; + #define CPU_COUNT 32 #define WORKER_PRIORITY 100 @@ -44,6 +46,11 @@ static test_context ctx = { .barrier = SMP_BARRIER_CONTROL_INITIALIZER, }; +static void function_to_flush( void ) +{ + /* Does nothing. Used to give a pointer to instruction address space. */ +} + static void test_cache_message( const void *d_addr, size_t n_bytes ) { rtems_test_assert(n_bytes == 123); @@ -52,22 +59,22 @@ static void test_cache_message( const void *d_addr, size_t n_bytes ) ctx.count[rtems_get_current_processor()]++; } -static void all_cache_manager_smp_functions( size_t set_size, +static void cache_manager_smp_functions( size_t set_size, cpu_set_t *cpu_set ) { - rtems_cache_flush_multiple_data_lines_processor_set( 0, 10, set_size, - cpu_set ); - rtems_cache_invalidate_multiple_data_lines_processor_set( 0, 10, set_size, - cpu_set ); + rtems_cache_flush_multiple_data_lines_processor_set( &data_to_flush, + sizeof(data_to_flush), set_size, cpu_set ); + rtems_cache_invalidate_multiple_data_lines_processor_set( &data_to_flush, + sizeof(data_to_flush), set_size, cpu_set ); rtems_cache_flush_entire_data_processor_set( set_size, cpu_set ); - rtems_cache_invalidate_entire_data_processor_set( set_size, cpu_set ); rtems_cache_invalidate_entire_instruction(); - rtems_cache_invalidate_multiple_instruction_lines( 0, 10 ); + rtems_cache_invalidate_multiple_instruction_lines( &function_to_flush, + 4 /* arbitrary size */ ); } static void standard_funcs_test( size_t set_size, cpu_set_t *cpu_set ) { - all_cache_manager_smp_functions( set_size, cpu_set ); + cache_manager_smp_functions( set_size, cpu_set ); } static void standard_funcs_isrdisabled_test( size_t set_size, @@ -79,7 +86,7 @@ static void standard_funcs_isrdisabled_test( size_t set_size, _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); - all_cache_manager_smp_functions( set_size, cpu_set ); + cache_manager_smp_functions( set_size, cpu_set ); _ISR_Enable_without_giant( isr_level ); } @@ -92,7 +99,7 @@ static void standard_funcs_giant_taken_test( size_t set_size, _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() ); - all_cache_manager_smp_functions( set_size, cpu_set ); + cache_manager_smp_functions( set_size, cpu_set ); if ( rtems_get_current_processor() == 0) _Giant_Release(); @@ -169,23 +176,23 @@ static void all_tests( void ) /* Send message to all available CPUs */ CPU_FILL_S( set_size, cpu_set ); - /* Call all SMP cache manager functions */ - cmlog( "Calling all standard SMP cache functions\n" ); + /* Call SMP cache manager functions */ + cmlog( "Calling standard SMP cache functions. " ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); standard_funcs_test( set_size, cpu_set ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); cmlog( "Done!\n"); - /* Call all SMP cache manager functions with ISR disabled */ - cmlog( "Calling all standard SMP cache functions. With ISR disabled\n" ); + /* Call SMP cache manager functions with ISR disabled */ + cmlog( "Calling standard SMP cache functions with ISR disabled. " ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); standard_funcs_isrdisabled_test( set_size, cpu_set, &bs ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); cmlog( "Done!\n" ); - /* Call all SMP cache manager functions with core 0 holding the giant lock */ - cmlog( "Calling all standard SMP cache functions. With CPU0 holding " - "the giant lock\n" ); + /* Call SMP cache manager functions with core 0 holding the giant lock */ + cmlog( "Calling standard SMP cache functions with CPU0 holding " + "the giant lock. " ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); standard_funcs_giant_taken_test( set_size, cpu_set, &bs ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); @@ -194,7 +201,7 @@ static void all_tests( void ) /* Call a test function using SMP cache manager and verify that all * cores invoke the function */ cmlog( "Calling a test function using the SMP cache manager to " - "verify that all CPUs receive the SMP message\n" ); + "verify that all CPUs receive the SMP message. " ); _SMP_barrier_Wait( &ctx.barrier, &bs, cpu_count ); test_func_test( set_size, cpu_set,
MirBSD KORN Shell
Hi, I had a play with the MirBSD KORN Shell (https://www.mirbsd.org/main.htm) on RTEMS and have something running. The source is here: http://www.rtems.org/ftp/pub/rtems/people/chrisj/mksh/mksh-R50-rtems.tar.xz It is a waf build so using something like: $ waf configure \ --rtems-tools=$HOME/development/rtems/4.11 \ --rtems=$HOME/development/rtems/bsps/4.11 \ --rtems-bsp=sparc/sis $ waf with a git 4.11 RTEMS kernel built and installed should work. A run on the sparc/sis bsp is: $ sparc-rtems4.11-run build/sparc-rtems4.11-sis/sh.exe /bin/sh: No controlling tty: open /dev/tty: No such file or directory # echo $KSH_VERSION @(#)MIRBSD KSH R50 2014/06/29 # task ID NAME PRI STATE MODES EVENTSWAITID WAITARG NOTES - 0a010001 UI1 1 READY P:T:nANONE # ^D I have hacked the code so the RTEMS shell commands are builtins. Not everything works, eg ls seems to end up in a heap corruption, and pipes need help from us, eg: $ sparc-rtems4.11-run build/sparc-rtems4.11-sis/sh.exe /bin/sh: No controlling tty: open /dev/tty: No such file or directory # arrname[1]=4 # print ${arraname[1]} # print ${arrname[*]} 4 # print ${#arrname[*]} 1 # x=$(echo "Me") /bin/sh: can't create pipe - try again The shell might be usable in RTEMS but it would need to work to clean up the global symbols and global data to it can be RTEMS multi-user and multi-threaded. Having it would give us a nice way to provide proven shell scripting. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel