Commit Graph

2023 Commits

Author SHA1 Message Date
Sebastian Huber
75524a5e13 sapi: Use rtems_config*_get_interrupt_stack_size 2012-11-07 15:08:43 +01:00
Sebastian Huber
e278f8b7d9 score: Support static_assert and _Static_assert 2012-11-06 10:20:42 +01:00
Sebastian Huber
0edf263139 rtems: Add system events
System events are similar to normal events.  They offer a second set of
events.  These events are intended for internal RTEMS use and should not
be used by applications (with the exception of the transient system
event).
2012-10-30 18:03:02 +01:00
Sebastian Huber
47a3cd8f73 score: Work area initialization API change
The work areas (RTEMS work space and C program heap) will be initialized
now in a separate step and are no longer part of
rtems_initialize_data_structures().  Initialization is performed with
tables of Heap_Area entries.  This allows usage of scattered memory
areas present on various small scale micro-controllers.

The sbrk() support API changes also.  The bsp_sbrk_init() must now deal
with a minimum size for the first memory chunk to take the configured
work space size into account.
2012-10-25 14:54:06 +02:00
Sebastian Huber
e4278f2050 score: Append to free list in _Heap_Extend() 2012-10-25 14:54:06 +02:00
Sebastian Huber
6ccfe722bd score: Change _Heap_Extend() API
The _Heap_Extend() has now the same signature as _Heap_Initialize().
The 4th parameter is ignored (page size in _Heap_Initialize()).

Add Heap_Area and Heap_Initialization_or_extend_handler.

Add and test _Heap_No_extend().

This helps to do a table based heap initialization and extension.
Create a table of Heap_Area elements and iterate through it.  Set the
handler to _Heap_Initialize() in the first iteration and then to
_Heap_Extend().
2012-10-25 14:54:06 +02:00
Sebastian Huber
8d4faf90e8 score: Use _Workspace_Allocate_or_fatal_error()
Use _Workspace_Allocate_or_fatal_error() consistently in case auto
extend is turned off.  This helps to avoid undefined behaviour in
_API_Mutex_Allocate() in case _API_Mutex_Information() fails.
2012-10-15 14:58:08 +02:00
Joel Sherrill
b8fa5013fd threadqextractwithproxy.c: Doxygen header and spacing 2012-10-11 15:52:51 -05:00
Sebastian Huber
9b83a66546 score: Critical fix for thread dispatching
The changes in _Thread_Dispatch() of commits
dad36c52b8 and
d4dc7c8196 introduced a severe bug which
destroys the real-time properties of RTEMS completely.

Consider the following scenario.  We have three tasks L (lowest
priority), M (middle priority), and H (highest priority).  Now let a
thread dispatch from M to L happen.  An interrupt occurs in
_Thread_Dispatch() here:

void _Thread_Dispatch( void )
{
  [...]

post_switch:

  _ISR_Enable( level );

  <-- INTERRUPT
  <-- AFTER INTERRUPT

  _Thread_Unnest_dispatch();

  _API_extensions_Run_postswitch();
}

The interrupt event makes task H ready.  The interrupt code will see
_Thread_Dispatch_disable_level > 0 and thus doesn't perform a
_Thread_Dispatch().  Now we return to position "AFTER INTERRUPT".  This
means task L executes now although task H is ready!  Task H will execute
once someone calls _Thread_Dispatch().
2012-10-07 14:40:49 +02:00
Joel Sherrill
8896c97621 threaddispatch.c: Fix typo 2012-10-02 13:28:08 -05:00
Joel Sherrill
196fe5964f score/thread.h: Move Thread_CPU_usage_t definition down
At the previous location, uint32_t was not available.
2012-10-02 13:27:04 -05:00
Joel Sherrill
9e73596610 score/percpu.h: _Thread_Time_of_last_context_switch always available
This field is used whether ticks are used for statistics or not.
2012-10-02 13:24:20 -05:00
Joel Sherrill
b249d7f6a6 score/tod.h: Fix formatting 2012-10-02 13:23:23 -05:00
Joel Sherrill
09f2ce38aa mips/idtcpu.h: Fix nested comment warning 2012-09-05 12:23:59 -05:00
Joel Sherrill
d658a9bfc3 coremsg.c: Clean up and comment improvement
This code was reviewed as part of coverage analysis improvements.  The
uncovered range had unclear documentation and the code itself was also
cleaned up to be easier to understand.

