Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/archival/libarchive/unxz
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/archival/libarchive/unxz/README
r2725 r3621 8 8 XZ Embedded was written for use in the Linux kernel, but the code can 9 9 be easily used in other environments too, including regular userspace 10 applications. 10 applications. See userspace/xzminidec.c for an example program. 11 11 12 12 This README contains information that is useful only when the copy … … 56 56 care than just using 32-bit integer instead of 64-bit). 57 57 58 If you use GCC, try to use a recent version. For example, on x86 ,58 If you use GCC, try to use a recent version. For example, on x86-32, 59 59 xz_dec_lzma2.c compiled with GCC 3.3.6 is 15-25 % slower than when 60 60 compiled with GCC 4.3.3. … … 94 94 95 95 #define Instruction set BCJ filter endianness 96 XZ_DEC_X86 x86 or x86-64Little endian only96 XZ_DEC_X86 x86-32 or x86-64 Little endian only 97 97 XZ_DEC_POWERPC PowerPC Big endian only 98 98 XZ_DEC_IA64 Itanium (IA-64) Big or little endian -
branches/3.3/mindi-busybox/archival/libarchive/unxz/xz.h
r2725 r3621 18 18 # include <stddef.h> 19 19 # include <stdint.h> 20 #endif 21 22 #ifdef __cplusplus 23 extern "C" { 20 24 #endif 21 25 … … 71 75 * is still possible in multi-call mode by simply 72 76 * calling xz_dec_run() again. 73 * N OTE: This return value is used only if77 * Note that this return value is used only if 74 78 * XZ_DEC_ANY_CHECK was defined at build time, 75 79 * which is not used in the kernel. Unsupported … … 106 110 * 107 111 * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer 108 * is too small ,or the compressed input is corrupt in a way that makes the112 * is too small or the compressed input is corrupt in a way that makes the 109 113 * decoder produce more output than the caller expected. When it is 110 114 * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR … … 208 212 * See enum xz_ret for details. 209 213 * 210 * N OTE: If an error occurs in single-call mode (return value is not211 * XZ_STREAM_END), b->in_pos and b->out_pos are not modified ,and the214 * Note that if an error occurs in single-call mode (return value is not 215 * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the 212 216 * contents of the output buffer from b->out[b->out_pos] onward are 213 217 * undefined. This is true even after XZ_BUF_ERROR, because with some filter … … 269 273 const uint8_t *buf, size_t size, uint32_t crc); 270 274 #endif 271 #endif 275 276 #ifdef __cplusplus 277 } 278 #endif 279 280 #endif -
branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_dec_bcj.c
r2725 r3621 78 78 #ifdef XZ_DEC_X86 79 79 /* 80 * This is macroused to test the most significant byte of a memory address80 * This is used to test the most significant byte of a memory address 81 81 * in an x86 instruction. 82 82 */ 83 #define bcj_x86_test_msbyte(b) ((b) == 0x00 || (b) == 0xFF) 83 static inline int bcj_x86_test_msbyte(uint8_t b) 84 { 85 return b == 0x00 || b == 0xFF; 86 } 84 87 85 88 static noinline_for_stack size_t XZ_FUNC bcj_x86( … … 444 447 * in the output buffer. If everything cannot be filtered, copy it 445 448 * to temp and rewind the output buffer position accordingly. 449 * 450 * This needs to be always run when temp.size == 0 to handle a special 451 * case where the output buffer is full and the next filter has no 452 * more output coming but hasn't returned XZ_STREAM_END yet. 446 453 */ 447 if (s->temp.size < b->out_size - b->out_pos ) {454 if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) { 448 455 out_start = b->out_pos; 449 456 memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size); … … 468 475 b->out_pos -= s->temp.size; 469 476 memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size); 477 478 /* 479 * If there wasn't enough input to the next filter to fill 480 * the output buffer with unfiltered data, there's no point 481 * to try decoding more data to temp. 482 */ 483 if (b->out_pos + s->temp.size < b->out_size) 484 return XZ_OK; 470 485 } 471 486 472 487 /* 473 * If we have unfiltered data in temp, try to fill by decoding more 474 * data from the next filter. Apply the BCJ filter on temp. Then we 475 * hopefully can fill the actual output buffer by copying filtered 476 * data from temp. A mix of filtered and unfiltered data may be left 477 * in temp; it will be taken care on the next call to this function. 488 * We have unfiltered data in temp. If the output buffer isn't full 489 * yet, try to fill the temp buffer by decoding more data from the 490 * next filter. Apply the BCJ filter on temp. Then we hopefully can 491 * fill the actual output buffer by copying filtered data from temp. 492 * A mix of filtered and unfiltered data may be left in temp; it will 493 * be taken care on the next call to this function. 478 494 */ 479 if ( s->temp.size > 0) {495 if (b->out_pos < b->out_size) { 480 496 /* Make b->out{,_pos,_size} temporarily point to s->temp. */ 481 497 s->out = b->out; -
branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_dec_lzma2.c
r2725 r3621 408 408 b->out_pos += copy_size; 409 409 b->in_pos += copy_size; 410 411 410 } 412 411 } … … 973 972 tmp = b->in[b->in_pos++]; 974 973 974 if (tmp == 0x00) 975 return XZ_STREAM_END; 976 975 977 if (tmp >= 0xE0 || tmp == 0x01) { 976 978 s->lzma2.need_props = true; … … 994 996 s->lzma2.next_sequence 995 997 = SEQ_PROPERTIES; 996 997 998 } else if (s->lzma2.need_props) { 998 999 return XZ_DATA_ERROR; 999 1000 1000 } else { 1001 1001 s->lzma2.next_sequence … … 1005 1005 } 1006 1006 } else { 1007 if (tmp == 0x00)1008 return XZ_STREAM_END;1009 1010 1007 if (tmp > 0x02) 1011 1008 return XZ_DATA_ERROR; … … 1082 1079 rc_reset(&s->rc); 1083 1080 s->lzma2.sequence = SEQ_CONTROL; 1084 1085 1081 } else if (b->out_pos == b->out_size 1086 1082 || (b->in_pos == b->in_size -
branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_dec_stream.c
r2725 r3621 354 354 355 355 s->pos += 8; 356 357 356 } while (s->pos < 32); 358 357 … … 754 753 b->out_pos = out_start; 755 754 } 756 757 755 } else if (ret == XZ_OK && in_start == b->in_pos 758 756 && out_start == b->out_pos) { -
branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_stream.h
r2725 r3621 26 26 #define STREAM_HEADER_SIZE 12 27 27 28 #define HEADER_MAGIC "\3757zXZ \0"28 #define HEADER_MAGIC "\3757zXZ" 29 29 #define HEADER_MAGIC_SIZE 6 30 30 … … 33 33 34 34 /* 35 * Variable-length integer can hold a 63-bit unsigned integer, or a special 36 * value to indicate that the value is unknown. 35 * Variable-length integer can hold a 63-bit unsigned integer or a special 36 * value indicating that the value is unknown. 37 * 38 * Experimental: vli_type can be defined to uint32_t to save a few bytes 39 * in code size (no effect on speed). Doing so limits the uncompressed and 40 * compressed size of the file to less than 256 MiB and may also weaken 41 * error detection slightly. 37 42 */ 38 43 typedef uint64_t vli_type;
Note:
See TracChangeset
for help on using the changeset viewer.