From 8a435729e19c176147b3a2223f17ebb34417e10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 6 Apr 2012 11:07:52 +0200 Subject: [PATCH] proof of concept with sh4-linux-gnu toolchain --- carlfw/include/config.h | 3 +++ carlfw/include/printf.h | 1 - extra/sh-elf-linux.cmake | 16 ++++++++-------- include/linux/types.h | 5 ++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/carlfw/include/config.h b/carlfw/include/config.h index e7c358d..14a1faf 100644 --- a/carlfw/include/config.h +++ b/carlfw/include/config.h @@ -61,4 +61,7 @@ static inline void __config_check(void) BUILD_BUG_ON(CARL9170_INTF_NUM >= AR9170_MAX_VIRTUAL_MAC); } +extern void *memset (void *__s, int __c, size_t __n); +extern void *memcpy (void *__dest, __const void *__src, size_t __n); + #endif /* __CARL9170FW_CONFIG_H */ diff --git a/carlfw/include/printf.h b/carlfw/include/printf.h index dd4559e..c0912d2 100644 --- a/carlfw/include/printf.h +++ b/carlfw/include/printf.h @@ -27,7 +27,6 @@ #define __CARL9170FW_PRINTF_H #include -#include #include "config.h" #include "carl9170.h" #include "uart.h" diff --git a/extra/sh-elf-linux.cmake b/extra/sh-elf-linux.cmake index 8be6d36..9691890 100644 --- a/extra/sh-elf-linux.cmake +++ b/extra/sh-elf-linux.cmake @@ -5,16 +5,16 @@ set_property(DIRECTORY PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/toolchain/inst/) -set(CMAKE_C_FLAGS "-m2 -ml -Os -ffreestanding -nostartfiles") +set(CMAKE_C_FLAGS "-ml -Os -ffreestanding -fleading-underscore -nostartfiles") set(CMAKE_C_LINK_FLAGS "-static -EL -x --gc-sections") -set(OBJCOPY ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-objcopy) -set(CMAKE_C_COMPILER "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-gcc") -set(CMAKE_AR ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ar) -set(CMAKE_ASM_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as) -set(CMAKE_ASM-ATT_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as) -set(CMAKE_LINKER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld) -set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld -o ") +set(OBJCOPY sh4-linux-gnu-objcopy) +set(CMAKE_C_COMPILER sh4-linux-gnu-gcc) +set(CMAKE_AR sh4-linux-gnu-ar) +set(CMAKE_ASM_COMPILER sh4-linux-gnu-as) +set(CMAKE_ASM-ATT_COMPILER sh4-linux-gnu-as) +set(CMAKE_LINKER sh4-linux-gnu-ld) +set(CMAKE_C_LINK_EXECUTABLE "sh4-linux-gnu-ld -o ") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/include/linux/types.h b/include/linux/types.h index 3f45f0f..5f13ec2 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -19,11 +19,10 @@ #include #include -#include -#include +#include #if BYTE_ORDER == BIG_ENDIAN -#error "big endian is not supported by target" +//#error "big endian is not supported by target" #endif typedef uint16_t __le16; -- 1.7.7.6