1 //===---- RemoteTargetMessage.h - LLI out-of-process message protocol -----===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // Definition of the LLIMessageType enum which is used for communication with a 11 // child process for remote execution. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLI_REMOTETARGETMESSAGE_H 16 #define LLI_REMOTETARGETMESSAGE_H 17 18 namespace llvm { 19 20 // LLI messages from parent-to-child or vice versa follow an exceedingly simple 21 // protocol where the first four bytes represent the message type, the next 22 // four bytes represent the size of data for the command and following bytes 23 // represent the actual data. 24 // 25 // The protocol is not intended to be robust, secure or fault-tolerant. It is 26 // only here for testing purposes and is therefore intended to be the simplest 27 // implementation that will work. It is assumed that the parent and child 28 // share characteristics like endianness. 29 30 enum LLIMessageType { 31 LLI_Error = -1, 32 LLI_ChildActive = 0, // Data = not used 33 LLI_AllocateSpace, // Data = struct { uint_32t Align, uint_32t Size } 34 LLI_AllocationResult, // Data = uint64_t AllocAddress (in Child memory space) 35 LLI_LoadCodeSection, // Data = uint32_t Addr, followed by section contests 36 LLI_LoadDataSection, // Data = uint32_t Addr, followed by section contents 37 LLI_LoadComplete, // Data = not used 38 LLI_Execute, // Data = Address of function to execute 39 LLI_ExecutionResult, // Data = uint64_t Result 40 LLI_Terminate // Data = not used 41 }; 42 43 } // end namespace llvm 44 45 #endif 46