Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4784be3 authored by Catalin Marinas's avatar Catalin Marinas
Browse files

Merge branch 'arm64-klib' into upstream

* arm64-klib:
  arm64: klib: Optimised atomic bitops
  arm64: klib: Optimised string functions
  arm64: klib: Optimised memory functions
parents e851b58c 62479586
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,6 @@ generic-y += shmbuf.h
generic-y += sizes.h
generic-y += sizes.h
generic-y += socket.h
generic-y += socket.h
generic-y += sockios.h
generic-y += sockios.h
generic-y += string.h
generic-y += switch_to.h
generic-y += switch_to.h
generic-y += swab.h
generic-y += swab.h
generic-y += termbits.h
generic-y += termbits.h
+16 −2
Original line number Original line Diff line number Diff line
@@ -32,6 +32,16 @@
#error only <linux/bitops.h> can be included directly
#error only <linux/bitops.h> can be included directly
#endif
#endif


/*
 * Little endian assembly atomic bitops.
 */
extern void set_bit(int nr, volatile unsigned long *p);
extern void clear_bit(int nr, volatile unsigned long *p);
extern void change_bit(int nr, volatile unsigned long *p);
extern int test_and_set_bit(int nr, volatile unsigned long *p);
extern int test_and_clear_bit(int nr, volatile unsigned long *p);
extern int test_and_change_bit(int nr, volatile unsigned long *p);

#include <asm-generic/bitops/builtin-__ffs.h>
#include <asm-generic/bitops/builtin-__ffs.h>
#include <asm-generic/bitops/builtin-ffs.h>
#include <asm-generic/bitops/builtin-ffs.h>
#include <asm-generic/bitops/builtin-__fls.h>
#include <asm-generic/bitops/builtin-__fls.h>
@@ -45,9 +55,13 @@
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/lock.h>


#include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>

/*
 * Ext2 is defined to use little-endian byte ordering.
 */
#define ext2_set_bit_atomic(lock, nr, p)	test_and_set_bit_le(nr, p)
#define ext2_clear_bit_atomic(lock, nr, p)	test_and_clear_bit_le(nr, p)


#endif /* __ASM_BITOPS_H */
#endif /* __ASM_BITOPS_H */
+37 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2013 ARM Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef __ASM_STRING_H
#define __ASM_STRING_H

#define __HAVE_ARCH_STRRCHR
extern char *strrchr(const char *, int c);

#define __HAVE_ARCH_STRCHR
extern char *strchr(const char *, int c);

#define __HAVE_ARCH_MEMCPY
extern void *memcpy(void *, const void *, __kernel_size_t);

#define __HAVE_ARCH_MEMMOVE
extern void *memmove(void *, const void *, __kernel_size_t);

#define __HAVE_ARCH_MEMCHR
extern void *memchr(const void *, int, __kernel_size_t);

#define __HAVE_ARCH_MEMSET
extern void *memset(void *, int, __kernel_size_t);

#endif
+16 −5
Original line number Original line Diff line number Diff line
@@ -39,10 +39,21 @@ EXPORT_SYMBOL(__copy_from_user);
EXPORT_SYMBOL(__copy_to_user);
EXPORT_SYMBOL(__copy_to_user);
EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(__clear_user);


	/* bitops */
#ifdef CONFIG_SMP
EXPORT_SYMBOL(__atomic_hash);
#endif

	/* physical memory */
	/* physical memory */
EXPORT_SYMBOL(memstart_addr);
EXPORT_SYMBOL(memstart_addr);

	/* string / mem functions */
EXPORT_SYMBOL(strchr);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(memchr);

	/* atomic bitops */
EXPORT_SYMBOL(set_bit);
EXPORT_SYMBOL(test_and_set_bit);
EXPORT_SYMBOL(clear_bit);
EXPORT_SYMBOL(test_and_clear_bit);
EXPORT_SYMBOL(change_bit);
EXPORT_SYMBOL(test_and_change_bit);
+3 −1
Original line number Original line Diff line number Diff line
lib-y		:= bitops.o delay.o					\
lib-y		:= bitops.o delay.o					\
		   strncpy_from_user.o strnlen_user.o clear_user.o	\
		   strncpy_from_user.o strnlen_user.o clear_user.o	\
		   copy_from_user.o copy_to_user.o copy_in_user.o	\
		   copy_from_user.o copy_to_user.o copy_in_user.o	\
		   copy_page.o clear_page.o
		   copy_page.o clear_page.o				\
		   memchr.o memcpy.o memmove.o memset.o			\
		   strchr.o strrchr.o
Loading