Skip to contentSkip to conversation

[5544] Preliminary BSD user emulator support

Qemu-devel Blue Swirl 1 participant 1 message Oct 26, 2008 Kbuild

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 5544

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5544
Author:   blueswir1
Date:     2008-10-26 20:33:16 +0000 (Sun, 26 Oct 2008)

Log Message:
-----------
Preliminary BSD user emulator support

Modified Paths:
--------------
trunk/Makefile.target
trunk/configure
trunk/cpu-exec.c
trunk/qemu-doc.texi

Added Paths:
-----------

    trunk/bsd-user/
    trunk/bsd-user/bsdload.c
    trunk/bsd-user/elfload.c
    trunk/bsd-user/errno_defs.h
    trunk/bsd-user/freebsd/
    trunk/bsd-user/freebsd/strace.list
    trunk/bsd-user/freebsd/syscall_nr.h
    trunk/bsd-user/main.c
    trunk/bsd-user/mmap.c
    trunk/bsd-user/netbsd/
    trunk/bsd-user/netbsd/strace.list
    trunk/bsd-user/netbsd/syscall_nr.h
    trunk/bsd-user/openbsd/
    trunk/bsd-user/openbsd/strace.list
    trunk/bsd-user/openbsd/syscall_nr.h
    trunk/bsd-user/path.c
    trunk/bsd-user/qemu.h
    trunk/bsd-user/signal.c
    trunk/bsd-user/sparc64/
    trunk/bsd-user/sparc64/syscall.h
    trunk/bsd-user/sparc64/target_signal.h
    trunk/bsd-user/strace.c
    trunk/bsd-user/syscall.c
    trunk/bsd-user/syscall_defs.h
    trunk/bsd-user/uaccess.c

Modified: trunk/Makefile.target
===================================================================

Makefile.target +105 -0
@@ -470,6 +470,111 @@
 endif #CONFIG_DARWIN_USER
 
 #########################################################
+# BSD user emulator target
+
+ifdef CONFIG_BSD_USER
+
+VPATH+=:$(SRC_PATH)/bsd-user
+CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
+
+ifdef CONFIG_STATIC
+LDFLAGS+=-static
+endif
+
+ifeq ($(ARCH),i386)
+ifdef TARGET_GPROF
+USE_I386_LD=y
+endif
+ifdef CONFIG_STATIC
+USE_I386_LD=y
+endif
+ifdef USE_I386_LD
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+else
+# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
+# that the kernel ELF loader considers as an executable. I think this
+# is the simplest way to make it self virtualizable!
+LDFLAGS+=-Wl,-shared
+endif
+endif
+
+ifeq ($(ARCH),x86_64)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),ppc)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),ppc64)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),s390)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),sparc)
+# -static is used to avoid g1/g3 usage by the dynamic linker
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
+endif
+
+ifeq ($(ARCH),sparc64)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),alpha)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),ia64)
+LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),arm)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),m68k)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
+
+ifeq ($(ARCH),mips)
+ifeq ($(WORDS_BIGENDIAN),yes)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+else
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
+endif
+endif
+
+ifeq ($(ARCH),mips64)
+ifeq ($(WORDS_BIGENDIAN),yes)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+else
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
+endif
+endif
+
+OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
+OBJS+= uaccess.o
+
+OBJS+= libqemu.a
+
+ifdef CONFIG_GDBSTUB
+OBJS+=gdbstub.o
+endif
+
+# Note: this is a workaround. The real fix is to avoid compiling
+# cpu_signal_handler() in cpu-exec.c.
+signal.o: signal.c
+	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+
+$(QEMU_PROG): $(OBJS) ../libqemu_user.a
+	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
+
+endif #CONFIG_BSD_USER
+
+#########################################################
 # System emulator target
 ifndef CONFIG_USER_ONLY
 

Added: trunk/bsd-user/bsdload.c
===================================================================

bsd-user/bsdload.c +204 -0

204 lines not on this page · raw message

Added: trunk/bsd-user/elfload.c
===================================================================

bsd-user/elfload.c +1523 -0

1,523 lines not on this page · raw message

Added: trunk/bsd-user/errno_defs.h
===================================================================

bsd-user/errno_defs.h +149 -0

149 lines not on this page · raw message

Added: trunk/bsd-user/freebsd/strace.list
===================================================================

bsd-user/freebsd/strace.list +170 -0

170 lines not on this page · raw message

Added: trunk/bsd-user/freebsd/syscall_nr.h
===================================================================

bsd-user/freebsd/syscall_nr.h +373 -0

373 lines not on this page · raw message

Added: trunk/bsd-user/main.c
===================================================================

bsd-user/main.c +576 -0

470 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/mmap.c
===================================================================

bsd-user/mmap.c +545 -0

545 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/netbsd/strace.list
===================================================================

bsd-user/netbsd/strace.list +145 -0

145 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/netbsd/syscall_nr.h
===================================================================

bsd-user/netbsd/syscall_nr.h +373 -0

373 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/openbsd/strace.list
===================================================================

bsd-user/openbsd/strace.list +187 -0

187 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/openbsd/syscall_nr.h
===================================================================

bsd-user/openbsd/syscall_nr.h +195 -0

195 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/path.c
===================================================================

bsd-user/path.c +163 -0

163 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/qemu.h
===================================================================

bsd-user/qemu.h +405 -0

405 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/signal.c
===================================================================

bsd-user/signal.c +39 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/sparc64/syscall.h
===================================================================

bsd-user/sparc64/syscall.h +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/sparc64/target_signal.h
===================================================================

bsd-user/sparc64/target_signal.h +27 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/strace.c
===================================================================

bsd-user/strace.c +191 -0

191 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/syscall.c
===================================================================

bsd-user/syscall.c +273 -0

273 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/syscall_defs.h
===================================================================

bsd-user/syscall_defs.h +108 -0

108 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Added: trunk/bsd-user/uaccess.c
===================================================================

bsd-user/uaccess.c +76 -0

76 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Modified: trunk/configure
===================================================================

configure +25 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Modified: trunk/cpu-exec.c
===================================================================

cpu-exec.c +16 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Modified: trunk/qemu-doc.texi
===================================================================

qemu-doc.texi +65 -0

65 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.