source: trunk/IPs/systemC/hierarchy_memory/sim2os/service_conversion.h @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 884 bytes
Line 
1#ifndef SERVICE_CONVERSION_H
2#define SERVICE_CONVERSION_H
3
4#include "service.h"
5
6namespace hierarchy_memory
7{
8  namespace sim2os
9  {
10    namespace service
11    {
12   
13      int service2int(service_t num_service)
14      {
15        return (int)num_service;
16      }
17
18      service_t int2service (int val)
19      {
20        switch (val)
21          {
22          case SERVICE_OPEN          : return SERVICE_OPEN ;
23          case SERVICE_CLOSE         : return SERVICE_CLOSE;
24          case SERVICE_READ          : return SERVICE_READ ;
25          case SERVICE_WRITE         : return SERVICE_WRITE;
26          case SERVICE_TIME          : return SERVICE_TIME ;
27          case SERVICE_CLOCK         : return SERVICE_CLOCK;
28          case SERVICE_LSEEK         : return SERVICE_LSEEK;
29          case SERVICE_UNIMPLEMENTED : return SERVICE_UNIMPLEMENTED;
30          default                    : return SERVICE_UNDEFINED;
31          }//end switch
32      }
33
34    };};};
35#endif //SERVICE_CONVERSION_H
Note: See TracBrowser for help on using the repository browser.