From: Harvey Harrison <harvey.harrison@gmail.com>
To: Roland McGrath <roland@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] x86: make X86_32 pt_regs members unsigned long
Date: Thu, 07 Feb 2008 21:06:22 -0800 [thread overview]
Message-ID: <1202447182.31361.41.camel@brick> (raw)
Similar to X86_64, move the 32 bit pt_regs to be unsigned long.
Adopt the X86_64-style of casting orig_ax to long in the signal.c
if statements when checking for >=0.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
arch/x86/kernel/signal_32.c | 4 ++--
include/asm-x86/ptrace.h | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index 7718395..c1f4ff7 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -527,7 +527,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
int ret;
/* Are we from a system call? */
- if (regs->orig_ax >= 0) {
+ if ((long)regs->orig_ax >= 0) {
/* If so, check system call restarting.. */
switch (regs->ax) {
case -ERESTART_RESTARTBLOCK:
@@ -625,7 +625,7 @@ static void do_signal(struct pt_regs *regs)
}
/* Did we come from a system call? */
- if (regs->orig_ax >= 0) {
+ if ((long)regs->orig_ax >= 0) {
/* Restart the system call - no handlers present */
switch (regs->ax) {
case -ERESTARTNOHAND:
diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h
index 708337a..bc44246 100644
--- a/include/asm-x86/ptrace.h
+++ b/include/asm-x86/ptrace.h
@@ -42,12 +42,12 @@ struct pt_regs {
unsigned long si;
unsigned long di;
unsigned long bp;
- long ax;
+ unsigned long ax;
unsigned long ds;
unsigned long es;
unsigned long fs;
/* int gs; */
- long orig_ax;
+ unsigned long orig_ax;
unsigned long ip;
unsigned long cs;
unsigned long flags;
@@ -145,7 +145,10 @@ extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int erro
void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
#endif
-#define regs_return_value(regs) ((regs)->ax)
+static inline unsigned long regs_return_value(struct pt_regs *regs)
+{
+ return regs->ax;
+}
/*
* user_mode_vm(regs) determines whether a register set came from user mode.
--
1.5.4.1219.g65b9
reply other threads:[~2008-02-08 5:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1202447182.31361.41.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
/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