summaryrefslogtreecommitdiff
path: root/linux-user/syscall_defs.h
AgeCommit message (Collapse)AuthorFilesLines
2014-03-03linux-user: Implement sendmmsg syscallAlexander Graf1-0/+4
Glibc when built for newer kernels assumes that the sendmmsg syscall is available. Without it, dns resolution simply fails to work. Wrap the syscall with existing infrastructure so that we don't have a host dependency on sendmmsg. To avoid locking the same area of guest memory twice (which will break if DEBUG_REMAP is defined) we pull the lock/unlock part of do_sendrecvmsg() out into its own function so the actual implementation can be shared. Signed-off-by: Alexander Graf <agraf@suse.de> [PMM: add recvmmsg support; handle errors (which also implies support for non-blocking operations); cap the vector length as the kernel implementation does; don't lock guest memory twice; support MSG_WAITFORONE flag] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
2014-03-03linux-user: Don't use UID16 on AArch64Andreas Schwab1-1/+2
The AArch64 kernel defines its __kernel_uid_t type as 32 bits, unlike 32 bit ARM, so don't enable our 16-bit UID wrapper handling. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
2014-02-19linux-user: Implement BLKPG ioctlAndreas Färber1-0/+1
Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-01-10linux-user: Support the accept4 socketcallAndré Hentschel1-0/+1
Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: André Hentschel <nerv@dawncrow.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-11-29linux-user: Add target struct defs needed for POSIX timer syscalls.Erik de Castro Lopo1-0/+25
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-11-07linux-user: Fix stat64 syscall for SPARC64Stefan Weil1-0/+14
Some targets use a stat64 structure for the stat64 syscall while others use a stat structure. SPARC64 used the wrong kind. Instead of extending the conditional compilation in syscall.c, now a macro TARGET_HAS_STRUCT_STAT64 is defined whenever a target has a target_stat64. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-09-24linux-user: Add setsockopt(SO_ATTACH_FILTER)Laurent Vivier1-0/+12
This is needed to be able to run dhclient. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-10linux-user: Fix up AArch64 syscall handlersAlexander Graf1-2/+26
Some syscall handlers have special code for ARM enabled that we don't need on AArch64. Exclude AArch64 in those cases. In other places we can share struct definitions with other targets or have to provide our own. With this patch applied, most syscall definitions in linux-user should be sound for AArch64. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1378235544-22290-16-git-send-email-peter.maydell@linaro.org Message-id: 1368505980-17151-9-git-send-email-john.rigby@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-07-23linux-user: Fix epoll on ARM hostsAlexander Graf1-1/+4
The epoll emulation uses data structures without packing them, so the compiler might choose to add padding inside. This patch makes the most offending one (target_epoll_event) a packed structure to make sure we don't pad it by accident. ARM would pad it, so declare the padding mandatory for ARM targets. This fixes i386-on-ARM epoll emulation for me. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-23linux-user: Fix target_stat and target_stat64 for OpenRISCPeter Maydell1-12/+37
OpenRISC uses the asm-generic versions of target_stat and target_stat64, but it was incorrectly using the x86/ARM/etc version due to a misplaced defined(TARGET_OPENRISC). The previously unused OpenRISC section of the ifdef ladder also defined an incorrect target_stat and omitted the target_stat64 definition. Fix target_stat, provide target_stat64, and add a comment noting that these are the asm-generic versions for the benefit of future ports. Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-01-16alpha-linux-user: Translate fcntl l_typeLaurent Vivier1-0/+18
The values of F_RDLCK, F_WRLCK, F_UNLCK, F_EXLCK, F_SHLCK differ between alpha and other linux architectures. This patch allows to run "dpkg" (database lock). Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-12alpha-linux-user: Fix sigactionRichard Henderson1-1/+1
Unconditional bswap replaced by __get_user/__put_user. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-19janitor: add guards to headersPaolo Bonzini1-0/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-08-27linux-user: fix emulation of getdentsDmitry V. Levin1-4/+4
In case when TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64, the last byte of the target dirent structure (aka d_type byte) was never copied from the host dirent structure, thus breaking everything that relies on valid d_type value, e.g. glob(3). Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2012-08-13linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitionsPeter Maydell1-2/+2
Fix the SNDCTL_DSP_MAP{IN,OUT}BUF ioctl definitions so that they refer to a suitably defined target struct layout rather than hardcoding the ioctl number. This fixes complaints from the syscall_init() consistency check when running an x86_64-to-x86_64 linux-user qemu. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-13linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSETPeter Maydell1-2/+2
The definitions for the ioctl numbers TARGET_BLKBSZGET and TARGET_BLKBSZSET had the wrong size parameters (they are defined with size_t, not int, even though the ioctl implementations themselves read and write integers). Since commit 354a0008 we now have an ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64 linux-user binary we were triggering the mismatch warning in syscall_init(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-04linux-user: Sync fcntl.h bits with the kernelRichard Henderson1-102/+92
For each target, only define the bits that appear in arch/target/include/asm/fcntl.h. Mirror the kernel's asm-generic layout by handling anything undefined afterward. Signed-off-by: Richard Henderson <rth@twiddle.net>
2012-08-04alpha-linux-user: Fix signal handlingRichard Henderson1-1/+40
Proper signal numbers were not defined, and EXCP_INTERRUPT was unhandled, leading to all sorts of subtle confusion. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
2012-07-27target-or32: Add linux user supportJia Liu1-3/+37
Add QEMU OpenRISC linux user support. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-06linux-user: fix BLK ioctl argumentsAlexander Graf1-3/+5
Some BLK ioctls passed sizeof(x) into a macro that already did sizeof() on the passed in argument, rendering the size information inside the ioctl be the size of the host default integer type. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2012-04-06linux-user: implement device mapper ioctlsAlexander Graf1-0/+18
This patch implements all ioctls currently implemented by device mapper, enabling us to run dmsetup and kpartx inside of linux-user. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2012-02-02linux-user: add SO_PEERCRED support for getsockoptAkos PASZTORY1-0/+6
Signed-off-by: Akos PASZTORY <akos.pasztory@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-12-02fix spelling in linux-user sub directoryDong Xu Wang1-3/+3
Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-10-27linux-user: fix abi_(u)long, target_ulong mismatchMatthias Braun1-4/+4
abi_(u)long might be different from target_ulong, so don't use tswapl but introduce a new tswapal Signed-off-by: Matthias Braun <matze@braunis.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-10-27linux-user: fix rlimit syscalls on sparc(64)Matthias Braun1-1/+6
Signed-off-by: Matthias Braun <matze@braunis.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-10-27linux-user: fix TARGET_RLIM_INFINITY declarationMatthias Braun1-1/+1
Signed-off-by: Matthias Braun <matze@braunis.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-09-03Use new macro QEMU_PACKED for packed structuresStefan Weil1-8/+8
Most changes were made using these commands: git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/' Whitespace in linux-user/syscall_defs.h was fixed manually to avoid warnings from scripts/checkpatch.pl. Manual changes were also applied to hw/pc.c. I did not fix indentation with tabs in block/vvfat.c. The patch will show 4 errors with scripts/checkpatch.pl. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12mips: rlimit codes are not the sameWesley W. Terpstra1-0/+34
The codes for get/setrlimit differ between linux target platforms. This patch adds conversion. This is important else programs (rsyslog, python, ...) can go into a near infinite loop trying to close all the file descriptors from 0 to -1. Signed-off-by: Wesley W. Terpstra <terpstra@debian.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Implement prlimit64 syscallPeter Maydell1-0/+4
Implement the prlimit64 syscall. Slightly modified to apply upstream -Riku Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add support for even more FB ioctlsCédric VINCENT1-0/+5
This patch was validated with programs from DirectFB-1.0 and WebKit/DirectFB. Signed-off-by: Cédric VINCENT <cedric.vincent@st.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add support for more VT ioctlsCédric VINCENT1-0/+4
DirectFB-1.0 uses at least two of the four added ioctls, and the two others were added for completeness. This patch was validated with the program "vlock -all/-new". Signed-off-by: Cédric VINCENT <cedric.vincent@st.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add support for KD...LED ioctlsCédric VINCENT1-0/+4
DirectFB-1.0 uses at least one of the four added ioctls, and the three others were added for completeness. This patch was validated with the program "setleds" and the following Makefile: SETLEDS_INIT = setleds -v -num -caps -scroll SETLEDS_TESTS = sh -c ' \ setleds -v +num +caps +scroll; \ setleds -v -num -caps -scroll; \ setleds -v +num -caps -scroll; \ setleds -v +num +caps -scroll; \ setleds -v +num +caps +scroll; \ setleds -v -num +caps +scroll; \ setleds -v -num -caps +scroll; \ setleds -v -num -caps -scroll' SETLEDS_HOST = setleds SETLEDS_QEMU = "SETLEDS_QEMU not set" .PHONY: setleds_tests setleds_tests: rm -f setleds.host setleds.target $(SETLEDS_INIT:setleds=$(SETLEDS_HOST)) $(SETLEDS_TESTS:setleds=$(SETLEDS_HOST)) >> setleds.host $(SETLEDS_INIT:setleds=$(SETLEDS_QEMU)) $(SETLEDS_TESTS:setleds=$(SETLEDS_QEMU)) >> setleds.target cmp setleds.host setleds.target Signed-off-by: Cédric VINCENT <cedric.vincent@st.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-05-20s390x: s390x-linux-user supportUlrich Hecht1-2/+53
This patch adds support for running s390x binaries in the linux-user emulation code. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-26linux-user: untie syscalls from UID16Riku Voipio1-1/+4
Quite a number of uid/gid related syscalls are only defined on systems with USE_UID16 defined. This is apperently based on the idea that these system calls would never be called on non-UID16 systems. Make these syscalls available for all architectures that define them. drop alpha hack to support selected UID16 syscalls. MIPS and PowerPC were also defined as UID16, to get uid/gid syscalls available, drop this error as well. Change QEMU to reflect this. Cc: Ulrich Hecht <uli@suse.de> Cc: Richard Henderson <rth@twiddle.net> Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-04-26linux-user: add ioctl(SIOCGIWNAME, ...) support.Laurent Vivier1-0/+3
Allow to run properly following program from linux-user: /* cc -o wifi wifi.c */ #include <stdio.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/socket.h> #include <linux/wireless.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> int main(int argc, char **argv) { int ret; struct ifreq req; struct sockaddr_in *addr; int s; if (argc != 2) { fprintf(stderr, "Need an interface name (like wlan0)\n"); return 1; } s = socket( AF_INET, SOCK_DGRAM, 0 ); if (s < 0) { perror("Cannot open socket"); return 1; } strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name)); ret = ioctl( s, SIOCGIWNAME, &req ); if (ret < 0) { fprintf(stderr, "No wireless extension\n"); return 1; } printf("%s\n", req.ifr_name); printf("%s\n", req.ifr_newname); return 0; } $ ./wifi eth0 No wireless extension $ ./wifi wlan0 wlan0 IEEE 802.11bg Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-04-12unicore32: necessary modifications for other files to support unicore32Guan Xuetao1-3/+7
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-17linux-user: Support the epoll syscallsPeter Maydell1-0/+13
Support the epoll family of syscalls: epoll_create(), epoll_create1(), epoll_ctl(), epoll_wait() and epoll_pwait(). Note that epoll_create1() and epoll_pwait() are later additions, so we have to test separately in configure for their presence. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2011-02-09linux-user: decode MAP_{UNINITIALIZED,EXECUTABLE} in straceMike Frysinger1-0/+1
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2011-01-07linux-user: Implement FS_IOC_FIEMAP ioctlPeter Maydell1-0/+1
Implement the FS_IOC_FIEMAP ioctl using the new support for custom handling of ioctls; this is needed because the struct that is passed includes a variable-length array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2010-12-03linux-user: fix mips and ppc to use UID16Martin Mohring1-1/+1
Signed-off-by: Martin Mohring <martin.mohring@5edatasoft.com> Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2010-08-09microblaze: Fix the target version of stat64 structEdgar E. Iglesias1-6/+8
MicroBlaze needs TARGET_STAT64_HAS_BROKEN_ST_INO. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-06-16Strace mprotect flags.Paul Brook1-0/+6
Teach strace code about linux specific mprotect flags. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-05-21alpha-linux-user: Add correct sigaction constants.Richard Henderson1-0/+8
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-05-19linux-user: fix 32-bit host breakageAurelien Jarno1-1/+1
Fix breakage introduced by commit 81bbe906c89b6b7af58a1eeb96ec5a0bfdc3386f. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-05-18linux-user: rlimit conversion between host and target.takasi-y@ops.dti.ne.jp1-0/+8
rlim_t conversion between host and target added. Otherwise there are some incorrect case like - RLIM_INFINITY on 32bit target -> 64bit host. - RLIM_INFINITY on 64bit host -> mips and sparc target ? - Big value(for 32bit target) on 64bit host -> 32bit target. One is added into getrlimit, setrlimit, and ugetrlimit. It converts both RLIM_INFINITY and value bigger than target can hold(>31bit) to RLIM_INFINITY. Another one is added to guest_stack_size calculation introduced by 703e0e89. The rule is mostly same except the result on the case is keeping the value of guest_stack_size. Slightly tested for SH4, and x86_64 -linux-user on x86_64-pc-linux host. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-28alpha-linux-user: Implement signals.Richard Henderson1-2/+21
Move userland PALcode handling into linux-user main loop so that we can send signals from there. This also makes alpha_palcode.c system-level only, so don't build it for userland. Add defines for GENTRAP PALcall mapping to signals. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-10-17linux-user: KD/VT/FB ioctlsUlrich Hecht1-0/+16
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>
2009-10-15linux-user: fix ppc target_stat64 st_blocks layoutMax Filippov1-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>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-28/+28
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>
2009-10-01Get rid of _t suffixmalc1-28/+28
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>