Commit Graph

25398 Commits

Author SHA1 Message Date
Sebastian Huber
0c551f76e5 score: Add _Scheduler_priority_Get_scheduler_info
Add and use _Scheduler_priority_Get_scheduler_info().
2013-08-20 10:14:02 +02:00
Sebastian Huber
e5ca54c996 score: PR2136: Fix _Thread_Change_priority()
Add call to _Scheduler_Schedule() in missing path after
_Thread_Set_transient() in _Thread_Change_priority().  See also
sptests/spintrcritical19.

Add thread parameter to _Scheduler_Schedule().  This parameter is
currently unused but may be used in future SMP schedulers.

Do heir selection in _Scheduler_Schedule().  Use
_Scheduler_Update_heir() for this in the particular scheduler
implementation.

Add and use _Scheduler_Generic_block().
2013-08-20 10:14:02 +02:00
WeiY
6931037e1d correct memory model in smpatomic test case 2013-08-19 14:35:38 +02:00
Nick Withers
01b0755035 Expose rtems_verror() 2013-08-15 04:57:56 +10:00
Pavel Pisa
2a2f559957 bsp/csb336: Memory map update and jump to start at image start provided.
CSB336 i.MX1/i.MXS memory map organization

 - SDRAM starts at address 0x08000000 but 2 MB are reserved
   for boot-block/loader (or other use) before RTEMS image
   origin/load address (that is kept from previous setup)

 - Caching of 30 MB of SDRAM used for RTEMS (start at 0x08200000)
   is changed to writeback mode which provides higher throughput.

 - The first 1 MB of RTEMS dedicated SDRAM is remapped to address 0
   to provide area for ARM CPU exceptions table.

 - Internal registers and rest of the Flash (above 1 MB) are mapped
   one to one. Registers region is extended to 2 MB to cover
   eSRAM found on i.MX1 chip variant.

 - The first two megabytes of SDRAM unused by RTEMS are mapped
   with attributes to allow specific purposes.

   - the first MB (at address 0x08000000) is nocached to allow
     directly set some values read by booot-block after warm reset

   - the second MB (at address 0x08100000) is set for write-through
     caching.  That allows to use memory for LCD frame-buffer without
     need to flush cache after each redraw.

Jump to start provided at address 0x08200000 allows
to load application image even as plain binary file
and start it by jump to image start address.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-08-14 16:25:58 +02:00
Karel Gardas
526f895efe bsp/lm3s69xx: add macros for UART CTS/RTS pin configuration 2013-08-14 16:25:55 +02:00
Sebastian Huber
d473dc0b22 bsps: Fix clock driver defines 2013-08-14 13:27:34 +02:00
Sebastian Huber
66c00789ef libblock: Add missing initializer 2013-08-14 12:14:31 +02:00
Sebastian Huber
ec98c997e8 posix: Typo 2013-08-14 11:55:51 +02:00
Sebastian Huber
6ccdc5ce8b rtems: Include missing header file 2013-08-14 11:10:45 +02:00
Sebastian Huber
540e860331 documentation: Directives allowed from an ISR
Update list.
2013-08-14 11:10:45 +02:00
Sebastian Huber
9de9b7d237 libblock: Add SMP support 2013-08-14 11:10:45 +02:00
Sebastian Huber
4180a9bb04 filesystem: Add SMP support 2013-08-14 11:10:44 +02:00
Chris Johns
b7f2060973 bsp: Fix CLOCK_DRIVER_USE_FAST_IDLE and CLOCK_DRIVER_ISRS_PER_TICK.
Use the value rather than being defined. This allows inverted
logic to be used.
2013-08-14 11:53:28 +10:00
Chris Johns
03acc5915e posix: Change pthread_once to be SMP safe.
Change pthread_once from using disabled pre-emption to using a
pthread mutex making it SMP safe. GCC using a posix threading
model uses pthread_once.

