/* 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"
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);
dma->ndph = _flows[1];
--ndsize;
++flows;
+ ATTRIBUTE_FALLTHROUGH;
case DMAFLOW_SMALL:
dma->ndpl = _flows[0];
--ndsize;
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;
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;