public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
To: Doug Warzecha <Douglas_Warzecha@dell.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
	abhay_salunke@dell.com, matt_domsch@dell.com
Subject: Re: [PATCH 2.6.12-rc6] char: Add Dell Systems Management Base driver
Date: Thu, 16 Jun 2005 14:28:58 -0400	[thread overview]
Message-ID: <42B1C4EA.9060200@didntduck.org> (raw)
In-Reply-To: <20050616173024.GA2596@sysman-doug.us.dell.com>

Doug Warzecha wrote:
> This patch adds the Dell Systems Management Base driver.
> 
> The Dell Systems Management Base driver is a character driver that
> provides support needed by Dell systems management software to manage
> certain Dell systems.  The driver implements ioctls for Dell systems
> management software to use to communicate with the driver.
> 
> This driver has been tested with Dell systems management software
> on a variety of Dell systems.
> 
> By making a contribution to this project, I certify that:
> The contribution was created in whole or in part by me and
> I have the right to submit it under the open source license
> indicated in the file.
> 
> Signed-off-by: Doug Warzecha <Douglas_Warzecha@dell.com>
> ---

> +	/* generate SMI */
> +	asm("pushl %ebx");
> +	asm("pushl %ecx");
> +	asm("rep" : : "b" (command_buffer_phys_addr));
> +	asm("rep" : : "c" (ci_cmd->signature));
> +	outb(ci_cmd->command_code, ci_cmd->command_address);
> +	asm("popl %ecx");
> +	asm("popl %ebx");

This is wrong.  GCC doesn't guarantee that any registers or stack state 
is preserved between asm statements.  What you really want is:

asm("outb %b0,%w1" : :
	"a" (ci_cmd->command_code),
	"d" (ci_cmd->command_address),
	"b" (command_buffer_phys_addr),
	"c" (ci_cmd->signature));

This way you don't need to explicitly push/pop %ebx and %ecx, since GCC 
will know they are being used.  If the SMI changes any of the registers 
then they need to be changed to outputs so GCC knows that they are 
clobbered.

--
				Brian Gerst

  parent reply	other threads:[~2005-06-16 18:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-16 17:30 [PATCH 2.6.12-rc6] char: Add Dell Systems Management Base driver Doug Warzecha
2005-06-16 17:59 ` Andi Kleen
2005-06-16 18:28 ` Brian Gerst [this message]
2005-06-16 21:20 ` Alexey Dobriyan
2005-06-16 22:04 ` Chris Wedgwood
2005-06-17  4:30 ` Andrey Panin
2005-06-20  9:56 ` Pavel Machek
2005-06-25  1:31 ` Chris Wedgwood

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=42B1C4EA.9060200@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=Douglas_Warzecha@dell.com \
    --cc=abhay_salunke@dell.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt_domsch@dell.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