Commit Graph

37 Commits

Author SHA1 Message Date
Sebastian Huber
96ec8ee80a rtems: Add more clock tick functions
Add rtems_clock_tick_later(), rtems_clock_tick_later_usec() and
rtems_clock_tick_before().
2014-08-26 10:21:27 +02:00
Sebastian Huber
2d5424d2d0 sptests/sp37: Account for internal struct align 2014-04-09 15:30:24 +02:00
Sebastian Huber
6c0301daad tests/sptests: Use <rtems/test.h> 2014-03-25 08:06:21 +01:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
53ad908a64 score: Add SMP lock profiling support 2014-03-14 08:46:49 +01:00
Sebastian Huber
28779c70ff score: Add function to destroy SMP locks 2014-03-11 10:58:09 +01:00
Sebastian Huber
d50acdbb6c score: Add local context to SMP lock API
Add a local context structure to the SMP lock API for acquire and
release pairs.  This context can be used to store the ISR level and
profiling information.  It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.

There is only one lock that cannot be used with a local context.  This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.
2014-03-11 10:58:09 +01:00
Sebastian Huber
bf30999cc6 smp: Add and use _Assert_Owner_of_giant()
Add and use _ISR_Disable_without_giant() and
_ISR_Enable_without_giant() if RTEMS_SMP is defined.

On single processor systems the ISR disable/enable was the big hammer
which ensured system-wide mutual exclusion.  On SMP configurations this
no longer works since other processors do not care about disabled
interrupts on this processor and continue to execute freely.

On SMP in addition to ISR disable/enable an SMP lock must be used.
Currently we have only the Giant lock so we can check easily that ISR
disable/enable is used only in the right context.
2013-08-30 11:16:28 +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
25d921e435 sptests/sp37: Add ISR level test for new threads 2013-08-05 17:31:35 +02:00
Sebastian Huber
da831d06fd sptests/sp37: Add ISR set/get level tests 2013-08-05 13:45:37 +02:00
Sebastian Huber
8d640134ba score: ISR lock API changes 2013-08-01 16:45:45 +02:00
Sebastian Huber
2d915cf389 score: Add and use ISR locks
ISR locks are low-level locks to protect critical sections accessed by
threads and interrupt service routines.

On single processor configurations the ISR locks degrade to simple ISR
disable/enable sequences.  No additional storage or objects are
required.

This synchronization primitive is supported on SMP configurations.  Here
SMP locks are used.
2013-07-31 15:09:04 +02:00
Sebastian Huber
f20275db90 sptests/sp37: Improved interrupt lock tests 2013-07-31 15:09:04 +02:00
Sebastian Huber
918d5565b2 sptests/sp37: Disable dispatch for clock tick 2013-07-22 16:57:25 +02:00
Sebastian Huber
c7bc6d44cb rtems: Add interrupt locks
Interrupt locks are low-level lock to protect critical sections accessed
by threads and interrupt service routines.
2013-06-12 16:11:24 +02: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
70f3719807 Remove CVS-Ids. 2012-05-04 09:36:24 +02:00
Joel Sherrill
5d44355937 PR 1991/cpukit - attr.c (really mode code) warning rework
This PR was about a warning for no previous prototype for
rtems_interrupt_level_attribute. This method exists (like
a few others) to have real bodies for Classic API services
implemented as macros. These macros are not available from
anything but C and C++. The most explicit use was in the Ada
binding but these would be needed from assembly language
or any other non-C based language.

