On Wed, 2007-11-14 at 17:25 +0100, Jocelyn Mayer wrote:
> On Wed, 2007-11-14 at 08:59 -0700, Thayne Harbaugh wrote:
> > This patch, 44_target_posix_types.patch provides target specific posix
> > types.  These types improve target structure creation, code similarity
> > to kernel code and improve type casting for assignment between target
> > and host.
> 
> Hi,
> 
> This seems not OK for ppc/ppc64. There is no ppc64 subdirectory anymore
> in the linux-user directory. ppc and ppc64 targets have been merged, as
> it is in recent kernels, so all the definitions should go in the ppc
> subdirectory, using #ifdef TARGET_PPC64 when there are differences; but
> there should be very few: there are only 2 ifdef __powerpc64__ in the
> linux-2.6.23/include/asm-powerpc/posix_types.h file.

How is this?
Index: qemu/linux-user/alpha/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/alpha/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,55 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-alpha/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef target_uint		target_ino_t;
+typedef target_uint		target_mode_t;
+typedef target_uint		target_nlink_t;
+typedef abi_long		target_off_t;
+typedef target_long_long	target_loff_t;
+typedef target_int		target_pid_t;
+typedef target_int		target_ipc_pid_t;
+typedef target_uint		target_uid_t;
+typedef target_uint		target_gid_t;
+typedef abi_ulong		target_size_t;
+typedef abi_long		target_ssize_t;
+typedef abi_long		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+/* typedef unsigned long	target_sigset_t; (conflicts in syscall_defs.h) */
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_timer_t;
+
+typedef struct {
+	target_int	val[2];
+} target_fsid_t;
+
+typedef target_uid_t		target_old_uid_t;
+typedef target_gid_t		target_old_gid_t;
+typedef target_uid_t		target_uid32_t;
+typedef target_gid_t		target_gid32_t;
+
+typedef target_uint		target_old_dev_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/arm/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/arm/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,62 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-arm/posix_types.h
+ *
+ *  Copyright (C) 1996-1998 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Changelog:
+ *   27-06-1996	RMK	Created
+ */
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_ushort		target_mode_t;
+typedef target_ushort		target_nlink_t;
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_ushort		target_ipc_pid_t;
+typedef target_ushort		target_uid_t;
+typedef target_ushort		target_gid_t;
+typedef target_uint		target_size_t;
+typedef target_int		target_ssize_t;
+typedef target_int		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		id16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint		target_uid32_t;
+typedef target_uint		target_gid32_t;
+
+typedef target_ushort		target_old_uid_t;
+typedef target_ushort		target_old_gid_t;
+typedef target_ushort		target_old_dev_t;
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+	target_int	val[2];
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES */
Index: qemu/linux-user/i386/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/i386/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,55 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-i386/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_ushort		target_mode_t;
+typedef target_ushort		target_nlink_t;
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_ushort		target_ipc_pid_t;
+typedef target_ushort		target_uid_t;
+typedef target_ushort		target_gid_t;
+typedef target_uint		target_size_t;
+typedef target_int		target_ssize_t;
+typedef target_int		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint		target_uid32_t;
+typedef target_uint		target_gid32_t;
+
+typedef target_ushort		target_old_uid_t;
+typedef target_ushort		target_old_gid_t;
+typedef target_ushort		target_old_dev_t;
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/m68k/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/m68k/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,54 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-m68k/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_ushort		target_mode_t;
+typedef target_ushort		target_nlink_t;
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_ushort		target_ipc_pid_t;
+typedef target_ushort		target_uid_t;
+typedef target_ushort		target_gid_t;
+typedef target_uint		target_size_t;
+typedef target_int		target_ssize_t;
+typedef target_int		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint		target_uid32_t;
+typedef target_uint		target_gid32_t;
+
+typedef target_ushort		target_old_uid_t;
+typedef target_ushort		target_old_gid_t;
+typedef target_ushort		target_old_dev_t;
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/mips/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/mips/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,79 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-mips/posix_types.h
+ */
+
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_uint		target_mode_t;
+#ifdef TARGET_MIPS
+typedef abi_ulong		target_nlink_t;
+#endif
+#ifdef TARGET_MIPS64
+typedef target_uint		target_nlink_t;
+#endif
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_int		target_ipc_pid_t;
+typedef target_uint		target_uid_t;
+typedef target_uint		target_gid_t;
+#ifdef TARGET_MIPS
+typedef target_uint		target_size_t;
+typedef target_int		target_ssize_t;
+typedef target_int		target_ptrdiff_t;
+#endif
+#ifdef TARGET_MIPS64
+typedef abi_ulong		target_size_t;
+typedef abi_long		target_ssize_t;
+typedef abi_long		target_ptrdiff_t;
+#endif
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef abi_long		target_daddr_t;
+typedef target_char *		target_caddr_t;
+
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint		target_uid32_t;
+typedef target_uint		target_gid32_t;
+typedef target_uid_t		target_old_uid_t;
+typedef target_gid_t		target_old_gid_t;
+typedef target_uint		target_old_dev_t;
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+#ifdef TARGET_MIPS
+    abi_long	val[2];
+#endif
+#ifdef TARGET_MIPS64
+    target_int	val[2];
+#endif
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/ppc/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/ppc/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,65 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-powerpc/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+/* ppc usually has unsigned chars */
+typedef int8_t			target_schar;
+
+typedef uint8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_uint		target_mode_t;
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_uint		target_uid_t;
+typedef target_uint		target_gid_t;
+typedef abi_long		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef abi_long		target_suseconds_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint		target_uid32_t;
+typedef target_uint		target_gid32_t;
+typedef target_uint		target_old_uid_t;
+typedef target_uint		target_old_gid_t;
+
+#if defined(TARGET_PPC64)
+typedef abi_ulong		target_nlink_t;
+typedef target_int		target_ipc_pid_t;
+typedef abi_ulong		target_size_t;
+typedef target_long		target_ssize_t;
+typedef abi_ulong		target_old_dev_t;
+#else /* !defined(TARGET_PPC64) */
+typedef target_ushort		target_nlink_t;
+typedef target_short		target_ipc_pid_t;
+typedef target_uint		target_size_t;
+typedef target_int		target_ssize_t;
+typedef target_uint		target_old_dev_t;
+#endif /* !defined(TARGET_PPC64) */
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/sh4/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/sh4/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,56 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-sh/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_ushort		target_mode_t;
+typedef target_ushort		target_nlink_t;
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_ushort		target_ipc_pid_t;
+typedef target_ushort		target_uid_t;
+typedef target_ushort		target_gid_t;
+typedef target_uint		target_size_t;
+typedef target_int		target_ssize_t;
+typedef target_int		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint		target_uid32_t;
+typedef target_uint		target_gid32_t;
+
+typedef target_ushort		target_old_uid_t;
+typedef target_ushort		target_old_gid_t;
+typedef target_ushort		target_old_dev_t;
+
+#ifdef __GNUC__
+typedef target_long_long	target_loff_t;
+#endif
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/sparc/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/sparc/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,56 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-sparc/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t                target_char;
+typedef int16_t               target_short;
+typedef int32_t               target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int32_t               target_long_int;
+typedef int64_t               target_long_long;
+
+typedef uint8_t               target_uchar;
+typedef uint16_t              target_ushort;
+typedef uint32_t              target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef int32_t               target_ulong_int;
+typedef uint64_t              target_ulong_long;
+
+typedef target_uint           target_size_t;
+typedef target_int            target_ssize_t;
+typedef target_long_int       target_ptrdiff_t;
+typedef abi_long              target_time_t;
+typedef abi_long              target_suseconds_t;
+typedef abi_long              target_clock_t;
+typedef target_int            target_pid_t;
+typedef target_ushort         target_ipc_pid_t;
+typedef target_ushort         target_uid_t;
+typedef target_ushort         target_gid_t;
+typedef abi_ulong             target_ino_t;
+typedef target_ushort         target_mode_t;
+typedef target_ushort         target_umode_t;
+typedef target_short          target_nlink_t;
+typedef abi_long              target_daddr_t;
+typedef abi_long              target_off_t;
+typedef target_char *         target_caddr_t;
+typedef target_ushort         target_uid16_t;
+typedef target_ushort         target_gid16_t;
+typedef target_uint           target_uid32_t;
+typedef target_uint           target_gid32_t;
+typedef target_ushort         target_old_uid_t;
+typedef target_ushort         target_old_gid_t;
+typedef target_ushort         target_old_dev_t;
+typedef target_int            target_clockid_t;
+typedef target_int            target_timer_t;
+
+typedef target_long_long      target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/sparc64/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/sparc64/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,58 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-sparc64/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+typedef int8_t                  target_char;
+typedef int16_t                 target_short;
+typedef int32_t                 target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t                 target_long_long;
+
+typedef uint8_t                 target_uchar;
+typedef uint16_t                target_ushort;
+typedef uint32_t                target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t                target_ulong_long;
+
+typedef abi_ulong               target_size_t;
+typedef abi_long                target_ssize_t;
+typedef abi_long                target_ptrdiff_t;
+typedef abi_long                target_time_t;
+typedef abi_long                target_clock_t;
+typedef target_int              target_pid_t;
+typedef target_int              target_ipc_pid_t;
+typedef target_uint             target_uid_t;
+typedef target_uint             target_gid_t;
+typedef abi_ulong               target_ino_t;
+typedef target_uint             target_mode_t;
+typedef target_ushort           target_umode_t;
+typedef target_uint             target_nlink_t;
+typedef target_int              target_daddr_t;
+typedef abi_long                target_off_t;
+typedef target_char *           target_caddr_t;
+typedef target_ushort           target_uid16_t;
+typedef target_ushort           target_gid16_t;
+typedef target_int              target_clockid_t;
+typedef target_int              target_timer_t;
+
+typedef target_ushort           target_old_uid_t;
+typedef target_ushort           target_old_gid_t;
+typedef target_uid_t            target_uid32_t;
+typedef target_gid_t            target_gid32_t;
+
+typedef target_uint             target_old_dev_t;
+
+/* Note this piece of asymmetry from the v9 ABI.  */
+typedef target_int              target_suseconds_t;
+
+typedef target_long_long        target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/x86_64/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/x86_64/target_posix_types.h	2007-11-13 15:36:14.000000000 -0700
@@ -0,0 +1,57 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-x86_64/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+#include <stdint.h>
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef abi_ulong		target_ino_t;
+typedef target_uint		target_mode_t;
+typedef abi_ulong		target_nlink_t;
+typedef abi_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_int		target_ipc_pid_t;
+typedef target_uint		target_uid_t;
+typedef target_uint		target_gid_t;
+typedef abi_ulong		target_size_t;
+typedef abi_long		target_ssize_t;
+typedef abi_long		target_ptrdiff_t;
+typedef abi_long		target_time_t;
+typedef abi_long		target_suseconds_t;
+typedef abi_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+typedef target_ushort target_old_uid_t;
+typedef target_ushort target_old_gid_t;
+typedef target_uid_t target_uid32_t;
+typedef target_gid_t target_gid32_t;
+
+typedef abi_ulong		target_old_dev_t;
+
+#endif /* TARGET_POSIX_TYPES_H */
Index: qemu/linux-user/syscall_defs.h
===================================================================
--- qemu.orig/linux-user/syscall_defs.h	2007-11-13 15:33:11.000000000 -0700
+++ qemu/linux-user/syscall_defs.h	2007-11-13 15:37:47.000000000 -0700
@@ -5,6 +5,7 @@
    necessary */
 
 #include "syscall_nr.h"