The pthread mutex requires at least 1 mutex is configured so
confdefs.h has been updated to account for the internal
mutex.
2013-08-14 10:21:41 +10:00
Chris Johns
40398c45dc posix: Handle recursive attributes correctly.
The recursive field in the pthread_mutexattr_t is now not used. The
code in pthread_mutexattr_settype only sets the type field and not
the recursive field.
2013-08-14 09:29:56 +10:00
Sebastian Huber
2606fee394 powerpc: Fix _CPU_Context_validate() 2013-08-13 14:48:42 +02:00
Sebastian Huber
c32c80ea04 bsps/arm: Use proper default priority for GIC
Some GIC implementations do not have the complete range of priorities.
The upper bits are RAZ/WI in this case.
2013-08-13 14:48:26 +02:00
Zhongwei Yao
39a6e4ea69 Fix a bug in spfreechain01 test case. 2013-08-11 19:22:47 +02:00
Sebastian Huber
806f84c8ee smptests/smpswitchextension01: Fix start sequence
Start the toggler after the context is initialized.
2013-08-09 23:02:45 +02:00
Sebastian Huber
4e3b7e26a2 bsps/i386: SMP and per-CPU thread dispatch disable
Interrupt support for SMP and the per-CPU thread dispatch disable level.
2013-08-09 23:02:45 +02:00
Sebastian Huber
55b1aee441 bsps/i386: Revert most SMP related changes
The commit partially restores the _ISR_Handler code to the original
version in commit b8fc2de1ce.  A list of
reverted changes follows.

commit c236082873
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue Jul 30 15:54:53 2013 +0200

    smp: Provide cache optimized Per_CPU_Control

    Delete _Per_CPU_Information_p.

This commit was completely reverted.

commit 39e51758c8
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Fri Jun 14 14:00:38 2013 +0200

    smp: Add and use _CPU_SMP_Get_current_processor()

    Add and use _SMP_Get_current_processor() and
    rtems_smp_get_current_processor().

    Delete bsp_smp_interrupt_cpu().

    Change type of current processor index from int to uint32_t to match
    _SMP_Processor_count type.

This commit was completely reverted.

commit e94aa61b68
Author: Till Straumann <strauman@slac.stanford.edu>
Date:   Fri Aug 5 00:15:50 2011 +0000

    2011-08-04	Till Straumann <strauman@slac.stanford.edu>

    	* shared/irq/irq_asm.S: BUGFIX (introduced by SMP changes
    	which moved code around, apparently): *must* store i8259
    	mask to frame *before* switching to IRQ stack. The code
    	retrieves the mask after switching back to original stack.
    	Also, the IRQ stack has no reserved space for the mask;
    	storing it there could overwrite memory!

This commit was completely reverted.

commit 01f2692e33
Author: Jennifer Averett <Jennifer.Averett@OARcorp.com>
Date:   Mon Aug 1 13:41:50 2011 +0000

    2011-08-01	Jennifer Averett <Jennifer.Averett@OARcorp.com>

    	PR 1802
    	* shared/irq/irq_asm.S, shared/irq/irq_init.c, shared/smp/smp-imps.c,
    	shared/smp/smp-imps.h: Add SMP support for i386.
    	* shared/smp/getcpuid.c: New file.

The parts modifying the code of _ISR_Handler were reverted.

commit 66729db311
Author: Joel Sherrill <joel.sherrill@OARcorp.com>
Date:   Wed Mar 16 20:05:17 2011 +0000

    2011-03-16	Jennifer Averett <jennifer.averett@OARcorp.com>

    	PR 1729/cpukit
    	* shared/irq/irq_asm.S: Add next step in SMP support. This adds an
    	allocated array of the Per_CPU structures to support multiple cpus vs
    	a single instance of the structure which is still used if SMP support
    	is disabled. Configuration support is also added to explicitly enable
    	or disable SMP. But SMP can only be enabled for the CPUs which will
    	support it initially -- SPARC and i386. With the stub BSP support, a
    	BSP can be run as a single core SMP system from an RTEMS data
    	structure standpoint.

This commit was completely reverted.
2013-08-09 23:02:45 +02:00
Sebastian Huber
f8ad6c6f7f sparc: Make _CPU_ISR_Dispatch_disable per-CPU
This variable must be available for each processor in the system.
2013-08-09 23:02:45 +02:00
Sebastian Huber
88f6c4fc5a sparc: Move _CPU_Context_switch(), etc.
Move the _CPU_Context_switch(), _CPU_Context_restore() and
_CPU_Context_switch_to_first_task_smp() code since the method to obtain
the processor index is BSP specific.
2013-08-09 23:02:44 +02:00
Sebastian Huber
8b077ca0e4 bsps/sparc: SMP and per-CPU thread dispatch disable
Interrupt support for SMP and per-CPU thread dispatch disable level.
2013-08-09 23:02:44 +02:00
Sebastian Huber
849bb7a332 bsps/sparc: Revert most SMP related changes
As a side-effect the PR2082 is fixed with this and later changes.

