public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miloslav Trmac <mitr@volny.cz>
To: Andrew Morton <akpm@osdl.org>
Cc: vojtech@suse.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Wistron laptop button driver
Date: Thu, 08 Sep 2005 11:32:45 +0200	[thread overview]
Message-ID: <4320053D.5000408@volny.cz> (raw)
In-Reply-To: <20050907222347.493f1047.akpm@osdl.org>

Andrew Morton wrote:
> Miloslav Trmac <mitr@volny.cz> wrote:
> 
>>+static void call_bios(struct regs *regs)
>> +{
>> +	unsigned long flags;
>> +
>> +	preempt_disable();
>> +	local_irq_save(flags);
>> +	asm volatile ("pushl %%ebp;"
>> +		      "movl %[data], %%ebp;"
>> +		      "call *%[routine];"
>> +		      "popl %%ebp"
>> +		      : "=a" (regs->eax), "=b" (regs->ebx), "=c" (regs->ecx)
>> +		      : "0" (regs->eax), "1" (regs->ebx), "2" (regs->ecx),
>> +			[routine] "m" (bios_entry_point),
>> +			[data] "m" (bios_data_map_base)
>> +		      : "edx", "edi", "esi", "memory");
>> +	local_irq_restore(flags);
>> +	preempt_enable();
>> +}
>> +
> 
> gcc-2.95.x spits the dummy over this [routine] stuff.  What compiler does
> this require?
(info gcc) says gcc >= 3.1.

> Is it necessary to open-code the BIOS call in the driver?  Does it make
> sense to have some library function to do this?
A general library function (handling all registers) would have to be
written in assembler because gcc has trouble allocating registers
otherwise; considering that we should ideally avoid BIOS calls and that
such a function wasn't needed in the last 14 years, I don't think it is
worth the effort.
	Mirek

  reply	other threads:[~2005-09-08  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-07  2:19 [PATCH] Wistron laptop button driver Miloslav Trmac
2005-09-08  5:23 ` Andrew Morton
2005-09-08  9:32   ` Miloslav Trmac [this message]
2005-09-08  6:43 ` Pekka Enberg
2005-09-08  9:36   ` Miloslav Trmac
2005-09-25 21:35 ` Miloslav Trmac

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=4320053D.5000408@volny.cz \
    --to=mitr@volny.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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