From d1012863307128061c4285a144c84ae736f3edeb Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Tue, 12 Jul 2016 22:48:53 -0400 Subject: Make probe_cores deal with an unconfigured FPGA (and come back later). See, reading from an unconfigured FPGA returns all-1, while reading from empty cores on a configured FPGA returns all-0. The consequence of this is that the HSM was probing the FPGA once on startup, filling its core table with 0xff, rendering the FPGA useless. Along the way, I put the FPGA core table in static memory, rather than malloc'ing it, because that's not so good in an embedded environment. But I kept the linked list, because that at least tells us what to do if HAL_STATIC_CORE_STATE_BLOCKS is 0. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b6597e1..190466b 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ # Number of static hash and HMAC state blocks to allocate. # Numbers pulled out of a hat, just testing. +STATIC_CORE_STATE_BLOCKS = 32 STATIC_HASH_STATE_BLOCKS = 10 STATIC_HMAC_STATE_BLOCKS = 4 STATIC_PKEY_STATE_BLOCKS = 6 @@ -185,6 +186,7 @@ LIBTFM_BLD ?= ${LIBTFM_SRC} # directory. CFLAGS += -g3 -Wall -std=c99 -Wno-strict-aliasing +CFLAGS += -DHAL_STATIC_CORE_STATE_BLOCKS=${STATIC_CORE_STATE_BLOCKS} CFLAGS += -DHAL_STATIC_HASH_STATE_BLOCKS=${STATIC_HASH_STATE_BLOCKS} CFLAGS += -DHAL_STATIC_HMAC_STATE_BLOCKS=${STATIC_HMAC_STATE_BLOCKS} CFLAGS += -DHAL_STATIC_PKEY_STATE_BLOCKS=${STATIC_PKEY_STATE_BLOCKS} -- cgit v1.2.3