summaryrefslogtreecommitdiffstats
path: root/pk/gpe/gpe_timebase.h
blob: 3c27bdfb6c4082782acc2817f9660c001fd5a207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __GPE_TIMEBASE_H__
#define __GPE_TIMEBASE_H__

//-----------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2015
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//-----------------------------------------------------------------------------

/// \file gpe_timebase.h
/// \brief support for using the OCB 32 bit timebase register
///
/// The OCB timebase register is a 32 bit count-up register that is shared
/// by all GPE's in the OCC complex.

#include "pk.h"

//The timebase register is not yet supported in the OCB model.
//remove this line once it is supported.
#define APPCFG_USE_DEC_FOR_TIMEBASE

#ifndef __ASSEMBLER__

#ifndef APPCFG_USE_DEC_FOR_TIMEBASE
static inline
uint32_t pk_timebase32_get(void)
{
    return in32(OCB_OTBR);
}

#else
//assembly function is defined in ppe42_timebase.S
uint32_t pk_timebase32_get(void);

#endif /* APPCFG_USE_DEC_FOR_TIMEBASE */

#else

    .macro _pk_timebase32_get rT, rA
        _lwzi \rT, \rA, OCB_OTBR
    .endm
#endif  /* __ASSEMBLER__ */

#endif /* __GPE_TIMEBASE_H__ */
OpenPOWER on IntegriCloud