Changeset 7ddcfb8c in rtems


Ignore:
Timestamp:
09/21/98 00:42:07 (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
718dc95
Parents:
97d7b068
Message:

Patch from Eric Norum and David Fiddes to put ColdFire? support in
the inet checksum routine.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libnetworking/netinet/in_cksum_m68k.c

    r97d7b068 r7ddcfb8c  
    114114                 */
    115115                {
    116                 unsigned long tcnt = mlen, t1, t2;
     116                unsigned long tcnt = mlen, t1;
    117117                __asm__ volatile (
    118118                "movel   %2,%3\n\t"
     
    121121                "negl    %3\n\t      | Each long uses 4 instruction bytes\n\t"
    122122#if IS_COLDFIRE
    123                 "move    %%cc,%4     | Move the CC into a temp reg\n\t"
    124                 "andil   #0xf,%4     | Clear X (extended carry flag)\n\t"
    125                 "move    %4,%%cc     | Move the modified value back to the cc\n\t"
     123                "addql   #1,%2       | Clear X (extended carry flag)\n\t"
     124                "subql   #1,%2       | \n\t"
    126125#else
    127126                "andi    #0xf,%%cc   | Clear X (extended carry flag)\n\t"
     
    170169                "movel   %0,%3       | Fold 32 bit sum to 16 bits\n\t"
    171170                "swap    %3          |\n\t"
    172                 "andl    %2,%0       |\n\t"
    173                 "andl    %2,%3       |\n\t"
     171                "andl    %2,%0       | Mask to 16-bit sum\n\t"
     172                "andl    %2,%3       | Mask to 16-bit sum\n\t"
    174173                "addl    %3,%0       |\n\t"
    175174                "movel   %0,%3       | Add in last carry\n\t"
    176175                "swap    %3          |\n\t"
    177176                "addl    %3,%0       |\n\t"
     177                "andl    %2,%0       | Mask to 16-bit sum\n\t"
    178178#else
    179179                "dbf     %2,lcsum1_lbl | (NB- dbf doesn't affect X)\n\t"
     
    183183                "moveq   #0,%3       | Add in last carry\n\t"
    184184                "addxw   %3,%0       |\n\t"
     185                "andl    #0xffff,%0  | Mask to 16-bit sum\n"
    185186#endif
    186                 "andl    #0xffff,%0     | Mask to 16-bit sum\n" :
    187                         "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1), "=d" (t2) :
     187                        :
     188                        "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1) :
    188189                        "0" (sum), "1" (w), "2" (tcnt) :
    189190                        "cc", "memory");
  • c/src/lib/libnetworking/netinet/in_cksum_m68k.c

    r97d7b068 r7ddcfb8c  
    114114                 */
    115115                {
    116                 unsigned long tcnt = mlen, t1, t2;
     116                unsigned long tcnt = mlen, t1;
    117117                __asm__ volatile (
    118118                "movel   %2,%3\n\t"
     
    121121                "negl    %3\n\t      | Each long uses 4 instruction bytes\n\t"
    122122#if IS_COLDFIRE
    123                 "move    %%cc,%4     | Move the CC into a temp reg\n\t"
    124                 "andil   #0xf,%4     | Clear X (extended carry flag)\n\t"
    125                 "move    %4,%%cc     | Move the modified value back to the cc\n\t"
     123                "addql   #1,%2       | Clear X (extended carry flag)\n\t"
     124                "subql   #1,%2       | \n\t"
    126125#else
    127126                "andi    #0xf,%%cc   | Clear X (extended carry flag)\n\t"
     
    170169                "movel   %0,%3       | Fold 32 bit sum to 16 bits\n\t"
    171170                "swap    %3          |\n\t"
    172                 "andl    %2,%0       |\n\t"
    173                 "andl    %2,%3       |\n\t"
     171                "andl    %2,%0       | Mask to 16-bit sum\n\t"
     172                "andl    %2,%3       | Mask to 16-bit sum\n\t"
    174173                "addl    %3,%0       |\n\t"
    175174                "movel   %0,%3       | Add in last carry\n\t"
    176175                "swap    %3          |\n\t"
    177176                "addl    %3,%0       |\n\t"
     177                "andl    %2,%0       | Mask to 16-bit sum\n\t"
    178178#else
    179179                "dbf     %2,lcsum1_lbl | (NB- dbf doesn't affect X)\n\t"
     
    183183                "moveq   #0,%3       | Add in last carry\n\t"
    184184                "addxw   %3,%0       |\n\t"
     185                "andl    #0xffff,%0  | Mask to 16-bit sum\n"
    185186#endif
    186                 "andl    #0xffff,%0     | Mask to 16-bit sum\n" :
    187                         "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1), "=d" (t2) :
     187                        :
     188                        "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1) :
    188189                        "0" (sum), "1" (w), "2" (tcnt) :
    189190                        "cc", "memory");
  • c/src/libnetworking/netinet/in_cksum_m68k.c

    r97d7b068 r7ddcfb8c  
    114114                 */
    115115                {
    116                 unsigned long tcnt = mlen, t1, t2;
     116                unsigned long tcnt = mlen, t1;
    117117                __asm__ volatile (
    118118                "movel   %2,%3\n\t"
     
    121121                "negl    %3\n\t      | Each long uses 4 instruction bytes\n\t"
    122122#if IS_COLDFIRE
    123                 "move    %%cc,%4     | Move the CC into a temp reg\n\t"
    124                 "andil   #0xf,%4     | Clear X (extended carry flag)\n\t"
    125                 "move    %4,%%cc     | Move the modified value back to the cc\n\t"
     123                "addql   #1,%2       | Clear X (extended carry flag)\n\t"
     124                "subql   #1,%2       | \n\t"
    126125#else
    127126                "andi    #0xf,%%cc   | Clear X (extended carry flag)\n\t"
     
    170169                "movel   %0,%3       | Fold 32 bit sum to 16 bits\n\t"
    171170                "swap    %3          |\n\t"
    172                 "andl    %2,%0       |\n\t"
    173                 "andl    %2,%3       |\n\t"
     171                "andl    %2,%0       | Mask to 16-bit sum\n\t"
     172                "andl    %2,%3       | Mask to 16-bit sum\n\t"
    174173                "addl    %3,%0       |\n\t"
    175174                "movel   %0,%3       | Add in last carry\n\t"
    176175                "swap    %3          |\n\t"
    177176                "addl    %3,%0       |\n\t"
     177                "andl    %2,%0       | Mask to 16-bit sum\n\t"
    178178#else
    179179                "dbf     %2,lcsum1_lbl | (NB- dbf doesn't affect X)\n\t"
     
    183183                "moveq   #0,%3       | Add in last carry\n\t"
    184184                "addxw   %3,%0       |\n\t"
     185                "andl    #0xffff,%0  | Mask to 16-bit sum\n"
    185186#endif
    186                 "andl    #0xffff,%0     | Mask to 16-bit sum\n" :
    187                         "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1), "=d" (t2) :
     187                        :
     188                        "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1) :
    188189                        "0" (sum), "1" (w), "2" (tcnt) :
    189190                        "cc", "memory");
  • cpukit/libnetworking/netinet/in_cksum_m68k.c

    r97d7b068 r7ddcfb8c  
    114114                 */
    115115                {
    116                 unsigned long tcnt = mlen, t1, t2;
     116                unsigned long tcnt = mlen, t1;
    117117                __asm__ volatile (
    118118                "movel   %2,%3\n\t"
     
    121121                "negl    %3\n\t      | Each long uses 4 instruction bytes\n\t"
    122122#if IS_COLDFIRE
    123                 "move    %%cc,%4     | Move the CC into a temp reg\n\t"
    124                 "andil   #0xf,%4     | Clear X (extended carry flag)\n\t"
    125                 "move    %4,%%cc     | Move the modified value back to the cc\n\t"
     123                "addql   #1,%2       | Clear X (extended carry flag)\n\t"
     124                "subql   #1,%2       | \n\t"
    126125#else
    127126                "andi    #0xf,%%cc   | Clear X (extended carry flag)\n\t"
     
    170169                "movel   %0,%3       | Fold 32 bit sum to 16 bits\n\t"
    171170                "swap    %3          |\n\t"
    172                 "andl    %2,%0       |\n\t"
    173                 "andl    %2,%3       |\n\t"
     171                "andl    %2,%0       | Mask to 16-bit sum\n\t"
     172                "andl    %2,%3       | Mask to 16-bit sum\n\t"
    174173                "addl    %3,%0       |\n\t"
    175174                "movel   %0,%3       | Add in last carry\n\t"
    176175                "swap    %3          |\n\t"
    177176                "addl    %3,%0       |\n\t"
     177                "andl    %2,%0       | Mask to 16-bit sum\n\t"
    178178#else
    179179                "dbf     %2,lcsum1_lbl | (NB- dbf doesn't affect X)\n\t"
     
    183183                "moveq   #0,%3       | Add in last carry\n\t"
    184184                "addxw   %3,%0       |\n\t"
     185                "andl    #0xffff,%0  | Mask to 16-bit sum\n"
    185186#endif
    186                 "andl    #0xffff,%0     | Mask to 16-bit sum\n" :
    187                         "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1), "=d" (t2) :
     187                        :
     188                        "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1) :
    188189                        "0" (sum), "1" (w), "2" (tcnt) :
    189190                        "cc", "memory");
  • cpukit/libnetworking/netinet/in_cksum_m68k.h

    r97d7b068 r7ddcfb8c  
    114114                 */
    115115                {
    116                 unsigned long tcnt = mlen, t1, t2;
     116                unsigned long tcnt = mlen, t1;
    117117                __asm__ volatile (
    118118                "movel   %2,%3\n\t"
     
    121121                "negl    %3\n\t      | Each long uses 4 instruction bytes\n\t"
    122122#if IS_COLDFIRE
    123                 "move    %%cc,%4     | Move the CC into a temp reg\n\t"
    124                 "andil   #0xf,%4     | Clear X (extended carry flag)\n\t"
    125                 "move    %4,%%cc     | Move the modified value back to the cc\n\t"
     123                "addql   #1,%2       | Clear X (extended carry flag)\n\t"
     124                "subql   #1,%2       | \n\t"
    126125#else
    127126                "andi    #0xf,%%cc   | Clear X (extended carry flag)\n\t"
     
    170169                "movel   %0,%3       | Fold 32 bit sum to 16 bits\n\t"
    171170                "swap    %3          |\n\t"
    172                 "andl    %2,%0       |\n\t"
    173                 "andl    %2,%3       |\n\t"
     171                "andl    %2,%0       | Mask to 16-bit sum\n\t"
     172                "andl    %2,%3       | Mask to 16-bit sum\n\t"
    174173                "addl    %3,%0       |\n\t"
    175174                "movel   %0,%3       | Add in last carry\n\t"
    176175                "swap    %3          |\n\t"
    177176                "addl    %3,%0       |\n\t"
     177                "andl    %2,%0       | Mask to 16-bit sum\n\t"
    178178#else
    179179                "dbf     %2,lcsum1_lbl | (NB- dbf doesn't affect X)\n\t"
     
    183183                "moveq   #0,%3       | Add in last carry\n\t"
    184184                "addxw   %3,%0       |\n\t"
     185                "andl    #0xffff,%0  | Mask to 16-bit sum\n"
    185186#endif
    186                 "andl    #0xffff,%0     | Mask to 16-bit sum\n" :
    187                         "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1), "=d" (t2) :
     187                        :
     188                        "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1) :
    188189                        "0" (sum), "1" (w), "2" (tcnt) :
    189190                        "cc", "memory");
Note: See TracChangeset for help on using the changeset viewer.