Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/archival/libarchive/unxz/README

    r2725 r3621  
    88    XZ Embedded was written for use in the Linux kernel, but the code can
    99    be easily used in other environments too, including regular userspace
    10     applications.
     10    applications. See userspace/xzminidec.c for an example program.
    1111
    1212    This README contains information that is useful only when the copy
     
    5656    care than just using 32-bit integer instead of 64-bit).
    5757
    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,
    5959    xz_dec_lzma2.c compiled with GCC 3.3.6 is 15-25 % slower than when
    6060    compiled with GCC 4.3.3.
     
    9494
    9595        #define             Instruction set     BCJ filter endianness
    96         XZ_DEC_X86          x86 or x86-64       Little endian only
     96        XZ_DEC_X86          x86-32 or x86-64    Little endian only
    9797        XZ_DEC_POWERPC      PowerPC             Big endian only
    9898        XZ_DEC_IA64         Itanium (IA-64)     Big or little endian
  • branches/3.3/mindi-busybox/archival/libarchive/unxz/xz.h

    r2725 r3621  
    1818#   include <stddef.h>
    1919#   include <stdint.h>
     20#endif
     21
     22#ifdef __cplusplus
     23extern "C" {
    2024#endif
    2125
     
    7175 *                          is still possible in multi-call mode by simply
    7276 *                          calling xz_dec_run() again.
    73  *                          NOTE: This return value is used only if
     77 *                          Note that this return value is used only if
    7478 *                          XZ_DEC_ANY_CHECK was defined at build time,
    7579 *                          which is not used in the kernel. Unsupported
     
    106110 *
    107111 * 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 the
     112 * is too small or the compressed input is corrupt in a way that makes the
    109113 * decoder produce more output than the caller expected. When it is
    110114 * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR
     
    208212 * See enum xz_ret for details.
    209213 *
    210  * NOTE: If an error occurs in single-call mode (return value is not
    211  * XZ_STREAM_END), b->in_pos and b->out_pos are not modified, and the
     214 * 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
    212216 * contents of the output buffer from b->out[b->out_pos] onward are
    213217 * undefined. This is true even after XZ_BUF_ERROR, because with some filter
     
    269273        const uint8_t *buf, size_t size, uint32_t crc);
    270274#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  
    7878#ifdef XZ_DEC_X86
    7979/*
    80  * This is macro used to test the most significant byte of a memory address
     80 * This is used to test the most significant byte of a memory address
    8181 * in an x86 instruction.
    8282 */
    83 #define bcj_x86_test_msbyte(b) ((b) == 0x00 || (b) == 0xFF)
     83static inline int bcj_x86_test_msbyte(uint8_t b)
     84{
     85    return b == 0x00 || b == 0xFF;
     86}
    8487
    8588static noinline_for_stack size_t XZ_FUNC bcj_x86(
     
    444447     * in the output buffer. If everything cannot be filtered, copy it
    445448     * 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.
    446453     */
    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) {
    448455        out_start = b->out_pos;
    449456        memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
     
    468475        b->out_pos -= s->temp.size;
    469476        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;
    470485    }
    471486
    472487    /*
    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.
    478494     */
    479     if (s->temp.size > 0) {
     495    if (b->out_pos < b->out_size) {
    480496        /* Make b->out{,_pos,_size} temporarily point to s->temp. */
    481497        s->out = b->out;
  • branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_dec_lzma2.c

    r2725 r3621  
    408408        b->out_pos += copy_size;
    409409        b->in_pos += copy_size;
    410 
    411410    }
    412411}
     
    973972            tmp = b->in[b->in_pos++];
    974973
     974            if (tmp == 0x00)
     975                return XZ_STREAM_END;
     976
    975977            if (tmp >= 0xE0 || tmp == 0x01) {
    976978                s->lzma2.need_props = true;
     
    994996                    s->lzma2.next_sequence
    995997                            = SEQ_PROPERTIES;
    996 
    997998                } else if (s->lzma2.need_props) {
    998999                    return XZ_DATA_ERROR;
    999 
    10001000                } else {
    10011001                    s->lzma2.next_sequence
     
    10051005                }
    10061006            } else {
    1007                 if (tmp == 0x00)
    1008                     return XZ_STREAM_END;
    1009 
    10101007                if (tmp > 0x02)
    10111008                    return XZ_DATA_ERROR;
     
    10821079                rc_reset(&s->rc);
    10831080                s->lzma2.sequence = SEQ_CONTROL;
    1084 
    10851081            } else if (b->out_pos == b->out_size
    10861082                    || (b->in_pos == b->in_size
  • branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_dec_stream.c

    r2725 r3621  
    354354
    355355        s->pos += 8;
    356 
    357356    } while (s->pos < 32);
    358357
     
    754753            b->out_pos = out_start;
    755754        }
    756 
    757755    } else if (ret == XZ_OK && in_start == b->in_pos
    758756            && out_start == b->out_pos) {
  • branches/3.3/mindi-busybox/archival/libarchive/unxz/xz_stream.h

    r2725 r3621  
    2626#define STREAM_HEADER_SIZE 12
    2727
    28 #define HEADER_MAGIC "\3757zXZ\0"
     28#define HEADER_MAGIC "\3757zXZ"
    2929#define HEADER_MAGIC_SIZE 6
    3030
     
    3333
    3434/*
    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.
    3742 */
    3843typedef uint64_t vli_type;
Note: See TracChangeset for help on using the changeset viewer.