From 41c80ace81e66abe5453572d757764971f38390e Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 1 Oct 2016 13:59:13 +0200 Subject: [PATCH] remove linux/compiler.h, mosty it is not used Signed-off-by: Oleksij Rempel --- .../magpie_fw_dev/target/inc/linux/compiler.h | 107 ------------------ .../magpie_fw_dev/target/init/app_start.c | 1 - .../magpie_fw_dev/target/init/app_start.h | 4 +- .../magpie_fw_dev/target/init/init.h | 2 +- 4 files changed, 4 insertions(+), 110 deletions(-) delete mode 100644 target_firmware/magpie_fw_dev/target/inc/linux/compiler.h diff --git a/target_firmware/magpie_fw_dev/target/inc/linux/compiler.h b/target_firmware/magpie_fw_dev/target/inc/linux/compiler.h deleted file mode 100644 index 725ee73..0000000 --- a/target_firmware/magpie_fw_dev/target/inc/linux/compiler.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __SHARED_COMPILER_H -#define __SHARED_COMPILER_H - -#define __noinline __attribute__((noinline)) -#define __noreturn __attribute__((noreturn)) -#define __inline __attribute__((always_inline)) -#define __hot __attribute__((hot)) -#define __cold __attribute__((cold)) -#define __unused __attribute__((unused)) -#define __force __attribute__((force)) -#define __section(s) __attribute__((section("." # s))) -#define __aligned(a) __attribute__((aligned(a))) -#define __packed __attribute__((packed)) -#define __visible __attribute__((externally_visible)) - -#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) -#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) - -#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) -#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) - -#define __roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) - -#define __must_be_array(a) \ - BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0]))) -#define ARRAY_SIZE(arr) (sizeof((arr)) / sizeof((arr)[0]) + __must_be_array(arr)) - -#define BIT(b) (1 << (b)) -#define MASK(w) (BIT(w) - 1) - -#undef offsetof -#ifdef __compiler_offsetof -# define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) -#else -# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif - -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) - -#define min(x, y) ({ \ - typeof(x) _min1 = (x); \ - typeof(y) _min2 = (y); \ - (void) (&_min1 == &_min2); \ - _min1 < _min2 ? _min1 : _min2; }) - -#define max(x, y) ({ \ - typeof(x) _max1 = (x); \ - typeof(y) _max2 = (y); \ - (void) (&_max1 == &_max2); \ - _max1 > _max2 ? _max1 : _max2; }) - -#define min_t(type, x, y) ({ \ - type __min1 = (x); \ - type __min2 = (y); \ - __min1 < __min2 ? __min1 : __min2; }) - -#define max_t(type, x, y) ({ \ - type __max1 = (x); \ - type __max2 = (y); \ - __max1 > __max2 ? __max1 : __max2; }) - - -#define container_of(ptr, type, member) ({ \ - const typeof(((type *)0)->member) * __mptr = (ptr); \ - (type *)(((unsigned long)__mptr - offsetof(type, member))); }) - -#define MAX_ERRNO 4095 - -#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) - -static inline void *ERR_PTR(long errornr) -{ - return (void *) errornr; -} - -static inline long PTR_ERR(const void *ptr) -{ - return (long) ptr; -} - -static inline long IS_ERR(const void *ptr) -{ - return IS_ERR_VALUE((unsigned long)ptr); -} - -static inline long IS_ERR_OR_NULL(const void *ptr) -{ - return !ptr || IS_ERR_VALUE((unsigned long)ptr); -} -#endif /* __SHARED_COMPILER_H */ diff --git a/target_firmware/magpie_fw_dev/target/init/app_start.c b/target_firmware/magpie_fw_dev/target/init/app_start.c index a9d2088..8fa9c8b 100644 --- a/target_firmware/magpie_fw_dev/target/init/app_start.c +++ b/target_firmware/magpie_fw_dev/target/init/app_start.c @@ -47,7 +47,6 @@ #include "init.h" #include "app_start.h" -#include // @TODO: Should define the memory region later~ #define ALLOCRAM_START ( ((unsigned int)&_fw_image_end) + 4) diff --git a/target_firmware/magpie_fw_dev/target/init/app_start.h b/target_firmware/magpie_fw_dev/target/init/app_start.h index aa2179f..5b91a72 100644 --- a/target_firmware/magpie_fw_dev/target/init/app_start.h +++ b/target_firmware/magpie_fw_dev/target/init/app_start.h @@ -37,7 +37,9 @@ #ifndef _ATH_APP_START_H_ #define _ATH_APP_START_H_ -#include +#define __noreturn __attribute__((noreturn)) +#define __section(s) __attribute__((section("." # s))) +#define __visible __attribute__((externally_visible)) void __section(boot) __noreturn __visible app_start(void); void Magpie_init(void); diff --git a/target_firmware/magpie_fw_dev/target/init/init.h b/target_firmware/magpie_fw_dev/target/init/init.h index 4ad0fe9..342f64b 100644 --- a/target_firmware/magpie_fw_dev/target/init/init.h +++ b/target_firmware/magpie_fw_dev/target/init/init.h @@ -36,8 +36,8 @@ #define ALLOCRAM_START ( ((unsigned int)&_fw_image_end) + 4) #define ALLOCRAM_SIZE ( SYS_RAM_SZIE - ( ALLOCRAM_START - SYS_D_RAM_REGION_0_BASE) - SYS_D_RAM_STACK_SIZE) +#include "app_start.h" #include "regdump.h" -#include #define SBOOT_PATTERN 0x5342 #define IS_FLASHBOOT() (((DEBUG_SYSTEM_STATE&~(0x0000ffff))>>16==SBOOT_PATTERN)) -- 2.31.1