Skip to content

Commit

Permalink
IntelFrameworkModulePkg LzmaDecompressLib: Update LZMA to new 16.04 v…
Browse files Browse the repository at this point in the history
…ersion

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <[email protected]>
Reviewed-by: Yonghong Zhu <[email protected]>
  • Loading branch information
lgao4 committed Nov 3, 2016
1 parent 1e23022 commit 00f5e11
Show file tree
Hide file tree
Showing 19 changed files with 1,499 additions and 998 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LzmaCustomDecompressLib is based on the LZMA SDK 4.65.
LZMA SDK 4.65 was placed in the public domain on
2009-02-03. It was released on the
LzmaCustomDecompressLib is based on the LZMA SDK 16.04.
LZMA SDK 16.04 was placed in the public domain on
2016-10-04. It was released on the
http://www.7-zip.org/sdk.html website.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## @file
# LzmaArchCustomDecompressLib produces LZMA custom decompression algorithm with the converter for the different arch code.
#
# It is based on the LZMA SDK 4.65.
# LZMA SDK 4.65 was placed in the public domain on 2009-02-03.
# It is based on the LZMA SDK 16.04
# LZMA SDK 16.04 was placed in the public domain on 2016-10-04.
# It was released on the http://www.7-zip.org/sdk.html website.
#
# Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -43,7 +43,9 @@
Sdk/C/LzFind.h
Sdk/C/LzHash.h
Sdk/C/LzmaDec.h
Sdk/C/Types.h
Sdk/C/7zTypes.h
Sdk/C/Precomp.h
Sdk/C/Compiler.h
UefiLzma.h
LzmaDecompressLibInternal.h

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## @file
# LzmaCustomDecompressLib produces LZMA custom decompression algorithm.
#
# It is based on the LZMA SDK 4.65.
# LZMA SDK 4.65 was placed in the public domain on 2009-02-03.
# It is based on the LZMA SDK 16.04.
# LZMA SDK 16.04 was placed in the public domain on 2016-10-04.
# It was released on the http://www.7-zip.org/sdk.html website.
#
# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -42,7 +42,9 @@
Sdk/C/LzFind.h
Sdk/C/LzHash.h
Sdk/C/LzmaDec.h
Sdk/C/Types.h
Sdk/C/7zTypes.h
Sdk/C/Precomp.h
Sdk/C/Compiler.h
GuidedSectionExtraction.c
UefiLzma.h
LzmaDecompressLibInternal.h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file
LZMA Decompress interfaces
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Expand All @@ -13,7 +13,7 @@
**/

#include "LzmaDecompressLibInternal.h"
#include "Sdk/C/Types.h"
#include "Sdk/C/7zTypes.h"
#include "Sdk/C/7zVersion.h"
#include "Sdk/C/LzmaDec.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
/** @file
Types.h
Based on LZMA SDK 4.65:
Types.h -- Basic types
2008-11-23 : Igor Pavlov : Public domain
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
/* 7zTypes.h -- Basic types
2013-11-12 : Igor Pavlov : Public domain */

#ifndef __7Z_TYPES_H
#define __7Z_TYPES_H

#ifdef EFIAPI
#ifdef _WIN32
/* #include <windows.h> */
#endif

#ifdef EFIAPI
#include "UefiLzma.h"

#else

#include <stddef.h>

#ifdef _WIN32
#include <windows.h>
#endif

#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
#endif

EXTERN_C_BEGIN

#define SZ_OK 0

Expand All @@ -54,7 +47,8 @@
typedef int SRes;

#ifdef _WIN32
typedef DWORD WRes;
/* typedef DWORD WRes; */
typedef unsigned WRes;
#else
typedef int WRes;
#endif
Expand Down Expand Up @@ -88,9 +82,11 @@ typedef unsigned long UInt64;
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#define UINT64_CONST(n) n
#else
typedef long long int Int64;
typedef unsigned long long int UInt64;
#define UINT64_CONST(n) n ## ULL
#endif

#endif
Expand All @@ -106,6 +102,12 @@ typedef int Bool;
#define False 0


#ifdef _WIN32
#define MY_STD_CALL __stdcall
#else
#define MY_STD_CALL
#endif

#ifdef _MSC_VER

#if _MSC_VER >= 1300
Expand All @@ -115,20 +117,29 @@ typedef int Bool;
#endif

#define MY_CDECL __cdecl
#define MY_STD_CALL __stdcall
#define MY_FAST_CALL MY_NO_INLINE __fastcall
#define MY_FAST_CALL __fastcall

#else

#define MY_NO_INLINE
#define MY_CDECL
#define MY_STD_CALL
#define MY_FAST_CALL

#endif


/* The following interfaces use first parameter as pointer to structure */

typedef struct
{
Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */
} IByteIn;

typedef struct
{
void (*Write)(void *p, Byte b);
} IByteOut;

typedef struct
{
SRes (*Read)(void *p, void *buf, size_t *size);
Expand Down Expand Up @@ -163,7 +174,7 @@ typedef struct

typedef struct
{
SRes (*Look)(void *p, void **buf, size_t *size);
SRes (*Look)(void *p, const void **buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) > input(*size)) is not allowed
(output(*size) < input(*size)) is allowed */
Expand Down Expand Up @@ -228,4 +239,22 @@ typedef struct
#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
#define IAlloc_Free(p, a) (p)->Free((p), a)

#ifdef _WIN32

#define CHAR_PATH_SEPARATOR '\\'
#define WCHAR_PATH_SEPARATOR L'\\'
#define STRING_PATH_SEPARATOR "\\"
#define WSTRING_PATH_SEPARATOR L"\\"

#else

#define CHAR_PATH_SEPARATOR '/'
#define WCHAR_PATH_SEPARATOR L'/'
#define STRING_PATH_SEPARATOR "/"
#define WSTRING_PATH_SEPARATOR L"/"

#endif

EXTERN_C_END

#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#define MY_VER_MAJOR 4
#define MY_VER_MINOR 65
#define MY_VER_MAJOR 16
#define MY_VER_MINOR 04
#define MY_VER_BUILD 0
#define MY_VERSION "4.65"
#define MY_DATE "2009-02-03"
#define MY_COPYRIGHT ": Igor Pavlov : Public domain"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE
#define MY_VERSION_NUMBERS "16.04"
#define MY_VERSION "16.04"
#define MY_DATE "2016-10-04"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain"
#define MY_COPYRIGHT_CR "Copyright (c) 1999-2016 Igor Pavlov"

#ifdef USE_COPYRIGHT_CR
#define MY_COPYRIGHT MY_COPYRIGHT_CR
#else
#define MY_COPYRIGHT MY_COPYRIGHT_PD
#endif

#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " : " MY_COPYRIGHT " : " MY_DATE
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* Bra.h -- Branch converters for executables
2008-10-04 : Igor Pavlov : Public domain */
2013-01-18 : Igor Pavlov : Public domain */

#ifndef __BRA_H
#define __BRA_H

#include "Types.h"
#include "7zTypes.h"

EXTERN_C_BEGIN

/*
These functions convert relative addresses to absolute addresses
Expand Down Expand Up @@ -57,4 +59,6 @@ SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);

EXTERN_C_END

#endif
Loading

0 comments on commit 00f5e11

Please sign in to comment.