Skip to content

Commit 3340576

Browse files
committed
make DMA selectable via makefile in tests, add github action
1 parent 0d3b750 commit 3340576

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.github/workflows/build-and-test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,26 @@ jobs:
3232
# Build and test standard build
3333
- name: Build and test
3434
run: cd test && make clean && make WOLFSSL_DIR=../wolfssl run
35+
36+
# Build and test standard build, with DMA and ASAN enabled
37+
- name: Build and test DMA ASAN
38+
run: cd test && make clean && make DMA=1 ASAN=1 WOLFSSL_DIR=../wolfssl run
3539

3640
# Build and test ASAN build, with wolfCrypt tests enabled.
3741
- name: Build and test ASAN TESTWOLFCRYPT
3842
run: cd test && make clean && make ASAN=1 TESTWOLFCRYPT=1 WOLFSSL_DIR=../wolfssl run
3943

4044
# Build and test ASAN build, with wolfCrypt tests enabled and using the DMA devId.
4145
- name: Build and test ASAN TESTWOLFCRYPT TESTWOLFCRYPT_DMA
42-
run: cd test && make clean && make ASAN=1 TESTWOLFCRYPT=1 TESTWOLFCRYPT_DMA=1 WOLFSSL_DIR=../wolfssl run
46+
run: cd test && make clean && make ASAN=1 TESTWOLFCRYPT=1 TESTWOLFCRYPT_DMA=1 DMA=1 WOLFSSL_DIR=../wolfssl run
4347

4448
# Build and test debug build with ASAN and NOCRYPTO
4549
- name: Build and test ASAN DEBUG NOCRYPTO
4650
run: cd test && make clean && make DEBUG=1 ASAN=1 NOCRYPTO=1 WOLFSSL_DIR=../wolfssl run
4751

48-
# Build and test debug build with ASAN
49-
- name: Build and test ASAN DEBUG
50-
run: cd test && make clean && make DEBUG=1 ASAN=1 WOLFSSL_DIR=../wolfssl run
52+
# Build and test debug build with ASAN and DMA
53+
- name: Build and test ASAN DEBUG DMA
54+
run: cd test && make clean && make DEBUG=1 ASAN=1 DMA=1 WOLFSSL_DIR=../wolfssl run
5155

5256
# Build and test with SHE and ASAN
5357
- name: Build and test ASAN SHE

test/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ ifeq ($(NOCRYPTO),1)
7777
CFLAGS += -DWOLFHSM_CFG_NO_CRYPTO
7878
endif
7979

80+
# Support a DMA-capable build
81+
ifeq ($(DMA), 1)
82+
CFLAGS += -DWOLFHSM_CFG_DMA
83+
endif
84+
8085
ifeq ($(SHE),1)
8186
CFLAGS += -DWOLFHSM_CFG_SHE_EXTENSION
8287
endif
@@ -121,6 +126,13 @@ ifeq ($(TESTWOLFCRYPT),1)
121126

122127
TESTWOLFCRYPT_DEFAULT_DEVID = 0x5748534D
123128

129+
# If TESTWOLFCRYPT_DMA is defined but DMA is not, error
130+
ifneq ($(TESTWOLFCRYPT_DMA),)
131+
ifeq ($(DMA),)
132+
$(error "TESTWOLFCRYPT_DMA=1 requires DMA=1 to be set")
133+
endif
134+
endif
135+
124136
# TESTWOLFCRYPT_DEVID and TESTWOLFCRYPT_DMA are mutually exclusive
125137
ifneq ($(TESTWOLFCRYPT_DMA),)
126138
ifneq ($(TESTWOLFCRYPT_DEVID),)

test/wolfhsm_cfg.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#define WOLFHSM_CFG_SERVER_DMAADDR_COUNT 8
4141
#define WOLFHSM_CFG_SERVER_CUSTOMCB_COUNT 6
4242

43-
#define WOLFHSM_CFG_DMA
4443
#define WOLFHSM_CFG_CERTIFICATE_MANAGER
4544
#define WOLFHSM_CFG_CERTIFICATE_MANAGER_ACERT
4645
#endif /* WOLFHSM_CFG_H_ */

0 commit comments

Comments
 (0)