From 3ad6f43ff3ba436eeac0c945c0fd6cc276acbaa6 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Wed, 30 May 2012 06:50:06 +0000 Subject: [PATCH] Added VisualDSP++ Compiler support. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2137 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/finsh/finsh.h | 2 +- components/finsh/shell.c | 12 +++++++++++- include/rtdef.h | 7 +++++++ include/rtthread.h | 5 +++++ src/kservice.c | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/components/finsh/finsh.h b/components/finsh/finsh.h index fd51b72a6..03a2e4778 100644 --- a/components/finsh/finsh.h +++ b/components/finsh/finsh.h @@ -59,7 +59,7 @@ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned long u_long; -#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__) +#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__) && !defined(__ADSPBLACKFIN__) typedef unsigned int size_t; #ifndef NULL diff --git a/components/finsh/shell.c b/components/finsh/shell.c index d399fdaca..601bf647f 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -53,7 +53,7 @@ char *strdup(const char *s) } #endif -#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__) +#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__) && !defined(__ADSPBLACKFIN__) int isalpha( int ch ) { return (unsigned int)((ch | 0x20) - 'a') < 26u; @@ -452,6 +452,13 @@ void finsh_system_var_init(const void* begin, const void* end) #pragma section="FSymTab" #pragma section="VSymTab" #endif +#elif defined(__ADSPBLACKFIN__) /* for VisaulDSP++ Compiler*/ + #ifdef FINSH_USING_SYMTAB + extern "asm" int __fsymtab_start; + extern "asm" int __fsymtab_end; + extern "asm" int __vsymtab_start; + extern "asm" int __vsymtab_end; + #endif #endif /* @@ -483,6 +490,9 @@ void finsh_system_init(void) extern const int __vsymtab_end; finsh_system_function_init(&__fsymtab_start, &__fsymtab_end); finsh_system_var_init(&__vsymtab_start, &__vsymtab_end); +#elif defined(__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */ + finsh_system_function_init(&__fsymtab_start, &__fsymtab_end); + finsh_system_var_init(&__vsymtab_start, &__vsymtab_end); #endif #endif diff --git a/include/rtdef.h b/include/rtdef.h index 6bd8ed002..213eb1dd1 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -126,6 +126,13 @@ typedef rt_base_t rt_off_t; /**< Type for offset #define ALIGN(n) __attribute__((aligned(n))) #define rt_inline static __inline #define RTT_API +#elif defined (__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */ + #include + #define SECTION(x) __attribute__((section(x))) + #define UNUSED __attribute__((unused)) + #define ALIGN(n) __attribute__((aligned(n))) + #define rt_inline static inline + #define RTT_API #endif /* event length */ diff --git a/include/rtthread.h b/include/rtthread.h index fd697b8ed..d37534218 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -375,6 +375,11 @@ void rt_interrupt_leave(void); */ rt_uint8_t rt_interrupt_get_nest(void); +/** + * application module + */ +void rt_system_module_init(void); + /** * @addtogroup KernelService */ diff --git a/src/kservice.c b/src/kservice.c index da4d7980b..a49cc377e 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1022,7 +1022,7 @@ rt_device_t rt_console_set_device(const char *name) } #endif -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__ADSPBLACKFIN__) void rt_hw_console_output(const char *str) __attribute__((weak)); void rt_hw_console_output(const char *str) #elif defined(__CC_ARM) -- GitLab