aboutsummaryrefslogtreecommitdiff
path: root/libstb/tss2
diff options
context:
space:
mode:
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>2020-06-01 17:34:33 -0300
committerOliver O'Halloran <oohall@gmail.com>2020-10-01 13:42:40 +1000
commit48833b96098ce14260cdc9711b25ce424129f6a5 (patch)
tree8438c494ca3cb5479129daf509890dec9c4e8811 /libstb/tss2
parent65192599d2364dbe0c078b6beb7810318dd9ce18 (diff)
downloadskiboot-48833b96098ce14260cdc9711b25ce424129f6a5.zip
skiboot-48833b96098ce14260cdc9711b25ce424129f6a5.tar.gz
skiboot-48833b96098ce14260cdc9711b25ce424129f6a5.tar.bz2
libstb/tss2: Add basic Build infrastructure for tss2
Co-authored-by: Eric Richter <erichte@linux.ibm.com> Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'libstb/tss2')
-rw-r--r--libstb/tss2/Makefile.inc34
-rw-r--r--libstb/tss2/netinet/in.h16
2 files changed, 50 insertions, 0 deletions
diff --git a/libstb/tss2/Makefile.inc b/libstb/tss2/Makefile.inc
new file mode 100644
index 0000000..15514ae
--- /dev/null
+++ b/libstb/tss2/Makefile.inc
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+# Copyright 2020 IBM Corp
+# -*-Makefile-*-
+
+LIBSTB_DIR = libstb
+TSS2_DIR = $(LIBSTB_DIR)/tss2
+IBMTSS_DIR = $(TSS2_DIR)/ibmtpm20tss/utils
+
+SUBDIRS += $(TSS2_DIR) $(IBMTSS_DIR)
+
+CPPFLAGS += -I$(SRC)/$(LIBSTB_DIR)
+CPPFLAGS += -I$(SRC)/$(TSS2_DIR)
+CPPFLAGS += -I$(SRC)/$(IBMTSS_DIR)
+
+TSS2LIB_SRCS = tssprint.c tssprintcmd.c tssmarshal.c Unmarshal.c Commands.c
+TSS2LIB_SRCS += CommandAttributeData.c tssresponsecode.c tssccattributes.c
+
+TSS2_SRCS = $(addprefix ibmtpm20tss/utils/,$(TSS2LIB_SRCS))
+
+TSS2_OBJS = $(TSS2_SRCS:%.c=%.o)
+
+CFLAGS_$(TSS2_DIR)/ = -DTPM_POSIX -DTPM_TPM20
+CFLAGS_$(TSS2_DIR)/ += -DTPM_NOSOCKET -DTPM_TSS_NODEPRECATED
+CFLAGS_$(TSS2_DIR)/ += -DTPM_TSS_NOECC -DTPM_TSS_NORSA -DTPM_TSS_NOCRYPTO
+CFLAGS_$(TSS2_DIR)/ += -DTPM_TSS_NOFILE -DTPM_TSS_NOENV -DTPM_TSS_NOCMDCHECK
+
+CFLAGS_$(IBMTSS_DIR)/ = $(CFLAGS_$(TSS2_DIR)/)
+
+CFLAGS_SKIP_$(TSS2_DIR)/ = -Wsuggest-attribute=const
+CFLAGS_SKIP_$(IBMTSS_DIR)/ = $(CFLAGS_SKIP_$(TSS2_DIR)/)
+
+TSS2 = $(TSS2_DIR)/built-in.a
+
+$(TSS2): $(TSS2_OBJS:%=$(TSS2_DIR)/%)
diff --git a/libstb/tss2/netinet/in.h b/libstb/tss2/netinet/in.h
new file mode 100644
index 0000000..d8f5c5c
--- /dev/null
+++ b/libstb/tss2/netinet/in.h
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+/* Copyright 2020 IBM Corp. */
+
+#ifndef _NETINIT_IN_H
+#define _NETINIT_IN_H
+
+//#pragma message "Implment in.h functions \n"
+
+#include <include/types.h>
+
+#define htonl(x) cpu_to_be32(x)
+#define ntohl(x) be32_to_cpu(x)
+#define htons(x) cpu_to_be16(x)
+#define ntohs(x) be16_to_cpu(x)
+
+#endif /* _NETINIT_IN_H */