Commit Graph

1524 Commits

Author SHA1 Message Date
Sebastian Huber
487b94e7ad bsps/powerpc: SMP support for SPR functions
These registers are local to a processor, there is no need to use SMP
locks here.
2014-04-16 09:07:33 +02:00
Sebastian Huber
509040f0af bsps/powerpc: SMP support for one TSEC driver 2014-04-15 10:43:05 +02:00
Sebastian Huber
10b0c3f9d3 bsps/powerpc: PR757: Fix PPC_IRQ_TRACE for ppc601
We could probably also remove the ppc601 support entirely.
2014-04-01 14:10:23 +02:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
155024265f bsps/powerpc: Add support for interrupt profiling 2014-03-14 08:46:50 +01:00
Ralf Kirchner
0656a00a82 bsp/arm: Add CP15 methods 2014-03-13 16:10:53 +01:00
Sebastian Huber
dedc1393f3 bsps/powerpc: Fix GET_INTERRUPT_MASK macro
Use _PPC_INTERRUPT_DISABLE_MASK introduced with
801b5d8032.
2014-03-12 16:40:49 +01:00
Sebastian Huber
ae88aa7927 sapi: Use one SMP lock for all chains
This partially reverts commit 1215fd4d94.

In order to support profiling of SMP locks and provide a future
compatible SMP locks API it is necessary to add an SMP lock destroy
function.  Since the commit above adds an SMP lock to each chain control
we would have to add a rtems_chain_destroy() function as well.  This
complicates the chain usage dramatically.  Thus revert the patch above.
A global SMP lock for all chains is used to implement the protected
chain operations.

Advantages:

* The SAPI chain API is now identical on SMP and non-SMP
  configurations.

* The size of the chain control is reduced and is then equal to the
  Score chains.

* The protected chain operations work correctly on SMP.

Disadvantage:

* Applications using many different chains and the protected operations
  may notice lock contention.

The chain control size drop is a huge benefit (SAPI chain controls are
66% larger than the Score chain controls).  The only disadvantage is not
really a problem since these applications can use specific interrupt
locks and unprotected chain operations to avoid this issue.
2014-03-11 10:58:09 +01:00
Sebastian Huber
e1d7bf002e rtems: Add cache size functions
Add rtems_cache_get_data_cache_size() and
rtems_cache_get_instruction_cache_size().
2014-02-28 09:06:16 +01:00
Sebastian Huber
e7549ff4a1 rtems: Use size_t for cache line size
A cache line cannot have a negative size.
2014-02-28 08:59:02 +01:00
Sebastian Huber
33cb8bf64d score: Add RTEMS_FATAL_SOURCE_BSP
Merge RTEMS_FATAL_SOURCE_BSP_GENERIC and RTEMS_FATAL_SOURCE_BSP_SPECIFIC
into new fatal source RTEMS_FATAL_SOURCE_BSP.  This makes it easier to
figure out the code position given a fatal source and code.
2014-02-19 09:59:39 +01:00
Sebastian Huber
801b5d8032 powerpc: Change interrupt disable implemetation
Instead of SPRG0 (= special purpose register 272) use the new global
symbol _PPC_INTERRUPT_DISABLE_MASK to store the interrupt disable mask.
The benefit is that it is now possible to disable interrupts without
further run-time initialization in boot_card().

At least on Freescale e500 cores this leads also to a faster execution
since the mfmsr and mfspr instruction require four cycles to complete.
The instructions to load the mask value can execute while the mfmsr is
in progress.
2014-02-19 09:59:38 +01:00
Sebastian Huber
022851aba5 Add thread-local storage (TLS) support
Tested and implemented on ARM, m68k, PowerPC and SPARC.  Other
architectures need more work.
2014-02-04 10:06:35 +01:00
Aleksandr Platonov
fc6a0ae1a6 rtems_cache_invalidate_multiple_instruction_lines
According with comment in
rtems_cache_invalidate_multiple_instruction_lines(), final_address
indicates the last address which needs to be invalidated.  But if in
while loop we got final_address == i_addr condition then loop breaks and
final_address will not be invalidated.
2014-01-14 14:40:07 +01:00
Sebastian Huber
eba0626fa2 bsps/arm: Use Normal memory for code and data 2014-01-13 13:24:02 +01:00
Chirayu Desai
e626c60af4 libcpu/powerpc/mpc5xx: use THREAD_DISABLE_DISPATCH_LEVEL in asm 2013-12-06 13:26:58 -05:00
Sebastian Huber
057c294afd bsps/powerpc: Unconditionally clear reservations 2013-12-03 12:58:47 +01:00
Sebastian Huber
39a4574652 powerpc: Add r2 to CPU context
The r2 may be used for thread-local storage.
2013-11-18 14:56:43 +01:00
Sebastian Huber
f074a4d1bb bsps/arm: ARMV7_MMU_DATA_READ_WRITE_SHAREABLE
Delete ARMV7_MMU_DATA_READ_WRITE_SHAREABLE and move RTEMS_SMP
specific MMU attribute settings to arm-cp15.h.
2013-10-27 19:39:36 +01:00
Hesham AL-Matary
0a9533fc2c Add a new necessary definition needed for raspberrypi MMU support
The new ARM_CP15_CTRL_XP is necessary to share ARMv6 and ARMv7
page-table formats and definitions.
It enables the extended page tables (introduced in ARMv6)
to be configured for the hardware page translation mechanism. This way
we can share ARMv6 and ARMv7 page tables entry formats.

