diff options
author | Chris Johns <chrisj@rtems.org> | 2014-07-16 02:45:32 +0200 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-07-16 14:17:25 +1000 |
commit | 6832a5606a284c74b631a4c20f6e1c538a32fafe (patch) | |
tree | 5bfd18142c46b4029057d0853edd7445f145c07e /c/src/lib/libbsp/arm/shared | |
parent | Use Shared Method for Thread Unblock Cleanup (diff) | |
download | rtems-6832a5606a284c74b631a4c20f6e1c538a32fafe.tar.bz2 |
Common ARM A8 code.
Diffstat (limited to 'c/src/lib/libbsp/arm/shared')
-rw-r--r-- | c/src/lib/libbsp/arm/shared/include/arm-a8core-start.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/shared/include/arm-a8core-start.h b/c/src/lib/libbsp/arm/shared/include/arm-a8core-start.h new file mode 100644 index 0000000000..416f282028 --- /dev/null +++ b/c/src/lib/libbsp/arm/shared/include/arm-a8core-start.h @@ -0,0 +1,55 @@ +/** + * @file + * + * @ingroup arm_shared + * + * @brief A8CORE_START Support + */ + +/* + * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#ifndef LIBBSP_ARM_SHARED_ARM_A8CORE_START_H +#define LIBBSP_ARM_SHARED_ARM_A8CORE_START_H + +#include <libcpu/arm-cp15.h> + +#include <bsp.h> +#include <bsp/start.h> +#include <bsp/arm-errata.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +BSP_START_TEXT_SECTION static inline arm_a8core_start_set_vector_base(void) +{ + /* + * Do not use bsp_vector_table_begin == 0, since this will get optimized away. + */ + if (bsp_vector_table_end != bsp_vector_table_size) { + uint32_t ctrl; + + arm_cp15_set_vector_base_address(bsp_vector_table_begin); + + ctrl = arm_cp15_get_control(); + ctrl &= ~ARM_CP15_CTRL_V; + arm_cp15_set_control(ctrl); + } +} + +BSP_START_TEXT_SECTION static inline arm_a8core_start_hook_1(void) +{ + arm_a8core_start_set_vector_base(); +} + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBBSP_ARM_SHARED_ARM_A8CORE_START_H */ |