Xilinx Zynq A8 Qemu BSP with libbsd.
Hi, I have just pushed a change to libbsd that disabled the IP header hardware checksum for the Cadence driver which is used on the Xilinx Zynq. If you are using the RSB qemu this tests should run. There is known issue with some tests where the Init task delete's itself and ends qemu. I am not sure why this is happening. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] rtems: rtems_interrupt_enable/flash/disable()
On Fri, Jun 19, 2015 at 2:13 AM, Sebastian Huber wrote: > > > On 12/06/15 22:26, Pavel Pisa wrote: >> >> Hello Sebastian and others, >> >> On Friday 12 of June 2015 17:47:42 Sebastian Huber wrote: >>> >>> - Gedare Bloom schrieb: I see. It provides the mutual exclusion for (SMP) applications that rely on interrupt_disable/enable locks? I guess we can never get rid of it as long as we allow for users to call isr_disable/enable? >>> >>> Yes, an alternative is to remove the >>> rtems_interrupt_disable/enable/flash() >>> on SMP configurations. A pure interrupt disable is not really helpful. >> >> this is exactly same debate as has been solved in Linux kernel >> lists more years ago. > > > It seems that every problem was solved by Linux at some time. > > >> The Linux kernel community resolution was >> to forbid control global interrupts disable from drivers >> and all kernel code. Only option is to proceed with local >> (on singel CPU) disabel operations >> >>local_irq_save(flags) >>local_irq_disable() >> >>local_irq_restore(flags); >> >> The original function names for global irq disable and enable have >> been kept on single CPU configurations for some transition period. >> Then they have been removed without replacement. >> >> Local IRQ disable is good mostly to build other synchronization >> primitives. At the level of drivers and higher level code >> they are not of much use, because there is no guarantee that code >> manipulating same data is not run on the other CPU. >> So at the end allmost all sites solely combine disable of interrupt >> together with spinlock >> >> macro to store flags >>spin_lock_irqsave(lock, flags) >> function >>spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) >> >> These lock do not deadlock even when called from interrupts, >> because any lock of this kind could be taken when IRQ >> is enabled. >> >> As for RTEMS, I would suggest to follow the same road. >> That is to define >> >>rtems_local_interrupt_disable/enable/flash() >> >> and for compatibility define rtems_interrupt_disable/enable/flash() >> to use these on UP targets. Fail the build of applications directly >> manipulating by IRQ state on the SMP targets. There are not much SMP >> applications and targets yet runnuning on RTEMS. So the impact is not >> so wide for start and as the applications are transformed to use >> irqsave spinlocks when the are moved to SMP environment. If the global >> IRQ disable is supported then applications do not stop to use it >> and it would lead to need keep support of this feature for too long. >> Even if you decide that providing global IRQ disable is required >> for now it should be defined with deprecated attribute to be extremely >> noisy. > > > I am fine with this change to use > rtems_local_interrupt_disable/enable/flash(). We should decide what to do > before the release. > I prefer this rather than the big hammer that might encourage users to develop broken SMP apps on 4.11. If you have time to get it implemented before the release, great, but if not, we should not support the isr_disable/enable for user apps on SMP. -Gedare > -- > 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 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: Xilinx Zynq A8 Qemu BSP with libbsd.
On June 19, 2015 2:44:23 AM CDT, Chris Johns wrote: >Hi, > >I have just pushed a change to libbsd that disabled the IP header >hardware checksum for the Cadence driver which is used on the Xilinx >Zynq. Is this a bug on real hardware as well? Or specific to qemu? If broken in qemu, works this be better with a kennel hint until fixed in qemu. >If you are using the RSB qemu this tests should run. > >There is known issue with some tests where the Init task delete's >itself >and ends qemu. I am not sure why this is happening. That is weird. >Chris >___ >devel mailing list >devel@rtems.org >http://lists.rtems.org/mailman/listinfo/devel --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: RTEMS for ARM Cortex-M1 ?
On Tue, Feb 17, 2015 at 10:53 AM, Daniel Gutson wrote: > > El 14/02/2015 10:29, "Sebastian Huber" > escribió: >> >> On 14/02/15 14:27, Sebastian Huber wrote: >>> >>> On 14/02/15 12:48, Daniel Gutson wrote: We're developing support for the cortex M 4 so we can let you know once we commit the patches so you can have a starting point in case an emulator is also needed. >>> >>> >>> The Cortex-M4 is already supported including the FPU (e.g. LPC4088). >>> >> >> Hm, I should read more carefully. You added a Cortex-M4 support for Qemu >> including the FPU? > > We are currently working on it, but we're focused in the DSP part of the > instruction set rather than the FP part. FWIW, it has been committed: (both patches are required) http://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg03724.html http://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg04234.html >> >> -- >> 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. >> -- Daniel F. Gutson Chief Engineering Officer, SPD San Lorenzo 47, 3rd Floor, Office 5 Córdoba, Argentina Phone: +54 351 4217888 / +54 351 4218211 Skype:dgutson LinkedIn: http://ar.linkedin.com/in/danielgutson ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
multiple definition of __getreent
Hi , I am working on porting the monkey http server to rtems. I am working on the bsp: xilinx_zynq_a9_qemu , target: arm-rtems4.11. There are two libraries that I am supposed to link to create my final executable, one is libbsd.a and the other is libc. libbsd.a links alright, but whenever I try to link libc to create the final executable , I get an error: /home/raaj/development/rtems/4.11/bsps/arm-rtems4.11/xilinx_zynq_a9_qemu/lib/librtemscpu.a(default-configuration.o): In function `__getreent': /home/raaj/development/rtems/xilinx_zynq_a9_qemu/arm-rtems4.11/c/xilinx_zynq_a9_qemu/cpukit/libmisc/../../cpukit/../../../xilinx_zynq_a9_qemu/lib/include/rtems/confdefs.h:2420: multiple definition of `__getreent' /home/raaj/development/rtems/4.11/tools/lib/gcc/arm-rtems4.11/4.9.2/../../../../arm-rtems4.11/lib/thumb/armv7-a/neon/hard/libc.a(lib_a-getreent.o): /home/raaj/development/rtems/rtems-source-builder/rtems/build/arm-rtems4.11-gcc-4.9.2-newlib-2.2.0.20150423-x86_64-linux-gnu-1/build/arm-rtems4.11/thumb/armv7-a/neon/hard/newlib/libc/reent/../../../../../../../../../gcc-4.9.2/newlib/libc/reent/getreent.c:13: first defined here The CFLAGS I am using to compile are : -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -O0 -g -qrtems -B/home/raaj/development/rtems/4.11/bsps/arm-rtems4.11/lib -B/home/raaj/development/rtems/4.11/bsps/arm-rtems4.11/xilinx_zynq_a9_qemu/lib/ --specs bsp_specs note: I require libc for three function , initgroups, timegm, and sendfile. note: I am working on a cmake build system If the information given here is insufficient, kindly ask. Thanks and regards, Sujay Raj ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] rtems: Add rtems_interrupt_local_disable|enable()
Add rtems_interrupt_local_disable|enable() as suggested by Pavel Pisa to emphasize that interrupts are only disabled on the current processor. Do not define the rtems_interrupt_disable|enable|flash() macros and functions on SMP configurations since they don't ensure system wide mutual exclusion. --- c/src/lib/libbsp/shared/bootcard.c | 2 +- cpukit/rtems/include/rtems/rtems/intr.h | 38 cpukit/rtems/src/intrbody.c | 4 + doc/user/intr.t | 94 ++ testsuites/libtests/heapwalk/init.c | 4 +- testsuites/samples/Makefile.am | 3 + testsuites/samples/configure.ac | 2 + testsuites/sptests/sp37/init.c | 164 ++-- testsuites/sptests/sp40/init.c | 6 +- testsuites/tmtests/tm26/task1.c | 9 +- 10 files changed, 244 insertions(+), 82 deletions(-) diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index 4f91aa9..0ee5e12 100644 --- a/c/src/lib/libbsp/shared/bootcard.c +++ b/c/src/lib/libbsp/shared/bootcard.c @@ -72,7 +72,7 @@ void boot_card( * Make sure interrupts are disabled. */ (void) bsp_isr_level; - rtems_interrupt_disable( bsp_isr_level ); + rtems_interrupt_local_disable( bsp_isr_level ); bsp_boot_cmdline = cmdline; diff --git a/cpukit/rtems/include/rtems/rtems/intr.h b/cpukit/rtems/include/rtems/rtems/intr.h index 259120f..d084959 100644 --- a/cpukit/rtems/include/rtems/rtems/intr.h +++ b/cpukit/rtems/include/rtems/rtems/intr.h @@ -89,10 +89,15 @@ rtems_status_code rtems_interrupt_catch( ); #endif +#if !defined(RTEMS_SMP) + /** * @brief Disable RTEMS Interrupt * * @note The interrupt level shall be of type @ref rtems_interrupt_level. + * + * This macro is only available on uni-processor configurations. The macro + * rtems_interrupt_local_disable() is available on all configurations. */ #define rtems_interrupt_disable( _isr_cookie ) \ _ISR_Disable(_isr_cookie) @@ -101,6 +106,9 @@ rtems_status_code rtems_interrupt_catch( * @brief Enable RTEMS Interrupt * * @note The interrupt level shall be of type @ref rtems_interrupt_level. + * + * This macro is only available on uni-processor configurations. The macro + * rtems_interrupt_local_enable() is available on all configurations. */ #define rtems_interrupt_enable( _isr_cookie ) \ _ISR_Enable(_isr_cookie) @@ -109,10 +117,40 @@ rtems_status_code rtems_interrupt_catch( * @brief Flash RTEMS Interrupt * * @note The interrupt level shall be of type @ref rtems_interrupt_level. + * + * This macro is only available on uni-processor configurations. The macro + * rtems_interrupt_local_disable() and rtems_interrupt_local_enable() is + * available on all configurations. */ #define rtems_interrupt_flash( _isr_cookie ) \ _ISR_Flash(_isr_cookie) +#endif /* RTEMS_SMP */ + +/** + * @brief This macro disables the interrupts on the current processor. + * + * On SMP configurations this will not ensure system wide mutual exclusion. + * Use interrupt locks instead. + * + * @param[in] _isr_cookie The previous interrupt level is returned. The type + * of this variable must be rtems_interrupt_level. + * + * @see rtems_interrupt_local_enable(). + */ +#define rtems_interrupt_local_disable( _isr_cookie ) \ + _ISR_Disable_without_giant( _isr_cookie ) + +/** + * @brief This macro restores the previous interrupt level on the current + * processor. + * + * @param[in] _isr_cookie The previous interrupt level returned by + * rtems_interrupt_local_disable(). + */ +#define rtems_interrupt_local_enable( _isr_cookie ) \ + _ISR_Enable_without_giant( _isr_cookie ) + /** * @brief RTEMS Interrupt Is in Progress * diff --git a/cpukit/rtems/src/intrbody.c b/cpukit/rtems/src/intrbody.c index 6b37eb2..deb0dc0 100644 --- a/cpukit/rtems/src/intrbody.c +++ b/cpukit/rtems/src/intrbody.c @@ -23,6 +23,8 @@ #include #include +#if !defined(RTEMS_SMP) + /* * Undefine all of these is normally a macro and we want a real body in * the library for other language bindings. @@ -70,3 +72,5 @@ bool rtems_interrupt_is_in_progress( void ) { return _ISR_Is_in_progress(); } + +#endif /* RTEMS_SMP */ diff --git a/doc/user/intr.t b/doc/user/intr.t index 6cb6a26..cf106f3 100644 --- a/doc/user/intr.t +++ b/doc/user/intr.t @@ -21,6 +21,8 @@ directive: @item @code{@value{DIRPREFIX}interrupt_disable} - Disable Interrupts @item @code{@value{DIRPREFIX}interrupt_enable} - Enable Interrupts @item @code{@value{DIRPREFIX}interrupt_flash} - Flash Interrupt +@item @code{@value{DIRPREFIX}interrupt_local_disable} - Disable Interrupts on Current Processor +@item @code{@value{DIRPREFIX}interrupt_local_enable} - Enable Interrupts on Current Processor @item @code{@value{DIRPREFIX}interrupt_lock_initialize} - Initialize an ISR Lock @item @code{@value{DIRPREFIX}interrupt_lock_acquire} - Acquire an ISR Lock @item @code{@value{DIRPREFIX}interrupt