Skip to content

Commit 3e3e1c7

Browse files
committed
change(aes): refactor DMA buffer allocation
1 parent b52b99a commit 3e3e1c7

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

components/mbedtls/port/aes/dma/esp_aes_dma_core.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "esp_attr.h"
99
#include "esp_cache.h"
1010
#include "esp_check.h"
11-
#include "esp_dma_utils.h"
1211
#include "esp_err.h"
1312
#include "esp_heap_caps.h"
1413
#include "esp_intr_alloc.h"
@@ -323,13 +322,7 @@ static inline void dma_desc_append(crypto_dma_desc_t **head, crypto_dma_desc_t *
323322

324323
static inline void *aes_dma_calloc(size_t num, size_t size, uint32_t caps, size_t *actual_size)
325324
{
326-
void *ptr = NULL;
327-
esp_dma_mem_info_t dma_mem_info = {
328-
.extra_heap_caps = caps,
329-
.dma_alignment_bytes = DMA_DESC_MEM_ALIGN_SIZE,
330-
};
331-
esp_dma_capable_calloc(num, size, &dma_mem_info, &ptr, actual_size);
332-
return ptr;
325+
return heap_caps_aligned_calloc(DMA_DESC_MEM_ALIGN_SIZE, num, size, caps | MALLOC_CAP_DMA | MALLOC_CAP_8BIT);
333326
}
334327

335328
static inline esp_err_t dma_desc_link(crypto_dma_desc_t *dmadesc, size_t crypto_dma_desc_num, size_t cache_line_size)

components/mbedtls/port/sha/dma/sha.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <stdio.h>
3030
#include <sys/lock.h>
3131

32-
#include "esp_dma_utils.h"
3332
#include "esp_private/esp_crypto_lock_internal.h"
3433
#include "esp_private/esp_cache_private.h"
3534
#include "esp_log.h"

0 commit comments

Comments
 (0)