1 | /* bsp.h |
---|
2 | * |
---|
3 | * This include file contains all SPARC64 simulator definitions. |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-1998. |
---|
6 | * On-Line Applications Research Corporation (OAR). |
---|
7 | * COPYRIGHT (c) 1995. |
---|
8 | * European Space Agency. |
---|
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 | * Ported to Simics Niagara version of SPARC64 |
---|
15 | * Niagara modifications of respective RTEMS file: COPYRIGHT (c) 2010. |
---|
16 | * Eugen Leontie. |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _BSP_H |
---|
20 | #define _BSP_H |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | #include <bspopts.h> |
---|
27 | #include <bsp/default-initial-extension.h> |
---|
28 | |
---|
29 | #include <rtems.h> |
---|
30 | #include <rtems/iosupp.h> |
---|
31 | #include <rtems/console.h> |
---|
32 | #include <rtems/clockdrv.h> |
---|
33 | |
---|
34 | /* support for simulated clock tick */ |
---|
35 | /* |
---|
36 | Thread clock_driver_sim_idle_body(uintptr_t); |
---|
37 | #define BSP_IDLE_TASK_BODY clock_driver_sim_idle_body |
---|
38 | */ |
---|
39 | |
---|
40 | /* this should be defined somewhere */ |
---|
41 | rtems_isr_entry set_vector( /* returns old vector */ |
---|
42 | rtems_isr_entry handler, /* isr routine */ |
---|
43 | rtems_vector_number vector, /* vector number */ |
---|
44 | int type /* RTEMS or RAW intr */ |
---|
45 | ); |
---|
46 | |
---|
47 | /* |
---|
48 | * Simple spin delay in microsecond units for device drivers. |
---|
49 | * This is very dependent on the clock speed of the target. |
---|
50 | */ |
---|
51 | |
---|
52 | #define rtems_bsp_delay( microseconds ) \ |
---|
53 | { register uint32_t _delay=(microseconds); \ |
---|
54 | register uint32_t _tmp = 0; /* initialized to avoid warning */ \ |
---|
55 | __asm__ volatile( "0: \ |
---|
56 | remo 3,31,%0 ; \ |
---|
57 | cmpo 0,%0 ; \ |
---|
58 | subo 1,%1,%1 ; \ |
---|
59 | cmpobne.t 0,%1,0b " \ |
---|
60 | : "=d" (_tmp), "=d" (_delay) \ |
---|
61 | : "0" (_tmp), "1" (_delay) ); \ |
---|
62 | } |
---|
63 | |
---|
64 | #ifdef __cplusplus |
---|
65 | } |
---|
66 | #endif |
---|
67 | |
---|
68 | #endif |
---|