1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2018 Cavium, Inc 3 */ 4 5 #ifndef _RTE_OCTEONTX_ZIP_REGS_H_ 6 #define _RTE_OCTEONTX_ZIP_REGS_H_ 7 8 9 /** 10 * Enumeration zip_cc 11 * 12 * ZIP compression coding Enumeration 13 * Enumerates ZIP_INST_S[CC]. 14 */ 15 enum zip_cc { 16 ZIP_CC_DEFAULT = 0, 17 ZIP_CC_DYN_HUFF, 18 ZIP_CC_FIXED_HUFF, 19 ZIP_CC_LZS 20 }; 21 22 /** 23 * Register (NCB) zip_vq#_ena 24 * 25 * ZIP VF Queue Enable Register 26 * If a queue is disabled, ZIP CTL stops fetching instructions from the queue. 27 */ 28 typedef union { 29 uint64_t u; 30 struct zip_vqx_ena_s { 31 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 32 uint64_t reserved_1_63 : 63; 33 uint64_t ena : 1; 34 #else /* Word 0 - Little Endian */ 35 uint64_t ena : 1; 36 uint64_t reserved_1_63 : 63; 37 #endif /* Word 0 - End */ 38 } s; 39 } zip_vqx_ena_t; 40 41 /** 42 * Register (NCB) zip_vq#_sbuf_addr 43 * 44 * ZIP VF Queue Starting Buffer Address Registers 45 * These registers set the buffer parameters for the instruction queues. 46 * When quiescent (i.e. 47 * outstanding doorbell count is 0), it is safe to rewrite this register 48 * to effectively reset the 49 * command buffer state machine. 50 * These registers must be programmed after software programs the 51 * corresponding ZIP_QUE()_SBUF_CTL. 52 */ 53 typedef union { 54 uint64_t u; 55 struct zip_vqx_sbuf_addr_s { 56 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 57 uint64_t reserved_49_63 : 15; 58 uint64_t ptr : 42; 59 uint64_t off : 7; 60 #else /* Word 0 - Little Endian */ 61 uint64_t off : 7; 62 uint64_t ptr : 42; 63 uint64_t reserved_49_63 : 15; 64 #endif /* Word 0 - End */ 65 } s; 66 } zip_vqx_sbuf_addr_t; 67 68 /** 69 * Register (NCB) zip_que#_doorbell 70 * 71 * ZIP Queue Doorbell Registers 72 * Doorbells for the ZIP instruction queues. 73 */ 74 typedef union { 75 uint64_t u; 76 struct zip_quex_doorbell_s { 77 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 78 uint64_t reserved_20_63 : 44; 79 uint64_t dbell_cnt : 20; 80 #else /* Word 0 - Little Endian */ 81 uint64_t dbell_cnt : 20; 82 uint64_t reserved_20_63 : 44; 83 #endif /* Word 0 - End */ 84 } s; 85 } zip_quex_doorbell_t; 86 87 /** 88 * Structure zip_nptr_s 89 * 90 * ZIP Instruction Next-Chunk-Buffer Pointer (NPTR) Structure 91 * This structure is used to chain all the ZIP instruction buffers 92 * together. ZIP instruction buffers are managed 93 * (allocated and released) by software. 94 */ 95 union zip_nptr_s { 96 uint64_t u; 97 struct zip_nptr_s_s { 98 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 99 uint64_t addr : 64; 100 #else /* Word 0 - Little Endian */ 101 uint64_t addr : 64; 102 #endif /* Word 0 - End */ 103 } s; 104 }; 105 106 /** 107 * generic ptr address 108 */ 109 union zip_zptr_addr_s { 110 /** This field can be used to set/clear all bits, or do bitwise 111 * operations over the entire structure. 112 */ 113 uint64_t u; 114 /** generic ptr address */ 115 struct { 116 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 117 uint64_t addr : 64; 118 #else /* Word 0 - Little Endian */ 119 uint64_t addr : 64; 120 #endif /* Word 0 - End */ 121 } s; 122 }; 123 124 /** 125 * generic ptr ctl 126 */ 127 union zip_zptr_ctl_s { 128 /** This field can be used to set/clear all bits, or do bitwise 129 * operations over the entire structure. 130 */ 131 uint64_t u; 132 /** generic ptr ctl */ 133 struct { 134 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */ 135 uint64_t reserved_112_127 : 16; 136 uint64_t length : 16; 137 uint64_t reserved_67_95 : 29; 138 uint64_t fw : 1; 139 uint64_t nc : 1; 140 uint64_t data_be : 1; 141 #else /* Word 1 - Little Endian */ 142 uint64_t data_be : 1; 143 uint64_t nc : 1; 144 uint64_t fw : 1; 145 uint64_t reserved_67_95 : 29; 146 uint64_t length : 16; 147 uint64_t reserved_112_127 : 16; 148 #endif /* Word 1 - End */ 149 } s; 150 151 }; 152 153 /** 154 * Structure zip_inst_s 155 * 156 * ZIP Instruction Structure 157 * Each ZIP instruction has 16 words (they are called IWORD0 to IWORD15 158 * within the structure). 159 */ 160 union zip_inst_s { 161 /** This field can be used to set/clear all bits, or do bitwise 162 * operations over the entire structure. 163 */ 164 uint64_t u[16]; 165 /** ZIP Instruction Structure */ 166 struct zip_inst_s_s { 167 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 168 /** Done interrupt */ 169 uint64_t doneint : 1; 170 /** reserved */ 171 uint64_t reserved_56_62 : 7; 172 /** Total output length */ 173 uint64_t totaloutputlength : 24; 174 /** reserved */ 175 uint64_t reserved_27_31 : 5; 176 /** EXNUM */ 177 uint64_t exn : 3; 178 /** HASH IV */ 179 uint64_t iv : 1; 180 /** EXBITS */ 181 uint64_t exbits : 7; 182 /** Hash more-in-file */ 183 uint64_t hmif : 1; 184 /** Hash Algorithm and enable */ 185 uint64_t halg : 3; 186 /** Sync flush*/ 187 uint64_t sf : 1; 188 /** Compression speed/storage */ 189 uint64_t ss : 2; 190 /** Compression coding */ 191 uint64_t cc : 2; 192 /** End of input data */ 193 uint64_t ef : 1; 194 /** Beginning of file */ 195 uint64_t bf : 1; 196 /** Comp/decomp operation */ 197 uint64_t op : 2; 198 /** Data scatter */ 199 uint64_t ds : 1; 200 /** Data gather */ 201 uint64_t dg : 1; 202 /** History gather */ 203 uint64_t hg : 1; 204 #else /* Word 0 - Little Endian */ 205 uint64_t hg : 1; 206 uint64_t dg : 1; 207 uint64_t ds : 1; 208 uint64_t op : 2; 209 uint64_t bf : 1; 210 uint64_t ef : 1; 211 uint64_t cc : 2; 212 uint64_t ss : 2; 213 uint64_t sf : 1; 214 uint64_t halg : 3; 215 uint64_t hmif : 1; 216 uint64_t exbits : 7; 217 uint64_t iv : 1; 218 uint64_t exn : 3; 219 uint64_t reserved_27_31 : 5; 220 uint64_t totaloutputlength : 24; 221 uint64_t reserved_56_62 : 7; 222 uint64_t doneint : 1; 223 224 #endif /* Word 0 - End */ 225 226 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */ 227 /** History length */ 228 uint64_t historylength : 16; 229 /** reserved */ 230 uint64_t reserved_96_111 : 16; 231 /** adler/crc32 checksum*/ 232 uint64_t adlercrc32 : 32; 233 #else /* Word 1 - Little Endian */ 234 uint64_t adlercrc32 : 32; 235 uint64_t reserved_96_111 : 16; 236 uint64_t historylength : 16; 237 #endif /* Word 1 - End */ 238 239 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */ 240 /** Decompression Context Pointer Address */ 241 union zip_zptr_addr_s ctx_ptr_addr; 242 #else /* Word 2 - Little Endian */ 243 union zip_zptr_addr_s ctx_ptr_addr; 244 #endif /* Word 2 - End */ 245 246 #if defined(__BIG_ENDIAN_BITFIELD) 247 /** Decompression Context Pointer Control */ 248 union zip_zptr_ctl_s ctx_ptr_ctl; 249 #else /* Word 3 - Little Endian */ 250 union zip_zptr_ctl_s ctx_ptr_ctl; 251 #endif /* Word 3 - End */ 252 253 #if defined(__BIG_ENDIAN_BITFIELD) 254 /** Decompression history pointer address */ 255 union zip_zptr_addr_s his_ptr_addr; 256 #else /* Word 4 - Little Endian */ 257 union zip_zptr_addr_s his_ptr_addr; 258 #endif /* Word 4 - End */ 259 260 #if defined(__BIG_ENDIAN_BITFIELD) 261 /** Decompression history pointer control */ 262 union zip_zptr_ctl_s his_ptr_ctl; 263 #else /* Word 5 - Little Endian */ 264 union zip_zptr_ctl_s his_ptr_ctl; 265 #endif /* Word 5 - End */ 266 267 #if defined(__BIG_ENDIAN_BITFIELD) 268 /** Input and compression history pointer address */ 269 union zip_zptr_addr_s inp_ptr_addr; 270 #else /* Word 6 - Little Endian */ 271 union zip_zptr_addr_s inp_ptr_addr; 272 #endif /* Word 6 - End */ 273 274 #if defined(__BIG_ENDIAN_BITFIELD) 275 /** Input and compression history pointer control */ 276 union zip_zptr_ctl_s inp_ptr_ctl; 277 #else /* Word 7 - Little Endian */ 278 union zip_zptr_ctl_s inp_ptr_ctl; 279 #endif /* Word 7 - End */ 280 281 #if defined(__BIG_ENDIAN_BITFIELD) 282 /** Output pointer address */ 283 union zip_zptr_addr_s out_ptr_addr; 284 #else /* Word 8 - Little Endian */ 285 union zip_zptr_addr_s out_ptr_addr; 286 #endif /* Word 8 - End */ 287 288 #if defined(__BIG_ENDIAN_BITFIELD) 289 /** Output pointer control */ 290 union zip_zptr_ctl_s out_ptr_ctl; 291 #else /* Word 9 - Little Endian */ 292 union zip_zptr_ctl_s out_ptr_ctl; 293 #endif /* Word 9 - End */ 294 295 #if defined(__BIG_ENDIAN_BITFIELD) 296 /** Result pointer address */ 297 union zip_zptr_addr_s res_ptr_addr; 298 #else /* Word 10 - Little Endian */ 299 union zip_zptr_addr_s res_ptr_addr; 300 #endif /* Word 10 - End */ 301 302 #if defined(__BIG_ENDIAN_BITFIELD) 303 /** Result pointer control */ 304 union zip_zptr_ctl_s res_ptr_ctl; 305 #else /* Word 11 - Little Endian */ 306 union zip_zptr_ctl_s res_ptr_ctl; 307 #endif /* Word 11 - End */ 308 309 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 12 - Big Endian */ 310 /** reserved */ 311 uint64_t reserved_812_831 : 20; 312 /** SSO guest group */ 313 uint64_t ggrp : 10; 314 /** SSO tag type */ 315 uint64_t tt : 2; 316 /** SSO tag */ 317 uint64_t tag : 32; 318 #else /* Word 12 - Little Endian */ 319 uint64_t tag : 32; 320 uint64_t tt : 2; 321 uint64_t ggrp : 10; 322 uint64_t reserved_812_831 : 20; 323 #endif /* Word 12 - End */ 324 325 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 13 - Big Endian */ 326 /** Work queue entry pointer */ 327 uint64_t wq_ptr : 64; 328 #else /* Word 13 - Little Endian */ 329 uint64_t wq_ptr : 64; 330 #endif /* Word 13 - End */ 331 332 #if defined(__BIG_ENDIAN_BITFIELD) 333 /** reserved */ 334 uint64_t reserved_896_959 : 64; 335 #else /* Word 14 - Little Endian */ 336 uint64_t reserved_896_959 : 64; 337 #endif /* Word 14 - End */ 338 #if defined(__BIG_ENDIAN_BITFIELD) 339 /** Hash structure pointer */ 340 uint64_t hash_ptr : 64; 341 #else /* Word 15 - Little Endian */ 342 uint64_t hash_ptr : 64; 343 #endif /* Word 15 - End */ 344 } /** ZIP 88xx Instruction Structure */zip88xx; 345 346 /** ZIP Instruction Structure */ 347 struct zip_inst_s_cn83xx { 348 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 349 /** Done interrupt */ 350 uint64_t doneint : 1; 351 /** reserved */ 352 uint64_t reserved_56_62 : 7; 353 /** Total output length */ 354 uint64_t totaloutputlength : 24; 355 /** reserved */ 356 uint64_t reserved_27_31 : 5; 357 /** EXNUM */ 358 uint64_t exn : 3; 359 /** HASH IV */ 360 uint64_t iv : 1; 361 /** EXBITS */ 362 uint64_t exbits : 7; 363 /** Hash more-in-file */ 364 uint64_t hmif : 1; 365 /** Hash Algorithm and enable */ 366 uint64_t halg : 3; 367 /** Sync flush*/ 368 uint64_t sf : 1; 369 /** Compression speed/storage */ 370 uint64_t ss : 2; 371 /** Compression coding */ 372 uint64_t cc : 2; 373 /** End of input data */ 374 uint64_t ef : 1; 375 /** Beginning of file */ 376 uint64_t bf : 1; 377 /** Comp/decomp operation */ 378 uint64_t op : 2; 379 /** Data scatter */ 380 uint64_t ds : 1; 381 /** Data gather */ 382 uint64_t dg : 1; 383 /** History gather */ 384 uint64_t hg : 1; 385 #else /* Word 0 - Little Endian */ 386 uint64_t hg : 1; 387 uint64_t dg : 1; 388 uint64_t ds : 1; 389 uint64_t op : 2; 390 uint64_t bf : 1; 391 uint64_t ef : 1; 392 uint64_t cc : 2; 393 uint64_t ss : 2; 394 uint64_t sf : 1; 395 uint64_t halg : 3; 396 uint64_t hmif : 1; 397 uint64_t exbits : 7; 398 uint64_t iv : 1; 399 uint64_t exn : 3; 400 uint64_t reserved_27_31 : 5; 401 uint64_t totaloutputlength : 24; 402 uint64_t reserved_56_62 : 7; 403 uint64_t doneint : 1; 404 #endif /* Word 0 - End */ 405 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */ 406 /** History length */ 407 uint64_t historylength : 16; 408 /** reserved */ 409 uint64_t reserved_96_111 : 16; 410 /** adler/crc32 checksum*/ 411 uint64_t adlercrc32 : 32; 412 #else /* Word 1 - Little Endian */ 413 uint64_t adlercrc32 : 32; 414 uint64_t reserved_96_111 : 16; 415 uint64_t historylength : 16; 416 #endif /* Word 1 - End */ 417 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */ 418 /** Decompression Context Pointer Address */ 419 union zip_zptr_addr_s ctx_ptr_addr; 420 #else /* Word 2 - Little Endian */ 421 union zip_zptr_addr_s ctx_ptr_addr; 422 #endif /* Word 2 - End */ 423 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 3 - Big Endian */ 424 /** Decompression Context Pointer Control */ 425 union zip_zptr_ctl_s ctx_ptr_ctl; 426 #else /* Word 3 - Little Endian */ 427 union zip_zptr_ctl_s ctx_ptr_ctl; 428 #endif /* Word 3 - End */ 429 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 4 - Big Endian */ 430 /** Decompression history pointer address */ 431 union zip_zptr_addr_s his_ptr_addr; 432 #else /* Word 4 - Little Endian */ 433 union zip_zptr_addr_s his_ptr_addr; 434 #endif /* Word 4 - End */ 435 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 5 - Big Endian */ 436 /** Decompression history pointer control */ 437 union zip_zptr_ctl_s his_ptr_ctl; 438 #else /* Word 5 - Little Endian */ 439 union zip_zptr_ctl_s his_ptr_ctl; 440 #endif /* Word 5 - End */ 441 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 6 - Big Endian */ 442 /** Input and compression history pointer address */ 443 union zip_zptr_addr_s inp_ptr_addr; 444 #else /* Word 6 - Little Endian */ 445 union zip_zptr_addr_s inp_ptr_addr; 446 #endif /* Word 6 - End */ 447 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 7 - Big Endian */ 448 /** Input and compression history pointer control */ 449 union zip_zptr_ctl_s inp_ptr_ctl; 450 #else /* Word 7 - Little Endian */ 451 union zip_zptr_ctl_s inp_ptr_ctl; 452 #endif /* Word 7 - End */ 453 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 8 - Big Endian */ 454 /** Output pointer address */ 455 union zip_zptr_addr_s out_ptr_addr; 456 #else /* Word 8 - Little Endian */ 457 union zip_zptr_addr_s out_ptr_addr; 458 #endif /* Word 8 - End */ 459 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 9 - Big Endian */ 460 /** Output pointer control */ 461 union zip_zptr_ctl_s out_ptr_ctl; 462 #else /* Word 9 - Little Endian */ 463 union zip_zptr_ctl_s out_ptr_ctl; 464 #endif /* Word 9 - End */ 465 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 10 - Big Endian */ 466 /** Result pointer address */ 467 union zip_zptr_addr_s res_ptr_addr; 468 #else /* Word 10 - Little Endian */ 469 union zip_zptr_addr_s res_ptr_addr; 470 #endif /* Word 10 - End */ 471 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 11 - Big Endian */ 472 /** Result pointer control */ 473 union zip_zptr_ctl_s res_ptr_ctl; 474 #else /* Word 11 - Little Endian */ 475 union zip_zptr_ctl_s res_ptr_ctl; 476 #endif /* Word 11 - End */ 477 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 12 - Big Endian */ 478 /** reserved */ 479 uint64_t reserved_812_831 : 20; 480 /** SSO guest group */ 481 uint64_t ggrp : 10; 482 /** SSO tag type */ 483 uint64_t tt : 2; 484 /** SSO tag */ 485 uint64_t tag : 32; 486 #else /* Word 12 - Little Endian */ 487 uint64_t tag : 32; 488 uint64_t tt : 2; 489 uint64_t ggrp : 10; 490 uint64_t reserved_812_831 : 20; 491 #endif /* Word 12 - End */ 492 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 13 - Big Endian */ 493 /** Work queue entry pointer */ 494 uint64_t wq_ptr : 64; 495 #else /* Word 13 - Little Endian */ 496 uint64_t wq_ptr : 64; 497 #endif /* Word 13 - End */ 498 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 14 - Big Endian */ 499 /** reserved */ 500 uint64_t reserved_896_959 : 64; 501 #else /* Word 14 - Little Endian */ 502 uint64_t reserved_896_959 : 64; 503 #endif /* Word 14 - End */ 504 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 15 - Big Endian */ 505 /** Hash structure pointer */ 506 uint64_t hash_ptr : 64; 507 #else /* Word 15 - Little Endian */ 508 uint64_t hash_ptr : 64; 509 #endif /* Word 15 - End */ 510 } /** ZIP 83xx Instruction Structure */s; 511 }; 512 513 /** 514 * Structure zip_zres_s 515 * 516 * ZIP Result Structure 517 * The ZIP coprocessor writes the result structure after it completes the 518 * invocation. The result structure is exactly 24 bytes, and each invocation 519 * of the ZIP coprocessor produces exactly one result structure. 520 */ 521 union zip_zres_s { 522 /** This field can be used to set/clear all bits, or do bitwise 523 * operations over the entire structure. 524 */ 525 uint64_t u[8]; 526 /** ZIP Result Structure */ 527 struct zip_zres_s_s { 528 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 529 /** crc32 checksum of uncompressed stream */ 530 uint64_t crc32 : 32; 531 /** adler32 checksum of uncompressed stream*/ 532 uint64_t adler32 : 32; 533 #else /* Word 0 - Little Endian */ 534 uint64_t adler32 : 32; 535 uint64_t crc32 : 32; 536 #endif /* Word 0 - End */ 537 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */ 538 /** Total numer of Bytes produced in output stream */ 539 uint64_t totalbyteswritten : 32; 540 /** Total number of bytes processed from the input stream */ 541 uint64_t totalbytesread : 32; 542 #else /* Word 1 - Little Endian */ 543 uint64_t totalbytesread : 32; 544 uint64_t totalbyteswritten : 32; 545 #endif /* Word 1 - End */ 546 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */ 547 /** Total number of compressed input bits 548 * consumed to decompress all blocks in the file 549 */ 550 uint64_t totalbitsprocessed : 32; 551 /** Done interrupt*/ 552 uint64_t doneint : 1; 553 /** reserved */ 554 uint64_t reserved_155_158 : 4; 555 /** EXNUM */ 556 uint64_t exn : 3; 557 /** reserved */ 558 uint64_t reserved_151 : 1; 559 /** EXBITS */ 560 uint64_t exbits : 7; 561 /** reserved */ 562 uint64_t reserved_137_143 : 7; 563 /** End of file */ 564 uint64_t ef : 1; 565 /** Completion/error code */ 566 uint64_t compcode : 8; 567 #else /* Word 2 - Little Endian */ 568 uint64_t compcode : 8; 569 uint64_t ef : 1; 570 uint64_t reserved_137_143 : 7; 571 uint64_t exbits : 7; 572 uint64_t reserved_151 : 1; 573 uint64_t exn : 3; 574 uint64_t reserved_155_158 : 4; 575 uint64_t doneint : 1; 576 uint64_t totalbitsprocessed : 32; 577 #endif /* Word 2 - End */ 578 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 3 - Big Endian */ 579 /** reserved */ 580 uint64_t reserved_253_255 : 3; 581 /** Hash length in bytes */ 582 uint64_t hshlen : 61; 583 #else /* Word 3 - Little Endian */ 584 uint64_t hshlen : 61; 585 uint64_t reserved_253_255 : 3; 586 #endif /* Word 3 - End */ 587 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 4 - Big Endian */ 588 /** Double-word 0 of computed hash */ 589 uint64_t hash0 : 64; 590 #else /* Word 4 - Little Endian */ 591 uint64_t hash0 : 64; 592 #endif /* Word 4 - End */ 593 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 5 - Big Endian */ 594 /** Double-word 1 of computed hash */ 595 uint64_t hash1 : 64; 596 #else /* Word 5 - Little Endian */ 597 uint64_t hash1 : 64; 598 #endif /* Word 5 - End */ 599 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 6 - Big Endian */ 600 /** Double-word 2 of computed hash */ 601 uint64_t hash2 : 64; 602 #else /* Word 6 - Little Endian */ 603 uint64_t hash2 : 64; 604 #endif /* Word 6 - End */ 605 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 7 - Big Endian */ 606 /** Double-word 3 of computed hash */ 607 uint64_t hash3 : 64; 608 #else /* Word 7 - Little Endian */ 609 uint64_t hash3 : 64; 610 #endif /* Word 7 - End */ 611 } /** ZIP Result Structure */s; 612 }; 613 614 /** 615 * Structure zip_zptr_s 616 * 617 * ZIP Generic Pointer Structure 618 * This structure is the generic format of pointers in ZIP_INST_S. 619 */ 620 union zip_zptr_s { 621 /** This field can be used to set/clear all bits, or do bitwise 622 * operations over the entire structure. 623 */ 624 uint64_t u[2]; 625 /** ZIP Generic Pointer Structure */ 626 struct zip_zptr_s_s { 627 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */ 628 /** Pointer to Data or scatter-gather list */ 629 uint64_t addr : 64; 630 #else /* Word 0 - Little Endian */ 631 uint64_t addr : 64; 632 #endif /* Word 0 - End */ 633 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */ 634 /** reserved */ 635 uint64_t reserved_112_127 : 16; 636 /** Length of Data or scatter-gather list*/ 637 uint64_t length : 16; 638 /** reserved */ 639 uint64_t reserved_67_95 : 29; 640 /** Full-block write */ 641 uint64_t fw : 1; 642 /** No cache allocation */ 643 uint64_t nc : 1; 644 /** reserved */ 645 uint64_t data_be : 1; 646 #else /* Word 1 - Little Endian */ 647 uint64_t data_be : 1; 648 uint64_t nc : 1; 649 uint64_t fw : 1; 650 uint64_t reserved_67_95 : 29; 651 uint64_t length : 16; 652 uint64_t reserved_112_127 : 16; 653 #endif /* Word 1 - End */ 654 } /** ZIP Generic Pointer Structure */s; 655 }; 656 657 /** 658 * Enumeration zip_comp_e 659 * 660 * ZIP Completion Enumeration 661 * Enumerates the values of ZIP_ZRES_S[COMPCODE]. 662 */ 663 #define ZIP_COMP_E_NOTDONE (0) 664 #define ZIP_COMP_E_SUCCESS (1) 665 #define ZIP_COMP_E_DTRUNC (2) 666 #define ZIP_COMP_E_DSTOP (3) 667 #define ZIP_COMP_E_ITRUNC (4) 668 #define ZIP_COMP_E_RBLOCK (5) 669 #define ZIP_COMP_E_NLEN (6) 670 #define ZIP_COMP_E_BADCODE (7) 671 #define ZIP_COMP_E_BADCODE2 (8) 672 #define ZIP_COMP_E_ZERO_LEN (9) 673 #define ZIP_COMP_E_PARITY (0xa) 674 #define ZIP_COMP_E_FATAL (0xb) 675 #define ZIP_COMP_E_TIMEOUT (0xc) 676 #define ZIP_COMP_E_INSTR_ERR (0xd) 677 #define ZIP_COMP_E_HCTX_ERR (0xe) 678 #define ZIP_COMP_E_STOP (3) 679 680 /** 681 * Enumeration zip_op_e 682 * 683 * ZIP Operation Enumeration 684 * Enumerates ZIP_INST_S[OP]. 685 * Internal: 686 */ 687 #define ZIP_OP_E_DECOMP (0) 688 #define ZIP_OP_E_NOCOMP (1) 689 #define ZIP_OP_E_COMP (2) 690 691 /** 692 * Enumeration zip compression levels 693 * 694 * ZIP Compression Level Enumeration 695 * Enumerates ZIP_INST_S[SS]. 696 * Internal: 697 */ 698 #define ZIP_COMP_E_LEVEL_MAX (0) 699 #define ZIP_COMP_E_LEVEL_MED (1) 700 #define ZIP_COMP_E_LEVEL_LOW (2) 701 #define ZIP_COMP_E_LEVEL_MIN (3) 702 703 #endif /* _RTE_ZIP_REGS_H_ */ 704