+#include "target_posix_types.h"
 
 #define SOCKOP_socket           1
 #define SOCKOP_bind             2
@@ -104,13 +105,15 @@
     uint8_t sa_data[14];
 };
 
+typedef uint32_t target_socklen_t;
+
 struct target_timeval {
-    abi_long tv_sec;
-    abi_long tv_usec;
+    target_time_t tv_sec;
+    target_suseconds_t tv_usec;
 };
 
 struct target_timespec {
-    abi_long tv_sec;
+    target_time_t tv_sec;
     abi_long tv_nsec;
 };
 
@@ -119,8 +122,6 @@
     struct target_timeval it_value;
 };
 
-typedef abi_long target_clock_t;
-
 #define TARGET_HZ 100
 
 struct target_tms {
@@ -131,8 +132,8 @@
 };
 
 struct target_utimbuf {
-    abi_long actime;
-    abi_long modtime;
+    target_time_t actime;
+    target_time_t modtime;
 };
 
 struct target_sel_arg_struct {
@@ -1481,10 +1482,6 @@
 #error unsupported CPU
 #endif
 
-typedef struct {
-        int     val[2];
-} target_fsid_t;
-
 #ifdef TARGET_MIPS
 #ifdef TARGET_MIPSN32
 struct target_statfs {
Index: qemu/linux-user/cris/target_posix_types.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/linux-user/cris/target_posix_types.h	2007-11-13 16:18:03.000000000 -0700
@@ -0,0 +1,59 @@
+/*
+ * Borrowed with minor changes from:
+ *  linux/include/asm-cris/posix_types.h
+ */
+
+#ifndef TARGET_POSIX_TYPES_H
+#define TARGET_POSIX_TYPES_H
+
+
+#include <stdint.h>
+
+
+typedef int8_t			target_char;
+typedef int16_t			target_short;
+typedef int32_t			target_int;
+/* target_long defined in qemu/cpu-defs.h */
+typedef int64_t			target_long_long;
+
+typedef uint8_t			target_uchar;
+typedef uint16_t		target_ushort;
+typedef uint32_t		target_uint;
+/* target_ulong defined in qemu/cpu-defs.h */
+typedef uint64_t		target_ulong_long;
+
+typedef target_ulong		target_ino_t;
+typedef target_ushort		target_mode_t;
+typedef target_ushort		target_nlink_t;
+typedef target_long		target_off_t;
+typedef target_int		target_pid_t;
+typedef target_ushort		target_ipc_pid_t;
+typedef target_ushort		target_uid_t;
+typedef target_ushort		target_gid_t;
+typedef target_ulong		target_size_t;
+typedef target_long		target_ssize_t;
+typedef target_int		target_ptrdiff_t;
+typedef target_long		target_time_t;
+typedef target_long            	target_suseconds_t;
+typedef target_long		target_clock_t;
+typedef target_int		target_timer_t;
+typedef target_int		target_clockid_t;
+typedef target_int		target_daddr_t;
+typedef target_char *		target_caddr_t;
+typedef target_ushort		target_uid16_t;
+typedef target_ushort		target_gid16_t;
+typedef target_uint    		target_uid32_t;
+typedef target_uint    		target_gid32_t;
+
+typedef target_ushort		target_old_uid_t;
+typedef target_ushort		target_old_gid_t;
+typedef target_ushort		target_old_dev_t;
+
+typedef target_long_long	target_loff_t;
+
+typedef struct {
+    target_int	val[2];
+} target_fsid_t;
+
+
+#endif /* TARGET_POSIX_TYPES_H */

Reply via email to