linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: PATCH] adding wistron_btns support for X86_64 systems.
@ 2007-12-22 20:40 Carlos Corbacho
  2008-01-02 22:31 ` Rémi Hérilier
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Corbacho @ 2007-12-22 20:40 UTC (permalink / raw)
  To: Rémi Hérilier; +Cc: linux-kernel, dtor, linux-input

(CC'ing linux-input, as that is the relevant subsystem list for wistron-btns).

Rémi Hérilier wrote:
> To use my previous patch (wistron_btns support for fujitsu-siemens amilo
> pro edition v3505) with my laptop, I need to make the wistron module
> compile for x86_64. It is based on Linux 2.4.24-rc4 too.

NAK.

You cannot make 32 bit BIOS calls in a 64 bit OS.

This will (and does) segfault on x86-64 (tested on my Aspire 5020, where  
call_bios wistron-btns just segfaults on x86-64 with this patch).

This is a known issue, and the reason why wistron-btns (and the out-of-tree 
acerhk) have not been ported to x86-64.

-Carlos
-- 
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH] adding wistron_btns support for X86_64 systems.
  2007-12-22 20:40 PATCH] adding wistron_btns support for X86_64 systems Carlos Corbacho
@ 2008-01-02 22:31 ` Rémi Hérilier
  2008-01-03 16:21   ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Rémi Hérilier @ 2008-01-02 22:31 UTC (permalink / raw)
  To: Carlos Corbacho; +Cc: linux-kernel, dtor, linux-input

Carlos Corbacho wrote:
> (CC'ing linux-input, as that is the relevant subsystem list for wistron-btns).
> 
> Rémi Hérilier wrote:
>> To use my previous patch (wistron_btns support for fujitsu-siemens amilo
>> pro edition v3505) with my laptop, I need to make the wistron module
>> compile for x86_64. It is based on Linux 2.4.24-rc4 too.
> 
> NAK.
> 
> You cannot make 32 bit BIOS calls in a 64 bit OS.
> 
> This will (and does) segfault on x86-64 (tested on my Aspire 5020, where  
> call_bios wistron-btns just segfaults on x86-64 with this patch).
> 
> This is a known issue, and the reason why wistron-btns (and the out-of-tree 
> acerhk) have not been ported to x86-64.
> 
> -Carlos

Yes, in theory, this must segfault on x86-64.

In pratice, there is one laptop where it seems to works (no problem
for 3 weeks). A good reason to find why.


Best regards

Remi Herilier

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH] adding wistron_btns support for X86_64 systems.
  2008-01-02 22:31 ` Rémi Hérilier
@ 2008-01-03 16:21   ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2008-01-03 16:21 UTC (permalink / raw)
  To: Rémi Hérilier; +Cc: Carlos Corbacho, linux-kernel, linux-input

Hi Rémi,

On Jan 2, 2008 5:31 PM, Rémi Hérilier <rherilier@yahoo.fr> wrote:
> Carlos Corbacho wrote:
> > (CC'ing linux-input, as that is the relevant subsystem list for wistron-btns).
> >
> > Rémi Hérilier wrote:
> >> To use my previous patch (wistron_btns support for fujitsu-siemens amilo
> >> pro edition v3505) with my laptop, I need to make the wistron module
> >> compile for x86_64. It is based on Linux 2.4.24-rc4 too.
> >
> > NAK.
> >
> > You cannot make 32 bit BIOS calls in a 64 bit OS.
> >
> > This will (and does) segfault on x86-64 (tested on my Aspire 5020, where
> > call_bios wistron-btns just segfaults on x86-64 with this patch).
> >
> > This is a known issue, and the reason why wistron-btns (and the out-of-tree
> > acerhk) have not been ported to x86-64.
> >
> > -Carlos
>
> Yes, in theory, this must segfault on x86-64.
>
> In pratice, there is one laptop where it seems to works (no problem
> for 3 weeks). A good reason to find why.
>

My concern that even on that particular model this may stop wotking if
you upgrade BIOS. Otherwise the fact that it doe snot work on some
other laptop should not stop us - we using DMI matching in wistron
buttons anyway.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* PATCH] adding wistron_btns support for X86_64 systems.
@ 2007-12-06 20:16 Rémi Hérilier
  0 siblings, 0 replies; 4+ messages in thread
From: Rémi Hérilier @ 2007-12-06 20:16 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel


Hello again.

To use my previous patch (wistron_btns support for fujitsu-siemens amilo pro edition v3505)
with my laptop, I need to make the wistron module compile for x86_64. It is based on Linux
2.4.24-rc4 too.

So, here it is:


Wistron button support for X86_64 systems.

Signed-off-by: Remi Herilier <rherilier@yahoo.fr>


diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 8f5c7b9..5bc8ce6 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -64,7 +64,7 @@ config INPUT_COBALT_BTNS
 
 config INPUT_WISTRON_BTNS
 	tristate "x86 Wistron laptop button interface"
-	depends on X86 && !X86_64
+	depends on X86
 	select INPUT_POLLDEV
 	select NEW_LEDS
 	select LEDS_CLASS
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index b438d99..9d8069b 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -74,10 +74,18 @@ static void call_bios(struct regs *regs)
 
 	preempt_disable();
 	local_irq_save(flags);
+#ifdef CONFIG_X86_64
+	asm volatile ("pushq %%rbp;"
+#else
 	asm volatile ("pushl %%ebp;"
+#endif
 		      "movl %7, %%ebp;"
 		      "call *%6;"
+#ifdef CONFIG_X86_64
+		      "popq %%rbp"
+#else
 		      "popl %%ebp"
+#endif 
 		      : "=a" (regs->eax), "=b" (regs->ebx), "=c" (regs->ecx)
 		      : "0" (regs->eax), "1" (regs->ebx), "2" (regs->ecx),
 			"m" (bios_entry_point), "m" (bios_data_map_base)

--
Best regards

Rémi Hérilier

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-03 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-22 20:40 PATCH] adding wistron_btns support for X86_64 systems Carlos Corbacho
2008-01-02 22:31 ` Rémi Hérilier
2008-01-03 16:21   ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2007-12-06 20:16 Rémi Hérilier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).