diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2011-05-25 14:38:45 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2011-05-25 14:38:45 +0000 |
commit | dc1c997b85f28f71c543057abdb1b006c33479ce (patch) | |
tree | 33b09e40a3bf026dce2655b882924a740022fedd /c/src/lib/libbsp/shared | |
parent | 2011-05-25 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-dc1c997b85f28f71c543057abdb1b006c33479ce.tar.bz2 |
2011-05-25 Jennifer Averett <Jennifer.Averett@OARcorp.com>
PR 1792/bsps
* src/lib/libbsp/i386/pc386/Makefile.am,
src/lib/libbsp/sparc/erc32/Makefile.am,
src/lib/libbsp/sparc/leon2/Makefile.am,
src/lib/libbsp/sparc/leon3/Makefile.am: Added a generic smp wait
method to sparc and i386 bsps.
* src/lib/libbsp/shared/smp/bspsmp_wait_for.c: New file.
Diffstat (limited to 'c/src/lib/libbsp/shared')
-rw-r--r-- | c/src/lib/libbsp/shared/smp/bspsmp_wait_for.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/shared/smp/bspsmp_wait_for.c b/c/src/lib/libbsp/shared/smp/bspsmp_wait_for.c new file mode 100644 index 0000000000..19b04fe5c9 --- /dev/null +++ b/c/src/lib/libbsp/shared/smp/bspsmp_wait_for.c @@ -0,0 +1,30 @@ +/* + * + * COPYRIGHT (c) 1989-2011. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id + */ + +void rtems_bsp_delay( int usec ); + +void bsp_smp_wait_for( + volatile unsigned int *address, + unsigned int desired, + int maximum_usecs +) +{ + int iterations; + volatile unsigned int *p = address; + + for (iterations=0 ; iterations < maximum_usecs ; iterations++ ) { + if ( *p == desired ) + break; + + rtems_bsp_delay( 1 ); + } +} |