]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/bfin/dv-bfin_dma.c
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / sim / bfin / dv-bfin_dma.c
index 06fe5ed738bae9297dbaffa8727c46b9dc4e4130..2978ae72697ce261c1f1cbc87bd7cf03a113fb23 100644 (file)
@@ -1,6 +1,6 @@
 /* Blackfin Direct Memory Access (DMA) Channel model.
 
-   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+   Copyright (C) 2010-2024 Free Software Foundation, Inc.
    Contributed by Analog Devices, Inc.
 
    This file is part of simulators.
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "config.h"
+/* This must come before any other includes.  */
+#include "defs.h"
+
+#include <stdlib.h>
 
 #include "sim-main.h"
 #include "devices.h"
@@ -135,17 +138,17 @@ bfin_dma_process_desc (struct hw *me, struct bfin_dma *dma)
     case DMAFLOW_ARRAY:
       if (ndsize == 0 || ndsize > 7)
        hw_abort (me, "DMA config error: DMAFLOW_ARRAY requires NDSIZE 1...7");
-      sim_read (hw_system (me), dma->curr_desc_ptr, (void *)flows, ndsize * 2);
+      sim_read (hw_system (me), dma->curr_desc_ptr, flows, ndsize * 2);
       break;
     case DMAFLOW_SMALL:
       if (ndsize == 0 || ndsize > 8)
        hw_abort (me, "DMA config error: DMAFLOW_SMALL requires NDSIZE 1...8");
-      sim_read (hw_system (me), dma->next_desc_ptr, (void *)flows, ndsize * 2);
+      sim_read (hw_system (me), dma->next_desc_ptr, flows, ndsize * 2);
       break;
     case DMAFLOW_LARGE:
       if (ndsize == 0 || ndsize > 9)
        hw_abort (me, "DMA config error: DMAFLOW_LARGE requires NDSIZE 1...9");
-      sim_read (hw_system (me), dma->next_desc_ptr, (void *)flows, ndsize * 2);
+      sim_read (hw_system (me), dma->next_desc_ptr, flows, ndsize * 2);
       break;
     default:
       hw_abort (me, "DMA config error: invalid DMAFLOW %#x", dma->config);
@@ -170,6 +173,7 @@ bfin_dma_process_desc (struct hw *me, struct bfin_dma *dma)
          dma->ndph = _flows[1];
          --ndsize;
          ++flows;
+         ATTRIBUTE_FALLTHROUGH;
        case DMAFLOW_SMALL:
          dma->ndpl = _flows[0];
          --ndsize;
@@ -328,7 +332,7 @@ bfin_dma_io_write_buffer (struct hw *me, const void *source, int space,
     value = dv_load_2 (source);
 
   mmr_off = addr % dma->base;
-  valuep = (void *)((unsigned long)dma + mmr_base() + mmr_off);
+  valuep = (void *)((uintptr_t)dma + mmr_base() + mmr_off);
   value16p = valuep;
   value32p = valuep;
 
@@ -426,7 +430,7 @@ bfin_dma_io_read_buffer (struct hw *me, void *dest, int space,
     return 0;
 
   mmr_off = addr % dma->base;
-  valuep = (void *)((unsigned long)dma + mmr_base() + mmr_off);
+  valuep = (void *)((uintptr_t)dma + mmr_base() + mmr_off);
   value16p = valuep;
   value32p = valuep;