47 unsigned long sum = ( ( ~partial ) & 0xffff );
48 unsigned long initial_word_count;
49 unsigned long loop_count;
50 unsigned long loop_partial_count;
51 unsigned long final_word_count;
52 unsigned long final_byte;
55 unsigned long discard_a;
56 unsigned long discard_r1;
57 unsigned long discard_r2;
64 if (
len >=
sizeof ( sum ) ) {
66 (
sizeof ( sum ) - 1 ) ) >> 1 );
68 initial_word_count = 0;
70 len -= ( initial_word_count * 2 );
77 loop_count = (
len / (
sizeof ( sum ) * 16 ) );
79 ( (
len % (
sizeof ( sum ) * 16 ) ) /
sizeof ( sum ) );
84 final_word_count = ( (
len %
sizeof ( sum ) ) / 2 );
87 final_byte = (
len & 1 );
93 "imul $( -x86_tcpip_loop_step_size ), %4\n\t" 110 "\nx86_tcpip_loop_start:\n\t" 111 "lods%z2\n\tadc %2, %0\n\t" 112 "lods%z2\n\tadc %2, %0\n\t" 113 "lods%z2\n\tadc %2, %0\n\t" 114 "lods%z2\n\tadc %2, %0\n\t" 115 "lods%z2\n\tadc %2, %0\n\t" 116 "lods%z2\n\tadc %2, %0\n\t" 117 "lods%z2\n\tadc %2, %0\n\t" 118 "lods%z2\n\tadc %2, %0\n\t" 119 "lods%z2\n\tadc %2, %0\n\t" 120 "lods%z2\n\tadc %2, %0\n\t" 121 "lods%z2\n\tadc %2, %0\n\t" 122 "lods%z2\n\tadc %2, %0\n\t" 123 "lods%z2\n\tadc %2, %0\n\t" 124 "lods%z2\n\tadc %2, %0\n\t" 125 "lods%z2\n\tadc %2, %0\n\t" 126 "lods%z2\n\tadc %2, %0\n\t" 127 "\nx86_tcpip_loop_end:\n\t" 128 "loop x86_tcpip_loop_start\n\t" 129 ".equ x86_tcpip_loop_step_size, " 130 " ( ( x86_tcpip_loop_end - x86_tcpip_loop_start ) >> 4 )\n\t" 164 :
"=&Q" ( sum ),
"=&S" (
discard_S ),
"=&a" ( discard_a ),
165 "=&c" (
discard_c ),
"=&r" ( discard_r1 ),
167 :
"0" ( sum ),
"1" (
data ),
"2" ( 0 ),
168 "3" ( initial_word_count + 1 ),
"4" ( loop_partial_count ),
170 "g" ( final_word_count + 1 ),
"g" ( final_byte ) );
172 return ( ~sum & 0xffff );
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
char x86_tcpip_loop_end[]
Transport-network layer interface.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
uint8_t data[48]
Additional event data.
uint16_t tcpip_continue_chksum(uint16_t partial, const void *data, size_t len)
Calculate continued TCP/IP checkum.