aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure36
-rw-r--r--linux-user/elfload.c9
-rw-r--r--linux-user/ioctls.h14
-rw-r--r--linux-user/linuxload.c1
-rw-r--r--linux-user/syscall.c22
-rw-r--r--linux-user/syscall_defs.h18
-rw-r--r--linux-user/syscall_types.h51
7 files changed, 145 insertions, 6 deletions
diff --git a/configure b/configure
index 7775b1b423..43d87c5276 100755
--- a/configure
+++ b/configure
@@ -1569,6 +1569,36 @@ if compile_prog "" "" ; then
eventfd=yes
fi
+# check for fallocate
+fallocate=no
+cat > $TMPC << EOF
+#include <fcntl.h>
+
+int main(void)
+{
+ fallocate(0, 0, 0, 0);
+ return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ fallocate=yes
+fi
+
+# check for dup3
+dup3=no
+cat > $TMPC << EOF
+#include <unistd.h>
+
+int main(void)
+{
+ dup3(0, 0, 0);
+ return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ dup3=yes
+fi
+
# Check if tools are available to build documentation.
if test "$docs" != "no" ; then
if test -x "`which texi2html 2>/dev/null`" -a \
@@ -1967,6 +1997,12 @@ fi
if test "$eventfd" = "yes" ; then
echo "CONFIG_EVENTFD=y" >> $config_host_mak
fi
+if test "$fallocate" = "yes" ; then
+ echo "CONFIG_FALLOCATE=y" >> $config_host_mak
+fi
+if test "$dup3" = "yes" ; then
+ echo "CONFIG_DUP3=y" >> $config_host_mak
+fi
if test "$inotify" = "yes" ; then
echo "CONFIG_INOTIFY=y" >> $config_host_mak
fi
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 62a3f2ac2c..682a813981 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -330,11 +330,18 @@ enum
ARM_HWCAP_ARM_FPA = 1 << 5,
ARM_HWCAP_ARM_VFP = 1 << 6,
ARM_HWCAP_ARM_EDSP = 1 << 7,
+ ARM_HWCAP_ARM_JAVA = 1 << 8,
+ ARM_HWCAP_ARM_IWMMXT = 1 << 9,
+ ARM_HWCAP_ARM_THUMBEE = 1 << 10,
+ ARM_HWCAP_ARM_NEON = 1 << 11,
+ ARM_HWCAP_ARM_VFPv3 = 1 << 12,
+ ARM_HWCAP_ARM_VFPv3D16 = 1 << 13,
};
#define ELF_HWCAP (ARM_HWCAP_ARM_SWP | ARM_HWCAP_ARM_HALF \
| ARM_HWCAP_ARM_THUMB | ARM_HWCAP_ARM_FAST_MULT \
- | ARM_HWCAP_ARM_FPA | ARM_HWCAP_ARM_VFP)
+ | ARM_HWCAP_ARM_FPA | ARM_HWCAP_ARM_VFP \
+ | ARM_HWCAP_ARM_NEON | ARM_HWCAP_ARM_VFPv3 )
#endif
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 685cc71310..769e1bcb81 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -53,7 +53,10 @@
IOCTL(KIOCSOUND, 0, TYPE_INT)
IOCTL(KDMKTONE, 0, TYPE_INT)
+ IOCTL(KDSETMODE, 0, TYPE_INT)
IOCTL(KDGKBTYPE, IOC_R, MK_PTR(TYPE_CHAR))
+ IOCTL(KDGKBMODE, IOC_R, MK_PTR(TYPE_INT))
+ IOCTL(KDSKBMODE, 0, TYPE_INT)
IOCTL(KDGKBENT, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_kbentry)))
IOCTL(KDGKBSENT, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_kbsentry)))
@@ -314,3 +317,14 @@
IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget)))
IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos)))
+
+ IOCTL(FBIOGET_FSCREENINFO, IOC_R, MK_PTR(MK_STRUCT(STRUCT_fb_fix_screeninfo)))
+ IOCTL(FBIOGET_VSCREENINFO, IOC_R, MK_PTR(MK_STRUCT(STRUCT_fb_var_screeninfo)))
+ IOCTL(FBIOPUT_VSCREENINFO, IOC_W, MK_PTR(MK_STRUCT(STRUCT_fb_var_screeninfo)))
+
+ IOCTL(VT_OPENQRY, IOC_R, MK_PTR(TYPE_INT))
+ IOCTL(VT_GETSTATE, IOC_R, MK_PTR(MK_STRUCT(STRUCT_vt_stat)))
+ IOCTL(VT_ACTIVATE, 0, TYPE_INT)
+ IOCTL(VT_WAITACTIVE, 0, TYPE_INT)
+ IOCTL(VT_LOCKSWITCH, 0, TYPE_INT)
+ IOCTL(VT_UNLOCKSWITCH, 0, TYPE_INT)
diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c
index 4091bdcccc..2d778a2ced 100644
--- a/linux-user/linuxload.c
+++ b/linux-user/linuxload.c
@@ -96,7 +96,6 @@ static int prepare_binprm(struct linux_binprm *bprm)
}
}
- memset(bprm->buf, 0, sizeof(bprm->buf));
retval = lseek(bprm->fd, 0L, SEEK_SET);
if(retval >= 0) {
retval = read(bprm->fd, bprm->buf, 128);
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bf06d14fc7..0254226a42 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -79,6 +79,8 @@
#include <linux/kd.h>
#include <linux/mtio.h>
#include <linux/fs.h>
+#include <linux/fb.h>
+#include <linux/vt.h>
#include "linux_loop.h"
#include "qemu.h"
@@ -4461,12 +4463,16 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
p3 = lock_user_string(arg3);
if (!p || !p2 || !p3)
ret = -TARGET_EFAULT;
- else
+ else {
/* FIXME - arg5 should be locked, but it isn't clear how to
* do that since it's not guaranteed to be a NULL-terminated
* string.
*/
- ret = get_errno(mount(p, p2, p3, (unsigned long)arg4, g2h(arg5)));
+ if ( ! arg5 )
+ ret = get_errno(mount(p, p2, p3, (unsigned long)arg4, NULL));
+ else
+ ret = get_errno(mount(p, p2, p3, (unsigned long)arg4, g2h(arg5)));
+ }
unlock_user(p, arg1, 0);
unlock_user(p2, arg2, 0);
unlock_user(p3, arg3, 0);
@@ -4746,6 +4752,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_dup2:
ret = get_errno(dup2(arg1, arg2));
break;
+#if defined(CONFIG_DUP3) && defined(TARGET_NR_dup3)
+ case TARGET_NR_dup3:
+ ret = get_errno(dup3(arg1, arg2, arg3));
+ break;
+#endif
#ifdef TARGET_NR_getppid /* not on alpha */
case TARGET_NR_getppid:
ret = get_errno(getppid());
@@ -5306,7 +5317,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
/* libc does special remapping of the return value of
* sys_getpriority() so it's just easiest to call
* sys_getpriority() directly rather than through libc. */
- ret = sys_getpriority(arg1, arg2);
+ ret = get_errno(sys_getpriority(arg1, arg2));
break;
case TARGET_NR_setpriority:
ret = get_errno(setpriority(arg1, arg2, arg3));
@@ -7013,6 +7024,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
#endif /* CONFIG_EVENTFD */
+#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
+ case TARGET_NR_fallocate:
+ ret = get_errno(fallocate(arg1, arg2, arg3, arg4));
+ break;
+#endif
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index c018165bf3..2d45753dd9 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -660,6 +660,9 @@ struct target_pollfd {
#define TARGET_KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
#define TARGET_KDMKTONE 0x4B30 /* generate tone */
#define TARGET_KDGKBTYPE 0x4b33
+#define TARGET_KDSETMODE 0x4b3a
+#define TARGET_KDGKBMODE 0x4b44
+#define TARGET_KDSKBMODE 0x4b45
#define TARGET_KDGKBENT 0x4B46 /* gets one entry in translation table */
#define TARGET_KDGKBSENT 0x4B48 /* gets one function key string entry */
@@ -874,6 +877,19 @@ struct target_pollfd {
#define TARGET_LOOP_GET_STATUS64 0x4C05
#define TARGET_LOOP_CHANGE_FD 0x4C06
+/* fb ioctls */
+#define TARGET_FBIOGET_VSCREENINFO 0x4600
+#define TARGET_FBIOPUT_VSCREENINFO 0x4601
+#define TARGET_FBIOGET_FSCREENINFO 0x4602
+
+/* vt ioctls */
+#define TARGET_VT_OPENQRY 0x5600
+#define TARGET_VT_GETSTATE 0x5603
+#define TARGET_VT_ACTIVATE 0x5606
+#define TARGET_VT_WAITACTIVE 0x5607
+#define TARGET_VT_LOCKSWITCH 0x560b
+#define TARGET_VT_UNLOCKSWITCH 0x560c
+
/* from asm/termbits.h */
#define TARGET_NCC 8
@@ -1187,8 +1203,8 @@ struct __attribute__((__packed__)) target_stat64 {
unsigned long long __pad0;
long long st_size;
int st_blksize;
- long long st_blocks; /* Number 512-byte blocks allocated. */
unsigned int __pad1;
+ long long st_blocks; /* Number 512-byte blocks allocated. */
int target_st_atime;
unsigned int target_st_atime_nsec;
int target_st_mtime;
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index d3f3df91a3..340dbd367f 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -114,3 +114,54 @@ STRUCT(mtop, TYPE_SHORT, TYPE_INT)
STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG,
TYPE_INT, TYPE_INT)
STRUCT(mtpos, TYPE_LONG)
+
+STRUCT(fb_fix_screeninfo,
+ MK_ARRAY(TYPE_CHAR, 16), /* id */
+ TYPE_ULONG, /* smem_start */
+ TYPE_INT, /* smem_len */
+ TYPE_INT, /* type */
+ TYPE_INT, /* type_aux */
+ TYPE_INT, /* visual */
+ TYPE_SHORT, /* xpanstep */
+ TYPE_SHORT, /* ypanstep */
+ TYPE_SHORT, /* ywrapstep */
+ TYPE_INT, /* line_length */
+ TYPE_ULONG, /* mmio_start */
+ TYPE_INT, /* mmio_len */
+ TYPE_INT, /* accel */
+ MK_ARRAY(TYPE_CHAR, 3)) /* reserved */
+
+STRUCT(fb_var_screeninfo,
+ TYPE_INT, /* xres */
+ TYPE_INT, /* yres */
+ TYPE_INT, /* xres_virtual */
+ TYPE_INT, /* yres_virtual */
+ TYPE_INT, /* xoffset */
+ TYPE_INT, /* yoffset */
+ TYPE_INT, /* bits_per_pixel */
+ TYPE_INT, /* grayscale */
+ MK_ARRAY(TYPE_INT, 3), /* red */
+ MK_ARRAY(TYPE_INT, 3), /* green */
+ MK_ARRAY(TYPE_INT, 3), /* blue */
+ MK_ARRAY(TYPE_INT, 3), /* transp */
+ TYPE_INT, /* nonstd */
+ TYPE_INT, /* activate */
+ TYPE_INT, /* height */
+ TYPE_INT, /* width */
+ TYPE_INT, /* accel_flags */
+ TYPE_INT, /* pixclock */
+ TYPE_INT, /* left_margin */
+ TYPE_INT, /* right_margin */
+ TYPE_INT, /* upper_margin */
+ TYPE_INT, /* lower_margin */
+ TYPE_INT, /* hsync_len */
+ TYPE_INT, /* vsync_len */
+ TYPE_INT, /* sync */
+ TYPE_INT, /* vmode */
+ TYPE_INT, /* rotate */
+ MK_ARRAY(TYPE_INT, 5)) /* reserved */
+
+STRUCT(vt_stat,
+ TYPE_SHORT, /* v_active */
+ TYPE_SHORT, /* v_signal */
+ TYPE_SHORT) /* v_state */