[tlinux-users:08139] Re: New release of omnibook module soon: testing welcome

Holger Nelson <[email protected]>
Newsgroups gmane.linux.hardware.toshiba
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 11 Sep 2006, Holger Nelson wrote:

> On Mon, 11 Sep 2006, Holger Nelson wrote:
> 
> Ok, next try. This time the return-codes are working. I also changed the
> code for ATI-chipsets this time.

Next time I should compile-test the code before I send it... Updated patch 
is below.

Holger

diff -urpN -X /usr/src/linux-2.6.17.3/Documentation/dontdiff xxx/trunk/nbsmi.c trunk/nbsmi.c
- --- xxx/trunk/nbsmi.c	2006-09-11 01:45:42.000000000 +0200
+++ trunk/nbsmi.c	2006-09-11 16:15:03.000000000 +0200
@@ -84,21 +84,27 @@ extern const struct pci_device_id lpc_br
 static inline void save_all_regs_flag(void)
 {	
 	spin_lock_irq(&smi_spinlock);
- -	__asm__ __volatile__("pushal ; pushfl");
 }
 
 static inline void restore_all_regs_flag(void)
 {
- -	__asm__ __volatile__("popfl; popal"
- -			     :
- -			     : 
- -			     : "eax", "ecx", "edx", "ebx", "esp", "esi", "edi");
 	spin_unlock_irq(&smi_spinlock);	
 }
 
 static inline void ati_do_smi_call(int *retval, u16 function)
 {
- -	outw( function, ATI_SMI_PORT ); /* Call to SMI */
+
+	// Call to SMI
+	
+	__asm__ __volatile__("pushf;	\
+			      pusha;	\
+			      out %w0,%w1;	\
+			      popa;	\
+			      popf"
+			     :
+			     : "a"(function), "Nd"(ATI_SMI_PORT)
+			     : "esp");
+	/*	outw( function, ATI_SMI_PORT ); Call to SMI */
 	*retval = inw(ATI_SMI_PORT + 1);
 }
 
@@ -109,17 +115,20 @@ static inline void intel_do_smi_call(int
 	state = inl(sci_en);
 	outl( 0, sci_en );
 
- -	outw( function, INTEL_SMI_PORT ); /* Call to SMI */
+	/* Success/Failure is saved in eax so don't save is on stack */
 	
- -/*
- - * Success/Failure state in now stored in eax
- - */
- -	__asm__ __volatile__("movl %%eax, %0"
+	__asm__ __volatile__("pushf;	\
+			      push %%ecx;push %%edx;push %%ebx;push %%esi;push %%edi; push %%ebp;	\
+			      out %w0,%w1;	\
+			      pop %%ebp; pop %%edi; pop %%esi; pop %%ebx; pop %%edx; pop %%ecx; 	\
+			      popf; 	\
+			      movl %%eax, (%2)"
 			     :
- -			     : "m" (retval)
- -			    );
- -
+			     : "a"(function), "Nd"(INTEL_SMI_PORT), "b"(retval)
+			     : "ecx", "edx", "esi", "edi", "ebp", "esp");
+	
 	outl( state, sci_en );	
+
 }
 
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFFBXCDV71P2fDJM84RAgbvAKCZN7QmBdx6FwptynBy4OLcGCvB2QCggt8K
oa4fw/+3qzTJ6MsyaLRhwEo=
=Sov5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.