[81] | 1 | #ifndef ENVIRONMENT_DATA_SEGMENT_H |
---|
| 2 | #define ENVIRONMENT_DATA_SEGMENT_H |
---|
| 3 | |
---|
| 4 | #include "../../../shared/soclib_segment_table.h" |
---|
| 5 | #include "Type_target.h" |
---|
| 6 | |
---|
| 7 | #include <iomanip> |
---|
[144] | 8 | #include <stdint.h> |
---|
[81] | 9 | |
---|
| 10 | extern "C" void loadexec(void **emem, int *esize, int *eoffset, const char *file, const char ** sections); |
---|
| 11 | |
---|
| 12 | namespace environment { |
---|
| 13 | namespace data { |
---|
| 14 | |
---|
| 15 | class Segment |
---|
| 16 | { |
---|
| 17 | protected : std::string name; |
---|
| 18 | |
---|
| 19 | protected : uint32_t base; |
---|
| 20 | protected : uint32_t index; |
---|
| 21 | protected : uint32_t size; |
---|
| 22 | protected : bool uncached; |
---|
| 23 | protected : char * data; |
---|
| 24 | protected : type_target_t type; |
---|
| 25 | |
---|
[134] | 26 | //public : Segment (void); |
---|
[81] | 27 | public : Segment (SEGMENT_TABLE_ENTRY * segment); |
---|
| 28 | public : ~Segment (void); |
---|
| 29 | |
---|
| 30 | public : bool init (const char * filename, const char ** sections); |
---|
| 31 | public : void define_target (type_target_t type, uint32_t index); |
---|
| 32 | public : type_target_t getType (void); |
---|
| 33 | public : uint32_t getIndex (void); |
---|
| 34 | public : uint32_t getBase (void); |
---|
| 35 | public : uint32_t getSize (void); |
---|
| 36 | public : bool getUncached (void); |
---|
| 37 | public : char * data_addr (void); |
---|
| 38 | public : bool test (std::string name); |
---|
| 39 | public : bool test (uint32_t address, uint32_t size); |
---|
| 40 | public : void read (uint32_t address, uint32_t size, char * & data_dest); |
---|
| 41 | public : void write (uint32_t address, uint32_t size, char * & data_src); |
---|
[88] | 42 | public : std::string print (uint32_t depth); |
---|
[81] | 43 | public : friend std::ostream& operator<< (std::ostream& output, Segment & x); |
---|
| 44 | }; |
---|
| 45 | |
---|
| 46 | }; |
---|
| 47 | }; |
---|
| 48 | #endif |
---|