Author: Krzysztof Mięsowicz <krzysztof.miesowicz@gmail.com>
2012-08-31 09:58:42 -05:00
Andreas Heinig
2aff1f0875 PR2069: Similar. Forgot to add missing file. 2012-08-06 13:53:38 -04:00
Andreas Heinig
7a9288fe35 PR2069: [CBS Scheduler] Memory leak and enqueue problem
Due to the fact that CBS extends the EDF scheduler, most parts of EDF are
 reused. One part is the allocation of the per-thread data. However, the CBS
 per-thread structure defines a further element (while including the rest of
 Scheduler_EDF_Per_thread)
2012-08-06 13:46:27 -04:00
Sebastian Huber
317ee8d7ff score: Change greedy allocation API 2012-07-17 10:19:16 +02:00
Sebastian Huber
c34bb0dcfa score: Fix performance issue for 64-bit timestamps
The 64-bit timestamps were introduced to simplify the timestamp
calculations.  This works well since nearly all operations are
additions.  The previous _TOD_Tickle_ticks() implementation had a
serious performance regression in case of 64-bit timestamps due to the
usage of two 64-bit divisions which are quite expensive on some
architectures.

A new field seconds_trigger in TOD_Control is introduced to trigger the
_Watchdog_Tickle_seconds() in _TOD_Tickle_ticks().  This avoids the
64-bit divisions completely and only 32-bit additions are used.
2012-06-14 14:20:30 +02:00
Sebastian Huber
3246b0f8fc score: New structure TOD_Control
Group the global TOD variables (_TOD_Now, _TOD_Uptime, and _TOD_Is_set)
in a structure to reduce address loads in _TOD_Tickle_ticks().
2012-06-14 14:20:30 +02:00
Joel Sherrill
1364eb9935 v850 - byte swap instructions not available on all multilibs 2012-06-12 17:58:01 -05:00
Joel Sherrill
2d7ae960bb v850 port: Initial addition with BSP for simulator in GDB
Port
  + v850 does not have appear to have any optimized bit scan instructions
  + v850 does have single instructions for wap u16 and u32
  + Code path optimization preferences set
  + Add BSP variants for each GCC CPU model flag and a README
    - v850e1 variant does not work (fails during BSP initialization)
BSP for GDB v850 Simulator
  + linkcmds matches defaults in GDB simulator with RTEMS mods
  + crt1.c added from v850 newlib port for __main()
  + BSP exits cleanly
  + printk and console I/O work
  + uses clock tick from IDLE task
  + Tests not requiring real clock ISR work
Documentation
  + CPU Supplment chapter for v850 added
2012-06-11 13:37:29 -05:00
Joel Sherrill
9da42fb87a powerpc/cpu.h: Define CPU_SIMPLE_VECTORED_INTERRUPTS and remove _CPU_ISR_Initialize 2012-06-11 13:00:57 -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
562cadfaa5 i386/cpu.h: Define CPU_SIMPLE_VECTORED_INTERRUPTS and remove _CPU_ISR_Initialize 2012-06-11 12:40:10 -05:00
Joel Sherrill
dea1050312 arm/cpu.h: Define CPU_SIMPLE_VECTORED_INTERRUPTS and remove _CPU_ISR_Initialize 2012-06-11 12:40:10 -05:00
Joel Sherrill
61baaccef1 isr.c: Do not call _CPU_Initialize_vectors() if PIC Interrupt Model 2012-06-11 12:40:04 -05:00
Joel Sherrill
97bda25c0e threadhandler.c: Fix spelling of __main() in prototype 2012-06-11 12:26:21 -05:00
Sebastian Huber
1869bb7101 powerpc: Simplify context switch
PowerPC cores with the SPE (Signal Processing Extension) have 64-bit
general-purpose registers.  The SPE context switch code has been merged
with the standard context switch code.  The context switch may use cache
operations to increase the performance.  It will be ensured that the
context is 32-byte aligned (PPC_DEFAULT_CACHE_LINE_SIZE).  This
increases the overall memory size of the context area in the thread
control block slightly.  The general-purpose registers GPR2 and GPR13
are no longer part of the context.  The BSP must initialize these
registers during startup (usually initialized by the __eabi() function).

The new BSP option BSP_USE_DATA_CACHE_BLOCK_TOUCH can be used to enable
the dcbt instruction in the context switch.

