summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadyield.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-05-12score: Use thread state lock for current stateSebastian Huber1-2/+2
In addition protect scheduler of thread by thread state lock. Enables use of scheduler per-instance locks. Update #2555.
2015-03-24score: Add scheduler acquire/releaseSebastian Huber1-3/+3
This is currently a global lock for all scheduler instances. It should get replaced with one lock per scheduler instance in the future. Update #2273.
2014-06-23score: Remove scheduler parameter from most opsSebastian Huber1-1/+1
Remove the scheduler parameter from most high level scheduler operations like - _Scheduler_Block(), - _Scheduler_Unblock(), - _Scheduler_Change_priority(), - _Scheduler_Update_priority(), - _Scheduler_Release_job(), and - _Scheduler_Yield(). This simplifies the scheduler operations usage.
2014-06-12score: PR2181: Add _Thread_Yield()Sebastian Huber1-13/+20
The _Scheduler_Yield() was called by the executing thread with thread dispatching disabled and interrupts enabled. The rtems_task_suspend() is explicitly allowed in ISRs: http://rtems.org/onlinedocs/doc-current/share/rtems/html/c_user/Interrupt-Manager-Directives-Allowed-from-an-ISR.html#Interrupt-Manager-Directives-Allowed-from-an-ISR Unlike the other scheduler operations the locking was performed inside the operation. This lead to the following race condition. Suppose a ISR suspends the executing thread right before the yield scheduler operation. Now the executing thread is not longer in the set of ready threads. The typical scheduler operations did not check the thread state and will now extract the thread again and enqueue it. This corrupted data structures. Add _Thread_Yield() and do the scheduler yield operation with interrupts disabled. This has a negligible effect on the interrupt latency.
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2014-02-24sparc: Fix CPU counter supportSebastian Huber1-2/+13
The SPARC processors supported by RTEMS have no built-in CPU counter support. We have to use some hardware counter module for this purpose. The BSP must provide a 32-bit register which contains the current CPU counter value and a function for the difference calculation. It can use for example the GPTIMER instance used for the clock driver.
2014-02-14score: Add CPU counter supportSebastian Huber1-8/+7
Add a CPU counter interface to allow access to a free-running counter. It is useful to measure short time intervals. This can be used for example to enable profiling of critical low-level functions. Add two busy wait functions rtems_counter_delay_ticks() and rtems_counter_delay_nanoseconds() implemented via the CPU counter.
2012-11-27score: Add CPU_Exception_frameSebastian Huber1-4/+4
Add CPU port type CPU_Exception_frame and function _CPU_Exception_frame_print(). The CPU ports of avr, bfin, h8300, lm32, m32c, m32r, m68k, nios2, sh, sparc64, and v850 use an empty default implementation of _CPU_Exception_frame_print(). Add rtems_exception_frame and rtems_exception_frame_print(). Add RTEMS_FATAL_SOURCE_EXCEPTION for CPU exceptions. Use rtems_fatal() with source RTEMS_FATAL_SOURCE_EXCEPTION in CPU ports of i386, powerpc, and sparc for unexpected exceptions. Add third parameter to RTEMS_BSP_CLEANUP_OPTIONS() which controls the BSP_PRINT_EXCEPTION_CONTEXT define used in the default bsp_fatal_extension(). Add test sptests/spfatal26.
2012-08-20libcsupport: Add and use rtems_putc()Sebastian Huber1-5/+3
This reduces code size and provides a function similar to fputc().
2012-03-13Filesystem: New defaults fsync_h and fdatasync_hSebastian Huber1-2/+2
New defaults rtems_filesystem_default_fsync_or_fdatasync() and rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and fdatasync_h. The rtems_filesystem_default_fsync_or_fdatasync() sets now errno to EINVAL according to POSIX.
2012-03-13Filesystem: Reference counting for locationsSebastian Huber1-10/+6
o A new data structure rtems_filesystem_global_location_t was introduced to be used for o the mount point location in the mount table entry, o the file system root location in the mount table entry, o the root directory location in the user environment, and o the current directory location in the user environment. During the path evaluation global start locations are obtained to ensure that the current file system instance will be not unmounted in the meantime. o The user environment uses now reference counting and is protected from concurrent access. o The path evaluation process was completely rewritten and simplified. The IMFS, RFS, NFS, and DOSFS use now a generic path evaluation method. Recursive calls in the path evaluation have been replaced with iteration to avoid stack overflows. Only the evaluation of symbolic links is recursive. No dynamic memory allocations and intermediate buffers are used in the high level path evaluation. No global locks are held during the file system instance specific path evaluation process. o Recursive symbolic link evaluation is now limited by RTEMS_FILESYSTEM_SYMLOOP_MAX. Applications can retrieve this value via sysconf(). o The device file system (devFS) uses now no global variables and allocation from the workspace. Node names are allocated from the heap. o The upper layer lseek() performs now some parameter checks. o The upper layer ftruncate() performs now some parameter checks. o unmask() is now restricted to the RWX flags and protected from concurrent access. o The fchmod_h and rmnod_h file system node handlers are now a file system operation. o The unlink_h operation has been removed. All nodes are now destroyed with the rmnod_h operation. o New lock_h, unlock_h, clonenod_h, and are_nodes_equal_h file system operations. o The path evaluation and file system operations are now protected by per file system instance lock and unlock operations. o Fix and test file descriptor duplicate in fcntl(). o New test fstests/fsnofs01.
2011-09-242011-09-24 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-16/+12
* rtems/score/armv7m.h, armv7m-context-initialize.c, armv7m-context-restore.c, armv7m-context-switch.c, armv7m-exception-handler-get.c, armv7m-exception-handler-set.c, armv7m-exception-priority-get.c, armv7m-exception-priority-set.c, armv7m-initialize.c, armv7m-isr-dispatch.c, armv7m-isr-enter-leave.c, armv7m-isr-level-get.c, armv7m-isr-level-set.c, armv7m-isr-vector-install.c, armv7m-multitasking-start-stop.c: New files. * Makefile.am, preinstall.am: Reflect changes above. * rtems/score/arm.h: Define ARM_MULTILIB_ARCH_V4 and ARM_MULTILIB_ARCH_V7M. * rtems/score/cpu.h, cpu_asm.S, cpu.c, arm_exc_abort.S, arm_exc_handler_high.c, arm_exc_handler_low.S, arm_exc_interrupt.S: Define CPU_HAS_HARDWARE_INTERRUPT_STACK to FALSE. Use ARM_MULTILIB_ARCH_V4 and ARM_MULTILIB_ARCH_V7M.
2011-03-282011-03-29 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-20/+1
* configure.ac, include/bspopts.h.in: New BSP option LPC32XX_SCRATCH_AREA_SIZE. Disable BSP option LPC32XX_DISABLE_READ_ONLY_PROTECTION for all BSPs. * include/boot.h: Removed application specific defines. * include/nand-mlc.h, misc/nand-mlc.c: Changed configuration layout. * include/mmu.h, misc/mmu.c: Documentation. Bugfix. * include/bsp.h, startup/bspstarthooks.c, misc/restart.c, startup/linkcmds.lpc32xx_mzx, startup/linkcmds.lpc32xx_mzx_stage_1, startup/linkcmds.lpc32xx_mzx_stage_2, startup/linkcmds.lpc32xx_phycore: Support for scratch area. Moved code into macros for reusability.
2011-02-212010-02-21 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-7/+10
* include/bsp.h, lpc32xx/misc/restart.c: Renamed lpc32xx_restart() in bsp_restart().
2011-02-112011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius1-1/+1
* irq/irq.c, misc/restart.c, rtc/rtc-config.c: Use "__asm__" instead of "asm" for improved c99-compliance.
2010-09-282010-09-28 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-6/+0
* misc/mmu.c: New file. * Makefile.am: Reflect change above. * configure.ac, include/bspopts.h.in, include/irq.h, include/lpc32xx.h, include/mmu.h, misc/emc.c, misc/restart.c, startup/bspstarthooks.c: Changes throughout.
2010-06-232010-06-23 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-0/+56
* make/custom/lpc32xx_mzx_boot_int.cfg, startup/linkcmds.lpc32xx_mzx_boot_int: Removed files. * include/boot.h, include/emc.h, include/i2c.h, include/nand-mlc.h, make/custom/lpc32xx_mzx.cfg, make/custom/lpc32xx_mzx_stage_1.cfg, make/custom/lpc32xx_mzx_stage_2.cfg, misc/boot.c, misc/emc.c, misc/i2c.c, misc/nand-mlc.c, misc/nand-mlc-read-blocks.c, misc/nand-mlc-write-blocks.c, misc/restart.c, startup/linkcmds.lpc32xx, startup/linkcmds.lpc32xx_mzx, startup/linkcmds.lpc32xx_mzx_stage_1, startup/linkcmds.lpc32xx_mzx_stage_2: New files. * configure.ac, Makefile.am, preinstall.am: Reflect changes above. * include/bsp.h, include/lpc32xx.h, irq/irq.c, rtc/rtc-config.c, startup/bspstart.c, startup/bspstarthooks.c, startup/linkcmds.lpc32xx_phycore: Changes throughout.