source: rtems/c/src/lib/libbsp/mips/hurricane/include/bsp.h @ 0c0181d

4.115
Last change on this file since 0c0181d was 0c0181d, checked in by Jennifer Averett <jennifer.averett@…>, on 04/04/12 at 13:39:46

PR 1993 - Convert MIPS to PIC IRQ model

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/**
2 *  @file
3 * 
4 */
5
6/*
7 *  COPYRIGHT (c) 1989-2012.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#ifndef _BSP_H
18#define _BSP_H
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <bspopts.h>
25
26#include <rtems.h>
27#include <rtems/iosupp.h>
28#include <rtems/console.h>
29#include <rtems/clockdrv.h>
30#include <libcpu/rm5231.h>
31
32extern void WriteDisplay( char * string );
33
34extern uint32_t mips_get_timer( void );
35
36#define BSP_FEATURE_IRQ_EXTENSION
37#define BSP_SHARED_HANDLER_SUPPORT      1
38
39#define CPU_CLOCK_RATE_MHZ     (200)
40#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */
41
42/*
43 *  Simple spin delay in microsecond units for device drivers.
44 *  This is very dependent on the clock speed of the target.
45 *
46 *  NOTE: This macro generates a warning like "integer constant out
47 *        of range" which is safe to ignore.  In 64 bit mode, unsigned32
48 *        types are actually 64 bits long so that comparisons between
49 *        unsigned32 types and pointers are valid.  The warning is caused
50 *        by code in the delay macro that is necessary for 64 bit mode.
51 */
52
53#define rtems_bsp_delay( microseconds ) \
54  { \
55     uint32_t _end_clock = \
56          mips_get_timer() + microseconds * CLOCKS_PER_MICROSECOND; \
57     _end_clock %= 0x100000000;  /* make sure result is 32 bits */ \
58     \
59     /* handle timer overflow, if necessary */ \
60     while ( _end_clock < mips_get_timer() );  \
61     \
62     while ( _end_clock > mips_get_timer() ); \
63  }
64
65/* Constants */
66
67#define RAM_START 0
68#define RAM_END   0x100000
69
70/* functions */
71
72rtems_isr_entry set_vector(
73  rtems_isr_entry, rtems_vector_number, int );
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif  /* __HURRICANE_BSP_h */
Note: See TracBrowser for help on using the repository browser.