| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -20,8 +20,6 @@
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					namespace Service {
 | 
					 | 
					 | 
					 | 
					namespace Service {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					typedef s32 NativeUID;                          ///< Native handle for a service
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static const int kMaxPortSize           = 0x08; ///< Maximum size of a port name (8 characters)
 | 
					 | 
					 | 
					 | 
					static const int kMaxPortSize           = 0x08; ///< Maximum size of a port name (8 characters)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static const int kCommandHeaderOffset   = 0x80; ///< Offset into command buffer of header
 | 
					 | 
					 | 
					 | 
					static const int kCommandHeaderOffset   = 0x80; ///< Offset into command buffer of header
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -56,11 +54,11 @@ public:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    };
 | 
					 | 
					 | 
					 | 
					    };
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /**
 | 
					 | 
					 | 
					 | 
					    /**
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * Gets the UID for the serice
 | 
					 | 
					 | 
					 | 
					     * Gets the Handle for the serice
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return UID of service in native format
 | 
					 | 
					 | 
					 | 
					     * @return Handle of service in native format
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */
 | 
					 | 
					 | 
					 | 
					     */
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    NativeUID GetUID() const {
 | 
					 | 
					 | 
					 | 
					    Handle GetHandle() const {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return (NativeUID)m_uid;
 | 
					 | 
					 | 
					 | 
					        return m_handle;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /**
 | 
					 | 
					 | 
					 | 
					    /**
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -73,7 +71,7 @@ public:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /// Allocates a new handle for the service
 | 
					 | 
					 | 
					 | 
					    /// Allocates a new handle for the service
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Handle NewHandle() {
 | 
					 | 
					 | 
					 | 
					    Handle NewHandle() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        Handle handle = (m_handles.size() << 16) | m_uid;
 | 
					 | 
					 | 
					 | 
					        Handle handle = (m_handles.size() << 16) | m_handle;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        m_handles.push_back(handle);
 | 
					 | 
					 | 
					 | 
					        m_handles.push_back(handle);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return handle;
 | 
					 | 
					 | 
					 | 
					        return handle;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -124,7 +122,7 @@ protected:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					private:
 | 
					 | 
					 | 
					 | 
					private:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    u32 m_uid;
 | 
					 | 
					 | 
					 | 
					    u32 m_handle;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    
 | 
					 | 
					 | 
					 | 
					    
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    std::vector<Handle>    m_handles;
 | 
					 | 
					 | 
					 | 
					    std::vector<Handle>    m_handles;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    std::map<u32, FunctionInfo>     m_functions;
 | 
					 | 
					 | 
					 | 
					    std::map<u32, FunctionInfo>     m_functions;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -145,7 +143,7 @@ public:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    void DeleteService(std::string port_name);
 | 
					 | 
					 | 
					 | 
					    void DeleteService(std::string port_name);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /// Get a Service Interface from its UID
 | 
					 | 
					 | 
					 | 
					    /// Get a Service Interface from its UID
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Interface* FetchFromUID(u32 uid);
 | 
					 | 
					 | 
					 | 
					    Interface* FetchFromHandle(u32 uid);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /// Get a Service Interface from its port
 | 
					 | 
					 | 
					 | 
					    /// Get a Service Interface from its port
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    Interface* FetchFromPortName(std::string port_name);
 | 
					 | 
					 | 
					 | 
					    Interface* FetchFromPortName(std::string port_name);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -153,13 +151,13 @@ public:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					private:
 | 
					 | 
					 | 
					 | 
					private:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /// Convert an index into m_services vector into a UID
 | 
					 | 
					 | 
					 | 
					    /// Convert an index into m_services vector into a UID
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    static u32 GetUIDFromIndex(const int index) {
 | 
					 | 
					 | 
					 | 
					    static Handle GetHandleFromIndex(const int index) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return index | 0x10000000;
 | 
					 | 
					 | 
					 | 
					        return index | 0x10000000;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /// Convert a UID into an index into m_services
 | 
					 | 
					 | 
					 | 
					    /// Convert a UID into an index into m_services
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    static int GetIndexFromUID(const u32 uid) {
 | 
					 | 
					 | 
					 | 
					    static int GetIndexFromHandle(const Handle handle) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return uid & 0x0FFFFFFF;
 | 
					 | 
					 | 
					 | 
					        return handle & 0x0FFFFFFF;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    std::vector<Interface*>     m_services;
 | 
					 | 
					 | 
					 | 
					    std::vector<Interface*>     m_services;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |