From 582ace5597d3bdefcd06b8b4ab673f48c81b969c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 22 Feb 2010 16:29:48 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1660 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/templates/chcore.h | 4 +--- os/ports/GCC/PPC/SPC56x/vectors.s | 2 +- os/ports/GCC/PPC/chcore.h | 35 +++++++++++++++++++++++++++-------- os/various/shell.c | 21 +++++++++++++++++---- 4 files changed, 46 insertions(+), 16 deletions(-) (limited to 'os') diff --git a/os/kernel/templates/chcore.h b/os/kernel/templates/chcore.h index 0e78dbcf5..e3fa8f0b9 100644 --- a/os/kernel/templates/chcore.h +++ b/os/kernel/templates/chcore.h @@ -46,9 +46,7 @@ #define CH_ARCHITECTURE_VARIANT_NAME "" /** - * @brief Base type for stack alignment. - * @details This type is used only for stack alignment reasons thus can be - * anything from a char to a double. + * @brief Base type for stack and memory alignment. */ typedef uint8_t stkalign_t; diff --git a/os/ports/GCC/PPC/SPC56x/vectors.s b/os/ports/GCC/PPC/SPC56x/vectors.s index 4b7e68ffe..3c8aed6a6 100644 --- a/os/ports/GCC/PPC/SPC56x/vectors.s +++ b/os/ports/GCC/PPC/SPC56x/vectors.s @@ -40,7 +40,7 @@ * override the weak symbol declared here. */ .section .vectors - .align 2 + .align 4 .globl _vectors _vectors: .long vector0 diff --git a/os/ports/GCC/PPC/chcore.h b/os/ports/GCC/PPC/chcore.h index 1351531f5..477b51f59 100644 --- a/os/ports/GCC/PPC/chcore.h +++ b/os/ports/GCC/PPC/chcore.h @@ -39,27 +39,46 @@ #define ENABLE_WFI_IDLE 0 #endif +/* Core variants identifiers.*/ +#define PPC_VARIANT_e200z3 3 /**< e200z3 core identifier. */ +#define PPC_VARIANT_e200z4 4 /**< e200z4 core identifier. */ + +/** + * @brief Core variant selector. + * @details This setting affects the predefined architecture strings and + * possibly code paths and structures into the port layer. + */ +#if !defined(PPC_VARIANT) || defined(__DOXYGEN__) +#define PPC_VARIANT PPC_VARIANT_e200z3 +#endif + /** * @brief Unique macro for the implemented architecture. */ -#define CH_ARCHITECTURE_PPCE200Z +#define CH_ARCHITECTURE_PPC /** * @brief Name of the implemented architecture. */ -#define CH_ARCHITECTURE_NAME "PowerPC" +#define CH_ARCHITECTURE_NAME "PowerPC" /** - * @brief Name of the architecture variant (optional). + * @brief Name of the architecture variant. */ -#define CH_CORE_VARIANT_NAME "e200zX" +#if (PPC_VARIANT == PPC_VARIANT_e200z3) || defined(__DOXYGEN__) +#define CH_CORE_VARIANT_NAME "e200z3" +#elif PPC_VARIANT == PPC_VARIANT_e200z4 +#define CH_CORE_VARIANT_NAME "e200z4" +#else +#error "unknown PowerPC variant specified" +#endif /** - * @brief Base type for stack alignment. - * @details This type is used only for stack alignment reasons thus can be - * anything from a char to a double. + * @brief Base type for stack and memory alignment. */ -typedef uint64_t stkalign_t; +typedef struct { + uint8_t a[8]; +} stkalign_t __attribute__((aligned(8))); /** * @brief Generic PPC register. diff --git a/os/various/shell.c b/os/various/shell.c index 41c78b1d8..8a0fd4d45 100644 --- a/os/various/shell.c +++ b/os/various/shell.c @@ -28,6 +28,7 @@ #include #include "ch.h" +#include "hal.h" #include "shell.h" #if SHELL_USE_IPRINTF @@ -84,13 +85,25 @@ static void cmd_info(BaseChannel *chp, int argc, char *argv[]) { return; } - shellPrint(chp, "Kernel version "); + shellPrint(chp, "Kernel version: "); shellPrintLine(chp, CH_KERNEL_VERSION); - shellPrint(chp, "Architecture "); - shellPrintLine(chp, CH_ARCHITECTURE_NAME); #ifdef __GNUC__ - shellPrint(chp, "GCC Version "); + shellPrint(chp, "GCC Version: "); shellPrintLine(chp, __VERSION__); +#endif + shellPrint(chp, "Architecture: "); + shellPrintLine(chp, CH_ARCHITECTURE_NAME); +#ifdef CH_CORE_VARIANT_NAME + shellPrint(chp, "Core Variant: "); + shellPrintLine(chp, CH_CORE_VARIANT_NAME); +#endif +#ifdef PLATFORM_NAME + shellPrint(chp, "Platform: "); + shellPrintLine(chp, PLATFORM_NAME); +#endif +#ifdef BOARD_NAME + shellPrint(chp, "Board: "); + shellPrintLine(chp, BOARD_NAME); #endif } -- cgit v1.2.3