diff options
author | Paul Selkirk <paul@psgd.org> | 2016-07-12 22:48:53 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2016-07-12 22:48:53 -0400 |
commit | d1012863307128061c4285a144c84ae736f3edeb (patch) | |
tree | 9139fc73af9fe5dc50845d9487600a18ec9a9248 /Makefile | |
parent | 20d94fd816ad1755086501547aaffdda7916235a (diff) |
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.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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} |