/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1992,1997 by Sun Microsystems, Inc.
* All rights reserved.
*/
/* Copyright (c) 1990 Mentat Inc. */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/isa_defs.h>
/*
* For maximum efficiency, these access macros should be redone for
* machines that can access unaligned data. NOTE: these assume
* ability to fetch from a zero extended 'uint8_t' and 'uint16_t'. Add explicit
* masks in the U8_FETCH, U16_FETCH, PREV_TWO and NEXT_TWO as needed.
*/
#ifdef _LITTLE_ENDIAN
#define U8_FETCH_FIRST(p) ((p)[0])
#else
#define U8_FETCH_SECOND(p) ((p)[0])
#endif
/*
* Return the ones complement checksum from the mblk chain at mp,
* after skipping offset bytes, and adding in the supplied partial
* sum. Note that a final complement of the return value is needed
* if no further contributions to the checksum are forthcoming.
*/
int offset;
{
/* >= 0x2 means flipped for memory align, 0x1 means last count was odd */
int odd_total = 0;
#ifdef TEST_COVERAGE
#else
#endif
for (;;) {
MARK_COVERAGE(0x1);
MARK_COVERAGE(0x2);
startp += 2;
}
MARK_COVERAGE(0x4);
odd_total = 1;
}
MARK_COVERAGE(0x8);
goto next_frag;
}
MARK_COVERAGE(0x10);
odd_total = 3;
startp++;
}
MARK_COVERAGE(0x20);
startp += 2;
}
MARK_COVERAGE(0x40);
odd_total ^= 0x1;
endp--;
}
MARK_COVERAGE(0x80);
endp -= 2;
}
{
#ifdef NOT_ALL_PTRS_EQUAL
#else
#endif
#ifdef USE_FETCH_AND_SHIFT
#endif
#ifdef USE_FETCH_AND_ADDC
#endif
#ifdef USE_ADDC
#endif
#ifdef USE_POSTINC
#endif
#ifndef LOAD1
#endif
#ifndef LOAD2
#endif
#ifndef SUM2
#endif
/* USE_INDEXING is the default */
#ifndef SUM1
#define SUM1(i)
#endif
LOAD1(0);
INC_ENDPTR(-8);
MARK_COVERAGE(0x100);
do {
INC_PTR(8);
}
#ifdef USE_TAIL_SWITCH
case 1: SUM1(0);
case 0: break;
}
#else
INC_ENDPTR(4);
MARK_COVERAGE(0x200);
INC_PTR(4);
}
INC_ENDPTR(4);
MARK_COVERAGE(0x400);
do {
INC_PTR(1);
}
#endif
}
if (odd_total > 1) {
MARK_COVERAGE(0x800);
odd_total -= 2;
}
if (!mp) {
MARK_COVERAGE(0x1000);
{
}
}
MARK_COVERAGE(0x4000);
MARK_COVERAGE(0x8000);
odd_total = 0;
startp++;
}
}
}