mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-11 16:40:17 +00:00
Make tests work on public repo as well
PUBLISHED_FROM=78acb18d597b6f47f31da13087fa6685f21ce445
This commit is contained in:
1 parent
3eb4eb8074
commit
7bf5144e62
145 files changed
+30660
-16
No files matched your search
@@ -0,0 +1,92 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* GCC Linker script for CC3200. Based on TI's example "blinky.ld".
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ORG = DEFINED(ORG) ? ORG : 0x20004000;
|
||||
RAM_SIZE = DEFINED(RAM_SIZE) ? RAM_SIZE : 0x3C000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* SRAM size of 240KB for cc3200 ES 1.33 device onward */
|
||||
SRAM (rwx) : ORIGIN = ORG, LENGTH = RAM_SIZE
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
_text = .;
|
||||
KEEP(*(.intvecs))
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
. = ALIGN(8);
|
||||
_etext = .;
|
||||
} > SRAM
|
||||
|
||||
.ARM : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} > SRAM
|
||||
|
||||
__init_data = .;
|
||||
|
||||
.data : AT(__init_data)
|
||||
{
|
||||
_data = .;
|
||||
*(.data*)
|
||||
. = ALIGN (8);
|
||||
_edata = .;
|
||||
} > SRAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
_bss = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
_ebss = .;
|
||||
} > SRAM
|
||||
|
||||
.heap :
|
||||
{
|
||||
_heap = .;
|
||||
. = . + (LENGTH(SRAM) - SIZEOF(.text) - SIZEOF(.ARM) - SIZEOF(.data) - SIZEOF(.bss));
|
||||
. = ALIGN(8);
|
||||
_eheap = .;
|
||||
|
||||
} > SRAM
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#if CS_PLATFORM == CS_P_CC3200
|
||||
|
||||
#include "common/mg_mem.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef __TI_COMPILER_VERSION__
|
||||
#include <reent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <inc/hw_types.h>
|
||||
#include <inc/hw_memmap.h>
|
||||
#include <driverlib/prcm.h>
|
||||
#include <driverlib/rom.h>
|
||||
#include <driverlib/rom_map.h>
|
||||
#include <driverlib/uart.h>
|
||||
#include <driverlib/utils.h>
|
||||
|
||||
#define CONSOLE_UART UARTA0_BASE
|
||||
|
||||
#ifdef __TI_COMPILER_VERSION__
|
||||
int asprintf(char **strp, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
int len;
|
||||
|
||||
*strp = MG_MALLOC(BUFSIZ);
|
||||
if (*strp == NULL) return -1;
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(*strp, BUFSIZ, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (len > 0) {
|
||||
*strp = MG_REALLOC(*strp, len + 1);
|
||||
if (*strp == NULL) return -1;
|
||||
}
|
||||
|
||||
if (len >= BUFSIZ) {
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(*strp, len + 1, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
#if MG_TI_NO_HOST_INTERFACE
|
||||
time_t HOSTtime() {
|
||||
struct timeval tp;
|
||||
gettimeofday(&tp, NULL);
|
||||
return tp.tv_sec;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TI_COMPILER_VERSION__ */
|
||||
|
||||
void fprint_str(FILE *fp, const char *str) {
|
||||
while (*str != '\0') {
|
||||
if (*str == '\n') MAP_UARTCharPut(CONSOLE_UART, '\r');
|
||||
MAP_UARTCharPut(CONSOLE_UART, *str++);
|
||||
}
|
||||
}
|
||||
|
||||
void _exit(int status) {
|
||||
fprint_str(stderr, "_exit\n");
|
||||
/* cause an unaligned access exception, that will drop you into gdb */
|
||||
*(int *) 1 = status;
|
||||
while (1)
|
||||
; /* avoid gcc warning because stdlib abort() has noreturn attribute */
|
||||
}
|
||||
|
||||
void _not_implemented(const char *what) {
|
||||
fprint_str(stderr, what);
|
||||
fprint_str(stderr, " is not implemented\n");
|
||||
_exit(42);
|
||||
}
|
||||
|
||||
int _kill(int pid, int sig) {
|
||||
(void) pid;
|
||||
(void) sig;
|
||||
_not_implemented("_kill");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _getpid() {
|
||||
fprint_str(stderr, "_getpid is not implemented\n");
|
||||
return 42;
|
||||
}
|
||||
|
||||
int _isatty(int fd) {
|
||||
/* 0, 1 and 2 are TTYs. */
|
||||
return fd < 2;
|
||||
}
|
||||
|
||||
#endif /* CS_PLATFORM == CS_P_CC3200 */
|
||||
@@ -0,0 +1,82 @@
|
||||
//*****************************************************************************
|
||||
// cc3200v1p32.cmd
|
||||
//
|
||||
// CCS linker configuration file for cc3200 ES 1.32.
|
||||
//
|
||||
// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// Neither the name of Texas Instruments Incorporated nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
--retain=g_pfnVectors
|
||||
|
||||
//*****************************************************************************
|
||||
// The following command line options are set as part of the CCS project.
|
||||
// If you are building using the command line, or for some reason want to
|
||||
// define them here, you can uncomment and modify these lines as needed.
|
||||
// If you are using CCS for building, it is probably better to make any such
|
||||
// modifications in your CCS project and leave this file alone.
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// The starting address of the application. Normally the interrupt vectors
|
||||
// must be located at the beginning of the application.
|
||||
//*****************************************************************************
|
||||
#define RAM_BASE 0x20004000
|
||||
|
||||
/* System memory map */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* Application uses internal RAM for program and data */
|
||||
SRAM_CODE (RWX) : origin = 0x20004000, length = 0x2F000
|
||||
SRAM_DATA (RWX) : origin = 0x20033000, length = 0xD000
|
||||
}
|
||||
|
||||
/* Section allocation in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs: > RAM_BASE
|
||||
.init_array : > SRAM_CODE
|
||||
.vtable : > SRAM_CODE
|
||||
.text : > SRAM_CODE
|
||||
.const : > SRAM_CODE
|
||||
.cinit : > SRAM_CODE
|
||||
.pinit : > SRAM_CODE
|
||||
.data : > SRAM_DATA
|
||||
.bss : > SRAM_DATA
|
||||
.sysmem : > SRAM_DATA
|
||||
.stack : > SRAM_DATA(HIGH)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
APP_LDFLAGS ?=
|
||||
CC_WRAPPER ?=
|
||||
GENFILES_LIST ?=
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
AR = arm-none-eabi-ar
|
||||
NM = arm-none-eabi-nm
|
||||
|
||||
IPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
|
||||
VPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
|
||||
|
||||
C_CXX_FLAGS = -mthumb -mcpu=cortex-m4 -ffunction-sections -fdata-sections \
|
||||
-MD -Os -ggdb -Wall -Werror -Dgcc
|
||||
CFLAGS += -std=c99 $(C_CXX_FLAGS)
|
||||
CXXFLAGS += -std=g++11 $(C_CXX_FLAGS)
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
LD = arm-none-eabi-ld
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
LIBGCC := ${shell ${CC} -mthumb ${CFLAGS} -print-libgcc-file-name}
|
||||
LIBC := ${shell ${CC} ${CFLAGS} -print-file-name=libc.a}
|
||||
LIBM := ${shell ${CC} ${CFLAGS} -print-file-name=libm.a}
|
||||
|
||||
# Disable certain warnings on SDK sources, we have no control over them anyway.
|
||||
# We also force-include platform.h which resolves some symbol conflicts
|
||||
# between system includes and simplelink.h
|
||||
$(SDK_OBJS): CFLAGS += -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable -Wno-builtin-macro-redefined
|
||||
$(SDK_OBJS): CFLAGS += -include common/platform.h
|
||||
|
||||
# cc flags,file
|
||||
define cc
|
||||
$(vecho) "GCC $2 -> $@"
|
||||
$(Q) $(CC_WRAPPER) $(CC) -c $1 -o $@ $2
|
||||
endef
|
||||
define cxx
|
||||
$(vecho) "G++ $2 -> $@"
|
||||
$(Q) $(CC_WRAPPER) $(CXX) -c $1 -o $@ $2
|
||||
endef
|
||||
|
||||
# ar files
|
||||
define ar
|
||||
$(vecho) "AR $@"
|
||||
$(Q) $(AR) cru $@ $1
|
||||
endef
|
||||
|
||||
# link script,flags,objs
|
||||
define link
|
||||
$(vecho) "LD $@"
|
||||
$(Q) $(CC_WRAPPER) $(LD) \
|
||||
--gc-sections -o $@ -T $1 $2 $3 \
|
||||
$(LIBM) $(LIBC) $(LIBGCC)
|
||||
endef
|
||||
@@ -0,0 +1,52 @@
|
||||
IPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/CCS/ARM_CM3
|
||||
VPATH += $(SDK_PATH)/third_party/FreeRTOS/source/portable/CCS/ARM_CM3
|
||||
|
||||
CC_WRAPPER ?=
|
||||
CC = $(TOOLCHAIN)/bin/armcl
|
||||
AR = $(TOOLCHAIN)/bin/armar
|
||||
NM = nm
|
||||
GENFILES_LIST ?=
|
||||
|
||||
C_CXX_FLAGS = -Dccs -I$(TOOLCHAIN)/include
|
||||
TI_C_CXX_FLAGS = -mv7M4 --little_endian --code_state=16 --float_support=vfplib --abi=eabi \
|
||||
-O4 --opt_for_speed=0 --unaligned_access=on --small_enum \
|
||||
--gen_func_subsections=on --diag_wrap=off --display_error_number \
|
||||
--emit_warnings_as_errors
|
||||
CFLAGS += --c99 $(TI_C_CXX_FLAGS) $(C_CXX_FLAGS)
|
||||
CXXFLAGS += $(TI_C_CXX_FLAGS) $(C_CXX_FLAGS)
|
||||
|
||||
# cc flags,file
|
||||
define cc
|
||||
$(vecho) "TICC $2 -> $@"
|
||||
$(Q) $(CC_WRAPPER) $(CC) -c --preproc_with_compile -ppd=$@.d $1 --output_file=$@ $2
|
||||
endef
|
||||
define cxx
|
||||
$(vecho) "TICXX $2 -> $@"
|
||||
$(Q) $(CC_WRAPPER) $(CC) -c --preproc_with_compile -ppd=$@.d $1 --output_file=$@ $2
|
||||
endef
|
||||
|
||||
# asm flags,file
|
||||
define asm
|
||||
$(vecho) "TIASM $2 -> $@"
|
||||
$(Q) $(CC_WRAPPER) $(CC) -c $1 --output_file=$@ $2
|
||||
endef
|
||||
|
||||
# ar files
|
||||
define ar
|
||||
$(vecho) "TIAR $@"
|
||||
$(Q) $(AR) qru $@ $1
|
||||
endef
|
||||
|
||||
# link script,flags,objs
|
||||
define link
|
||||
$(vecho) "TILD $@"
|
||||
$(Q) $(CC_WRAPPER) $(CC) \
|
||||
-mv7M4 --code_state=16 --float_support=vfplib --abi=eabi --little_endian \
|
||||
--run_linker \
|
||||
--generate_dead_funcs_list=$@.garbage.xml \
|
||||
-i $(TOOLCHAIN)/lib \
|
||||
--reread_libs --warn_sections --display_error_number \
|
||||
--unused_section_elimination=on \
|
||||
-o $@ --map_file=$@.map --xml_link_info=$@.map.xml \
|
||||
$2 $1 $3
|
||||
endef
|
||||
Reference in new issue
Block a user