Vendor Unique iSCSI CRC32C
256 T10000: Interface Reference Manual August 2016
Vendor Unique iSCSI CRC32C
Build Instructions
The following instructions must be put into a Makefile. Include all of the “C” code
identified in all sections below into a file called main.c and put the SPARC assembler
in a file called crc32.il. Then run “make”.
MACH:sh = uname -p
# SunOS
i386_CFLAGS =
sparc_CFLAGS = crc32.il
# Linux
x86_64_CFLAGS =
CFLAGS = $($(MACH)_CFLAGS)
main : main.c
cc $(CFLAGS) -o main main.c
Main Function and Defines
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(__sparc)
#define CRC32C_SIZE 8 /* 8 data bytes per cpu crc inst */
#else
#if defined(__amd64) || defined(__x86_64)
#define CRC32C_INST "0x48, " /* byte code for 64-bit code */
#define CRC32C_SIZE 8 /* 8 data bytes per cpu crc inst */
#else
#define CRC32C_INST /* no inst byte code for 32-
bit code */
#define CRC32C_SIZE 4 /* 4 data bytes per cpu crc inst */
#endif
#define CRC32C_ALIGN (CRC32C_SIZE - 1)
#define CRC32C_XOR 0xFFFFFFFF /* ending polynomial crc xor
value */
#define CRC32C_INIT 0xFFFFFFFF
#define CRC32C_LEN 4 /* crc length in bytes */
#if defined(__sun__) || defined(__SunOS)
/********************/
/* Solaris ONLY */