summaryrefslogtreecommitdiffstats
path: root/linux-user
Commit message (Collapse)AuthorAgeFilesLines
* Replace noreturn with QEMU_NORETURNmalc2009-02-011-1/+1
| | | | | | | | Thanks to Robert Riebisch for analysis [1] [1] http://marc.info/?l=qemu-devel&m=123352293319271&w=2 git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6492 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: fix signal.c warningaurel322009-01-301-4/+4
| | | | | | | | | | | | | | | | This patch fixes: linux-user/signal.c:1403: warning: no previous prototype for 'do_sigreturn_v1' linux-user/signal.c:1473: warning: no previous prototype for 'do_sigreturn_v2' linux-user/signal.c:1511: warning: no previous prototype for 'do_rt_sigreturn_v1' linux-user/signal.c:1552: warning: no previous prototype for 'do_rt_sigreturn_v2' by making the appropriate functions static. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6486 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: identify running binary in /proc/self/exeaurel322009-01-303-3/+16
| | | | | | | | | | | | Some applications like to test /proc/self/exe to find out who they are. Fake the result of readlink() for them. Use realpath() to return full path to binary (which the links /proc/self/exe are) Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6485 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: Add generic env variable handlingaurel322009-01-303-16/+303
| | | | | | | | | | | Adds support for qemu to modify target process environment variables using -E and -U commandline switches. This replaces eventually the -drop-ld-preload flag. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Riku Voipio <riku.voipio@iki.fi> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6484 c046a42c-6fe2-441c-8c8c-71466251a162
* target-ppc: Fix struct target_stat64 for 32-bit hostaurel322009-01-301-2/+3
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6483 c046a42c-6fe2-441c-8c8c-71466251a162
* target-sh4: Fix struct target_stat64 for 64-bit hostaurel322009-01-301-1/+1
| | | | | | | Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6482 c046a42c-6fe2-441c-8c8c-71466251a162
* linuw-user fix: read() and acct() on NULL argumentsaurel322009-01-301-8/+16
| | | | | | | | | | | Returning efault in these cases is not correct. Originally proposed by Thayne Harbaugh in 2007: http://www.mail-archive.com/qemu-devel@nongnu.org/msg14658.html Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6481 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: don't crash with null nameaurel322009-01-301-1/+1
| | | | | | | | | | | | From Thayne Harbaugh. path() may be called with null string, don't bother trying to remap in that case. Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6480 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: return EINVAL on incorrect sockaddraurel322009-01-301-2/+31
| | | | | | | | | | | From: Lauro Ramos Venancio <lauro.venancio@gmail.com> Fixes ltp test accept01 Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6479 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: fix accept(2) with NULL peeraurel322009-01-301-0/+3
| | | | | | | | | Based on scratchbox2 patch by Mika Westerberg Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6478 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix qemu_malloc.malc2009-01-281-0/+2
| | | | | | | make {linux,bsd}-user qemu_realloc handle ptr == NULL correctly. spotted by malc. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6466 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: add qemu_realloc() implementation to unbreak the build (Gerd ↵aliguori2009-01-231-0/+13
| | | | | | | | | | Hoffman) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6412 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix user emulator breakage, based on patch by Riku Voipioblueswir12009-01-201-13/+15
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6371 c046a42c-6fe2-441c-8c8c-71466251a162
* Convert references to logfile/loglevel to use qemu_log*() macrosaliguori2009-01-153-21/+17
| | | | | | | | | | | | This is a large patch that changes all occurrences of logfile/loglevel global variables to use the new qemu_log*() macros. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6338 c046a42c-6fe2-441c-8c8c-71466251a162
* Clean up debugging code #ifdefs (Eduardo Habkost)aliguori2009-01-151-22/+17
| | | | | | | | | | | | | | | Use macros to avoid #ifdefs on debugging code. This patch doesn't try to merge logging macros from different files, but just unify the debugging code #ifdefs onto a macro on each file. A further cleanup can unify the debugging macros on a common header, later Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162
* Get rid of user_mode_onlyaurel322009-01-141-1/+0
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6305 c046a42c-6fe2-441c-8c8c-71466251a162
* Add noreturn function attributeblueswir12009-01-141-1/+2
| | | | | | | | | | | | | | | | Introduce noreturn attribute and attach it to cpu_loop_exit as well as interrupt/exception helpers for i386. This avoids a bunch of gcc4 warnings. [ Note that this patch comes with a workaround to include qemu-common.h even in cases where is currently causes conflicts with dyngen-exec.h. I've been told that these conflicts will get resolved in the future (/me will try to have a look as well - as time permits). ] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6303 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove all traces of __powerpc__malc2009-01-141-1/+1
| | | | | | | | According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is the ubiquitous define which should be used to test whether gcc targets PowerPC, on 64bit platforms _ARCH_PPC64 will be also defined. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6301 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Add a bunch of syscall numbers.edgar_igl2009-01-071-0/+44
| | | | | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6223 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Clone flags are reversed on CRIS.edgar_igl2009-01-071-0/+2
| | | | | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6222 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Implement set_thread_area for CRIS.edgar_igl2009-01-071-0/+8
| | | | | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6210 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix more FSF addressesblueswir12009-01-057-7/+14
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6192 c046a42c-6fe2-441c-8c8c-71466251a162
* Update FSF address in GPL/LGPL boilerplateaurel322009-01-041-1/+1
| | | | | | | | | | The attached patch updates the FSF address in the GPL/LGPL boilerplate in most GPL/LGPLed files, and also in COPYING.LIB. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6162 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix qemu endless loop when raising a SIGSEGV/SIGBUS signal with gdbstub in ↵aurel322009-01-031-2/+2
| | | | | | | | | | | | | | | | | | user emulation When a SIGSEGV signal is raised in user mode emulation the current test to know whether the signal is sent by the kernel is wrong : info->si_code == SI_KERNEL according to /usr/include/bits/siginfo.h it should be info->si_code > 0 Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6151 c046a42c-6fe2-441c-8c8c-71466251a162
* Use the ARRAY_SIZE() macro where appropriate.malc2008-12-221-1/+1
| | | | | | | | | Change from v1: Avoid changing the existing coding style in certain files. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162
* User-mode GDB stub improvements - handle signalsaurel322008-12-181-16/+49
| | | | | | | | | | | | | Handle signals in the user-mode GDB stub. Report them to GDB, and allow it to change or cancel them. Also correct the protocol numbering; it happens to match Linux numbering for SIGINT and SIGTRAP, but that's just good fortune. Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6096 c046a42c-6fe2-441c-8c8c-71466251a162
* User-mode GDB stub improvements - handle forkaurel322008-12-182-13/+13
| | | | | | | | | | Close gdbserver in child processes, so that only one stub tries to talk to GDB at a time. Updated from an earlier patch by Paul Brook. Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6095 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix mremap, based on patch by Kirill A. Shutemovblueswir12008-12-151-8/+11
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6056 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix warning about unused shm_regionsblueswir12008-12-131-0/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6001 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove unnecessary trailing newlinesblueswir12008-12-1313-13/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix compiling without MREMAP_FIXEDblueswir12008-12-111-1/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5979 c046a42c-6fe2-441c-8c8c-71466251a162
* Introduce and use cache-utils.[ch]malc2008-12-101-1/+4
| | | | | | | | | | | | Thanks to Segher Boessenkool and Holis Blanchard. AIX and Darwin cache inquiry: http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00388.html Auxiliary vectors: http://manugarg.googlepages.com/aboutelfauxiliaryvectors git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5973 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctlyaurel322008-12-081-6/+28
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5959 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: mmap: add check if requested memory area fits target address spaceaurel322008-12-081-0/+10
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5958 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: Move abi_* typedefs into qemu-types.haurel322008-12-082-19/+25
| | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5954 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: Add support for STOP/CONT signals.ths2008-11-271-1/+6
| | | | | | | Signed-off-by: Riku Voipio <riku.voipio@iki.fi> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5802 c046a42c-6fe2-441c-8c8c-71466251a162
* linux-user: sig is target signal.ths2008-11-271-1/+1
| | | | | | | Signed-off-by: Riku Voipio <riku.voipio@iki.fi> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5801 c046a42c-6fe2-441c-8c8c-71466251a162
* x86: Debug register emulation (Jan Kiszka)aliguori2008-11-181-2/+2
| | | | | | | | | | | | | | | | Built on top of previously enhanced breakpoint/watchpoint support, this patch adds full debug register emulation for the x86 architecture. Many corner cases were considered, and the result was successfully tested inside a Linux guest with gdb, but I won't be surprised if one or two scenarios still behave differently in reality. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5747 c046a42c-6fe2-441c-8c8c-71466251a162
* target-alpha: implement getxuid and getxgid syscallsaurel322008-11-141-0/+24
| | | | | | | | | | | | | | | | | This patch implemented the setxuid and setxgid syscalls for Alpha. These syscalls return two values, both uid/euid and gid/egid. In addition to returning the first value in $v0, the additional value is returned in the $a4 register. The syscalls are used instead of the separate syscalls for those values used on other architectures (this is probably because Alpha Linux started out syscall compatible with DEC/OSF/Tru64). With this patch, the perlbmk benchmarks from Spec2000 run properly. (Vince Weaver) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5722 c046a42c-6fe2-441c-8c8c-71466251a162
* ppc-linux-user: handle EXCP_DEBUGaurel322008-11-141-14/+13
| | | | | | | | | | | Replace POWERPC_EXCP_DEBUG by EXCP_DEBUG as the former can not happen in user mode emulation, while the later can happen and should be handled. Noticed by Andrew Stubbs. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5721 c046a42c-6fe2-441c-8c8c-71466251a162
* target-alpha: fix termbits and target IOC macrosaurel322008-11-122-34/+34
| | | | | | | | | | | | | | This patch fixes the two following problems for Alpha linux-user: - termbits.h is incorrectly using host IOC macros and structures - IOC bitfields sizes are incorrectly set This patch corrects the ioctl TCGETS done by isatty function call on Alpha (when running SPEC crafty for instance). Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5704 c046a42c-6fe2-441c-8c8c-71466251a162
* target-alpha: add proper fcntl definitionsaurel322008-11-111-0/+19
| | | | | | | | | | | | | On Alpha the target to native fcntl definitions were missing. Because of this, programs trying to open files with the O_CREAT option were getting O_APPEND instead, etc. This was keeping gcc from the spec benchmarks from running, among other things. (Vince Weaver) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5672 c046a42c-6fe2-441c-8c8c-71466251a162
* use target_mmap() to allocate idt, gdt and ldt (Kirill A. Shutemov).balrog2008-11-102-12/+23
| | | | | | | | | | env->*dt.base should fit target address space, so we should use target_mmap to allocate them. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5666 c046a42c-6fe2-441c-8c8c-71466251a162
* User qemu profilingaurel322008-11-061-0/+6
| | | | | | | | | | | | | | - Makefile.target: re-enable profiling for user qemu. It seems profiling was (accidently?) removed by commit 3937 - syscall.c: * add an include to get _mcleanup prototype * add a call to _mcleanup for exit_group in a way similar to what is done for exit (Laurent Desnogues) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5642 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix return value printing for shmat (Lauro Ramos Venancio).balrog2008-10-281-1/+1
| | | | | | | | The shmat syscall returns an address, so we must use the print_syscall_ret_addr function. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5565 c046a42c-6fe2-441c-8c8c-71466251a162
* Recvmsg must return the number of bytes received (Lauro Ramos Venancio).balrog2008-10-281-2/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5564 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix iovec for the case with invalid elements (Lauro Ramos Venancio).balrog2008-10-281-13/+7
| | | | | | | | | We must call the writev even if an iovec element is invalid. For example, if the second element is invalid, the linux process the first one. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5562 c046a42c-6fe2-441c-8c8c-71466251a162
* Use the host exit syscall for exiting (Lauro Ramos Venancio).balrog2008-10-281-1/+3
| | | | | | | | We can't call the libc _exit function because it calls the exit_group host syscall. We must call directly the exit host syscall. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5561 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix undeclared symbol warnings from sparseblueswir12008-10-263-6/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
* Replace uses of strncpy (a GNU extension) with Qemu pstrcpyblueswir12008-10-251-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5531 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud