diff options
| author | ruki <[email protected]> | 2015-07-02 16:04:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-07-02 16:04:26 +0800 |
| commit | c14febe1bf4e0386d3590989bc610efa64d7f13c (patch) | |
| tree | 26a670724502ed5551861dfe27d5c3aa66a883ba | |
| parent | 9f1e12860e7590f4301a1cb428b44534505914b2 (diff) | |
fix some tbox headers
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/algorithm/count.h | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S | 148 | ||||
| -rwxr-xr-x[-rw-r--r--] | core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S | 46 | ||||
| -rw-r--r-- | xmake/scripts/base/rule.lua | 10 |
9 files changed, 132 insertions, 72 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 + diff --git a/xmake/scripts/base/rule.lua b/xmake/scripts/base/rule.lua index cff18ed16..b8695d418 100644 --- a/xmake/scripts/base/rule.lua +++ b/xmake/scripts/base/rule.lua @@ -236,10 +236,14 @@ function rule.headerfiles(target, headerdir) table.join2(srcheaders, srcpathes) -- add the destinate headers - local i = 1 for _, srcpath in ipairs(srcpathes) do - dstheaders[i] = path.absolute(path.relative(srcpath, rootdir), headerdir) - i = i + 1 + + -- the header + local dstheader = path.absolute(path.relative(srcpath, rootdir), headerdir) + assert(dstheader) + + -- add it + table.insert(dstheaders, dstheader) end end end |
