qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alessandro Di Federico <ale+qemu@clearmind.me>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/7] Factor out *-user/mmap.c
Date: Tue, 28 Feb 2017 18:19:16 +0100	[thread overview]
Message-ID: <20170228171921.21602-3-ale+qemu@clearmind.me> (raw)
In-Reply-To: <20170228171921.21602-1-ale+qemu@clearmind.me>

This commit moves linux-user/mmap.c to the top level directory so that
it can be employed by bsd-user (when it will be back in a working shape)
and libtcg.
---
 Makefile.target             |  1 +
 include/qemu-user-common.h  | 17 +++++++++++++++++
 linux-user/Makefile.objs    |  2 +-
 linux-user/qemu.h           | 16 ----------------
 linux-user/mmap.c => mmap.c |  0
 5 files changed, 19 insertions(+), 17 deletions(-)
 rename linux-user/mmap.c => mmap.c (100%)

diff --git a/Makefile.target b/Makefile.target
index 924304c9e6..cf8adc3ced 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -89,6 +89,7 @@ all: $(PROGS) stap
 #########################################################
 # cpu emulator library
 obj-y = exec.o translate-all.o cpu-exec.o
+obj-$(call land,$(CONFIG_USER_ONLY),$(call lnot,$(CONFIG_BSD_USER))) += mmap.o
 obj-y += translate-common.o
 obj-y += cpu-exec-common.o
 obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
diff --git a/include/qemu-user-common.h b/include/qemu-user-common.h
index 349dd72fff..e772f54c8f 100644
--- a/include/qemu-user-common.h
+++ b/include/qemu-user-common.h
@@ -177,4 +177,21 @@ static inline void *lock_user_string(abi_ulong guest_addr)
 #define unlock_user_struct(host_ptr, guest_addr, copy)		\
     unlock_user(host_ptr, guest_addr, (copy) ? sizeof(*host_ptr) : 0)
 
+/* mmap.c */
+extern unsigned long mmap_min_addr;
+
+int target_mprotect(abi_ulong start, abi_ulong len, int prot);
+abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
+                     int flags, int fd, abi_ulong offset);
+int target_munmap(abi_ulong start, abi_ulong len);
+abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
+                       abi_ulong new_size, unsigned long flags,
+                       abi_ulong new_addr);
+int target_msync(abi_ulong start, abi_ulong len, int flags);
+extern unsigned long last_brk;
+extern abi_ulong mmap_next_start;
+abi_ulong mmap_find_vma(abi_ulong, abi_ulong);
+void mmap_fork_start(void);
+void mmap_fork_end(int child);
+
 #endif /* QEMU_USER_COMMON_H */
diff --git a/linux-user/Makefile.objs b/linux-user/Makefile.objs
index 8c93058100..1595f44d12 100644
--- a/linux-user/Makefile.objs
+++ b/linux-user/Makefile.objs
@@ -1,4 +1,4 @@
-obj-y = main.o syscall.o strace.o mmap.o signal.o \
+obj-y = main.o syscall.o strace.o signal.o \
 	elfload.o linuxload.o uaccess.o uname.o \
 	safe-syscall.o
 
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 22b0ad7d30..5cfe68bd43 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -156,7 +156,6 @@ void init_task_state(TaskState *ts);
 void task_settid(TaskState *);
 void stop_all_tasks(void);
 extern const char *qemu_uname_release;
-extern unsigned long mmap_min_addr;
 
 /* ??? See if we can avoid exposing so much of the loader internals.  */
 
@@ -420,21 +419,6 @@ void sparc64_set_context(CPUSPARCState *env);
 void sparc64_get_context(CPUSPARCState *env);
 #endif
 
-/* mmap.c */
-int target_mprotect(abi_ulong start, abi_ulong len, int prot);
-abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
-                     int flags, int fd, abi_ulong offset);
-int target_munmap(abi_ulong start, abi_ulong len);
-abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
-                       abi_ulong new_size, unsigned long flags,
-                       abi_ulong new_addr);
-int target_msync(abi_ulong start, abi_ulong len, int flags);
-extern unsigned long last_brk;
-extern abi_ulong mmap_next_start;
-abi_ulong mmap_find_vma(abi_ulong, abi_ulong);
-void mmap_fork_start(void);
-void mmap_fork_end(int child);
-
 /* main.c */
 extern unsigned long guest_stack_size;
 
diff --git a/linux-user/mmap.c b/mmap.c
similarity index 100%
rename from linux-user/mmap.c
rename to mmap.c
-- 
2.11.1

  parent reply	other threads:[~2017-02-28 17:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 17:19 [Qemu-devel] [PATCH 0/7] Introducing libtcg Alessandro Di Federico
2017-02-28 17:19 ` [Qemu-devel] [PATCH 1/7] Factor out linux-user/qemu.h Alessandro Di Federico
2017-02-28 17:19 ` Alessandro Di Federico [this message]
2017-02-28 17:19 ` [Qemu-devel] [PATCH 3/7] Move *_cpu_dump_state to translate.c Alessandro Di Federico
2017-02-28 17:19 ` [Qemu-devel] [PATCH 4/7] *-user targets object files decoupling Alessandro Di Federico
2017-02-28 17:19 ` [Qemu-devel] [PATCH 5/7] Isolate coprocessor parts from target/arm/helper.c Alessandro Di Federico
2017-02-28 17:19 ` [Qemu-devel] [PATCH 6/7] Factor out tcg/tcg.h Alessandro Di Federico
2017-02-28 17:19 ` [Qemu-devel] [PATCH 7/7] Introduce libtcg infrastructure Alessandro Di Federico
2017-03-04  0:21 ` [Qemu-devel] [PATCH 0/7] Introducing libtcg Richard Henderson
2017-03-04  9:53   ` Alessandro Di Federico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170228171921.21602-3-ale+qemu@clearmind.me \
    --to=ale+qemu@clearmind.me \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).