On top of needing a prototype, the methods were misnamed.
They were related to modes.  This renames them, moves the
file, fixes test code, etc.
2012-02-02 16:57:42 -06:00
Joel Sherrill
61250b4ce9 Remove all .cvsignore files. 2012-02-01 10:59:44 -06:00
Joel Sherrill
d13eb6bf2c 2011-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1589/build
	* sp01/Makefile.am, sp02/Makefile.am, sp03/Makefile.am,
	sp04/Makefile.am, sp05/Makefile.am, sp06/Makefile.am,
	sp07/Makefile.am, sp08/Makefile.am, sp09/Makefile.am,
	sp10/Makefile.am, sp11/Makefile.am, sp12/Makefile.am,
	sp13/Makefile.am, sp14/Makefile.am, sp15/Makefile.am,
	sp16/Makefile.am, sp17/Makefile.am, sp18/Makefile.am,
	sp19/Makefile.am, sp20/Makefile.am, sp2038/Makefile.am,
	sp21/Makefile.am, sp22/Makefile.am, sp23/Makefile.am,
	sp24/Makefile.am, sp25/Makefile.am, sp26/Makefile.am,
	sp27/Makefile.am, sp27a/Makefile.am, sp28/Makefile.am,
	sp29/Makefile.am, sp30/Makefile.am, sp31/Makefile.am,
	sp32/Makefile.am, sp33/Makefile.am, sp34/Makefile.am,
	sp35/Makefile.am, sp36/Makefile.am, sp37/Makefile.am,
	sp38/Makefile.am, sp39/Makefile.am, sp40/Makefile.am,
	sp41/Makefile.am, sp42/Makefile.am, sp43/Makefile.am,
	sp44/Makefile.am, sp45/Makefile.am, sp46/Makefile.am,
	sp47/Makefile.am, sp48/Makefile.am, sp49/Makefile.am,
	sp50/Makefile.am, sp51/Makefile.am, sp52/Makefile.am,
	sp53/Makefile.am, sp54/Makefile.am, sp55/Makefile.am,
	sp56/Makefile.am, sp57/Makefile.am, sp58/Makefile.am,
	sp59/Makefile.am, sp60/Makefile.am, sp62/Makefile.am,
	sp63/Makefile.am, sp64/Makefile.am, sp65/Makefile.am,
	sp66/Makefile.am, sp67/Makefile.am, sp68/Makefile.am,
	sp69/Makefile.am, sp70/Makefile.am, sp71/Makefile.am,
	sp72/Makefile.am, sp73/Makefile.am, sp74/Makefile.am,
	sp75/Makefile.am, sp76/Makefile.am, spassoc01/Makefile.am,
	spcbssched01/Makefile.am, spcbssched02/Makefile.am,
	spcbssched03/Makefile.am, spchain/Makefile.am,
	spclockget/Makefile.am, spcoverage/Makefile.am,
	spedfsched01/Makefile.am, spedfsched02/Makefile.am,
	spedfsched03/Makefile.am, sperror01/Makefile.am,
	sperror02/Makefile.am, sperror03/Makefile.am, spfatal01/Makefile.am,
	spfatal02/Makefile.am, spfatal03/Makefile.am, spfatal04/Makefile.am,
	spfatal05/Makefile.am, spfatal06/Makefile.am, spfatal07/Makefile.am,
	spfatal08/Makefile.am, spfatal09/Makefile.am, spfatal10/Makefile.am,
	spfatal11/Makefile.am, spfatal12/Makefile.am, spfatal13/Makefile.am,
	spfatal14/Makefile.am, spfatal15/Makefile.am, spfatal16/Makefile.am,
	spfatal17/Makefile.am, spfatal18/Makefile.am, spfatal19/Makefile.am,
	spfatal20/Makefile.am, spfatal21/Makefile.am, spfatal22/Makefile.am,
	spfatal23/Makefile.am, spfatal24/Makefile.am, spfatal25/Makefile.am,
	spfifo01/Makefile.am, spfifo02/Makefile.am, spfifo03/Makefile.am,
	spfifo04/Makefile.am, spfifo05/Makefile.am, spheapprot/Makefile.am,
	spintrcritical01/Makefile.am, spintrcritical02/Makefile.am,
	spintrcritical03/Makefile.am, spintrcritical04/Makefile.am,
	spintrcritical05/Makefile.am, spintrcritical06/Makefile.am,
	spintrcritical07/Makefile.am, spintrcritical08/Makefile.am,
	spintrcritical09/Makefile.am, spintrcritical10/Makefile.am,
	spintrcritical11/Makefile.am, spintrcritical12/Makefile.am,
	spintrcritical13/Makefile.am, spintrcritical14/Makefile.am,
	spintrcritical15/Makefile.am, spintrcritical16/Makefile.am,
	spintrcritical17/Makefile.am, spmkdir/Makefile.am,
	spmountmgr01/Makefile.am, spnotepad01/Makefile.am,
	spnsext01/Makefile.am, spobjgetnext/Makefile.am,
	spprintk/Makefile.am, spprivenv01/Makefile.am,
	sprbtree01/Makefile.am, spsimplesched01/Makefile.am,
	spsimplesched02/Makefile.am, spsimplesched03/Makefile.am,
	spsize/Makefile.am, spstkalloc/Makefile.am, spthreadq01/Makefile.am,
	spwatchdog/Makefile.am, spwkspace/Makefile.am: Remove obsolete
	optional manager capability.
