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