The commit restores the _ISR_Handler code to the original version in
"cpukit/score/sparc/cpu_asm.S" in commit
6d42b4c60a.  A list of reverted changes
follows.

commit c236082873
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue Jul 30 15:54:53 2013 +0200

    smp: Provide cache optimized Per_CPU_Control

    Delete _Per_CPU_Information_p.

This commit was completely reverted.

commit e517714b7c
Author: Jennifer Averett <jennifer.averett@oarcorp.com>
Date:   Tue Feb 26 12:31:23 2013 -0600

    sparc: Remove dead code that was leftover from SMP development.

This commit was completely reverted.

commit 47a61aa16f
Author: Joel Sherrill <joel.sherrill@OARcorp.com>
Date:   Fri Oct 7 14:35:03 2011 +0000

    2011-10-07	Daniel Hellstrom <daniel@gaisler.com>

    	PR 1933/cpukit
    	* shared/irq_asm.S: From code inspection I have found the following
    	issues (most SMP), and some improvements in irq_asm.S. I would need a
    	long test with interrupts to verify the interrupt handler better,
    	however I can not see that these patches hurt. Please see comment per
    	hunk below, One should go through the file to indent delay-slots
    	correctly, I have fixed some in the patch areas. An extra space is
    	added in front of delay slots to indicate a delay slot.

This commit was completely reverted.

commit 0bd3f7e5d1
Author: Jennifer Averett <Jennifer.Averett@OARcorp.com>
Date:   Thu Jul 28 17:33:07 2011 +0000

    2011-07-28	Jennifer Averett <Jennifer.Averett@OARcorp.com>

    	PR 1801
    	* shared/irq_asm.S: Modifications to synch the sparc with the smp
    	working tree.

This commit was completely reverted.

commit 5d69cd33e9
Author: Joel Sherrill <joel.sherrill@OARcorp.com>
Date:   Wed Mar 16 20:05:30 2011 +0000

    2011-03-16	Jennifer Averett <jennifer.averett@OARcorp.com>

    	PR 1729/cpukit
    	* shared/irq_asm.S: New file.

The parts modifying the original code of _ISR_Handler were reverted.
Only the content move remains.
2013-08-09 23:02:44 +02:00
Sebastian Huber
07567903d2 arm: Per-CPU thread dispatch disable
Interrupt support for per-CPU thread dispatch disable level.
2013-08-09 23:02:44 +02:00
Sebastian Huber
c6c998b000 bsps/powerpc: Per-CPU thread dispatch disable
Interrupt support for per-CPU thread dispatch disable level.
2013-08-09 23:02:43 +02:00
Sebastian Huber
d19cce29dc score: Per-CPU thread dispatch disable level
Use a per-CPU thread dispatch disable level.  So instead of one global
thread dispatch disable level we have now one instance per processor.
This is a major performance improvement for SMP.  On non-SMP
configurations this may simplifiy the interrupt entry/exit code.

The giant lock is still present, but it is now decoupled from the thread
dispatching in _Thread_Dispatch(), _Thread_Handler(),
_Thread_Restart_self() and the interrupt entry/exit.   Access to the
giant lock is now available via _Giant_Acquire() and _Giant_Release().
The giant lock is still implicitly acquired via
_Thread_Dispatch_decrement_disable_level().

The giant lock is only acquired for high-level operations in interrupt
handlers (e.g. release of a semaphore, sending of an event).

As a side-effect this change fixes the lost thread dispatch necessary
indication bug in _Thread_Dispatch().

A per-CPU thread dispatch disable level greatly simplifies the SMP
support for the interrupt entry/exit code since no spin locks have to be
acquired in this area.  It is only necessary to get the current
processor index and use this to calculate the address of the own per-CPU
control.  This reduces the interrupt latency considerably.

All elements for the interrupt entry/exit code are now part of the
Per_CPU_Control structure: thread dispatch disable level, ISR nest level
and thread dispatch necessary.  Nothing else is required (except CPU
port specific stuff like on SPARC).
2013-08-09 23:02:38 +02:00
Sebastian Huber
8581725434 score: Add and use _Per_CPU_Acquire_all().
Add and use _Per_CPU_Release_all().

