mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 05:55:06 +07:00
2c6deb0152
Commit 7dd968163f
("bitmap: bitmap_equal memcmp optimization") was
rather more restrictive than necessary; we can use memcmp() to implement
bitmap_equal() as long as the number of bits can be proved to be a
multiple of 8. And architectures other than s390 may be able to make
good use of this optimisation.
[arnd@arndb.de: fix build: add a memcmp() declaration]
Link: http://lkml.kernel.org/r/20170630153908.3439707-1-arnd@arndb.de
Link: http://lkml.kernel.org/r/20170628153221.11322-5-willy@infradead.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
64 lines
1.6 KiB
C
64 lines
1.6 KiB
C
#define _LINUX_STRING_H_
|
|
|
|
#include <linux/compiler.h> /* for inline */
|
|
#include <linux/types.h> /* for size_t */
|
|
#include <linux/stddef.h> /* for NULL */
|
|
#include <linux/linkage.h>
|
|
#include <asm/string.h>
|
|
|
|
extern unsigned long free_mem_ptr;
|
|
extern unsigned long free_mem_end_ptr;
|
|
extern void error(char *);
|
|
|
|
#define STATIC static
|
|
#define STATIC_RW_DATA /* non-static please */
|
|
|
|
/* Diagnostic functions */
|
|
#ifdef DEBUG
|
|
# define Assert(cond,msg) {if(!(cond)) error(msg);}
|
|
# define Trace(x) fprintf x
|
|
# define Tracev(x) {if (verbose) fprintf x ;}
|
|
# define Tracevv(x) {if (verbose>1) fprintf x ;}
|
|
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
|
|
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
|
|
#else
|
|
# define Assert(cond,msg)
|
|
# define Trace(x)
|
|
# define Tracev(x)
|
|
# define Tracevv(x)
|
|
# define Tracec(c,x)
|
|
# define Tracecv(c,x)
|
|
#endif
|
|
|
|
/* Not needed, but used in some headers pulled in by decompressors */
|
|
extern char * strstr(const char * s1, const char *s2);
|
|
extern size_t strlen(const char *s);
|
|
extern int memcmp(const void *cs, const void *ct, size_t count);
|
|
|
|
#ifdef CONFIG_KERNEL_GZIP
|
|
#include "../../../../lib/decompress_inflate.c"
|
|
#endif
|
|
|
|
#ifdef CONFIG_KERNEL_LZO
|
|
#include "../../../../lib/decompress_unlzo.c"
|
|
#endif
|
|
|
|
#ifdef CONFIG_KERNEL_LZMA
|
|
#include "../../../../lib/decompress_unlzma.c"
|
|
#endif
|
|
|
|
#ifdef CONFIG_KERNEL_XZ
|
|
#define memmove memmove
|
|
#define memcpy memcpy
|
|
#include "../../../../lib/decompress_unxz.c"
|
|
#endif
|
|
|
|
#ifdef CONFIG_KERNEL_LZ4
|
|
#include "../../../../lib/decompress_unlz4.c"
|
|
#endif
|
|
|
|
int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
|
|
{
|
|
return __decompress(input, len, NULL, NULL, output, 0, NULL, error);
|
|
}
|