Other Fault Status Register Definitions can be useful for debugging or
excpetion handlers.
2013-10-03 08:51:29 -04:00
Joel Sherrill
4fab260dd1 libcpu/sparc/.../access_le.c: Add include file to fix warning 2013-09-23 08:24:32 -05:00
Sebastian Huber
f55215a837 bsps: Fix cache manager support 2013-09-10 08:51:06 +02:00
Sebastian Huber
d157a4fd4d bsps/arm: Fix ARM CP15 opcode for get functions 2013-09-05 09:37:17 +02:00
Sebastian Huber
1215fd4d94 sapi: SMP support for chains
Add ISR lock to chain control for proper SMP protection.  Replace
rtems_chain_extract() with rtems_chain_explicit_extract() and
rtems_chain_insert() with rtems_chain_explicit_insert() on SMP
configurations.  Use rtems_chain_explicit_extract() and
rtems_chain_explicit_insert() to provide SMP support.
2013-08-30 11:16:28 +02:00
Ric Claus
2bd440ed58 bsp/xilinx-zynq: Add cache support 2013-08-26 09:53:06 +02:00
Ric Claus
c9b66f5ed3 bsps/arm: Add more CP15 cache functions 2013-08-22 14:20:47 +02:00
Sebastian Huber
d473dc0b22 bsps: Fix clock driver defines 2013-08-14 13:27:34 +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
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
Sebastian Huber
f031df0e63 score: Rename tod.h to todimpl.h 2013-08-01 16:45:45 +02:00
Pavel Pisa
02632e83e0 bsp/csb336: mc9328mxl correct AITC access in bsp_interrupt_dispatch.
The original version is missing void and result is that (*x >> 16) is
optimized to ldh rX,[rY]. But it is not allowed/supported to access
bus/address range used by AITC by other than 32 bit wide accesses
and 16-bit access results in the data abort exception.
The corrected version works on real hardware and is even
more readable.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-07-26 11:55:47 +02:00
Sebastian Huber
88c74ab115 score: Merge tod implementation into one file
Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().
2013-07-26 11:55:47 +02:00
Sebastian Huber
0c3edbf0cf Include missing <rtems/score/threaddispatch.h> 2013-07-26 11:55:47 +02:00
Peter Dufault
b3a84034e2 bsp/mpc55xx: Fix prototype 2013-07-24 15:49:53 +02:00
Sebastian Huber
39046f766f score: Merge sysstate API into one file 2013-07-24 11:11:21 +02:00
Sebastian Huber
c8d78ee510 bsp/mpc55xx: Add MPC5668G support 2013-07-15 11:57:13 +02:00
Sebastian Huber
4fe3ad2f99 bsps/powerpc: Add ppc_count_leading_zeros() 2013-07-09 16:42:00 +02:00
Sebastian Huber
56435e646c powerpc: Fix Altivec support
Use the right context.
2013-06-26 10:31:43 +02:00
Sebastian Huber
e18db9f0cf termios: Update due to API changes
Termios notifies now the driver about an inactive transmit with the
length argument set to zero.
2013-06-25 17:03:21 +02:00
Sebastian Huber
7d0e88f240 bsps/powerpc: Delete clock_4xx.c 2013-06-24 10:53:58 +02:00
Sebastian Huber
ade27c69eb bsps: Move bsp_generic_fatal_code to new file
Add bsp_generic_fatal().
2013-06-21 10:26:10 +02:00
Sebastian Huber
5f91272e9b bsps/powerpc: Delete bsp_exceptions_in_RAM
Delete ppc_exc_vector_base.  Add and use
ppc_exc_initialize_with_vector_base().
2013-06-21 10:26:09 +02:00
Sebastian Huber
9a037da966 bsps/arm: Set vector base address if necessary 2013-06-20 10:15:10 +02:00
Sebastian Huber
49cdf40afa score: Add and use _Thread_Dispatch_is_enabled()
Delete _Thread_Dispatch_in_critical_section() and
_Thread_Is_dispatching_enabled().
2013-06-14 16:26:06 +02:00
Sebastian Huber
18e2fbe70d smp: Fix PowerPC context switch 2013-06-07 17:06:43 +02:00
Sebastian Huber
db42c079a0 bsps/arm: Add SMP support 2013-05-31 15:20:33 +02:00
Sebastian Huber
ffbeb6f6a3 smp: Add PowerPC support 2013-05-31 15:20:32 +02:00
Sebastian Huber
e3be691598 score: Remove idle field of Per_CPU_Control
This field is unused except for special case simulator clock drivers.
In these places use an alternative.  Add and use
_Thread_Set_global_exit_status() and _Thread_Get_global_exit_status().
2013-05-31 15:20:31 +02:00
Sebastian Huber
5b391f857b bsps/arm: Use Write-Allocate cache for ARMv7 2013-05-31 15:20:31 +02:00