From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus <torvalds@transmeta.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
anton@samba.org, "David S. Miller" <davem@redhat.com>,
ak@muc.de, davidm@hpl.hp.com, schwidefsky@de.ibm.com,
ralf@gnu.org, willy@debian.org
Subject: [PATCH][COMPAT] consolidate sys32_times - architecture independent
Date: Tue, 10 Dec 2002 17:35:30 +1100 [thread overview]
Message-ID: <20021210173530.6ec651d2.sfr@canb.auug.org.au> (raw)
Hi Linus,
This is the next in the series. This patch creates compat_sys_times and
a few more compability types. Across all the architectures, the
diffstat looks like this:
arch/ia64/ia32/ia32_entry.S | 2 +-
arch/ia64/ia32/sys_ia32.c | 31 -------------------------------
arch/mips64/kernel/linux32.c | 29 -----------------------------
arch/mips64/kernel/scall_o32.S | 2 +-
arch/parisc/kernel/sys_parisc32.c | 26 --------------------------
arch/ppc64/kernel/misc.S | 2 +-
arch/ppc64/kernel/sys_ppc32.c | 31 -------------------------------
arch/s390x/kernel/entry.S | 2 +-
arch/s390x/kernel/linux32.c | 30 ------------------------------
arch/s390x/kernel/linux32.h | 6 ++----
arch/s390x/kernel/wrapper32.S | 8 ++++----
arch/sparc64/kernel/sys_sparc32.c | 30 ------------------------------
arch/sparc64/kernel/systbls.S | 2 +-
arch/x86_64/ia32/ia32entry.S | 2 +-
arch/x86_64/ia32/sys_ia32.c | 31 -------------------------------
include/asm-ia64/compat.h | 3 +++
include/asm-ia64/ia32.h | 8 +++-----
include/asm-mips64/compat.h | 3 +++
include/asm-mips64/posix_types.h | 3 ---
include/asm-parisc/compat.h | 3 +++
include/asm-parisc/posix_types.h | 3 ---
include/asm-ppc64/compat.h | 3 +++
include/asm-ppc64/ppc32.h | 6 ++----
include/asm-s390x/compat.h | 3 +++
include/asm-sparc64/compat.h | 3 +++
include/asm-sparc64/posix_types.h | 2 --
include/asm-sparc64/siginfo.h | 6 ++++--
include/asm-x86_64/compat.h | 3 +++
include/asm-x86_64/ia32.h | 8 ++++----
include/linux/compat.h | 13 +++++++++++--
kernel/compat.c | 20 ++++++++++++++++++++
31 files changed, 77 insertions(+), 247 deletions(-)
This is the architecture independent part of the patch.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.51-32bit.base/include/linux/compat.h 2.5.51-32bit.1/include/linux/compat.h
--- 2.5.51-32bit.base/include/linux/compat.h 2002-12-10 15:10:40.000000000 +1100
+++ 2.5.51-32bit.1/include/linux/compat.h 2002-12-10 16:40:20.000000000 +1100
@@ -1,8 +1,8 @@
#ifndef _LINUX_COMPAT_H
#define _LINUX_COMPAT_H
/*
- * These are the type definitions for the arhitecure sepcific
- * compatibility layer.
+ * These are the type definitions for the architecture specific
+ * syscall compatibility layer.
*/
#include <linux/config.h>
@@ -10,6 +10,8 @@
#include <asm/compat.h>
+#define compat_jiffies_to_clock_t(x) ((x) / (HZ / COMPAT_USER_HZ))
+
struct compat_utimbuf {
compat_time_t actime;
compat_time_t modtime;
@@ -20,5 +22,12 @@
struct compat_timeval it_value;
};
+struct compat_tms {
+ compat_clock_t tms_utime;
+ compat_clock_t tms_stime;
+ compat_clock_t tms_cutime;
+ compat_clock_t tms_cstime;
+};
+
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff -ruN 2.5.51-32bit.base/kernel/compat.c 2.5.51-32bit.1/kernel/compat.c
--- 2.5.51-32bit.base/kernel/compat.c 2002-12-10 15:10:41.000000000 +1100
+++ 2.5.51-32bit.1/kernel/compat.c 2002-12-10 16:45:09.000000000 +1100
@@ -161,3 +161,23 @@
return -EFAULT;
return 0;
}
+
+asmlinkage long compat_sys_times(struct compat_tms *tbuf)
+{
+ /*
+ * In the SMP world we might just be unlucky and have one of
+ * the times increment as we use it. Since the value is an
+ * atomically safe type this is just fine. Conceptually its
+ * as if the syscall took an instant longer to occur.
+ */
+ if (tbuf) {
+ struct compat_tms tmp;
+ tmp.tms_utime = compat_jiffies_to_clock_t(current->utime);
+ tmp.tms_stime = compat_jiffies_to_clock_t(current->stime);
+ tmp.tms_cutime = compat_jiffies_to_clock_t(current->cutime);
+ tmp.tms_cstime = compat_jiffies_to_clock_t(current->cstime);
+ if (copy_to_user(tbuf, &tmp, sizeof(tmp)))
+ return -EFAULT;
+ }
+ return compat_jiffies_to_clock_t(jiffies);
+}
next reply other threads:[~2002-12-10 6:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-10 6:35 Stephen Rothwell [this message]
2002-12-10 6:38 ` [PATCH][COMPAT] consolidate sys32_times - ppc64 Stephen Rothwell
2002-12-10 6:39 ` [PATCH][COMPAT] consolidate sys32_times - sparc64 Stephen Rothwell
2002-12-10 6:41 ` [PATCH][COMPAT] consolidate sys32_times - x86_64 Stephen Rothwell
2002-12-10 6:43 ` [PATCH][COMPAT] consolidate sys32_times - ia64 Stephen Rothwell
2002-12-10 6:44 ` [PATCH][COMPAT] consolidate sys32_times - s390x Stephen Rothwell
2002-12-10 6:47 ` [PATCH][COMPAT] consolidate sys32_times - mips64 Stephen Rothwell
2002-12-10 6:48 ` [PATCH][COMPAT] consolidate sys32_times - parisc Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021210173530.6ec651d2.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=ak@muc.de \
--cc=anton@samba.org \
--cc=davem@redhat.com \
--cc=davidm@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@gnu.org \
--cc=schwidefsky@de.ibm.com \
--cc=torvalds@transmeta.com \
--cc=willy@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®