diff --git a/armsrc/Makefile b/armsrc/Makefile index f3caf6e22..04590554d 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -124,8 +124,11 @@ THUMBSRC = start.c \ BigBuf.c \ ticks.c \ clocks.c \ - hfsnoop.c - + hfsnoop.c \ + umm_info.c \ + umm_integrity.c \ + umm_malloc.c \ + umm_poison.c # These are to be compiled in ARM mode ARMSRC = fpgaloader.c \ diff --git a/armsrc/dbprint.h b/armsrc/dbprint.h index 993e06289..509d3c2c0 100644 --- a/armsrc/dbprint.h +++ b/armsrc/dbprint.h @@ -50,4 +50,26 @@ void Dbhexdump(int len, uint8_t *d, bool bAsci); void print_result(const char *name, uint8_t *buf, size_t len); //void PrintToSendBuffer(void); +// Functions for umm_malloc +// Alternatively, use https://github.com/rhempel/c-helper-macros/blob/develop/dbglog/dbglog.h +#define DBGLOG_FORCE(...) {\ + Dbprintf (__VA_ARGS__); \ + } + +#define DBGLOG_ERROR(...) {\ + if (DBGLEVEL >= DBG_ERROR) Dbprintf (__VA_ARGS__); \ + } + +#define DBGLOG_CRITICAL(...) {\ + if (DBGLEVEL >= DBG_ERROR) Dbprintf (__VA_ARGS__); \ + } + +#define DBGLOG_DEBUG(...) {\ + if (DBGLEVEL >= DBG_DEBUG) Dbprintf (__VA_ARGS__); \ + } + +#define DBGLOG_TRACE(...) {\ + if (DBGLEVEL >= DBG_EXTENDED) Dbprintf (__VA_ARGS__); \ + } + #endif diff --git a/armsrc/umm_malloc.c b/armsrc/umm_malloc.c index 459dd44a6..38006ace2 100644 --- a/armsrc/umm_malloc.c +++ b/armsrc/umm_malloc.c @@ -48,7 +48,8 @@ #define DBGLOG_LEVEL 0 -#include "dbglog/dbglog.h" +//#include "dbglog/dbglog.h" +#include "dbprint.h" extern void *UMM_MALLOC_CFG_HEAP_ADDR; extern uint32_t UMM_MALLOC_CFG_HEAP_SIZE;