~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/skiboot/libpore/fapi_sbe_common.H

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* IBM_PROLOG_BEGIN_TAG                                                   */
 
2
/* This is an automatically generated prolog.                             */
 
3
/*                                                                        */
 
4
/* $Source: src/usr/hwpf/hwp/include/fapi_sbe_common.H $                  */
 
5
/*                                                                        */
 
6
/* OpenPOWER HostBoot Project                                             */
 
7
/*                                                                        */
 
8
/* COPYRIGHT International Business Machines Corp. 2012,2014              */
 
9
/*                                                                        */
 
10
/* Licensed under the Apache License, Version 2.0 (the "License");        */
 
11
/* you may not use this file except in compliance with the License.       */
 
12
/* You may obtain a copy of the License at                                */
 
13
/*                                                                        */
 
14
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
 
15
/*                                                                        */
 
16
/* Unless required by applicable law or agreed to in writing, software    */
 
17
/* distributed under the License is distributed on an "AS IS" BASIS,      */
 
18
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
 
19
/* implied. See the License for the specific language governing           */
 
20
/* permissions and limitations under the License.                         */
 
21
/*                                                                        */
 
22
/* IBM_PROLOG_END_TAG                                                     */
 
23
#ifndef __FAPI_SBE_COMMON_H
 
24
#define __FAPI_SBE_COMMON_H
 
25
 
 
26
// $Id: fapi_sbe_common.H,v 1.1 2012/04/16 23:55:37 bcbrock Exp $
 
27
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/fapi_sbe_common.H,v $
 
28
//------------------------------------------------------------------------------
 
29
// *! (C) Copyright International Business Machines Corp. 2011
 
30
// *! All Rights Reserved -- Property of IBM
 
31
// *! *** IBM Confidential ***
 
32
//------------------------------------------------------------------------------
 
33
// *! OWNER NAME  :               Email:
 
34
 
 
35
/// \file fapi_sbe_common.H
 
36
/// \brief Definitions common to FAPI and SBE procedures
 
37
///
 
38
/// Several preprocessor macros are required to have different definitions in
 
39
/// C, C++ and SBE assembly procedures.  These common forms are collected here.
 
40
 
 
41
#if defined __ASSEMBLER__
 
42
 
 
43
#define CONST_UINT8_T(name, expr) .set name, (expr)
 
44
#define CONST_UINT32_T(name, expr) .set name, (expr)
 
45
#define CONST_UINT64_T(name, expr) .set name, (expr)
 
46
 
 
47
#define ULL(x) x
 
48
 
 
49
#elif defined __cplusplus
 
50
 
 
51
#include <stdint.h>
 
52
 
 
53
#define CONST_UINT8_T(name, expr) const uint8_t name = (expr);
 
54
#define CONST_UINT32_T(name, expr) const uint32_t name = (expr);
 
55
#define CONST_UINT64_T(name, expr) const uint64_t name = (expr);
 
56
 
 
57
#define ULL(x) x##ull
 
58
 
 
59
#else // C code
 
60
 
 
61
// CONST_UINT[8,3,64]_T() can't be used in C code/headers; Use 
 
62
//
 
63
//     #define <symbol> <value> [ or ULL(<value>) for 64-bit constants
 
64
 
 
65
#define ULL(x) x##ull
 
66
 
 
67
#endif  // __ASSEMBLER__
 
68
 
 
69
#endif  // __FAPI_SBE_COMMON_H