lkml.org 
[lkml]   [2005]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Wistron laptop button driver
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-08 11:39    [W:0.055 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site