summaryrefslogtreecommitdiffstats
path: root/libstb/tss/trustedboot.H
blob: dccee1a7c8d11007bd2cddf2f8db0db349757291 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 /* Copyright 2013-2016 IBM Corp.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  * implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */

/***************************************************************
 * This file maps some routines and types from TSS and tpmLogMgr
 * codes to equivalent routines and types in skiboot.
 ***************************************************************/

#ifndef __TRUSTEDBOOT_H
#define __TRUSTEDBOOT_H

#include <skiboot.h>
#include <stdint.h>
#include <stdio.h>
#include <lock.h>

/* Failure trace routines */
#define TRACFCOMP(TB, fmt, ...) prlog(PR_ERR, "TSS: " fmt "\n", ##__VA_ARGS__);
//#define TRACFCOMP(args...)

/* Debug trace routines */
//#define TRACDCOMP(TB, fmt, ...) prlog(PR_DEBUG, "TSS: " fmt "\n", ##__VA_ARGS__)
#define TRACDCOMP(args...)

//#define TRACUCOMP(TB, fmt, ...) prlog(PR_DEBUG, "TSS: " fmt "\n", ##__VA_ARGS__);
#define TRACUCOMP(args...)

//#define TRACUBIN(TB, fmt, ...) prlog(PR_DEBUG, "TSS: " fmt "\n", ##__VA_ARGS__);
#define TRACUBIN(args...)

#define g_trac_trustedboot NULL
#define g_trac_tpmdd NULL
typedef uint32_t errlHndl_t;
#define TB_SUCCESS 0
#define htole32(val) cpu_to_le32(val)
#define le32toh(val) le32_to_cpu(val)
#define le16toh(val) le16_to_cpu(val)
#define htole16(val) cpu_to_le16(val)

#define mutex_init(mutex) init_lock(mutex)
#define mutex_lock(mutex) lock(mutex)
#define mutex_unlock(mutex) unlock(mutex)
#define mutex_t struct lock

typedef enum {
    PCR_0 = 0,
    PCR_1 = 1,
    PCR_2 = 2,
    PCR_3 = 3,
    PCR_4 = 4,
    PCR_5 = 5,
    PCR_6 = 6,
    PCR_7 = 7,
    /* As defined in the TCG PC Client Platform TPM Profile (PTP)
     * Specification, Revision 00.43. (TPM_PT_PCR_COUNT) */
    IMPLEMENTATION_PCR = 24
} TPM_Pcr;

#endif
OpenPOWER on IntegriCloud