2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 2010 Free Software Foundation, Inc. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A * This file is based on code from XZ embedded project 2N/A * For userspace builds, use a separate header to define the required 2N/A * macros and functions. This makes it easier to adapt the code into 2N/A * different environments and avoids clutter in the Linux kernel tree. 2N/A * If any of the BCJ filter decoders are wanted, define XZ_DEC_BCJ. 2N/A * XZ_DEC_BCJ is used to enable generic support for BCJ decoders. 2N/A * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used 2N/A * before calling xz_dec_lzma2_run(). 2N/A * Decode the LZMA2 properties (one byte) and reset the decoder. Return 2N/A * XZ_OK on success, XZ_MEMLIMIT_ERROR if the preallocated dictionary is not 2N/A * big enough, and XZ_OPTIONS_ERROR if props indicates something that this 2N/A * decoder doesn't support. 2N/A/* Decode raw LZMA2 stream from b->in to b->out. */ 2N/A/* Free the memory allocated for the LZMA2 decoder. */ 2N/A * Allocate memory for BCJ decoders. xz_dec_bcj_reset() must be used before 2N/A * calling xz_dec_bcj_run(). 2N/A * Decode the Filter ID of a BCJ filter. This implementation doesn't 2N/A * support custom start offsets, so no decoding of Filter Properties 2N/A * is needed. Returns XZ_OK if the given Filter ID is supported. 2N/A * Otherwise XZ_OPTIONS_ERROR is returned. 2N/A * Decode raw BCJ + LZMA2 stream. This must be used only if there actually is 2N/A * a BCJ filter in the chain. If the chain has only LZMA2, xz_dec_lzma2_run() 2N/A * must be called directly. 2N/A/* Free the memory allocated for the BCJ filters. */