Changeset 88 for trunk/IPs/systemC/Environment/Sim2OS/src
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- Location:
- trunk/IPs/systemC/Environment/Sim2OS/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_convert_address.cpp
r81 r88 9 9 void * Sim2OS::convert_address (void * address) 10 10 { 11 void * result = param->segment_table->getAddrAlloc( (uint32_t)address);11 void * result = param->segment_table->getAddrAlloc(static_cast<uint32_t>(reinterpret_cast<uint64_t>(address))); 12 12 13 13 if (result == NULL) 14 14 { 15 std::cerr << "<" << name << "> address don't match : " << std::hex << (uint32_t)(address) << std::dec << std::endl;15 std::cerr << "<" << name << "> address don't match : " << std::hex << static_cast<uint32_t>(reinterpret_cast<uint64_t>(address)) << std::dec << std::endl; 16 16 exit(0); 17 17 } -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_parameter.cpp
r81 r88 13 13 { 14 14 if (num_reg == 0) 15 num_service = int2service( (int)(val));15 num_service = int2service(static_cast<int32_t>(reinterpret_cast<int64_t>(val))); 16 16 else 17 17 arguments[num_reg] = val; -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_clock.cpp
r81 r88 16 16 17 17 std::cout << "\n\t***** service : clock *****" << std::endl; 18 std::cout << "\tresult : " << (unsigned int) result<< std::endl;19 std::cout << "\terrno : " << (unsigned int) error<< std::endl;18 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 19 std::cout << "\terrno : " << error << std::endl; 20 20 21 21 return result; -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_close.cpp
r81 r88 12 12 } 13 13 14 int fd = (int) arguments[1];14 int fd = static_cast<int>(reinterpret_cast<int64_t>(arguments[1])); 15 15 void * result = (void *) close(fd); 16 16 error = errno; … … 18 18 std::cout << "\n\t***** service : close *****" << std::endl; 19 19 std::cout << "\tfd : " << (unsigned int) fd << std::endl; 20 std::cout << "\tresult : " << (unsigned int) result<< std::endl;20 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 21 21 std::cout << "\terrno : " << (unsigned int) error << std::endl; 22 22 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_lseek.cpp
r81 r88 12 12 } 13 13 14 int flides = (int) arguments[1];15 off_t offset = (off_t) arguments[2];16 int whence = (int) arguments[3];14 int flides = static_cast<int >(reinterpret_cast<int64_t>(arguments[1])); 15 off_t offset = static_cast<off_t>(reinterpret_cast<int64_t>(arguments[2])); 16 int whence = static_cast<int >(reinterpret_cast<int64_t>(arguments[3])); 17 17 void * result = (void *) lseek(flides,offset,whence); 18 18 error = errno; … … 24 24 std::cout << "\toffset : " << (unsigned int) offset << std::endl; 25 25 std::cout << "\twhence : " << (unsigned int) whence << std::endl; 26 std::cout << "\tresult : " << (unsigned int) result<< std::endl;26 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 27 27 std::cout << "\terrno : " << (unsigned int) error << std::endl; 28 28 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_open.cpp
r81 r88 13 13 14 14 const char *pathname = (const char *) convert_address(arguments[1]); 15 int flags = (int) arguments[2];16 mode_t mode = (mode_t) arguments[3];15 int flags = static_cast<int >(reinterpret_cast<int64_t>(arguments[2])); 16 mode_t mode = static_cast<mode_t>(reinterpret_cast<int64_t>(arguments[3])); 17 17 void * result = (void *) open(pathname,flags,mode); 18 18 error = errno; … … 26 26 std::cout << "\tmode /10 : " << std::dec << (unsigned int) mode << std::endl; 27 27 std::cout << "\tmode /16 : " << std::hex << (unsigned int) mode << std::endl; 28 std::cout << "\tresult : " << st d::dec << (unsigned int) result<< std::endl;28 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 29 29 std::cout << "\terrno : " << (unsigned int) error << std::endl; 30 30 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_read.cpp
r81 r88 12 12 } 13 13 14 int fd = (int) arguments[1];14 int fd = static_cast<int>(reinterpret_cast<int64_t>(arguments[1])); 15 15 void * buf = (void *) convert_address(arguments[2]); 16 16 ssize_t count = (ssize_t) arguments[3]; … … 19 19 std::cout << "\n\t***** service : read *****" << std::endl; 20 20 std::cout << "\tfd : " << (unsigned int) fd << std::endl; 21 std::cout << "\tbuf : " << std::hex << (unsigned int) buf<< std::endl;21 std::cout << "\tbuf : " << std::hex << static_cast<int32_t>(reinterpret_cast<int64_t>(buf)) << std::endl; 22 22 //std::cout << "\tbuf : " << std::dec << (char *) buf << std::endl; 23 23 std::cout << "\tcount : " << std::dec << (unsigned int) count << std::endl; 24 std::cout << "\tresult : " << (unsigned int) result<< std::endl;24 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 25 25 std::cout << "\terrno : " << (unsigned int) error << std::endl; 26 26 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_time.cpp
r81 r88 17 17 18 18 std::cout << "\n\t***** service : time *****" << std::endl; 19 std::cout << "\tt : " << std::hex << (unsigned int) t<< std::endl;20 std::cout << "\tresult : " << std::dec << (unsigned int) result<< " - " << ctime((time_t *) t) << std::endl;19 std::cout << "\tt : " << std::hex << static_cast<int32_t>(reinterpret_cast<int64_t>(t)) << std::endl; 20 std::cout << "\tresult : " << std::dec << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << " - " << ctime((time_t *) t) << std::endl; 21 21 std::cout << "\terrno : " << (unsigned int) error << std::endl; 22 22 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_write.cpp
r81 r88 12 12 } 13 13 14 int fd = (int) arguments[1];14 int fd = static_cast<int>(reinterpret_cast<int64_t>(arguments[1])); 15 15 const void *buf = (const void *) convert_address(arguments[2]); 16 16 ssize_t count = (ssize_t) arguments[3]; … … 22 22 std::cout << "\n\t***** service : write *****" << std::endl; 23 23 std::cout << "\tfd : " << (unsigned int) fd << std::endl; 24 std::cout << "\tbuf : " << std::hex << (unsigned int) buf<< std::endl;24 std::cout << "\tbuf : " << std::hex << static_cast<int32_t>(reinterpret_cast<int64_t>(buf)) << std::endl; 25 25 //std::cout << "\tbuf : " << std::dec << (char *) buf << std::endl; 26 26 std::cout << "\tcount : " << std::dec << (unsigned int) count << std::endl; 27 std::cout << "\tresult : " << (unsigned int) result<< std::endl;27 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 28 28 std::cout << "\terrno : " << (unsigned int) error << std::endl; 29 29
Note: See TracChangeset
for help on using the changeset viewer.