The new BSP option BSP_USE_SYNC_IN_CONTEXT_SWITCH can be used to enable
sync and isync instructions in the context switch.  This should be not
necessary in most cases.
2012-06-04 09:54:31 +02:00
Joel Sherrill
721fe34aae Fix C files which had two semi-colons at EOL 2012-05-31 15:34:36 -05:00
Gedare Bloom
2b36355b44 PR2065: RBTree: Insert function (protected) does not enable interrupts
Save the return value from the unprotected version and return it after
enabling interrupts to their previous level.
2012-05-13 10:40:10 -04:00
Joel Sherrill
65c6425de9 Remove CVS Id Strings (manual edits after script)
These modifications were required by hand after running the script.
In some cases, the file names did not match patterns. In others,
the format of the file did not match any common patterns.
2012-05-11 08:44:14 -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
826fa6b169 Score ISR - Minimize Capabilities When Not Simple Vectored
In particular CPU_INTERRUPT_NUMBER_OF_VECTORS and
CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER are only used on
Simple Vectored Architectures, so do not depend on
them being defined. This disables as much as possible
that is specific to the Simple Vectored Model and
not expected to be used on architectures which use
the Programmable Interrupt Controller model for
interrupt handler vectoring.
2012-05-09 16:55:10 -05:00
Joel Sherrill
2824e63a69 Score Semaphore - Need Semaphore Seize Body When Multiprocessing is Enabled
mptests did not link without this modification.
2012-05-09 16:55:10 -05:00
Gedare Bloom
f53aa8d302 rbtree: API changes. Remove rbtree control node from RBTree_Next.
The implementation of RBTree_Next was using an awkward construction to detect
and avoid accessing the false root of the red-black tree. To deal with the
false root, RBTree_Next was comparing node parents with the control node.
Instead the false root can be detected by checking if the grandparent of a
node exists; the grandparent of the tree's true root is NULL by definition
so the root of the tree is found while walking up the tree by checking for
the non-existence of a grandparent.

This change propagates into the predecessor/successor and iterate functions.
2012-05-08 18:40:44 -04:00
Gedare Bloom
a41950ddfb PR2061: RBTree: updating min and max on insert with duplicates
When inserting to a red-black tree with duplicates the min and max pointers are
not updated properly. We need to check the key of the min/max node against the
insert node since the insert point could be the child of a node with an
identical key to the min/max node.
2012-05-08 18:40:44 -04:00
Gedare Bloom
3d74da6e23 PR2060: RBTree: updating min and max on extract path
During node extraction from a red-black tree the min and max values are updated
incorrectly. We need to use the successor/predecessor functions to find the
next/previous node when we remove the min/max from the tree.
2012-05-08 18:40:44 -04:00
Gedare Bloom
0f31ec5d3b score/rbtree: eliminate unused function _RBTree_Peek. 2012-05-08 18:40:44 -04:00
Gedare Bloom
857275285f rbtree: API Changes
Make default for rtems_rbtree functions be unprotected (preemption enabled)
unless an unprotected variant e.g. rtems_rbtree_xxx_unprotected is available.
2012-05-08 18:40:44 -04:00
Gedare Bloom
8712622959 score/rbtree: replace _RBTree_Peek_unprotected with _RBTree_First. 2012-05-08 18:40:44 -04:00
Gedare Bloom
bc96bad6ca score/scheduling: Use RBTree_First instead of Peek in EDF scheduler. 2012-05-08 18:40:44 -04: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
Joel Sherrill
32815a2636 Simple SMP Scheduler - Fix typo which likely broke scheduling 2012-04-24 16:10:01 -05:00
Sebastian Huber
3595533de5 score: Remove _Stack_Adjust_size()
The increase of the stack size by CPU_STACK_ALIGNMENT in
_Thread_Stack_Allocate() is disadvantageous.  This may lead to a huge
over allocation for specialized stack allocators.  The
CPU_STACK_ALIGNMENT is at most 16 on all current RTEMS CPU ports.  The
mimimum stack size ensured by _Stack_Ensure_minimum() must be
considerable larger than this value, otherwise stack overflows will
likely occur.  Thus the _Stack_Adjust_size() is also superfluous.
2012-04-24 14:22:57 +02:00
Sebastian Huber
4012792168 score: Documentation 2012-04-20 15:31:00 +02:00
Gedare Bloom
e99dbaa7cd no_cpu: replace no_cpu_isr with rtems_isr 2012-04-16 19:39:22 -04:00
Gedare Bloom
416f1efbd2 lm32: replace lm32_isr with rtems_isr 2012-04-16 13:11:20 -04:00
Gedare Bloom
1fec9e0357 m68k: replace m68k_isr with rtems_isr 2012-04-16 13:11:20 -04:00