Changeset fe46647e in rtems


Ignore:
Timestamp:
Jun 15, 2018, 2:53:27 PM (10 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ebc5cfd
Parents:
c47ad8e
git-author:
Sebastian Huber <sebastian.huber@…> (06/15/18 14:53:27)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/21/18 09:21:04)
Message:

score: Macros to declare and define global symbols

Add RTEMS_DEFINE_GLOBAL_SYMBOL() and add RTEMS_DECLARE_GLOBAL_SYMBOL().

Update #3459.

Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/basedefs.h

    rc47ad8e rfe46647e  
    1111 *  On-Line Applications Research Corporation (OAR).
    1212 *
    13  *  Copyright (c) 2010, 2017 embedded brains GmbH.
     13 *  Copyright (c) 2010, 2018 embedded brains GmbH.
    1414 *
    1515 *  The license and distribution terms for this file may be
     
    248248#else
    249249  #define RTEMS_OBFUSCATE_VARIABLE( _var ) (void) (_var)
     250#endif
     251
     252/**
     253 * @brief Declares a global symbol with the specified name.
     254 *
     255 * This macro must be placed at file scope.
     256 *
     257 * The name must be a valid designator.
     258 */
     259#define RTEMS_DECLARE_GLOBAL_SYMBOL( _name ) \
     260  extern char _name[];
     261
     262/**
     263 * @brief Defines a global symbol with the specified name and value.
     264 *
     265 * This macro must be placed at file scope.
     266 *
     267 * The name must be a valid designator.
     268 *
     269 * On the value parameters macro expansion is performed and afterwards it is
     270 * stringified.  It must expand to an integer literal understood by the
     271 * assembler.
     272 */
     273#if defined(__GNUC__)
     274  #define RTEMS_DEFINE_GLOBAL_SYMBOL( _name, _value ) \
     275    __asm__( \
     276      "\t.globl " RTEMS_XSTRING( __USER_LABEL_PREFIX__ ) #_name \
     277      "\n\t.set " RTEMS_XSTRING( __USER_LABEL_PREFIX__ ) #_name \
     278      ", " RTEMS_STRING( _value ) "\n" \
     279    )
     280#else
     281  #define RTEMS_DEFINE_GLOBAL_SYMBOL( _name, _value )
    250282#endif
    251283
  • testsuites/sptests/Makefile.am

    rc47ad8e rfe46647e  
    14941494endif
    14951495
     1496if TEST_spmisc01
     1497sp_tests += spmisc01
     1498sp_screens += spmisc01/spmisc01.scn
     1499sp_docs += spmisc01/spmisc01.doc
     1500spmisc01_SOURCES = spmisc01/init.c
     1501spmisc01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spmisc01) \
     1502        $(support_includes)
     1503endif
     1504
    14961505if TEST_spmountmgr01
    14971506sp_tests += spmountmgr01
  • testsuites/sptests/configure.ac

    rc47ad8e rfe46647e  
    195195RTEMS_TEST_CHECK([splinkersets01])
    196196RTEMS_TEST_CHECK([spmkdir])
     197RTEMS_TEST_CHECK([spmisc01])
    197198RTEMS_TEST_CHECK([spmountmgr01])
    198199RTEMS_TEST_CHECK([spmrsp01])
Note: See TracChangeset for help on using the changeset viewer.