Last change
on this file since 732 was
437,
checked in by alain, 10 years ago
|
Introducing dynamic allocation of peripheral channel(TTY, NIC, TIM, CMA)
Removint the ICU driver : ICU component not supported anymore.
Removing the FBF driver.
|
File size:
1.3 KB
|
Line | |
---|
1 | /////////////////////////////////////////////////////////////////////////////////// |
---|
2 | // File : sim_driver.c |
---|
3 | // Date : 23/11/2013 |
---|
4 | // Author : alain greiner / cesar fuguet |
---|
5 | // Copyright (c) UPMC-LIP6 |
---|
6 | /////////////////////////////////////////////////////////////////////////////////// |
---|
7 | |
---|
8 | #include <hard_config.h> |
---|
9 | #include <giet_config.h> |
---|
10 | #include <sim_driver.h> |
---|
11 | |
---|
12 | #if !defined(SEG_SIM_BASE) |
---|
13 | # error: You must define SEG_SIM_BASE in the hard_config.h file |
---|
14 | #endif |
---|
15 | |
---|
16 | ///////////////////////////////////////////////////// |
---|
17 | void _sim_helper_access( unsigned int register_index, |
---|
18 | unsigned int value, |
---|
19 | unsigned int * retval ) |
---|
20 | { |
---|
21 | volatile unsigned int* sim_helper_address = (unsigned int*)&seg_sim_base; |
---|
22 | |
---|
23 | if (register_index == SIMHELPER_SC_STOP) |
---|
24 | { |
---|
25 | sim_helper_address[register_index] = value; |
---|
26 | } |
---|
27 | else if (register_index == SIMHELPER_CYCLES) |
---|
28 | { |
---|
29 | *retval = sim_helper_address[register_index]; |
---|
30 | } |
---|
31 | else |
---|
32 | { |
---|
33 | _tty_get_lock( 0 ); |
---|
34 | _puts("\n[GIET ERROR] in _sim_helper_access() : undefined register\n"); |
---|
35 | _tty_release_lock( 0 ); |
---|
36 | _exit(); |
---|
37 | } |
---|
38 | } |
---|
39 | |
---|
40 | // Local Variables: |
---|
41 | // tab-width: 4 |
---|
42 | // c-basic-offset: 4 |
---|
43 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
44 | // indent-tabs-mode: nil |
---|
45 | // End: |
---|
46 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.