ubsan: alpha-coff: signed integer overflow
[deliverable/binutils-gdb.git] / sim / common / dv-cfi.c
index 42d868c8f28aa24ae4c40803d85994a3ff23a452..fc31d79038f35bb20bb55b9efe4374c0b3ddf3b0 100644 (file)
@@ -2,7 +2,7 @@
    http://www.spansion.com/Support/AppNotes/CFI_Spec_AN_03.pdf
    http://www.spansion.com/Support/AppNotes/cfi_100_20011201.pdf
 
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2020 Free Software Foundation, Inc.
    Contributed by Analog Devices, Inc.
 
    This file is part of simulators.
 
 /* TODO: support vendor query tables.  */
 
-#include "cconfig.h"
+#include "config.h"
 
 #include <math.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <stdbool.h>
 #include <unistd.h>
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
@@ -726,7 +727,7 @@ attach_cfi_regs (struct hw *me, struct cfi *cfi)
   /* Figure out where our initial flash data is coming from.  */
   if (fd != -1 && fd_writable)
     {
-#ifdef HAVE_MMAP
+#if defined (HAVE_MMAP) && defined (HAVE_POSIX_FALLOCATE)
       posix_fallocate (fd, 0, cfi->dev_size);
 
       cfi->mmap = mmap (NULL, cfi->dev_size,
This page took 0.025401 seconds and 4 git commands to generate.