aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-16 20:28:50 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-16 20:28:50 +0000
commit1a9353d258aba69afd8a389bf5fb705caab12ce0 (patch)
tree6d82000351db013b87af23a2f554bdd5a5bf6b5a /linux-user
parent6dbad63eef5947c6c8750e44f408138779b6d0bb (diff)
added loop/xadd/cmpxchg support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@29 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/ioctls.h3
-rw-r--r--linux-user/syscall.c45
-rw-r--r--linux-user/syscall_defs.h10
-rw-r--r--linux-user/syscall_types.h3
4 files changed, 57 insertions, 4 deletions
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 49deb09da4..eeefcac3ee 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -280,3 +280,6 @@
IOCTL(HDIO_SET_DMA, 0, TYPE_INT)
IOCTL(HDIO_SET_32BIT, 0, TYPE_INT)
IOCTL(HDIO_SET_PIO_MODE, 0, TYPE_INT)
+
+ IOCTL(VFAT_IOCTL_READDIR_BOTH, IOC_R, MK_PTR(MK_ARRAY(MK_STRUCT(STRUCT_dirent), 2)))
+ IOCTL(VFAT_IOCTL_READDIR_SHORT, IOC_R, MK_PTR(MK_ARRAY(MK_STRUCT(STRUCT_dirent), 2)))
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9ed8daa0f8..caaea1aae6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -66,6 +66,10 @@ struct dirent {
char d_name[256]; /* We must not include limits.h! */
};
+//#include <linux/msdos_fs.h>
+#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])
+#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct dirent [2])
+
#include "syscall_defs.h"
#ifdef TARGET_I386
@@ -324,6 +328,40 @@ static long do_socketcall(int num, long *vptr)
break;
case SOCKOP_sendmsg:
case SOCKOP_recvmsg:
+ {
+ int fd;
+ struct target_msghdr *msgp;
+ struct msghdr msg;
+ int flags, count, i;
+ struct iovec *vec;
+ struct target_iovec *target_vec;
+
+ msgp = (void *)vptr[1];
+ msg.msg_name = (void *)tswapl(msgp->msg_name);
+ msg.msg_namelen = tswapl(msgp->msg_namelen);
+ msg.msg_control = (void *)tswapl(msgp->msg_control);
+ msg.msg_controllen = tswapl(msgp->msg_controllen);
+ msg.msg_flags = tswap32(msgp->msg_flags);
+
+ count = tswapl(msgp->msg_iovlen);
+ vec = alloca(count * sizeof(struct iovec));
+ target_vec = (void *)tswapl(msgp->msg_iov);
+ for(i = 0;i < count; i++) {
+ vec[i].iov_base = (void *)tswapl(target_vec[i].iov_base);
+ vec[i].iov_len = tswapl(target_vec[i].iov_len);
+ }
+ msg.msg_iovlen = count;
+ msg.msg_iov = vec;
+
+ fd = vptr[0];
+ flags = vptr[2];
+ if (num == SOCKOP_sendmsg)
+ ret = sendmsg(fd, &msg, flags);
+ else
+ ret = recvmsg(fd, &msg, flags);
+ ret = get_errno(ret);
+ }
+ break;
case SOCKOP_setsockopt:
case SOCKOP_getsockopt:
default:
@@ -356,7 +394,7 @@ typedef struct IOCTLEntry {
int host_cmd;
const char *name;
int access;
- const argtype arg_type[3];
+ const argtype arg_type[5];
} IOCTLEntry;
#define IOC_R 0x0001
@@ -962,12 +1000,11 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
ret = get_errno(setsid());
break;
case TARGET_NR_sigaction:
-#if 0
+#if 1
{
int signum = arg1;
struct target_old_sigaction *tact = arg2, *toldact = arg3;
- ret = get_errno(setsid());
-
+ ret = 0;
}
break;
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index e8357dff36..dc44272dbb 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -29,6 +29,16 @@ struct target_iovec {
target_long iov_len; /* Number of bytes */
};
+struct target_msghdr {
+ target_long msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ target_long msg_iov; /* Data blocks */
+ target_long msg_iovlen; /* Number of blocks */
+ target_long msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
+ target_long msg_controllen; /* Length of cmsg list */
+ unsigned int msg_flags;
+};
+
struct target_rusage {
struct target_timeval ru_utime; /* user time used */
struct target_timeval ru_stime; /* system time used */
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index 540114430b..e9ec148165 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -61,3 +61,6 @@ STRUCT(cdrom_read_audio,
STRUCT(hd_geometry,
TYPE_CHAR, TYPE_CHAR, TYPE_SHORT, TYPE_ULONG)
+
+STRUCT(dirent,
+ TYPE_LONG, TYPE_LONG, TYPE_SHORT, MK_ARRAY(TYPE_CHAR, 256))