Skip to content
Snippets Groups Projects
  1. Oct 09, 2020
  2. Sep 23, 2020
    • Stefan Hajnoczi's avatar
      qemu/atomic.h: rename atomic_ to qatomic_ · d73415a3
      Stefan Hajnoczi authored
      
      clang's C11 atomic_fetch_*() functions only take a C11 atomic type
      pointer argument. QEMU uses direct types (int, etc) and this causes a
      compiler error when a QEMU code calls these functions in a source file
      that also included <stdatomic.h> via a system header file:
      
        $ CC=clang CXX=clang++ ./configure ... && make
        ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)
      
      Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
      used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
      and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
      searched GitHub for existing "qatomic_" users but there seem to be none.
      
      This patch was generated using:
      
        $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
          sort -u >/tmp/changed_identifiers
        $ for identifier in $(</tmp/changed_identifiers); do
              sed -i "s%\<$identifier\>%q$identifier%g" \
                  $(git grep -I -l "\<$identifier\>")
          done
      
      I manually fixed line-wrap issues and misaligned rST tables.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200923105646.47864-1-stefanha@redhat.com>
      d73415a3
  3. Sep 16, 2020
  4. Aug 21, 2020
  5. Jul 10, 2020
  6. Apr 29, 2020
    • Philippe Mathieu-Daudé's avatar
      various: Remove suspicious '\' character outside of #define in C code · 78ee6bd0
      Philippe Mathieu-Daudé authored
      
      Fixes the following coccinelle warnings:
      
        $ spatch --sp-file --verbose-parsing  ... \
            scripts/coccinelle/remove_local_err.cocci
        ...
        SUSPICIOUS: a \ character appears outside of a #define at ./target/ppc/translate_init.inc.c:5213
        SUSPICIOUS: a \ character appears outside of a #define at ./target/ppc/translate_init.inc.c:5261
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:166
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:167
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:169
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:170
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:171
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:172
        SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:173
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5787
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5789
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5800
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5801
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5802
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5804
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5805
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5806
        SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:6329
        SUSPICIOUS: a \ character appears outside of a #define at ./hw/sd/sdhci.c:1133
        SUSPICIOUS: a \ character appears outside of a #define at ./hw/scsi/scsi-disk.c:3081
        SUSPICIOUS: a \ character appears outside of a #define at ./hw/net/virtio-net.c:1529
        SUSPICIOUS: a \ character appears outside of a #define at ./hw/riscv/sifive_u.c:468
        SUSPICIOUS: a \ character appears outside of a #define at ./dump/dump.c:1895
        SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2209
        SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2215
        SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2221
        SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2222
        SUSPICIOUS: a \ character appears outside of a #define at ./block/replication.c:172
        SUSPICIOUS: a \ character appears outside of a #define at ./block/replication.c:173
      
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200412223619.11284-2-f4bug@amsat.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      78ee6bd0
  7. Apr 04, 2020
  8. Apr 03, 2020
  9. Dec 18, 2019
  10. Aug 16, 2019
    • Markus Armbruster's avatar
      sysemu: Split sysemu/runstate.h off sysemu/sysemu.h · 54d31236
      Markus Armbruster authored
      
      sysemu/sysemu.h is a rather unfocused dumping ground for stuff related
      to the system-emulator.  Evidence:
      
      * It's included widely: in my "build everything" tree, changing
        sysemu/sysemu.h still triggers a recompile of some 1100 out of 6600
        objects (not counting tests and objects that don't depend on
        qemu/osdep.h, down from 5400 due to the previous two commits).
      
      * It pulls in more than a dozen additional headers.
      
      Split stuff related to run state management into its own header
      sysemu/runstate.h.
      
      Touching sysemu/sysemu.h now recompiles some 850 objects.  qemu/uuid.h
      also drops from 1100 to 850, and qapi/qapi-types-run-state.h from 4400
      to 4200.  Touching new sysemu/runstate.h recompiles some 500 objects.
      
      Since I'm touching MAINTAINERS to add sysemu/runstate.h anyway, also
      add qemu/main-loop.h.
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190812052359.30071-30-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      [Unbreak OS-X build]
      54d31236
    • Markus Armbruster's avatar
      Clean up inclusion of sysemu/sysemu.h · d5938f29
      Markus Armbruster authored
      
      In my "build everything" tree, changing sysemu/sysemu.h triggers a
      recompile of some 5400 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Almost a third of its inclusions are actually superfluous.  Delete
      them.  Downgrade two more to qapi/qapi-types-run-state.h, and move one
      from char/serial.h to char/serial.c.
      
      hw/semihosting/config.c, monitor/monitor.c, qdev-monitor.c, and
      stubs/semihost.c define variables declared in sysemu/sysemu.h without
      including it.  The compiler is cool with that, but include it anyway.
      
      This doesn't reduce actual use much, as it's still included into
      widely included headers.  The next commit will tackle that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-27-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      d5938f29
    • Markus Armbruster's avatar
      Include qemu/main-loop.h less · db725815
      Markus Armbruster authored
      
      In my "build everything" tree, changing qemu/main-loop.h triggers a
      recompile of some 5600 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).  It includes block/aio.h,
      which in turn includes qemu/event_notifier.h, qemu/notify.h,
      qemu/processor.h, qemu/qsp.h, qemu/queue.h, qemu/thread-posix.h,
      qemu/thread.h, qemu/timer.h, and a few more.
      
      Include qemu/main-loop.h only where it's needed.  Touching it now
      recompiles only some 1700 objects.  For block/aio.h and
      qemu/event_notifier.h, these numbers drop from 5600 to 2800.  For the
      others, they shrink only slightly.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190812052359.30071-21-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      db725815
  11. Jul 02, 2019
Loading