1 | #ifndef ENVIRONMENT_SIM2OS_H |
---|
2 | #define ENVIRONMENT_SIM2OS_H |
---|
3 | |
---|
4 | #include <iostream> |
---|
5 | #include <map> |
---|
6 | #include <stdarg.h> |
---|
7 | #include <errno.h> |
---|
8 | #include <sys/types.h> |
---|
9 | #include <sys/stat.h> |
---|
10 | #include <fcntl.h> |
---|
11 | |
---|
12 | #include "Sim2OS_Parameters.h" |
---|
13 | #include "Service_conversion.h" |
---|
14 | #include "../../Endianness/include/Endianness.h" |
---|
15 | namespace environment { |
---|
16 | namespace sim2os { |
---|
17 | |
---|
18 | class Sim2OS |
---|
19 | { |
---|
20 | private : std::string name; |
---|
21 | private : Parameters * param; |
---|
22 | private : service_t num_service; // number of service |
---|
23 | private : std::map<uint32_t,void *> arguments; |
---|
24 | private : uint32_t nb_cycle; |
---|
25 | public : void * result; |
---|
26 | public : int error; // It's errno |
---|
27 | |
---|
28 | public : Sim2OS (std::string name, |
---|
29 | Parameters * param); |
---|
30 | public : ~Sim2OS (void); |
---|
31 | |
---|
32 | public : void reset (void); |
---|
33 | |
---|
34 | private : bool have_all_arguments (uint32_t); |
---|
35 | private : void * convert_address (void *); |
---|
36 | |
---|
37 | private : void * service_open (void); |
---|
38 | private : void * service_close (void); |
---|
39 | private : void * service_read (void); |
---|
40 | private : void * service_write (void); |
---|
41 | private : void * service_time (void); |
---|
42 | private : void * service_clock (void); |
---|
43 | private : void * service_lseek (void); |
---|
44 | |
---|
45 | public : void * execute (void); |
---|
46 | public : void * execute (service_t); |
---|
47 | public : void * execute (service_t, void *, ...); |
---|
48 | public : void parameter (uint32_t, void *); |
---|
49 | public : void transition (void); |
---|
50 | public : friend std::ostream& operator<< (std::ostream&, Sim2OS&); |
---|
51 | }; |
---|
52 | |
---|
53 | }; |
---|
54 | }; |
---|
55 | #endif |
---|