www.pudn.com > LPC1768_SD_Test.rar > retarget.i, change:2010-03-29,size:38412b


#line 1 "Retarget.c" 
 
 
 
 
 
 
 
 
 
  
 
#line 1 "C:\\Keil\\\\ARM\\RV31\\INC\\stdio.h" 
  
  
  
 
 
 
 
 
  
 
 
 
 
 
 
  
 
 
 
 
 
 
 
 
 
#line 34 "C:\\Keil\\\\ARM\\RV31\\INC\\stdio.h" 
 
 
   
  typedef unsigned int size_t;     
 
 
 
 
 
 
 
 
  
  
 
  
  typedef struct __va_list __va_list; 
 
 
 
 
 
    
 
 
 
 
  
 
 
 
 
typedef struct __fpos_t_struct { 
    unsigned __int64 __pos; 
     
 
 
 
  
    struct { 
        unsigned int __state1, __state2; 
    } __mbstate; 
} fpos_t; 
    
 
 
  
 
 
    
 
  
 
typedef struct __FILE FILE; 
    
 
 
 
 
 
 
  
 
extern FILE __stdin, __stdout, __stderr; 
extern FILE *__aeabi_stdin, *__aeabi_stdout, *__aeabi_stderr; 
 
#line 125 "C:\\Keil\\\\ARM\\RV31\\INC\\stdio.h" 
     
 
     
 
     
 
 
 
 
 
      
 
 
 
    
 
 
  
 
 
    
 
 
  
 
    
 
 
 
  
 
    
 
 
  
 
 
 
 
    
 
 
  
 
 
 
 
 
     
 
 
  
 
 
 
 
 
 
extern __declspec(__nothrow) int remove(const char *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
  
extern __declspec(__nothrow) int rename(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) FILE *tmpfile(void); 
    
 
 
 
 
  
extern __declspec(__nothrow) char *tmpnam(char *  ); 
    
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) int fclose(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) int fflush(FILE *  ); 
    
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) FILE *fopen(const char * __restrict  , 
                           const char * __restrict  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) FILE *freopen(const char * __restrict  , 
                    const char * __restrict  , 
                    FILE * __restrict  ) __attribute__((__nonnull__(2,3))); 
    
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) void setbuf(FILE * __restrict  , 
                    char * __restrict  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
  
extern __declspec(__nothrow) int setvbuf(FILE * __restrict  , 
                   char * __restrict  , 
                   int  , size_t  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
#pragma __printf_args 
extern __declspec(__nothrow) int fprintf(FILE * __restrict  , 
                    const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
#pragma __printf_args 
extern __declspec(__nothrow) int _fprintf(FILE * __restrict  , 
                     const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
#pragma __printf_args 
extern __declspec(__nothrow) int printf(const char * __restrict  , ...) __attribute__((__nonnull__(1))); 
    
 
 
 
 
  
#pragma __printf_args 
extern __declspec(__nothrow) int _printf(const char * __restrict  , ...) __attribute__((__nonnull__(1))); 
    
 
 
 
  
#pragma __printf_args 
extern __declspec(__nothrow) int sprintf(char * __restrict  , const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
  
#pragma __printf_args 
extern __declspec(__nothrow) int _sprintf(char * __restrict  , const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
 
#pragma __printf_args 
extern __declspec(__nothrow) int snprintf(char * __restrict  , size_t  , 
                     const char * __restrict  , ...) __attribute__((__nonnull__(3))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
#pragma __printf_args 
extern __declspec(__nothrow) int _snprintf(char * __restrict  , size_t  , 
                      const char * __restrict  , ...) __attribute__((__nonnull__(3))); 
    
 
 
 
  
#pragma __scanf_args 
extern __declspec(__nothrow) int fscanf(FILE * __restrict  , 
                    const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
#pragma __scanf_args 
extern __declspec(__nothrow) int _fscanf(FILE * __restrict  , 
                     const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
#pragma __scanf_args 
extern __declspec(__nothrow) int scanf(const char * __restrict  , ...) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
  
#pragma __scanf_args 
extern __declspec(__nothrow) int _scanf(const char * __restrict  , ...) __attribute__((__nonnull__(1))); 
    
 
 
 
  
#pragma __scanf_args 
extern __declspec(__nothrow) int sscanf(const char * __restrict  , 
                    const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
  
#pragma __scanf_args 
extern __declspec(__nothrow) int _sscanf(const char * __restrict  , 
                     const char * __restrict  , ...) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
 
  
extern __declspec(__nothrow) int vfscanf(FILE * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) int vscanf(const char * __restrict  , __va_list) __attribute__((__nonnull__(1))); 
extern __declspec(__nothrow) int vsscanf(const char * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2))); 
 
extern __declspec(__nothrow) int _vfscanf(FILE * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) int _vscanf(const char * __restrict  , __va_list) __attribute__((__nonnull__(1))); 
extern __declspec(__nothrow) int _vsscanf(const char * __restrict  , const char * __restrict  , __va_list) __attribute__((__nonnull__(1,2))); 
 
extern __declspec(__nothrow) int vprintf(const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
  
extern __declspec(__nothrow) int _vprintf(const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1))); 
    
 
 
 
  
extern __declspec(__nothrow) int vfprintf(FILE * __restrict  , 
                    const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
  
extern __declspec(__nothrow) int vsprintf(char * __restrict  , 
                     const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) int vsnprintf(char * __restrict  , size_t  , 
                     const char * __restrict  , __va_list  ) __attribute__((__nonnull__(3))); 
    
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) int _vsprintf(char * __restrict  , 
                      const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
extern __declspec(__nothrow) int _vfprintf(FILE * __restrict  , 
                     const char * __restrict  , __va_list  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
extern __declspec(__nothrow) int _vsnprintf(char * __restrict  , size_t  , 
                      const char * __restrict  , __va_list  ) __attribute__((__nonnull__(3))); 
    
 
 
 
  
extern __declspec(__nothrow) int fgetc(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) char *fgets(char * __restrict  , int  , 
                    FILE * __restrict  ) __attribute__((__nonnull__(1,3))); 
    
 
 
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) int fputc(int  , FILE *  ) __attribute__((__nonnull__(2))); 
    
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) int fputs(const char * __restrict  , FILE * __restrict  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
  
extern __declspec(__nothrow) int getc(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
  
 
 
 
 
    extern __declspec(__nothrow) int (getchar)(void); 
 
    
 
 
 
 
 
  
extern __declspec(__nothrow) char *gets(char *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) int putc(int  , FILE *  ) __attribute__((__nonnull__(2))); 
    
 
 
 
 
 
  
 
 
 
 
    extern __declspec(__nothrow) int (putchar)(int  ); 
 
    
 
 
 
  
extern __declspec(__nothrow) int puts(const char *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
  
extern __declspec(__nothrow) int ungetc(int  , FILE *  ) __attribute__((__nonnull__(2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) size_t fread(void * __restrict  , 
                    size_t  , size_t  , FILE * __restrict  ) __attribute__((__nonnull__(1,4))); 
    
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) size_t __fread_bytes_avail(void * __restrict  , 
                    size_t  , FILE * __restrict  ) __attribute__((__nonnull__(1,3))); 
    
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) size_t fwrite(const void * __restrict  , 
                    size_t  , size_t  , FILE * __restrict  ) __attribute__((__nonnull__(1,4))); 
    
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) int fgetpos(FILE * __restrict  , fpos_t * __restrict  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) int fseek(FILE *  , long int  , int  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) int fsetpos(FILE * __restrict  , const fpos_t * __restrict  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) long int ftell(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) void rewind(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
 
  
 
extern __declspec(__nothrow) void clearerr(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
 
  
 
extern __declspec(__nothrow) int feof(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
  
extern __declspec(__nothrow) int ferror(FILE *  ) __attribute__((__nonnull__(1))); 
    
 
 
  
extern __declspec(__nothrow) void perror(const char *  ); 
    
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) int _fisatty(FILE *   ) __attribute__((__nonnull__(1))); 
     
  
 
extern __declspec(__nothrow) void __use_no_semihosting_swi(void); 
extern __declspec(__nothrow) void __use_no_semihosting(void); 
     
 
 
 
 
 
  
 
 
 
 
 
 
 
 
 
 
 
#line 944 "C:\\Keil\\\\ARM\\RV31\\INC\\stdio.h" 
 
 
 
  
#line 13 "Retarget.c" 
#line 1 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
  
  
  
  
 
 
 
 
  
 
 
 
 
 
 
 
 
  
 
 
 
 
 
 
 
 
 
 
 
#line 37 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
 
 
   
  typedef unsigned int size_t; 
 
 
 
 
 
 
 
 
extern __declspec(__nothrow) void *memcpy(void * __restrict  , 
                    const void * __restrict  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
  
extern __declspec(__nothrow) void *memmove(void *  , 
                    const void *  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
  
extern __declspec(__nothrow) char *strcpy(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
  
extern __declspec(__nothrow) char *strncpy(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
  
 
extern __declspec(__nothrow) char *strcat(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
  
extern __declspec(__nothrow) char *strncat(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
  
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) int memcmp(const void *  , const void *  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
  
extern __declspec(__nothrow) int strcmp(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
  
extern __declspec(__nothrow) int strncmp(const char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
  
extern __declspec(__nothrow) int strcasecmp(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
  
extern __declspec(__nothrow) int strncasecmp(const char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
  
extern __declspec(__nothrow) int strcoll(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) size_t strxfrm(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
 
#line 184 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
extern __declspec(__nothrow) void *memchr(const void *  , int  , size_t  ) __attribute__((__nonnull__(1))); 
 
    
 
 
 
 
 
  
 
#line 200 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
extern __declspec(__nothrow) char *strchr(const char *  , int  ) __attribute__((__nonnull__(1))); 
 
    
 
 
 
 
  
 
extern __declspec(__nothrow) size_t strcspn(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
  
 
#line 223 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
extern __declspec(__nothrow) char *strpbrk(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
 
    
 
 
 
 
  
 
#line 238 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
extern __declspec(__nothrow) char *strrchr(const char *  , int  ) __attribute__((__nonnull__(1))); 
 
    
 
 
 
 
 
  
 
extern __declspec(__nothrow) size_t strspn(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
  
 
#line 261 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
extern __declspec(__nothrow) char *strstr(const char *  , const char *  ) __attribute__((__nonnull__(1,2))); 
 
    
 
 
 
 
 
  
 
extern __declspec(__nothrow) char *strtok(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(2))); 
extern __declspec(__nothrow) char *_strtok_r(char *  , const char *  , char **  ) __attribute__((__nonnull__(2,3))); 
 
extern __declspec(__nothrow) char *strtok_r(char *  , const char *  , char **  ) __attribute__((__nonnull__(2,3))); 
 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) void *memset(void *  , int  , size_t  ) __attribute__((__nonnull__(1))); 
    
 
 
 
  
extern __declspec(__nothrow) char *strerror(int  ); 
    
 
 
 
 
 
  
extern __declspec(__nothrow) size_t strlen(const char *  ) __attribute__((__nonnull__(1))); 
    
 
 
 
  
 
extern __declspec(__nothrow) size_t strlcpy(char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) size_t strlcat(char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2))); 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
extern __declspec(__nothrow) void _membitcpybl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitcpybb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitcpyhl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitcpyhb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitcpywl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitcpywb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitmovebl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitmovebb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitmovehl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitmovehb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitmovewl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
extern __declspec(__nothrow) void _membitmovewb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2))); 
     
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
 
 
 
 
 
 
#line 493 "C:\\Keil\\\\ARM\\RV31\\INC\\string.h" 
 
 
 
  
#line 14 "Retarget.c" 
#line 1 "C:\\Keil\\\\ARM\\RV31\\INC\\rt_misc.h" 
 
 
 
 
 
 
 
  
 
 
 
 
 
 
 
 
 
 
 
  
extern void _getenv_init(void); 
 
 
 
 
  
extern void _clock_init(void); 
 
 
 
 
 
  
 
extern void *__user_libspace(void); 
 
 
 
 
 
 
 
 
 
  
struct __argc_argv { 
    int argc; 
    char **argv; 
    int r2, r3; 
}; 
extern __value_in_regs struct __argc_argv 
__rt_lib_init(unsigned  , unsigned  ); 
 
 
 
 
 
 
 
 
 
  
__value_in_regs struct __argc_argv __ARM_get_argv(void * ); 
 
 
 
 
  
extern void __rt_lib_shutdown(void); 
 
 
 
 
 
 
  
extern void __rt_exit(int  );     
 
 
 
 
 
 
 
 
 
 
 
 
 
  
struct __initial_stackheap { 
    unsigned heap_base;                  
    unsigned stack_base;                 
    unsigned heap_limit;                 
    unsigned stack_limit;                
}; 
extern __value_in_regs struct __initial_stackheap 
__user_initial_stackheap(unsigned  , unsigned  , 
                         unsigned  , unsigned  ); 
 
 
 
 
  
struct __heap_extent { 
    unsigned base, range; 
}; 
extern __value_in_regs struct __heap_extent 
__user_heap_extent(unsigned  , unsigned  ); 
 
 
 
 
 
 
 
 
 
 
  
struct __stack_slop { 
    unsigned always, cleanup; 
}; 
extern __value_in_regs struct __stack_slop 
__user_stack_slop(unsigned  , unsigned  ); 
 
 
 
 
 
 
 
 
  
extern unsigned __user_heap_extend(int  , 
                                   void **  , 
                                   unsigned  ); 
 
 
 
 
 
 
  
int __raise(int  , int  ); 
 
 
 
 
 
 
  
int __default_signal_handler(int  , int  ); 
 
 
 
 
 
  
void __rt_raise(int  , int  ); 
 
 
 
 
 
#line 15 "Retarget.c" 
#line 1 "C:\\Keil\\\\ARM\\RV31\\INC\\rt_sys.h" 
 
 
 
 
 
 
 
  
 
 
 
 
 
 
 
 
 
 
 
  
typedef int FILEHANDLE; 
 
 
 
  
extern FILEHANDLE _sys_open(const char *  , int  ); 
 
 
 
  
 
 
 
 
 
 
 
 
 
 
  
extern const char __stdin_name[]; 
extern const char __stdout_name[]; 
extern const char __stderr_name[]; 
 
 
 
  
extern int _sys_close(FILEHANDLE  ); 
 
 
 
 
 
  
extern int _sys_write(FILEHANDLE  , const unsigned char *  , 
                      unsigned  , int  ); 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
extern int _sys_read(FILEHANDLE  , unsigned char *  , 
                     unsigned  , int  ); 
 
 
 
 
  
extern void _ttywrch(int  ); 
 
 
 
  
extern int _sys_istty(FILEHANDLE  ); 
 
 
 
 
  
extern int _sys_seek(FILEHANDLE  , long  ); 
 
 
 
 
 
  
extern int _sys_ensure(FILEHANDLE  ); 
 
 
 
 
 
 
 
  
extern long _sys_flen(FILEHANDLE  ); 
 
 
 
 
 
  
extern int _sys_tmpnam(char *  , int  , unsigned  ); 
 
 
 
 
  
extern void _sys_exit(int  );     
 
 
 
 
 
  
extern char *_sys_command_string(char *  , int  ); 
 
 
 
 
 
#line 16 "Retarget.c" 
#line 1 "C:\\Keil\\\\ARM\\RV31\\INC\\File_Config.h" 
 
 
 
 
 
 
 
 
 
  
 
 
 
 
#line 1 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
 
 
 
 
 
 
 
 
  
 
 
 
 
  
 
  
 
 
#line 27 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
 
 
 
 
 
 
 typedef unsigned int   size_t; 
 
 
typedef signed char     S8; 
typedef unsigned char   U8; 
typedef short           S16; 
typedef unsigned short  U16; 
typedef int             S32; 
typedef unsigned int    U32; 
typedef long long       S64; 
typedef unsigned long long U64; 
typedef unsigned char   BIT; 
typedef unsigned int    BOOL; 
 
#line 54 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
 
 
  
 
 
 
 
 
  
typedef U32 OS_SEM[2]; 
 
  
 
typedef U32 OS_MBX[]; 
 
  
typedef U32 OS_MUT[3]; 
 
  
typedef U32 OS_TID; 
 
  
typedef void *OS_ID; 
 
  
typedef U32 OS_RESULT; 
 
  
 
 
 
 
 
 
 
 
 
 
 
 
#line 176 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
 
 
  
 
 
 
  
extern void      os_set_env    (void); 
extern void      rt_sys_init   (void (*task)(void), U8 priority, void *stk); 
extern void      rt_tsk_pass   (void); 
extern OS_TID    rt_tsk_self   (void); 
extern OS_RESULT rt_tsk_prio   (OS_TID task_id, U8 new_prio); 
extern OS_TID    rt_tsk_create (void (*task)(void), U8 priority, void *stk, void *argv); 
extern OS_RESULT rt_tsk_delete (OS_TID task_id); 
 
#line 211 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
extern void      _os_sys_init(U32 p, void (*task)(void), U32 prio_stksz, 
                                     void *stk)                        __svc_indirect(0); 
extern OS_TID    _os_tsk_create (U32 p, void (*task)(void), U32 prio_stksz, 
                                        void *stk, void *argv)         __svc_indirect(0); 
extern OS_TID    _os_tsk_create_ex (U32 p, void (*task)(void *), U32 prio_stksz, 
                                           void *stk, void *argv)      __svc_indirect(0); 
extern OS_TID    _os_tsk_self (U32 p)                                  __svc_indirect(0); 
extern void      _os_tsk_pass (U32 p)                                  __svc_indirect(0); 
extern OS_RESULT _os_tsk_prio (U32 p, OS_TID task_id, U8 new_prio)     __svc_indirect(0); 
extern OS_RESULT _os_tsk_delete (U32 p, OS_TID task_id)                __svc_indirect(0); 
 
  
extern OS_RESULT rt_evt_wait (U16 wait_flags,  U16 timeout, BOOL and_wait); 
extern void      rt_evt_set  (U16 event_flags, OS_TID task_id); 
extern void      rt_evt_clr  (U16 clear_flags, OS_TID task_id); 
extern U16       rt_evt_get  (void); 
 
 
 
 
 
 
 
extern OS_RESULT _os_evt_wait(U32 p, U16 wait_flags, U16 timeout, 
                                     BOOL and_wait)                    __svc_indirect(0); 
extern void      _os_evt_set (U32 p, U16 event_flags, OS_TID task_id)  __svc_indirect(0); 
extern void      _os_evt_clr (U32 p, U16 clear_flags, OS_TID task_id)  __svc_indirect(0); 
extern U16       _os_evt_get (U32 p)                                   __svc_indirect(0); 
extern void      isr_evt_set (U16 event_flags, OS_TID task_id); 
 
  
extern void      rt_sem_init (OS_ID semaphore, U16 token_count); 
extern OS_RESULT rt_sem_send (OS_ID semaphore); 
extern OS_RESULT rt_sem_wait (OS_ID semaphore, U16 timeout); 
 
 
 
 
 
extern void      _os_sem_init (U32 p, OS_ID semaphore,  
                                      U16 token_count)                 __svc_indirect(0); 
extern OS_RESULT _os_sem_send (U32 p, OS_ID semaphore)                 __svc_indirect(0); 
extern OS_RESULT _os_sem_wait (U32 p, OS_ID semaphore, U16 timeout)    __svc_indirect(0); 
extern void      isr_sem_send (OS_ID semaphore); 
 
  
extern void      rt_mbx_init  (OS_ID mailbox, U16 mbx_size); 
extern OS_RESULT rt_mbx_send  (OS_ID mailbox, void *p_msg,    U16 timeout); 
extern OS_RESULT rt_mbx_wait  (OS_ID mailbox, void **message, U16 timeout); 
extern OS_RESULT rt_mbx_check (OS_ID mailbox); 
 
 
 
 
 
 
 
extern void      _os_mbx_init (U32 p, OS_ID mailbox, U16 mbx_size)     __svc_indirect(0); 
extern OS_RESULT _os_mbx_send (U32 p, OS_ID mailbox, void *message_ptr, 
                                      U16 timeout)                     __svc_indirect(0); 
extern OS_RESULT _os_mbx_wait (U32 p, OS_ID mailbox, void  **message, 
                                      U16 timeout)                     __svc_indirect(0); 
extern OS_RESULT _os_mbx_check (U32 p, OS_ID mailbox)                  __svc_indirect(0); 
extern void      isr_mbx_send (OS_ID mailbox, void *message_ptr); 
extern OS_RESULT isr_mbx_receive (OS_ID mailbox, void **message); 
 
  
extern void      rt_mut_init    (OS_ID mutex); 
extern OS_RESULT rt_mut_release (OS_ID mutex); 
extern OS_RESULT rt_mut_wait    (OS_ID mutex, U16 timeout); 
 
 
 
 
 
extern void      _os_mut_init (U32 p, OS_ID mutex)                     __svc_indirect(0); 
extern OS_RESULT _os_mut_release (U32 p, OS_ID mutex)                  __svc_indirect(0); 
extern OS_RESULT _os_mut_wait (U32 p, OS_ID mutex, U16 timeout)        __svc_indirect(0); 
 
  
extern void      rt_dly_wait (U16 delay_time); 
extern void      rt_itv_set  (U16 interval_time); 
extern void      rt_itv_wait (void); 
 
 
 
 
 
extern void      _os_dly_wait (U32 p, U16 delay_time)                  __svc_indirect(0); 
extern void      _os_itv_set (U32 p, U16 interval_time)                __svc_indirect(0); 
extern void      _os_itv_wait (U32 p)                                  __svc_indirect(0); 
 
  
extern OS_ID     rt_tmr_create (U16 tcnt, U16 info); 
extern OS_ID     rt_tmr_kill   (OS_ID timer); 
 
 
 
 
extern OS_ID     _os_tmr_create (U32 p, U16 tcnt, U16 info)            __svc_indirect(0); 
extern OS_ID     _os_tmr_kill (U32 p, OS_ID timer)                     __svc_indirect(0); 
 
  
extern void      rt_tsk_lock   (void); 
extern void      rt_tsk_unlock (void); 
 
 
 
 
extern void      _os_tsk_lock (U32 p)                                  __svc_indirect(0); 
extern void      _os_tsk_unlock (U32 p)                                __svc_indirect(0); 
 
  
extern int       _init_box (void *box_mem, U32 box_size, U32 blk_size); 
extern void     *_alloc_box (void *box_mem); 
extern void     *_calloc_box (void *box_mem); 
extern int       _free_box (void *box_mem, void *box); 
 
 
 
 
 
 
 
 
 
 
  
 
typedef struct {                          
   U8  hr;                                
   U8  min;                               
   U8  sec;                               
   U8  day;                               
   U8  mon;                               
   U16 year;                              
} RL_TIME; 
 
typedef struct {                          
   S8  name[256];                         
   U32 size;                              
   U16 fileID;                            
   U8  attrib;                            
   RL_TIME time;                          
} FINFO; 
 
extern int finit (void); 
extern int fdelete (const char *filename); 
extern int frename (const char *oldname, const char *newname); 
extern int ffind (const char *pattern, FINFO *info); 
extern U32 ffree (const char *drive); 
extern int fformat (const char *drive); 
extern int fanalyse (const char *drive); 
extern int fcheck (const char *drive); 
extern int fdefrag (const char *drive); 
 
  
 
 
 
 
  
 
  
 
 
 
  
 
 
 
 
  
#line 391 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
  
#line 404 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
  
 
 
 
 
 
  
#line 418 "C:\\Keil\\\\ARM\\RV31\\INC\\RTL.h" 
 
  
 
 
 
 
  
 
 
 
extern void init_TcpNet (void); 
extern void main_TcpNet (void); 
extern void timer_tick (void); 
extern U8   udp_get_socket (U8 tos, U8 opt,  
                            U16 (*listener)(U8 socket, U8 *remip, U16 port, U8 *buf, U16 len)); 
extern BOOL udp_release_socket (U8 socket); 
extern BOOL udp_open (U8 socket, U16 locport); 
extern BOOL udp_close (U8 socket); 
extern BOOL udp_mcast_ttl (U8 socket, U8 ttl); 
extern U8  *udp_get_buf (U16 size); 
extern BOOL udp_send (U8 socket, U8 *remip, U16 remport, 
                      U8 *buf,   U16 dlen); 
extern U8   tcp_get_socket (U8 type, U8 tos, U16 tout, 
                            U16 (*listener)(U8 socket, U8 event, U8 *buf, U16 len)); 
extern BOOL tcp_release_socket (U8 socket); 
extern BOOL tcp_listen (U8 socket, U16 locport); 
extern BOOL tcp_connect (U8 socket, U8 *remip, U16 remport, U16 locport); 
extern U8  *tcp_get_buf (U16 size); 
extern U16  tcp_max_dsize (U8 socket); 
extern BOOL tcp_check_send (U8 socket); 
extern U8   tcp_get_state (U8 socket); 
extern BOOL tcp_send (U8 socket, U8 *buf, U16 dlen); 
extern BOOL tcp_close (U8 socket); 
extern BOOL tcp_abort (U8 socket); 
extern void tcp_reset_window (U8 socket); 
extern BOOL arp_cache_ip (U8 *ipadr, U8 type); 
extern void ppp_listen (char const *user, char const *passw); 
extern void ppp_connect (char const *dialnum, char const *user, char const *passw); 
extern void ppp_close (void); 
extern BOOL ppp_is_up (void); 
extern void slip_listen (void); 
extern void slip_connect (char const *dialnum); 
extern void slip_close (void); 
extern BOOL slip_is_up (void); 
extern U8   get_host_by_name (U8 *hostn, void (*cbfunc)(U8 event, U8 *host_ip)); 
extern BOOL smtp_connect (U8 *ipadr, U16 port, void (*cbfunc)(U8 event)); 
extern void dhcp_disable (void); 
extern BOOL igmp_join (U8 *group_ip); 
extern BOOL igmp_leave (U8 *group_ip); 
 
 
 
 
 
 
  
   
 
  
#line 16 "C:\\Keil\\\\ARM\\RV31\\INC\\File_Config.h" 
 
  
 
 
 
 
 
 
  
 
 
 
  
 
 
  
typedef struct DevConf { 
   U32 bStart; 
   U32 bEnd; 
} DEVCONF; 
 
  
typedef struct iob { 
   U16   fileID;                          
   U16   flags;                           
   U8    drive;                           
   U8    attrib;                          
   U16   NumSect;                         
   U32   InitVal;                         
   void *DevCfg;                          
   U16   _fblock;                         
   U16   _fidx;                           
   U32   _fbot;                           
   U32   _ftop;                           
   U32   _firstClus;                      
   U32   _lastEntClus;                    
   U8    _currDatSect;                    
   U32   _currDatClus;                    
   U32   fsize;                           
   U32   fpos;                            
} IOB; 
 
  
 
  
#line 69 "C:\\Keil\\\\ARM\\RV31\\INC\\File_Config.h" 
 
  
 
 
 
 
  
typedef struct falloc { 
   U32 end; 
   U16 fileID; 
   U16 index; 
} FALLOC; 
 
  
typedef struct fdbuf { 
   U16 index; 
   U16 fblock; 
   U32 fbot; 
   U32 ftop; 
} FDBUF; 
 
  
typedef struct fatinfo { 
   U32 BootRecSec;                        
   U8  FatType;                           
   U8  NumOfFat;                          
   U8  SecPerClus;                        
   U16 FatSize;                           
   U16 RsvdSecCnt;                        
   U32 DskSize;                           
   U32 DataSecCnt;                        
   U16 RootEntCnt;                        
   U16 BytesPerSec;                       
   U32 DataClusCnt;                       
   U16 RootDirAddr;                       
   U16 RootSecCnt;                        
   U32 ClusSize;                          
   U16 EntsPerClus;                       
                                          
   U16 FAT32_ExtFlags;                    
   U32 FAT32_RootClus;                    
   U16 FAT32_FSInfo;                      
   U16 FAT32_BkBootSec;                   
} FATINFO; 
 
  
typedef struct filerec { 
   U8  FileName[11];                      
   U8  Attr;                              
   U8  NTRsvd;                            
   U8  CrtTimeTenth;                      
   U16 CrtTime;                           
   U16 CrtDate;                           
   U16 LastAccDate;                       
   U16 FirstClusHI;                       
   U16 WriteTime;                         
   U16 WriteDate;                         
   U16 FirstClusLO;                       
   U32 FileSize;                          
} FILEREC; 
 
  
typedef struct lfn_filerec { 
   U8  Ordinal;                           
   U8  Unichar0[10];                      
   U8  Attr;                              
   U8  Rsvd;                              
   U8  Checksum;                          
   U8  Unichar1[12];                      
   U16 FirstClusLO;                       
   U8  Unichar2[4];                       
} LFN_FILEREC; 
 
 
 
  
typedef struct devpar { 
   U8  FatType;                           
   U8  SecClus;                           
   U8  SecClus32;                         
   U16 NumHeads;                          
   U8  NumSect;                           
   U16 NumCyl;                            
   U16 BootRecSec;                        
} DEVPAR; 
 
  
#line 164 "C:\\Keil\\\\ARM\\RV31\\INC\\File_Config.h" 
 
  
 
 
  
 
 
 
 
 
  
 
 
 
 
 
 
  
typedef struct fcache { 
   U32 sect; 
   U8  *buf; 
   BIT dirty; 
} FCACHE; 
 
  
typedef struct dcache { 
   U32 sect; 
   U32 csect; 
   U8  *buf; 
   U8  *cbuf; 
   U8  nwr; 
   U8  nrd; 
} DCACHE; 
 
  
typedef struct mmcfg { 
   U32 sernum; 
   U32 blocknr; 
   U16 read_blen; 
   U16 write_blen; 
} MMCFG; 
 
  
extern struct iob _iob[]; 
extern U32    mc_cache[]; 
 
  
extern struct DevConf const FlashDev []; 
extern struct DevConf const SpiDev[]; 
extern struct DevConf const RamDev []; 
extern U16 const _FlashNumSect; 
extern U16 const _SpiNumSect; 
extern U16 const _RamNumSect; 
extern U32 const _BlockFREE; 
extern U32 const _SpiBlFREE; 
extern U16 const _NFILE; 
extern U16 const _DEF_DRIVE; 
extern U16 const _MC_CSIZE; 
 
  
extern int  _fdelete (IOB *fcb); 
extern int  _fcreate (const char *fname, IOB *fcb); 
extern int  _frename (const char *filename, IOB *fcb); 
extern BOOL _ffind (FINFO *info, IOB *fcb); 
 
  
extern int  __fopen (const char *fname, int openmode); 
extern int  __fclose (int handle); 
extern int  __write (int handle, const U8 *buf, U32 len); 
extern int  __flushbuf (int handle); 
extern int  __read (int handle, U8 *buf, U32 len); 
extern int  __setfpos (int handle, U32 pos); 
extern U32  __getfsize (IOB *fcb, BOOL set_fidx); 
 
 
  
extern U16  fs_get_freeID (U32 maxID, IOB *fcb); 
extern U32  fs_get_freeMem (U32 block, IOB *fcb); 
extern BOOL fs_check_fwopen (U32 block, IOB *fcb); 
extern void fs_mark_freeMem (IOB *fcb); 
extern BOOL fs_mark_fileMem (IOB *fcb); 
extern U32  fs_Find_File (const char *name, IOB *fcb); 
extern BOOL fs_BlockFull (IOB *fcb); 
extern BOOL fs_AllocBlock (IOB *fcb); 
extern BOOL fs_BlockInvalid (U32 block, IOB *fcb); 
extern BOOL fs_InitBlock (U32 block, IOB *fcb); 
extern BOOL fs_WriteBlock (U32 adr, void *buf, U32 cnt, IOB *fcb); 
extern BOOL fs_ReadBlock (U32 adr, void *buf, U32 cnt, IOB *fcb); 
extern U32  fs_adr_sig (U32 bl, IOB *fcb); 
extern U32  fs_rd_alloc (U32 adr, FALLOC *fa); 
extern U32  fs_rd_sig (U32 adr, U32 *sig); 
 
  
extern BOOL fn_cmp (const char *sp, const char *fp); 
extern int  fs_strpos (const char *sp, const char ch); 
extern int  fs_get_drive (const char *fn); 
extern int  fs_find_iob (void); 
extern BOOL fs_set_params (IOB *fcb); 
extern int  fs_ReadData (U32 adr, U32 cnt, U8 *buf); 
extern int  fs_WriteData (U32 adr, U32 cnt, U8 *buf); 
 
  
extern int  fs_Init (U32 adr, U32 clk); 
extern int  fs_EraseSector (U32 adr); 
extern int  fs_ProgramPage (U32 adr, U32 sz, U8 *buf); 
 
  
extern int  fs_spi_Init (void); 
extern int  fs_spi_EraseSector (U32 adr); 
extern int  fs_spi_ProgramPage (U32 adr, U32 sz, U8 *buf); 
extern int  fs_spi_ReadData (U32 adr, U32 sz, U8 *buf); 
 
  
extern int  fat_init (void); 
extern BOOL fat_find_file (const char *fn, IOB *fcb); 
extern BOOL fat_set_fpos (IOB *fcb, U32 pos); 
extern U32  fat_read (IOB *fcb, U8 *buf, U32 len); 
extern BOOL fat_write (IOB *fcb, const U8 *buf, U32 len); 
extern U32  fat_free (void); 
extern BOOL fat_delete (const char *fn, IOB *fcb); 
extern BOOL fat_close_write (IOB *fcb); 
extern BOOL fat_rename (const char *old, const char *new, IOB *fcb); 
extern BOOL fat_create (const char *fn, IOB *fcb); 
extern BOOL fat_format (const char *label); 
extern BOOL fat_ffind  (const char *fn, FINFO *info, IOB *fcb); 
 
  
extern BOOL mmc_init (void); 
extern BOOL mmc_write_sect (U32 sect, U8 *buf, U32 cnt); 
extern BOOL mmc_read_sect (U32 sect, U8 *buf, U32 cnt); 
extern BOOL mmc_read_config (MMCFG *cfg); 
 
  
extern U32  fs_get_time (void); 
extern U32  fs_get_date (void); 
 
  
extern void spi_init (void); 
extern U8   spi_send (U8 outb); 
extern void spi_ss (U32 ss); 
extern void spi_hi_speed (BOOL on); 
extern void spi_command (U8 *cmd, U8 *tbuf, U8 *rbuf, U32 sz); 
 
  
#line 315 "C:\\Keil\\\\ARM\\RV31\\INC\\File_Config.h" 
 
  
__weak void _mutex_acquire (int *mutex); 
__weak void _mutex_release (int *mutex); 
__weak int  _stream_list_lock; 
#line 17 "Retarget.c" 
#line 1 "Serial.h" 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
 
 
 
extern void SER_init      (int uart); 
extern int  SER_getChar   (int uart); 
extern int  SER_getChar_nb(int uart); 
extern int  SER_putChar   (int uart, int c); 
extern void SER_putString (int uart, unsigned char *s); 
 
#line 18 "Retarget.c" 
 
#pragma import(__use_no_semihosting_swi) 
 
 
 
 
 
  
 
  
 
 
 
 
  
const char __stdin_name[]  = "STDIN"; 
const char __stdout_name[] = "STDOUT"; 
const char __stderr_name[] = "STDERR"; 
 
struct __FILE { int handle;   }; 
 
 
 
 
  
int sendchar (int c) { 
 
  if (c == '\n')  { 
    SER_putChar (1, 0x0D); 
  } 
  SER_putChar (1, c); 
 
  return (c); 
} 
 
 
 
 
  
int getkey (void) { 
 
  return (SER_getChar(1)); 
} 
 
 
  
 
void _ttywrch (int ch) { 
 
   sendchar(ch); 
 
} 
 
  
 
FILEHANDLE _sys_open (const char *name, int openmode) { 
     
   if (strcmp(name, "STDIN") == 0) { 
      return (0x8001); 
   } 
   if (strcmp(name, "STDOUT") == 0) { 
      return (0x8002); 
   } 
   if (strcmp(name, "STDERR") == 0) { 
      return (0x8003); 
   } 
   return (__fopen (name, openmode)); 
} 
 
  
 
int _sys_close (FILEHANDLE fh) { 
   if (fh > 0x8000) { 
      return (0); 
   } 
   return (__fclose (fh)); 
} 
 
  
 
int _sys_write (FILEHANDLE fh, const U8 *buf, U32 len, int mode) { 
 
   if (fh == 0x8002) { 
        
      for (  ; len; len--) { 
         sendchar (*buf++); 
      } 
      return (0); 
   } 
 
   if (fh > 0x8000) { 
      return (-1); 
   } 
   return (__write (fh, buf, len)); 
} 
 
  
 
int _sys_read (FILEHANDLE fh, U8 *buf, U32 len, int mode) { 
 
   if (fh == 0x8001) { 
        
      for (  ; len; len--) { 
         *buf++ = getkey (); 
      } 
      return (0); 
   } 
 
   if (fh > 0x8000) { 
      return (-1); 
   } 
   return (__read (fh, buf, len)); 
} 
 
  
 
int _sys_istty (FILEHANDLE fh) { 
   if (fh > 0x8000) { 
      return (1); 
   } 
   return (0); 
} 
 
  
 
int _sys_seek (FILEHANDLE fh, long pos) { 
   if (fh > 0x8000) { 
      return (-1); 
   } 
   return (__setfpos (fh, pos)); 
} 
 
  
 
int _sys_ensure (FILEHANDLE fh) { 
   if (fh > 0x8000) { 
      return (-1); 
   } 
   return (__flushbuf (fh)); 
} 
 
  
 
long _sys_flen (FILEHANDLE fh) { 
   if (fh > 0x8000) { 
      return (0); 
   } 
   return (__getfsize(&_iob[fh],0)); 
} 
 
  
 
int _sys_tmpnam (char *name, int sig, unsigned maxlen) { 
   return (1); 
} 
 
  
 
char *_sys_command_string (char *cmd, int len) { 
   return (cmd); 
} 
 
  
 
void _sys_exit (int return_code) { 
     
   while (1); 
}