forked from Imagelibrary/rtems
2011-11-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/utility.h: Fixed some casts. * include/irq-generic.h: Define bsp_interrupt_handler_index_type conditionally.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2011-11-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* include/utility.h: Fixed some casts.
|
||||||
|
* include/irq-generic.h: Define bsp_interrupt_handler_index_type
|
||||||
|
conditionally.
|
||||||
|
|
||||||
2011-11-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
2011-11-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
* console_private.h: Removed Console_Port_Minor declaration.
|
* console_private.h: Removed Console_Port_Minor declaration.
|
||||||
|
|||||||
@@ -65,6 +65,13 @@ typedef struct bsp_interrupt_handler_entry bsp_interrupt_handler_entry;
|
|||||||
extern bsp_interrupt_handler_entry bsp_interrupt_handler_table [];
|
extern bsp_interrupt_handler_entry bsp_interrupt_handler_table [];
|
||||||
|
|
||||||
#ifdef BSP_INTERRUPT_USE_INDEX_TABLE
|
#ifdef BSP_INTERRUPT_USE_INDEX_TABLE
|
||||||
|
#if BSP_INTERRUPT_HANDLER_TABLE_SIZE < 0x100
|
||||||
|
typedef uint8_t bsp_interrupt_handler_index_type;
|
||||||
|
#elif BSP_INTERRUPT_HANDLER_TABLE_SIZE < 0x10000
|
||||||
|
typedef uint16_t bsp_interrupt_handler_index_type;
|
||||||
|
#else
|
||||||
|
typedef uint32_t bsp_interrupt_handler_index_type;
|
||||||
|
#endif
|
||||||
extern bsp_interrupt_handler_index_type bsp_interrupt_handler_index_table [];
|
extern bsp_interrupt_handler_index_type bsp_interrupt_handler_index_table [];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -102,10 +109,7 @@ static inline rtems_vector_number bsp_interrupt_handler_index(
|
|||||||
* For boards with small memory requirements you can define
|
* For boards with small memory requirements you can define
|
||||||
* @ref BSP_INTERRUPT_USE_INDEX_TABLE. With an enabled index table the handler
|
* @ref BSP_INTERRUPT_USE_INDEX_TABLE. With an enabled index table the handler
|
||||||
* table will be accessed via a small index table. You can define the size of
|
* table will be accessed via a small index table. You can define the size of
|
||||||
* the handler table with @ref BSP_INTERRUPT_HANDLER_TABLE_SIZE. You must
|
* the handler table with @ref BSP_INTERRUPT_HANDLER_TABLE_SIZE.
|
||||||
* provide a data type for the index table
|
|
||||||
* (@ref bsp_interrupt_handler_index_type). It must be an integer type big
|
|
||||||
* enough to index the complete handler table.
|
|
||||||
*
|
*
|
||||||
* Normally new list entries are allocated from the heap. You may define
|
* Normally new list entries are allocated from the heap. You may define
|
||||||
* @ref BSP_INTERRUPT_NO_HEAP_USAGE, if you do not want to use the heap. For
|
* @ref BSP_INTERRUPT_NO_HEAP_USAGE, if you do not want to use the heap. For
|
||||||
|
|||||||
@@ -7,16 +7,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008, 2010
|
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
|
||||||
|
*
|
||||||
* embedded brains GmbH
|
* embedded brains GmbH
|
||||||
* Obere Lagerstr. 30
|
* Obere Lagerstr. 30
|
||||||
* D-82178 Puchheim
|
* 82178 Puchheim
|
||||||
* Germany
|
* Germany
|
||||||
* <rtems@embedded-brains.de>
|
* <rtems@embedded-brains.de>
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
* http://www.rtems.com/license/LICENSE.
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBCPU_SHARED_UTILITY_H
|
#ifndef LIBCPU_SHARED_UTILITY_H
|
||||||
@@ -25,13 +28,14 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define BSP_BIT8(bit) \
|
#define BSP_BIT8(bit) \
|
||||||
((uint8_t) (((uint8_t) 1) << (bit)))
|
((uint8_t) (((unsigned int) 1) << (bit)))
|
||||||
|
|
||||||
#define BSP_MSK8(first_bit, last_bit) \
|
#define BSP_MSK8(first_bit, last_bit) \
|
||||||
((uint8_t) ((BSP_BIT8((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
((uint8_t) ((BSP_BIT8((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
||||||
|
|
||||||
#define BSP_FLD8(val, first_bit, last_bit) \
|
#define BSP_FLD8(val, first_bit, last_bit) \
|
||||||
((uint8_t) (((val) << (first_bit)) & BSP_MSK8(first_bit, last_bit)))
|
((uint8_t) \
|
||||||
|
((((unsigned int) (val)) << (first_bit)) & BSP_MSK8(first_bit, last_bit)))
|
||||||
|
|
||||||
#define BSP_FLD8GET(reg, first_bit, last_bit) \
|
#define BSP_FLD8GET(reg, first_bit, last_bit) \
|
||||||
((uint8_t) (((reg) & BSP_MSK8(first_bit, last_bit)) >> (first_bit)))
|
((uint8_t) (((reg) & BSP_MSK8(first_bit, last_bit)) >> (first_bit)))
|
||||||
@@ -41,13 +45,14 @@
|
|||||||
| BSP_FLD8(val, first_bit, last_bit)))
|
| BSP_FLD8(val, first_bit, last_bit)))
|
||||||
|
|
||||||
#define BSP_BIT16(bit) \
|
#define BSP_BIT16(bit) \
|
||||||
((uint16_t) (((uint16_t) 1) << (bit)))
|
((uint16_t) (((unsigned int) 1) << (bit)))
|
||||||
|
|
||||||
#define BSP_MSK16(first_bit, last_bit) \
|
#define BSP_MSK16(first_bit, last_bit) \
|
||||||
((uint16_t) ((BSP_BIT16((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
((uint16_t) ((BSP_BIT16((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
||||||
|
|
||||||
#define BSP_FLD16(val, first_bit, last_bit) \
|
#define BSP_FLD16(val, first_bit, last_bit) \
|
||||||
((uint16_t) (((val) << (first_bit)) & BSP_MSK16(first_bit, last_bit)))
|
((uint16_t) \
|
||||||
|
((((unsigned int) (val)) << (first_bit)) & BSP_MSK16(first_bit, last_bit)))
|
||||||
|
|
||||||
#define BSP_FLD16GET(reg, first_bit, last_bit) \
|
#define BSP_FLD16GET(reg, first_bit, last_bit) \
|
||||||
((uint16_t) (((reg) & BSP_MSK16(first_bit, last_bit)) >> (first_bit)))
|
((uint16_t) (((reg) & BSP_MSK16(first_bit, last_bit)) >> (first_bit)))
|
||||||
@@ -63,7 +68,8 @@
|
|||||||
((uint32_t) ((BSP_BIT32((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
((uint32_t) ((BSP_BIT32((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
||||||
|
|
||||||
#define BSP_FLD32(val, first_bit, last_bit) \
|
#define BSP_FLD32(val, first_bit, last_bit) \
|
||||||
((uint32_t) (((val) << (first_bit)) & BSP_MSK32(first_bit, last_bit)))
|
((uint32_t) \
|
||||||
|
((((uint32_t) (val)) << (first_bit)) & BSP_MSK32(first_bit, last_bit)))
|
||||||
|
|
||||||
#define BSP_FLD32GET(reg, first_bit, last_bit) \
|
#define BSP_FLD32GET(reg, first_bit, last_bit) \
|
||||||
((uint32_t) (((reg) & BSP_MSK32(first_bit, last_bit)) >> (first_bit)))
|
((uint32_t) (((reg) & BSP_MSK32(first_bit, last_bit)) >> (first_bit)))
|
||||||
@@ -79,7 +85,8 @@
|
|||||||
((uint64_t) ((BSP_BIT64((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
((uint64_t) ((BSP_BIT64((last_bit) - (first_bit) + 1) - 1) << (first_bit)))
|
||||||
|
|
||||||
#define BSP_FLD64(val, first_bit, last_bit) \
|
#define BSP_FLD64(val, first_bit, last_bit) \
|
||||||
((uint64_t) (((val) << (first_bit)) & BSP_MSK64(first_bit, last_bit)))
|
((uint64_t) \
|
||||||
|
((((uint64_t) (val)) << (first_bit)) & BSP_MSK64(first_bit, last_bit)))
|
||||||
|
|
||||||
#define BSP_FLD64GET(reg, first_bit, last_bit) \
|
#define BSP_FLD64GET(reg, first_bit, last_bit) \
|
||||||
((uint64_t) (((reg) & BSP_MSK64(first_bit, last_bit)) >> (first_bit)))
|
((uint64_t) (((reg) & BSP_MSK64(first_bit, last_bit)) >> (first_bit)))
|
||||||
|
|||||||
Reference in New Issue
Block a user