Commit Graph

257 Commits

Author SHA1 Message Date
Sebastian Huber
27bfcd88f7 score: Delete _CPU_Context_Fp_start()
Since the FP area pointer is passed by reference in
_CPU_Context_Initialize_fp() the optional FP area adjustment via
_CPU_Context_Fp_start() is superfluous.  It is also wrong with respect
to memory management, e.g. pointer passed to _Workspace_Free() may be
not the one returned by _Workspace_Allocate().

Close #1400.
2017-01-26 07:31:09 +01:00
Sebastian Huber
4aa23c9641 Remove CPU_BIG_ENDIAN and CPU_LITTLE_ENDIAN
Use de-facto standard BYTE_ORDER instead.

Close #2803.
2017-01-24 08:39:22 +01:00
Sebastian Huber
84e6f15c82 score: Robust thread dispatch
On SMP configurations, it is a fatal error to call blocking operating
system with interrupts disabled, since this prevents delivery of
inter-processor interrupts. This could lead to executing threads which
are not allowed to execute resulting in undefined behaviour.

The ARM Cortex-M port has a similar problem, since the interrupt state
is not a part of the thread context.

Update #2811.
2016-11-23 12:52:06 +01:00
Sebastian Huber
408609f6b9 score: Add _ISR_Is_enabled()
In contrast to _ISR_Get_level() the _ISR_Is_enabled() function evaluates
a level parameter and returns a boolean value.

Update #2811.
2016-11-18 07:30:35 +01:00
Sebastian Huber
141e16d225 rtems: Conditionally define rtems_interrupt_frame
Update #2808.
2016-11-18 07:30:32 +01:00
Sebastian Huber
82d30a310c score: Move CPU_PER_CPU_CONTROL_SIZE
Move CPU_PER_CPU_CONTROL_SIZE and the optional CPU_Per_CPU_control to
<rtems/score/cpuimpl.h> to hide it from <rtems.h>.
2016-11-18 07:30:32 +01:00
Sebastian Huber
acc6d9bf37 score: Remove obsolete defines
The thread dispatch inline option is no longer used.
2016-11-18 07:30:31 +01:00
Sebastian Huber
df63fbd1ac score: Add <rtems/score/cpuimpl.h>
The aim of this file is to encapsulate CPU port implementation details.
This helps to hide implementation details from <rtems.h> which
indirectly includes <rtems/score/cpu.h>.
2016-11-07 07:39:41 +01:00
Sebastian Huber
9149c87ec7 score: Fix C/C++ compatibility issue
Only use CPU_Per_CPU_control if it contains at least one filed.  In GNU
C empty structures have a size of zero.  In C++ structures have a
non-zero size.  In case CPU_PER_CPU_CONTROL_SIZE is defined to zero,
then this structure is not used anymore.
2016-09-23 06:57:03 +02:00
Sebastian Huber
b04b76c6a0 score: Simplify priority bit map implementation
The priority bit map can deal with a maximum of 256 priority values
ranging from 0 to 255.  Consistently use an unsigned int for
computation, due to the usual integer promotion rules.

Make Priority_bit_map_Word definition architecture-independent and
define it to uint16_t.  This was already the case for all architectures
except PowerPC.  Adjust the PowerPC bitmap support accordingly.
2016-06-08 15:48:03 +02:00
Sebastian Huber
18e29faf98 score: Delete CPU_USE_GENERIC_BITFIELD_DATA
Rename __log2table into _Bitfield_Leading_zeros since it acually returns
the count of leading zeros of an 8-bit integer.  The value for zero is a
bit odd.  Provide it unconditionally.
2016-06-08 15:48:03 +02:00
Sebastian Huber
ec5d7f92fd score: Delete dead copy and paste code 2016-06-08 15:48:02 +02:00
Sebastian Huber
decff899ec score: Add CPU_MAXIMUM_PROCESSORS
Maximum number of processors of all systems supported by this CPU port.
2016-03-04 13:36:08 +01:00
Sebastian Huber
d638aca61b mips: Avoid SCORE_EXTERN
Update #2559.
2016-02-17 09:15:01 +01:00
Sebastian Huber
a8865f8b41 score: Introduce CPU_CACHE_LINE_BYTES
Add CPU_CACHE_LINE_BYTES for the maximum cache line size in bytes.  The
actual processor may use no cache or a smaller cache line size.
2016-01-26 09:07:30 +01:00
Sebastian Huber
01b32d44a4 score: Delete obsolete CPU_TIMESTAMP_* defines
Update #2271.
2016-01-25 12:05:10 +01:00
Sebastian Huber
143696acbd basedefs.h: Add and use RTEMS_NO_RETURN 2015-10-26 09:13:19 +01:00
Sebastian Huber
335e5caa9a score: Add Thread_Control::is_fp
Store the floating-point unit property in the thread control block
regardless of the CPU_HARDWARE_FP and CPU_SOFTWARE_FP settings.  Make
sure the floating-point unit is only enabled for the corresponding
multilibs.  This helps targets which have a volatile only floating point
context like SPARC for example.
2015-06-09 09:05:50 +02:00
Gedare Bloom
46d3c6d833 cpukit: add and use CPU_Uint32ptr type 2015-03-16 16:24:18 -04:00
Sebastian Huber
8ac3549db3 score: Delete unused CPU_UNROLL_ENQUEUE_PRIORITY 2015-03-05 08:12:24 +01:00
Sebastian Huber
c48cf0bd0c score: Rename _BSP_Exception_frame_print()
Rename _BSP_Exception_frame_print() to _CPU_Exception_frame_print() to
be in line with other CPU port functions.
2014-09-11 09:10:16 +02:00
Daniel Hellstrom
f82752a474 Let CPU/BSP Fatal handler have access to source
Without the source the error code does not say that much.
Let it be up to the CPU/BSP to determine the error code
reported on fatal shutdown.

