Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

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  
    99  void * Sim2OS::convert_address (void * address)
    1010  {
    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)));
    1212   
    1313    if (result == NULL)
    1414      {
    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;
    1616        exit(0);
    1717      }
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_parameter.cpp

    r81 r88  
    1313    {
    1414      if (num_reg == 0)
    15         num_service = int2service((int)(val));
     15        num_service = int2service(static_cast<int32_t>(reinterpret_cast<int64_t>(val)));
    1616      else
    1717        arguments[num_reg] = val;
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_clock.cpp

    r81 r88  
    1616   
    1717    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;
    2020   
    2121    return      result;
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_close.cpp

    r81 r88  
    1212      }
    1313   
    14     int    fd     = (int)    arguments[1];
     14    int    fd     = static_cast<int>(reinterpret_cast<int64_t>(arguments[1]));
    1515    void * result = (void *) close(fd);
    1616    error         = errno;
     
    1818    std::cout << "\n\t***** service : close         *****" << std::endl;
    1919    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;
    2121    std::cout << "\terrno     : " << (unsigned int) error  << std::endl;
    2222   
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_lseek.cpp

    r81 r88  
    1212      }
    1313   
    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]));
    1717    void * result   = (void *) lseek(flides,offset,whence);
    1818    error           = errno;
     
    2424    std::cout << "\toffset    : " << (unsigned int) offset << std::endl;
    2525    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;
    2727    std::cout << "\terrno     : " << (unsigned int) error  << std::endl;
    2828   
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_open.cpp

    r81 r88  
    1313   
    1414    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]));
    1717    void *      result   = (void *)       open(pathname,flags,mode);
    1818    error                = errno;
     
    2626    std::cout << "\tmode  /10 : " << std::dec << (unsigned int) mode     << std::endl;
    2727    std::cout << "\tmode  /16 : " << std::hex << (unsigned int) mode     << std::endl;
    28     std::cout << "\tresult    : " << std::dec << (unsigned int) result  << std::endl;
     28    std::cout << "\tresult    : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl;
    2929    std::cout << "\terrno     : " <<             (unsigned int) error    << std::endl;
    3030   
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_read.cpp

    r81 r88  
    1212      }
    1313   
    14     int     fd       = (int)     arguments[1];
     14    int     fd       = static_cast<int>(reinterpret_cast<int64_t>(arguments[1]));
    1515    void *  buf      = (void *)  convert_address(arguments[2]);
    1616    ssize_t count    = (ssize_t) arguments[3];
     
    1919    std::cout << "\n\t***** service : read          *****"        << std::endl;
    2020    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;
    2222  //std::cout << "\tbuf       : " << std::dec << (char *)       buf    << std::endl;
    2323    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;
    2525    std::cout << "\terrno     : " <<             (unsigned int) error  << std::endl;
    2626   
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_time.cpp

    r81 r88  
    1717   
    1818    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;
    2121    std::cout << "\terrno     : " <<             (unsigned int) error                                  << std::endl;
    2222   
  • trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_write.cpp

    r81 r88  
    1212      }
    1313 
    14     int         fd       = (int)          arguments[1];
     14    int         fd       = static_cast<int>(reinterpret_cast<int64_t>(arguments[1]));
    1515    const void *buf      = (const void *) convert_address(arguments[2]);
    1616    ssize_t     count    = (ssize_t)      arguments[3];
     
    2222    std::cout << "\n\t***** service : write         *****"        << std::endl;
    2323    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;
    2525  //std::cout << "\tbuf       : " << std::dec << (char *)       buf    << std::endl;
    2626    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;
    2828    std::cout << "\terrno     : " <<             (unsigned int) error  << std::endl;
    2929   
Note: See TracChangeset for help on using the changeset viewer.