2011-12-08 21:38:41 +00:00
Joel Sherrill
9e15e9bfba 2011-07-24 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp04/tswitch.c, sp07/task1.c, sp07/task2.c, sp09/screen07.c,
	sp11/task1.c, sp11/task2.c, sp12/pridrv.c, sp12/pritask.c,
	sp13/task1.c, sp14/asr.c, sp14/task1.c, sp19/first.c, sp19/fptask.c,
	sp19/inttest.h, sp19/task1.c, sp20/task1.c, sp25/task1.c,
	sp26/task1.c, sp28/init.c, sp29/init.c, sp31/task1.c, sp32/init.c,
	sp33/init.c, sp34/changepri.c, sp36/strict_order_mut.c, sp37/init.c,
	sp43/init.c, sp44/init.c, sp48/init.c, sp54/init.c, sp59/init.c,
	sp65/init.c, sp68/init.c, spchain/init.c, spclockget/init.c,
	spfatal03/testcase.h, spfatal07/testcase.h, spfatal_support/init.c:
	Do not line length exceed 80 columns.
2011-07-24 22:10:20 +00:00
Ralf Corsepius
7d3f9c646a Add HAVE_CONFIG_H. 2011-02-22 07:37:03 +00:00
Ralf Corsepius
b1274bd94c Whitespace removal. 2009-11-30 03:33:25 +00:00
Joel Sherrill
380c61ac67 2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp32/Makefile.am, sp33/Makefile.am, sp37/Makefile.am,
	sp38/Makefile.am, sp39/Makefile.am, sp43/Makefile.am,
	sp44/Makefile.am, spfatal01/Makefile.am, spfatal02/Makefile.am,
	spfatal03/Makefile.am, spfatal04/Makefile.am, spfatal05/Makefile.am,
	spfatal06/Makefile.am, spfatal07/Makefile.am, spfatal08/Makefile.am,
	spfatal09/Makefile.am, spobjgetnext/Makefile.am,
	spprintk/Makefile.am, spsize/Makefile.am, spwatchdog/Makefile.am,
	spwkspace/Makefile.am: Add documentation files for multiple tests.
	* sp32/sp32.doc, sp33/sp33.doc, sp37/sp37.doc, sp38/sp38.doc,
	sp39/sp39.doc, sp43/sp43.doc, sp44/sp44.doc, spfatal01/spfatal01.doc,
	spfatal02/spfatal02.doc, spfatal03/spfatal03.doc,
	spfatal04/spfatal04.doc, spfatal05/spfatal05.doc,
	spfatal06/spfatal06.doc, spfatal07/spfatal07.doc,
	spfatal08/spfatal08.doc, spfatal09/spfatal09.doc,
	spobjgetnext/spobjgetnext.doc, spprintk/spprintk.doc,
	spsize/spsize.doc, spwatchdog/spwatchdog.doc,
	spwkspace/spwkspace.doc: New files.
2009-11-09 14:25:28 +00:00
Ralf Corsepius
82a8addafb 2009-10-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* sp37/init.c: Add local prototypes for
	rtems_interrupt_disable, rtems_interrupt_enable,
	rtems_interrupt_flash, rtems_interrupt_is_in_progress.
