summaryrefslogtreecommitdiff
path: root/core/pkg
diff options
context:
space:
mode:
authorruki <[email protected]>2015-07-02 16:04:26 +0800
committerruki <[email protected]>2015-07-02 16:04:26 +0800
commitc14febe1bf4e0386d3590989bc610efa64d7f13c (patch)
tree26a670724502ed5551861dfe27d5c3aa66a883ba /core/pkg
parent9f1e12860e7590f4301a1cb428b44534505914b2 (diff)
fix some tbox headers
Diffstat (limited to 'core/pkg')
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h0
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h0
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h0
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h0
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/algorithm/count.h0
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h0
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S148
-rwxr-xr-x[-rw-r--r--]core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S46
8 files changed, 125 insertions, 69 deletions
diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h
index e8c3981ac..e8c3981ac 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h
+++ b/core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h
diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h
index 6a6f0b5f5..6a6f0b5f5 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h
+++ b/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h
diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h
index 43d9f581c..43d9f581c 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h
+++ b/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h
diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h
index 9d98c046e..9d98c046e 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h
+++ b/core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h
diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/count.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/count.h
index 58053cbef..58053cbef 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/algorithm/count.h
+++ b/core/pkg/tbox.pkg/inc/tbox/algorithm/count.h
diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h
index 4800417b5..4800417b5 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h
+++ b/core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h
diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S
index e8c3981ac..d815dcbb7 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S
+++ b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S
@@ -17,41 +17,131 @@
* Copyright (C) 2009 - 2015, ruki All rights reserved.
*
* @author ruki
- * @file algorithm.h
- * @defgroup algorithm
+ * @file prefix.S
*
*/
-#ifndef TB_ALGORITHM_H
-#define TB_ALGORITHM_H
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "prefix.h"
-#include "predicate.h"
-#include "distance.h"
-#include "for.h"
-#include "for_if.h"
-#include "rfor.h"
-#include "rfor_if.h"
-#include "sort.h"
-#include "heap_sort.h"
-#include "quick_sort.h"
-#include "insert_sort.h"
-#include "bubble_sort.h"
-#include "find.h"
-#include "find_if.h"
-#include "rfind.h"
-#include "rfind_if.h"
-#include "binary_find.h"
-#include "binary_find_if.h"
-#include "walk.h"
-#include "rwalk.h"
-#include "count.h"
-#include "count_if.h"
-#include "remove.h"
-#include "remove_if.h"
-#include "remove_first.h"
-#include "remove_first_if.h"
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * macros
+ */
+
+#ifdef TB_ARCH_ARM_THUMB
+# define A @
+# define T
+#else
+# define A
+# define T @
+#endif
+
+#ifdef TB_ARCH_ELF
+# define ELF
+# define EXTERN_ASM
+#else
+# define ELF @
+# define EXTERN_ASM _
+#endif
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * arch
+ */
+
+#if defined(TB_ARCH_ARM_v7A)
+ .arch armv7-a
+#elif defined(TB_ARCH_ARM_v7)
+ .arch armv7
+#elif defined(TB_ARCH_ARM_v6)
+ .arch armv6
+#elif defined(TB_ARCH_ARM_v5te)
+ .arch armv5te
+#elif defined(TB_ARCH_ARM_v5)
+ .arch armv5
+#endif
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * fpu
+ */
+
+#if defined(TB_ARCH_ARM_NEON) && !defined(TB_ARCH_ARM64)
+ .fpu neon
+#elif defined(TB_ARCH_VFP)
+ .fpu vfp
+#endif
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * syntax
+ */
+#ifndef TB_ARCH_ARM64
+ .syntax unified
+#endif
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * thumb
+ */
+
+// will crash
+//T .thumb
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * eabi
+ */
+#ifndef TB_ARCH_ARM64
+ELF .eabi_attribute 25, 1
+#endif
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * macros
+ */
+
+/*! function
+ *
+ * @code
+ function func_xxxx, export=1
+ ...
+ bx lr
+ endfunc
+ @endcode
+ */
+.macro function name, export=0
+ .macro endfunc
+ELF .size \name, . - \name
+ .endfunc
+ .purgem endfunc
+ .endm
+
+ .text
+#ifdef TB_ARCH_ARM64
+ .align 8
+#else
+ .align 4
+#endif
+ .if \export
+ .global EXTERN_ASM\name
+EXTERN_ASM\name:
+ .endif
+ELF .type \name, %function
+ .func \name
+\name:
+.endm
+
+/*! label
+ *
+ * @code
+ label name
+ xxx
+ xxx
+ bl name
+ @endcode
+ */
+.macro label name
+#ifdef TB_ARCH_ARM64
+ .align 8
+#else
+ .align 4
#endif
+\name:
+.endm
diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S
index 6a6f0b5f5..574675b8a 100644..100755
--- a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S
+++ b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S
@@ -16,50 +16,16 @@
*
* Copyright (C) 2009 - 2015, ruki All rights reserved.
*
- * @author ruki
- * @file binary_find.h
- * @ingroup algorithm
+ * @author ruki
+ * @file prefix.S
*
*/
-#ifndef TB_ALGORITHM_BINARY_FIND_H
-#define TB_ALGORITHM_BINARY_FIND_H
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
-#include "prefix.h"
-
-/* //////////////////////////////////////////////////////////////////////////////////////
- * extern
- */
-__tb_extern_c_enter__
-
-/* //////////////////////////////////////////////////////////////////////////////////////
- * interfaces
- */
-
-/*! binary find item
- *
- * @param iterator the iterator
- * @param head the iterator head
- * @param tail the iterator tail
- * @param item the finded item
- *
- * @return the iterator itor, return tb_iterator_tail(iterator) if not found
- */
-tb_size_t tb_binary_find(tb_iterator_ref_t iterator, tb_size_t head, tb_size_t tail, tb_cpointer_t item);
-
-/*!binary find item for all
- *
- * @param iterator the iterator
- * @param item the finded item
- *
- * @return the iterator itor, return tb_iterator_tail(iterator) if not found
- */
-tb_size_t tb_binary_find_all(tb_iterator_ref_t iterator, tb_cpointer_t item);
-
-/* //////////////////////////////////////////////////////////////////////////////////////
- * extern
- */
-__tb_extern_c_leave__
+#include "asm.h"
+#if defined(TB_ARCH_ARM)
+# include "arm/prefix.S"
#endif
+