summaryrefslogtreecommitdiffstats
path: root/linux-user
Commit message (Collapse)AuthorAgeFilesLines
* linux-user: adapt uname machine to emulated CPULoïc Minier2010-02-063-1/+75
| | | | | | | | | This patch for linux-user adapts the output of the emulated uname() syscall to match the configured CPU. Tested with x86, x86-64 and arm emulation. Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Loïc Minier <lool@dooz.org>
* mmap_frag() users only check for -1 errorJuan Quintela2010-01-261-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* linux-user/mmap.c: fix warnings with _FORTIFY_SOURCEKirill A. Shutemov2010-01-261-2/+4
| | | | | | | | | | | | | | CC i386-linux-user/mmap.o cc1: warnings being treated as errors /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:253: error: ignoring return value of 'pread', declared with attribute warn_unused_result /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap': /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result make[1]: *** [mmap.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix linux-user microblaze ELF_ARCH definitionMike Frysinger2010-01-171-1/+1
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* alpha: fix stat64 issueVince Weaver2010-01-141-1/+1
| | | | | | | | | | | | | | | | The stat64/fstat64 syscalls are broken for alpha linux-user. This is because Alpha, even though it is native 64-bits, has a stat64 syscall that is different than regular stat. This means that the "TARGET_LONG_BITS==64" check in syscall.c isn't enough. Below is a patch that fixes things for me, although it might not be the cleanest fix. This issue keeps sixtrack and fma3d spec2k benchmarks from running. Signed-off-by: Vince Weaver <vince@csl.cornell.edu> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix build with gcc-4.1Aurelien Jarno2009-12-241-0/+2
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC: Make DCR uint32_tAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | For what I know DCR is always 32 bits wide, so we should also use uint32_t to pass it along the stacks. This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making it compile without --disable-werror Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix alternate timebaseAurelien Jarno2009-12-211-2/+2
| | | | | | | Fix the alternate time base the same way as the default timebase. SPR_ATBL should return a 64-bit value on 64 bit implementations. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix timebaseAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | | | | | On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL. On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full 64 bits as return value. If we only take the lower ones, fine. But Linux wants to see all 64 bits or it breaks. This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary, which usually happened a few seconds after bootup. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Add aliases for some Alpha syscallsRichard Henderson2009-12-211-0/+8
| | | | | | | | | Alpha always used 32-bit uids, but never renamed the syscalls to match i386 when 32-bit uids were added there. This enables the proper bits in syscall.c. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for SHNathan Froyd2009-12-191-0/+33
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for M68KNathan Froyd2009-12-191-0/+29
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for MIPSNathan Froyd2009-12-191-0/+46
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: add core dump support for PPCNathan Froyd2009-12-191-0/+26
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix ARM core dumps on opposite-endian hostsNathan Froyd2009-12-191-19/+19
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: commonify definitions of target typedefsNathan Froyd2009-12-191-22/+10
| | | | | | | | | There's no sense in separately declaring target_{elf_greg,uid,gid,pid}_t for every architecture. Just declare them once with appropriate USE_UID16 handling. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix ELF_USE_CORE_DUMP/USE_ELF_CORE_DUMP confusionNathan Froyd2009-12-191-1/+1
| | | | | Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: use TARGET_ABI_FMT_lx to print abi_ulong typesAurelien Jarno2009-12-191-1/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: cleanup force_sig() callsRiku Voipio2009-12-191-20/+20
| | | | | | | | | Force_sig should be always called with TARGET_ signals. Not that it really matters with SEGV, so this patch is just for cleanup and improving consistency. Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: Fix mmap_lock orderingRiku Voipio2009-12-191-2/+2
| | | | | | | | | mmap_lock() can be called while tb_lock() is being held. To avoid deadlock when one thread is holding mmap_lock and another tb_lock, _always_ lock first tb_lock(). Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-alpha: Fixes for alpha-linux syscalls.Richard Henderson2009-12-132-10/+339
| | | | | | | | | | | | | | | | | | 1. Add correct definitions of error numbers. 2. Implement SYS_osf_sigprocmask 3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL. This last requires exposing the FPCR value to do_syscall. Since this value is actually split up into the float_status, expose routines from helper.c to access it. Finally, also add a float_exception_mask field to float_status. We don't actually use it to control delivery of exceptions to the emulator yet, but simply hold the value that we placed there when loading/storing the FPCR. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-alpha: Drop bogus UNIQ initial value on Linux.Richard Henderson2009-12-131-3/+0
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix ARM userspace strex implementation.Paul Brook2009-12-111-0/+1
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* linux-user: remove hardcoded value of _NSIG in signal.cArnaud Patard2009-11-241-6/+6
| | | | | | | | | In a bunch of places, 64 is used as value of _NSIG but it's wrong at least on MIPS were _NSIG is 128. Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add missing break.Paul Brook2009-11-241-0/+1
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* ARM atomic ops rewritePaul Brook2009-11-221-0/+80
| | | | | | Implement ARMv6 atomic ops (ldrex/strex) using the same trick as PPC. Signed-off-by: Paul Brook <paul@codesourcery.com>
* target-mips: rename CP0_LLAddr into lladdrAurelien Jarno2009-11-221-2/+2
| | | | | | | | The variable CP0_LLAddr represent the full lladdr, not the actual register value, which is only part of this value and depends on the CPU. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* (x86/Sparc/PPC)-user: fix cpu_copyBlue Swirl2009-11-071-0/+3
| | | | | | | | b55a37c981914aa8ecd21b9a2a2fb37f39b917c5 moved the call to cpu_reset to user emulators. But cpu_copy also initializes a CPU structure, so add the call also there. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* user: move CPU reset call to main.c for x86/PPC/SparcBlue Swirl2009-11-071-0/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Re: linux-user/syscall.c - don't add GUEST_BASE to NULL pointerJan-Simon Möller2009-10-171-2/+6
| | | | | | | | | | | This patch fixes the mount call. GUEST_BASE shouldn't be added to a NULL pointer on arg5 . failing call: mount("rootfs", "/", 0x47a78, MS_MGC_VAL|MS_REMOUNT, 0x10000) = -1 EFAULT (Bad address) correct call: mount("rootfs", "/", 0x37ab0, MS_MGC_VAL|MS_REMOUNT, NULL) = 0 Signed-off-by:  Jan-Simon Möller  <dl9pf@gmx.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: KD/VT/FB ioctlsUlrich Hecht2009-10-174-0/+83
| | | | | | | everything needed to run SDL on a framebuffer device in the userspace emulator Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: Update ARM hwcapsRiku Voipio2009-10-161-1/+8
| | | | | | Update ARM hwcaps to match Linux kernel 2.6.31 state Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: don't zero a buffer twicePaul Bolle2009-10-161-1/+0
| | | | | | | | prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in main() and hasn't been touched since so that is not necessary. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fix ppc target_stat64 st_blocks layoutMax Filippov2009-10-151-1/+1
| | | | | | | | Swap __pad1 and st_blocks fields location to maintain proper alignment. This fixes incorrect 'du' and 'stat' report on ppc guest. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: getpriority errno fixUlrich Hecht2009-10-151-1/+1
| | | | | | | getpriority returned wrong errno; fixes LTP test getpriority02. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* implementations of dup3 and fallocate that are good enough to fool LTPUlrich Hecht2009-10-151-0/+10
| | | | | | | | | | updated fallocate check to new configure, added dup3 check as suggested by Jan-Simon Möller. Riku: updated to apply to current git. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* linux-user: fix "#if 0"'d printf()Paul Bolle2009-10-041-1/+1
| | | | | | | | | | Make an "#if 0"'d printf() in load_elf_binary(), probably left to aid in debugging, reflect what the actual code does. The current printf() will only confuse those who "#if 1" it (it certainly confused me enough to write this trivial patch). Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* linux-user: fix up oversealous nitpickingMichael S. Tsirkin2009-10-021-1/+1
| | | | | | | | | | Looks like linux-user code was correct, just unreadable: what it wanted to do with "-=" was really assign a negative number, not decrement. Fix up accordingly. Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-0122-251/+251
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-0122-251/+251
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* linux-user: fix coding style nitMichael S. Tsirkin2009-09-301-1/+1
| | | | | | | | Put space between = and & when taking a pointer, to avoid confusion with old-style "&=". Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: fix old style decrement usageMichael S. Tsirkin2009-09-301-1/+1
| | | | | | | | Modern compilers do not parse "=-" as decrement: you must use "-=" for that. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* elfload: fix coding style nitMichael S. Tsirkin2009-09-301-1/+1
| | | | | | | | Put space between = and * when dereferencing a pointer, to avoid confusion with old-style "*=" Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* __thread should be before real typeJuan Quintela2009-09-251-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* static and inline should came before the type of the functionsJuan Quintela2009-09-251-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Export tables properly to avoid a Sparse warningBlue Swirl2009-09-211-3/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix Sparse warnings about using plain integer as NULL pointerBlue Swirl2009-09-211-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile loader only onceBlue Swirl2009-09-201-2/+2
| | | | | | | | | | | | | Callers must pass ELF machine, byte swapping and symbol LSB clearing information to ELF loader. A.out loader needs page size information, pass that too as a parameter. Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw. Adjust callers. Also use target_phys_addr_t instead of target_ulong for addresses: loader addresses aren't virtual. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Fix Sparc/Linux host breakage by ↵Blue Swirl2009-09-131-21/+0
| | | | | | | | df70204db53e3611af986f434e74a882bce190ca" This reverts commit 91b40c5be84a478e98c0416325844a7f66d0efae. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190caBlue Swirl2009-09-131-0/+21
| | | | | | | | | | | While i386, x86_64 and Sparc64/OpenBSD still worked after df70204db53e3611af986f434e74a882bce190ca, Sparc32 and Sparc64 Linux hosts broke. Partially revert the commit: make the restored code conditional to !CONFIG_USER_PIE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud