asm macro 
Author Message
 asm macro

Hi,

Am porting some C code from linux to solaris.

I have come across some asm macros used in linux which are not supported
in Solaris. Can anybody advise about how we convert/write equivalent
code for Solaris environment.

Here is sample code of one such macro usage.

---------------

static unsigned short ip_fast_csum(unsigned char * iph,
                                         unsigned int ihl) {
       unsigned int sum;

       __asm__ __volatile__(" movl (%1), %0 subl $4, %2 jbe 2f addl
4(%1), %0 adcl 8(%1), %0 adcl 12(%1), %0
1:        adcl 16(%1), %0 lea 4(%1), %1 decl %2 jne 1b adcl $0, %0
movl %0, %2 shrl $16, %0 addw %w2, %w0 adcl $0, %0 notl %0
2:        "

       :"=r" (sum), "=r" (iph), "=r" (ihl)
       :"1" (iph), "2" (ihl));
       return(sum);

Quote:
}

----------------------

Appreciate your time and advise.

Thanks,

Harija

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Fri, 08 Mar 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. C and asm macro

2. ASM Macros ?

3. ASM Macro

4. A macro involving two sub-macros - where the 2nd macro needs results from the first

5. FS: IBM Macro ASM V 2.0

6. Square Root in ASM (I'd also like a print literal Macro)

7. asm in c macro. how

8. FS: IBM Macro ASM V 2.0

9. challenge for MACRO experts & ASM gurus

10. Macro Preprocessor (was: C -> ASM compression problem)

11. macro -vs- macro/codeblock

12. Help with macros writing macros in Bigloo

 

 
Powered by phpBB® Forum Software