2009-10-29 09:34:28 +00:00
Ralf Corsepius
787114813b Add local prototype for rtems_interrupt_level_attribute. 2009-10-29 07:42:55 +00:00
Ralf Corsepius
79c49e1ae4 Add missing argument to printf. 2009-10-27 07:12:05 +00:00
Joel Sherrill
b84f1fdc0d 2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp04/system.h, sp04/task1.c, sp04/tswitch.c, sp07/init.c,
	sp12/init.c, sp13/putbuff.c, sp13/system.h, sp13/task1.c,
	sp15/init.c, sp16/system.h, sp19/fptask.c, sp25/system.h,
	sp26/task1.c, sp27/init.c, sp28/init.c, sp29/init.c, sp31/task1.c,
	sp33/init.c, sp34/changepri.c, sp35/priinv.c, sp37/init.c,
	sp38/init.c, sp39/init.c, sp41/init.c, sp42/init.c, sp43/init.c,
	sp44/init.c, sp45/init.c, sp46/init.c, sp47/init.c, sp48/init.c,
	spfatal03/testcase.h, spfatal05/testcase.h, spfatal06/testcase.h,
	spfatal_support/system.h, spobjgetnext/init.c, spsize/getint.c,
	spsize/size.c: Fix warnings.
2009-05-10 14:39:46 +00:00
Joel Sherrill
c8633f1fda 2009-04-20 Santosh G Vattam <vattam.santosh@gmail.com>
* sp37/init.c, sp37/sp37.scn: Add test case for
	rtems_interrupt_level_attribute body.
2009-04-20 15:47:32 +00:00
Ralf Corsepius
3d5483771c Eliminate _exe_/.exe. 2009-04-03 12:55:13 +00:00
Ralf Corsepius
f0157b8fd8 Convert to "bool". 2008-09-06 03:39:58 +00:00
Joel Sherrill
86db88d270 2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp28/init.c: Corrections to configuration.
	* sp37/init.c: Correctly invoke rtems_interrupt_disable() body.
	* spsize/size.c: _ISR_Vector_table only exists on architectures
	which use the Simple Vectored Interrupt Model.
2008-06-05 14:23:57 +00:00
Joel Sherrill
2186ba8064 2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp01/init.c, sp02/init.c, sp03/init.c, sp04/init.c, sp05/init.c,
	sp06/init.c, sp07/init.c, sp08/init.c, sp09/init.c, sp11/init.c,
	sp12/init.c, sp13/init.c, sp14/init.c, sp15/init.c, sp16/init.c,
	sp17/init.c, sp19/init.c, sp20/init.c, sp21/init.c, sp22/init.c,
	sp23/init.c, sp24/init.c, sp25/init.c, sp26/init.c, sp28/init.c,
	sp30/init.c, sp31/init.c, sp32/init.c, sp33/init.c, sp37/init.c,
	sp38/init.c, sp39/init.c, sp40/init.c, sp41/init.c, sp43/init.c,
	spfatal/init.c, spfatal_support/init.c, spsize/init.c: Change
	TEST_INIT to CONFIGURE_INIT. Make tmacros.h available to all POSIX
	tests. Add a clock_settime case for < 1988.
2008-02-01 00:45:11 +00:00
Joel Sherrill
6bc19a148a 2007-12-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp09/screen07.c, sp09/sp09.scn: Add test for
	rtems_message_queue_broadcast for bad buffer and count pointers.
	* sp30/init.c, sp30/sp30.scn: Add test for initiating timer server
	with bad priority or initiating twice.
	* sp37/sp37.scn, sp37/system.h: Add test for rtems_clock_tick when
	it forces a dispatch.
	* sp37/init.c: New file.
2007-12-14 17:44:15 +00:00
Joel Sherrill
dcdaba216a 2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new tests for interrupt disable,
	enable, flash, and is in progress. These are normally inlines but
	also have bodies for non-C code. This test also exercises the odd
	case of calling clock tick from outside an ISR.
	* sp37/.cvsignore, sp37/Makefile.am, sp37/sp37.scn, sp37/system.h: New files.
2007-12-13 22:41:52 +00:00