rbug: Add Gallium Remote Debugger Protocol code
[mesa.git] / src / gallium / auxiliary / rbug / rbug_proto.h
1 /*
2 * Copyright 2009 VMware, Inc.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /*
26 * This file holds common definitions of the gallium remote debugging protocol.
27 */
28
29 #ifndef _RBUG_PROTO_H_
30 #define _RBUG_PROTO_H_
31
32 #include "pipe/p_compiler.h"
33
34 /**
35 * Uniqe indentifier for each command.
36 *
37 * Replys are designated by negative.
38 */
39 enum rbug_opcode
40 {
41 RBUG_OP_NOOP = 0,
42 RBUG_OP_PING = 1,
43 RBUG_OP_ERROR = 2,
44 RBUG_OP_PING_REPLY = -1,
45 RBUG_OP_ERROR_REPLY = -2,
46 RBUG_OP_TEXTURE_LIST = 256,
47 RBUG_OP_TEXTURE_INFO = 257,
48 RBUG_OP_TEXTURE_WRITE = 258,
49 RBUG_OP_TEXTURE_READ = 259,
50 RBUG_OP_TEXTURE_LIST_REPLY = -256,
51 RBUG_OP_TEXTURE_INFO_REPLY = -257,
52 RBUG_OP_TEXTURE_READ_REPLY = -259,
53 RBUG_OP_CONTEXT_LIST = 512,
54 RBUG_OP_CONTEXT_INFO = 513,
55 RBUG_OP_CONTEXT_BLOCK_DRAW = 514,
56 RBUG_OP_CONTEXT_UNBLOCK_DRAW = 515,
57 RBUG_OP_CONTEXT_LIST_REPLY = -512,
58 RBUG_OP_CONTEXT_INFO_REPLY = -513,
59 RBUG_OP_SHADER_LIST = 768,
60 RBUG_OP_SHADER_INFO = 769,
61 RBUG_OP_SHADER_DISABLE = 770,
62 RBUG_OP_SHADER_REPLACE = 771,
63 RBUG_OP_SHADER_LIST_REPLY = -768,
64 RBUG_OP_SHADER_INFO_REPLY = -769,
65 };
66
67 /**
68 * Header for demarshaled message.
69 */
70 struct rbug_header
71 {
72 enum rbug_opcode opcode;
73 void *__message;
74 };
75
76 /**
77 * Header for a message in wire format.
78 */
79 struct rbug_proto_header
80 {
81 int32_t opcode;
82 uint32_t length;
83 };
84
85 /**
86 * Forward declare connection here, as this file is included by all users.
87 */
88 struct rbug_connection;
89
90 #endif