From: Rusty Russell <rusty@rustcorp.com.au>
To: Muli Ben-Yehuda <mulix@actcom.co.il>
Cc: ak@suse.de, linux-kernel@vger.kernel.org
Subject: Re: rename 'unused' in sys_iopl to somethign else, since it is used
Date: Tue, 30 Jul 2002 11:02:33 +1000 [thread overview]
Message-ID: <20020730011859.96E0B4276@lists.samba.org> (raw)
In-Reply-To: Your message of "Sun, 28 Jul 2002 17:12:56 +0300." <20020728141256.GA9573@alhambra.actcom.co.il>
In message <20020728141256.GA9573@alhambra.actcom.co.il> you write:
> sys_iopl on i386 accepts one parameter, 'unsigned long unused'. Then
> it goes ahead and uses it to get a pointer to struct pt_regs. This
> patch changes its name to 'location'.=20
Hmmm.... Andi, the x86_64 version is different: do you really push one
arg on the stack then the regs? Please check...
> diff -Nru a/arch/i386/kernel/ioport.c b/arch/i386/kernel/ioport.c
> --- a/arch/i386/kernel/ioport.c Sun Jul 28 17:08:54 2002
> +++ b/arch/i386/kernel/ioport.c Sun Jul 28 17:08:54 2002
> @@ -102,9 +102,9 @@
> * code.
> */
>
> -asmlinkage int sys_iopl(unsigned long unused)
> +asmlinkage int sys_iopl(unsigned long location)
> {
> - struct pt_regs * regs =3D (struct pt_regs *) &unused;
> + struct pt_regs * regs =3D (struct pt_regs *) &location;=20
> unsigned int level =3D regs->ebx;
> unsigned int old =3D (regs->eflags >> 12) & 3;
>
It also then rereads the arg out of regs->ebx. I prefer the following
patch, which makes it obvious that the arg *is* required, and what it
means:
diff -urpN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.29/arch/i386/kernel/ioport.c working-2.5.29-iopl/arch/i386/kernel/ioport.c
--- linux-2.5.29/arch/i386/kernel/ioport.c Mon Jun 17 23:19:16 2002
+++ working-2.5.29-iopl/arch/i386/kernel/ioport.c Tue Jul 30 10:58:38 2002
@@ -102,10 +102,9 @@ asmlinkage int sys_ioperm(unsigned long
* code.
*/
-asmlinkage int sys_iopl(unsigned long unused)
+asmlinkage int sys_iopl(unsigned int level)
{
- struct pt_regs * regs = (struct pt_regs *) &unused;
- unsigned int level = regs->ebx;
+ struct pt_regs * regs = (struct pt_regs *) &level;
unsigned int old = (regs->eflags >> 12) & 3;
if (level > 3)
Thanks!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next parent reply other threads:[~2002-07-30 1:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20020728141256.GA9573@alhambra.actcom.co.il>
2002-07-30 1:02 ` Rusty Russell [this message]
2002-07-30 4:25 ` Andi Kleen
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=20020730011859.96E0B4276@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mulix@actcom.co.il \
/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®