This patch does not change the current behaviour, just
adds the option to handle the source of the fatal halt.
2014-09-10 14:06:08 +02:00
Chris Johns
59990cc975 Regenerate all preinstall.am files.
With this patch the preinstall.am files are in a set order and not
dependent on now perl implements a hash.
2014-08-29 12:48:01 +10:00
Joel Sherrill
b597c0d60c Regenerate all preinstall.am files.
Apparently, at some point automake output changed and these were
not updated.
2014-08-28 08:44:52 -05:00
Sebastian Huber
03b7789ec7 score: Statically initialize _ISR_Vector_table 2014-04-29 09:51:22 +02:00
Sebastian Huber
f570b07199 score: Rename Priority_bit_map_Control
Rename Priority_bit_map_Control in Priority_bit_map_Word.
2014-04-03 11:13:26 +02:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
24bf11eca1 score: Add CPU counter support
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.
2014-02-14 10:28:29 +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
Joel Sherrill
bd90283947 mips/.../cpu.h: Comment improvement 2013-11-14 17:26:31 -06:00
WeiY
58a70b7635 score: Simplify <rtems/score/cpuatomic.h>
Add proper license and copyright.
2013-08-28 14:58:50 +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
10fd4aacc7 score/cpu: Add CPU_Per_CPU_control
Add CPU port specific per-CPU control.
2013-08-09 21:58:39 +02:00
WeiY
d61e54c2e0 update-all-architectures-to-new-atomic-implementation 2013-07-17 13:07:33 +02:00
Sebastian Huber
39993d6d76 score: Add CPU context validation 2013-05-10 12:10:14 +02:00
Chris Johns
3806e01a77 Revert bootstrap whitespace changes. 2013-05-10 18:33:11 +10:00
WeiY
9b605b28b4 Using the generic atomic ops to implement UP mode atomic for all architectures. SMP atomic port will be later. 2013-05-01 10:28:48 -04:00
Sebastian Huber
59c05590df mips: Fix warnings 2013-04-23 09:59:57 +02:00
Gedare Bloom
fad2d38a9f RTEMS: Delete ChangeLog files.
This commit deletes all RTEMS ChangeLog files. These files have been abandoned
since converting to git version control. The historical data may be recovered
by checking out any commit before this one. Most of the contents of these
ChangeLog files can also be found in the git log.

Two external ChangeLog files, ChangeLog.slac and ChangeLog.zlib, remain.
2013-03-08 15:55:06 -05:00
Joel Sherrill
b10825cd5d cpukit: Add EOL on files missing EOL at EOF 2013-01-10 17:06:47 -06:00
Alex Ivanov
1362b7a6d0 score: Doxygen Clean Up Task #4 2013-01-08 11:40:52 -06:00
Mathew Kallada
a1f9934a8f score: Doxygen Clean Up Task #3 2013-01-04 09:01:21 -06:00
Alex Ivanov
e0f91da505 score misc: Score misc: Clean up Doxygen #9 (GCI 2012)
This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

https://google-melange.appspot.com/gci/task/view/google/gci2012/7977211
2012-11-30 15:35:36 -06:00
Sebastian Huber
815994fd17 score: Add CPU_Exception_frame
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-11-27 17:03:40 +01:00
Sebastian Huber
f1738ed619 score: PR1607: Add and use CPU_SIZEOF_POINTER
Add and use new CPU port define CPU_SIZEOF_POINTER.  It must be an
integer literal that can be used by the assembler.  This value will be
used to calculate offsets of structure members.  These offsets will be
used in assembler code.

The size of a pointer is part of the application binary interface (ABI)
and thus independent of the actual programming language.  The compiler
will provide defines to determine the current ABI.  We use these defines
to select the appropriate CPU_SIZEOF_POINTER value.

Static assertions in the new file "cpukit/score/src/percpuasm.c" will
ensure that the value of CPU_SIZEOF_POINTER is consistent with the
current compiler settings.  Also the offset values used by assembler
code are verfied.
2012-11-22 16:35:07 +01:00
Joel Sherrill
09f2ce38aa mips/idtcpu.h: Fix nested comment warning 2012-09-05 12:23:59 -05:00
Joel Sherrill
3e5ff08227 mips/cpu.h: Define CPU_SIMPLE_VECTORED_INTERRUPTS and remove _CPU_ISR_Initialize 2012-06-11 12:40:11 -05:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Joel Sherrill
33a105fb69 Revert: Remove CVS Ids
See http://www.rtems.org/pipermail/rtems-devel/2012-May/001006.html
for details.
2012-05-07 11:08:48 -05:00
Ralf Corsépius
ee32f67a6f Remove CVS-Ids. 2012-05-04 09:36:25 +02:00