The context switch user extensions are invoked in _Thread_Dispatch().
This change is necessary to avoid the giant lock in _Thread_Dispatch().
2013-08-09 21:58:39 +02:00
Sebastian Huber
7045dc425d smp: Use ISR lock in per-CPU control
Rename _Per_CPU_Lock_acquire() to _Per_CPU_ISR_disable_and_acquire().
Rename _Per_CPU_Lock_release() to _Per_CPU_Release_and_ISR_enable().

Add _Per_CPU_Acquire() and _Per_CPU_Release().
2013-08-09 21:58:39 +02:00
Sebastian Huber
10fd4aacc7 score/cpu: Add CPU_Per_CPU_control
Add CPU port specific per-CPU control.
2013-08-09 21:58:39 +02:00
Sebastian Huber
838d71427b bsp/pc386: Provide local outb() for elink driver 2013-08-09 15:24:13 +02:00
Nick Withers
712c62d8a5 Add "const void* data" parameter to rtems_rfs_rtems_initialize()'s declaration, matching its definition
See https://www.rtems.org/bugzilla/show_bug.cgi?id=2137
2013-08-09 18:24:31 +10:00
Chris Johns
c31a71298f bsp/xilinx_zynq_zc706_smp: Add. 2013-08-09 18:22:42 +10:00
Nick Withers
efdda56546 Use $(EXEEXT) [defaults to "exe"] to generate binaries 2013-08-09 09:18:23 +02:00
Pavel Pisa
98bcf4ff6e bsp/csb336: implement bsp_interrupt_vector_enable/disable.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-08-09 09:01:51 +02:00
Pavel Pisa
e4b16ea919 bsp/csb336: Fix MMU _ttbl_base location to not overlap with exception vectors.
The initial region (64 bytes) of SDRAM RTEMS image is remapped
to provide overlay of the initial/ROM exceptions table.
This area cannot be used for MMU mapping table. Different correctly
aligned block has to be used for MMU table. Remapping of SDRAM
(address 0x08200000) to address 0 is supported only on 1 MB block
granularity and that is why SDRAM_VEC area has to be 1 MB aligned too
but unused part of remapped region can be freely used for other
purposes (as MMU tables).

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-08-09 08:49:55 +02:00
Sebastian Huber
ef3c17fb89 sptests/spintrcritical19: Typos 2013-08-08 14:22:07 +02:00
Sebastian Huber
6b0cd960e5 sptests/spintrcritical19: PR2136: New test 2013-08-08 14:11:23 +02:00
Sebastian Huber
c8670f50d7 smptests/smpmigration01: Fix start sequence
Start the runner after the context is initialized.
2013-08-08 14:11:23 +02:00
Sebastian Huber
3346106b4c score: Rename _Scheduler_simple_Update()
Rename _Scheduler_simple_Update() in _Scheduler_default_Update().
2013-08-08 14:11:23 +02:00
Sebastian Huber
62d947d368 score: Rename _Scheduler_simple_Allocate(), etc.
Rename _Scheduler_simple_Allocate() in _Scheduler_default_Allocate().
Rename _Scheduler_simple_Free() in _Scheduler_default_Free().
2013-08-08 14:11:22 +02:00
Sebastian Huber
037cfd17b9 score: Rename _Scheduler_priority_Release_job()
Rename _Scheduler_priority_Release_job() into
_Scheduler_default_Release_job().
2013-08-08 14:11:22 +02:00
Sebastian Huber
ae75429ca1 PR766: Delete __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 2013-08-08 14:11:22 +02:00
Sebastian Huber
6b4e448ebe PR766: Delete __RTEMS_INSIDE__ 2013-08-08 14:11:22 +02:00
Sebastian Huber
006304112a PR766: Delete __RTEMS_APPLICATION__
This define is no longer used.
2013-08-08 14:11:21 +02:00
Sebastian Huber
c9b784f3e7 posix: Delete POSIX_Keys_Freechain type
Use the POSIX configuration value directly.  Use right type early and
avoid casts.  Use proper unlimited objects API.  Check workspace
allocation.  Make functions static.
2013-08-08 14:11:21 +02:00
Chris Johns
e932c53698 bsp/xilinx_zynq_zc706: Add. 2013-08-08 15:34:01 +10:00
Chris Johns
f65e8e66d0 posix: Add missing header. 2013-08-08 10:21:54 +10:00