1259698Sdim//===---- RemoteTargetMessage.h - LLI out-of-process message protocol -----===// 2259698Sdim// 3259698Sdim// The LLVM Compiler Infrastructure 4259698Sdim// 5259698Sdim// This file is distributed under the University of Illinois Open Source 6259698Sdim// License. See LICENSE.TXT for details. 7259698Sdim// 8259698Sdim//===----------------------------------------------------------------------===// 9259698Sdim// 10259698Sdim// Definition of the LLIMessageType enum which is used for communication with a 11259698Sdim// child process for remote execution. 12259698Sdim// 13259698Sdim//===----------------------------------------------------------------------===// 14259698Sdim 15259698Sdim#ifndef LLI_REMOTETARGETMESSAGE_H 16259698Sdim#define LLI_REMOTETARGETMESSAGE_H 17259698Sdim 18259698Sdimnamespace llvm { 19259698Sdim 20259698Sdim// LLI messages from parent-to-child or vice versa follow an exceedingly simple 21259698Sdim// protocol where the first four bytes represent the message type, the next 22259698Sdim// four bytes represent the size of data for the command and following bytes 23259698Sdim// represent the actual data. 24259698Sdim// 25259698Sdim// The protocol is not intended to be robust, secure or fault-tolerant. It is 26259698Sdim// only here for testing purposes and is therefore intended to be the simplest 27259698Sdim// implementation that will work. It is assumed that the parent and child 28259698Sdim// share characteristics like endianness. 29259698Sdim 30259698Sdimenum LLIMessageType { 31259698Sdim LLI_Error = -1, 32259698Sdim LLI_ChildActive = 0, // Data = not used 33259698Sdim LLI_AllocateSpace, // Data = struct { uint_32t Align, uint_32t Size } 34259698Sdim LLI_AllocationResult, // Data = uint64_t AllocAddress (in Child memory space) 35259698Sdim LLI_LoadCodeSection, // Data = uint32_t Addr, followed by section contests 36259698Sdim LLI_LoadDataSection, // Data = uint32_t Addr, followed by section contents 37259698Sdim LLI_LoadComplete, // Data = not used 38259698Sdim LLI_Execute, // Data = Address of function to execute 39259698Sdim LLI_ExecutionResult, // Data = uint64_t Result 40259698Sdim LLI_Terminate // Data = not used 41259698Sdim}; 42259698Sdim 43259698Sdim} // end namespace llvm 44259698Sdim 45259698Sdim#endif 46