Home | History | Annotate | Download | only in smc_pa_ctrl
      1 /**
      2  * Copyright(c) 2011 Trusted Logic.   All rights reserved.
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions
      6  * are met:
      7  *
      8  *  * Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  *  * Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in
     12  *    the documentation and/or other materials provided with the
     13  *    distribution.
     14  *  * Neither the name Trusted Logic nor the names of its
     15  *    contributors may be used to endorse or promote products derived
     16  *    from this software without specific prior written permission.
     17  *
     18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  */
     30 
     31 #ifndef __S_VERSION_H__
     32 #define __S_VERSION_H__
     33 
     34 /*
     35  * Usage: define S_VERSION_BUILD on the compiler's command line.
     36  *
     37  * Then set:
     38  * - S_VERSION_OS
     39  * - S_VERSION_PLATFORM
     40  * - S_VERSION_MAIN
     41  * - S_VERSION_ENG is optional
     42  * - S_VERSION_PATCH is optional
     43  * - S_VERSION_BUILD = 0 if S_VERSION_BUILD not defined or empty
     44  */
     45 #if defined(WIN32)
     46 #define S_VERSION_OS "W"          /* "W" for Windows PC (XP, Vista) */
     47 #define S_VERSION_PLATFORM "X"    /* "X" for ix86 PC simulators */
     48 #elif defined(__ANDROID32__)
     49 #define S_VERSION_OS "A"          /* "A" for Android */
     50 #define S_VERSION_PLATFORM "G"    /* "G" for 4430 */
     51 #elif defined(LINUX)
     52 #define S_VERSION_OS "L"          /* "L" for Linux */
     53 #define S_VERSION_PLATFORM "X"    /* "X" for ix86 PC simulators */
     54 #else
     55 #define S_VERSION_OS "X"          /* "X" for Secure-World */
     56 #define S_VERSION_PLATFORM "G"    /* "G" for 4430 */
     57 #endif
     58 
     59 /*
     60  * This version number must be updated for each new release
     61  */
     62 #define S_VERSION_MAIN  "01.04"
     63 #define S_VERSION_RESOURCE 1,4,0,S_VERSION_BUILD
     64 
     65 /*
     66 * If this is a patch or engineering version use the following
     67 * defines to set the version number. Else set these values to 0.
     68 */
     69 #define S_VERSION_PATCH 11
     70 #define S_VERSION_ENG 0
     71 
     72 #ifdef S_VERSION_BUILD
     73 /* TRICK: detect if S_VERSION is defined but empty */
     74 #if 0 == S_VERSION_BUILD-0
     75 #undef  S_VERSION_BUILD
     76 #define S_VERSION_BUILD 0
     77 #endif
     78 #else
     79 /* S_VERSION_BUILD is not defined */
     80 #define S_VERSION_BUILD 0
     81 #endif
     82 
     83 #define __STRINGIFY(X) #X
     84 #define __STRINGIFY2(X) __STRINGIFY(X)
     85 
     86 #if S_VERSION_ENG != 0
     87 #define _S_VERSION_ENG "e" __STRINGIFY2(S_VERSION_ENG)
     88 #else
     89 #define _S_VERSION_ENG ""
     90 #endif
     91 
     92 #if S_VERSION_PATCH != 0
     93 #define _S_VERSION_PATCH "p" __STRINGIFY2(S_VERSION_PATCH)
     94 #else
     95 #define _S_VERSION_PATCH ""
     96 #endif
     97 
     98 #if !defined(NDEBUG) || defined(_DEBUG)
     99 #define S_VERSION_VARIANT "D   "
    100 #else
    101 #define S_VERSION_VARIANT "    "
    102 #endif
    103 
    104 #define S_VERSION_STRING \
    105 	"SMC" \
    106 	S_VERSION_OS \
    107 	S_VERSION_PLATFORM \
    108 	S_VERSION_MAIN \
    109 	_S_VERSION_PATCH \
    110 	_S_VERSION_ENG \
    111 	"."  __STRINGIFY2(S_VERSION_BUILD) " " \
    112 	S_VERSION_VARIANT
    113 
    114 #endif /* __S_VERSION_H__ */
    115