Skip to content

Commit

Permalink
[Hexagon] Guard UserDMA code with architecture check (#10770)
Browse files Browse the repository at this point in the history
UserDMA is only available in Hexagon V68 and later.
This fixes issue #10768.
  • Loading branch information
Krzysztof Parzyszek committed Mar 24, 2022
1 parent 4bff490 commit 3918717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/runtime/hexagon/hexagon/hexagon_user_dma.cc
Expand Up @@ -29,7 +29,7 @@ namespace runtime {
namespace hexagon {

int init_hexagon_user_dma() {
#if defined(__hexagon__)
#if defined(__hexagon__) && __HEXAGON_ARCH__ >= 68
// reset DMA engine
unsigned int status = dmpause() & DM0_STATUS_MASK;
if (status != DM0_STATUS_IDLE) {
Expand All @@ -40,7 +40,7 @@ int init_hexagon_user_dma() {
}

int hexagon_user_dma_1d_sync(void* dst, void* src, uint32_t length) {
#if defined(__hexagon__)
#if defined(__hexagon__) && __HEXAGON_ARCH__ >= 68
static int config_dma = init_hexagon_user_dma();
if (config_dma != DMA_SUCCESS) {
return DMA_FAILURE;
Expand Down
Expand Up @@ -24,7 +24,7 @@ namespace tvm {
namespace runtime {
namespace hexagon {

#if defined(__hexagon__)
#if defined(__hexagon__) && __HEXAGON_ARCH__ >= 68

inline unsigned int dmpause() {
unsigned int dm0 = 0;
Expand Down

0 comments on commit 3918717

Please sign in to comment.