mirror of
https://github.com/facebook/zstd.git
synced 2025-03-07 09:26:03 +02:00
[contrib][linux] Add zstd_common module
The zstd_common module was added upstream in commit
637a642f5c
.
But the kernel specific code was inlined into the library. This commit
switches it to use the out of line method that we use for the other
modules.
This commit is contained in:
parent
dcc7228de9
commit
330558ad52
@ -60,6 +60,7 @@ libzstd:
|
||||
mv linux/lib/zstd/zstd.h linux/include/linux/zstd_lib.h
|
||||
mv linux/lib/zstd/zstd_errors.h linux/include/linux/
|
||||
cp linux_zstd.h linux/include/linux/zstd.h
|
||||
cp zstd_common_module.c linux/lib/zstd
|
||||
cp zstd_compress_module.c linux/lib/zstd
|
||||
cp zstd_decompress_module.c linux/lib/zstd
|
||||
cp decompress_sources.h linux/lib/zstd
|
||||
|
@ -10,16 +10,10 @@
|
||||
# ################################################################
|
||||
obj-$(CONFIG_ZSTD_COMPRESS) += zstd_compress.o
|
||||
obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd_decompress.o
|
||||
|
||||
ccflags-y += -Wno-error=deprecated-declarations
|
||||
obj-$(CONFIG_ZSTD_COMMON) += zstd_common.o
|
||||
|
||||
zstd_compress-y := \
|
||||
zstd_compress_module.o \
|
||||
common/debug.o \
|
||||
common/entropy_common.o \
|
||||
common/error_private.o \
|
||||
common/fse_decompress.o \
|
||||
common/zstd_common.o \
|
||||
compress/fse_compress.o \
|
||||
compress/hist.o \
|
||||
compress/huf_compress.o \
|
||||
@ -35,13 +29,16 @@ zstd_compress-y := \
|
||||
|
||||
zstd_decompress-y := \
|
||||
zstd_decompress_module.o \
|
||||
decompress/huf_decompress_amd64.o \
|
||||
decompress/huf_decompress.o \
|
||||
decompress/zstd_ddict.o \
|
||||
decompress/zstd_decompress.o \
|
||||
decompress/zstd_decompress_block.o \
|
||||
|
||||
zstd_common-y := \
|
||||
zstd_common_module.o \
|
||||
common/debug.o \
|
||||
common/entropy_common.o \
|
||||
common/error_private.o \
|
||||
common/fse_decompress.o \
|
||||
common/zstd_common.o \
|
||||
decompress/huf_decompress.o \
|
||||
decompress/huf_decompress_amd64.o \
|
||||
decompress/zstd_ddict.o \
|
||||
decompress/zstd_decompress.o \
|
||||
decompress/zstd_decompress_block.o \
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
#define EXPORT_SYMBOL(symbol) \
|
||||
void* __##symbol = symbol
|
||||
#define EXPORT_SYMBOL_GPL(symbol) \
|
||||
void* __##symbol = symbol
|
||||
#define MODULE_LICENSE(license)
|
||||
#define MODULE_DESCRIPTION(description)
|
||||
|
||||
|
32
contrib/linux-kernel/zstd_common_module.c
Normal file
32
contrib/linux-kernel/zstd_common_module.c
Normal file
@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under both the BSD-style license (found in the
|
||||
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
||||
* in the COPYING file in the root directory of this source tree).
|
||||
* You may select, at your option, one of the above-listed licenses.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include "common/huf.h"
|
||||
#include "common/fse.h"
|
||||
#include "common/zstd_internal.h"
|
||||
|
||||
// Export symbols shared by compress and decompress into a common module
|
||||
|
||||
#undef ZSTD_isError /* defined within zstd_internal.h */
|
||||
EXPORT_SYMBOL_GPL(FSE_readNCount);
|
||||
EXPORT_SYMBOL_GPL(HUF_readStats);
|
||||
EXPORT_SYMBOL_GPL(HUF_readStats_wksp);
|
||||
EXPORT_SYMBOL_GPL(ZSTD_isError);
|
||||
EXPORT_SYMBOL_GPL(ZSTD_getErrorName);
|
||||
EXPORT_SYMBOL_GPL(ZSTD_getErrorCode);
|
||||
EXPORT_SYMBOL_GPL(ZSTD_customMalloc);
|
||||
EXPORT_SYMBOL_GPL(ZSTD_customCalloc);
|
||||
EXPORT_SYMBOL_GPL(ZSTD_customFree);
|
||||
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
MODULE_DESCRIPTION("Zstd Common");
|
Loading…
x
Reference in New Issue
Block a user