14a49301eSmrg/*
24a49301eSmrg * Copyright 2009 VMware, Inc.
34a49301eSmrg * All Rights Reserved.
44a49301eSmrg *
54a49301eSmrg * Permission is hereby granted, free of charge, to any person obtaining a
64a49301eSmrg * copy of this software and associated documentation files (the "Software"),
74a49301eSmrg * to deal in the Software without restriction, including without limitation
84a49301eSmrg * on the rights to use, copy, modify, merge, publish, distribute, sub
94a49301eSmrg * license, and/or sell copies of the Software, and to permit persons to whom
104a49301eSmrg * the Software is furnished to do so, subject to the following conditions:
114a49301eSmrg *
124a49301eSmrg * The above copyright notice and this permission notice (including the next
134a49301eSmrg * paragraph) shall be included in all copies or substantial portions of the
144a49301eSmrg * Software.
154a49301eSmrg *
164a49301eSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
174a49301eSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
184a49301eSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
194a49301eSmrg * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
204a49301eSmrg * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
214a49301eSmrg * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
224a49301eSmrg * USE OR OTHER DEALINGS IN THE SOFTWARE.
234a49301eSmrg */
244a49301eSmrg
254a49301eSmrg/*
264a49301eSmrg * This file holds common definitions of the gallium remote debugging protocol.
274a49301eSmrg */
284a49301eSmrg
294a49301eSmrg#ifndef _RBUG_PROTO_H_
304a49301eSmrg#define _RBUG_PROTO_H_
314a49301eSmrg
324a49301eSmrg#include "pipe/p_compiler.h"
334a49301eSmrg
344a49301eSmrg/**
354a49301eSmrg * Uniqe indentifier for each command.
364a49301eSmrg *
374a49301eSmrg * Replys are designated by negative.
384a49301eSmrg */
394a49301eSmrgenum rbug_opcode
404a49301eSmrg{
414a49301eSmrg	RBUG_OP_NOOP = 0,
424a49301eSmrg	RBUG_OP_PING = 1,
434a49301eSmrg	RBUG_OP_ERROR = 2,
444a49301eSmrg	RBUG_OP_PING_REPLY = -1,
454a49301eSmrg	RBUG_OP_ERROR_REPLY = -2,
464a49301eSmrg	RBUG_OP_TEXTURE_LIST = 256,
474a49301eSmrg	RBUG_OP_TEXTURE_INFO = 257,
484a49301eSmrg	RBUG_OP_TEXTURE_WRITE = 258,
494a49301eSmrg	RBUG_OP_TEXTURE_READ = 259,
504a49301eSmrg	RBUG_OP_TEXTURE_LIST_REPLY = -256,
514a49301eSmrg	RBUG_OP_TEXTURE_INFO_REPLY = -257,
524a49301eSmrg	RBUG_OP_TEXTURE_READ_REPLY = -259,
534a49301eSmrg	RBUG_OP_CONTEXT_LIST = 512,
544a49301eSmrg	RBUG_OP_CONTEXT_INFO = 513,
554a49301eSmrg	RBUG_OP_CONTEXT_DRAW_BLOCK = 514,
564a49301eSmrg	RBUG_OP_CONTEXT_DRAW_STEP = 515,
574a49301eSmrg	RBUG_OP_CONTEXT_DRAW_UNBLOCK = 516,
584a49301eSmrg	RBUG_OP_CONTEXT_DRAW_RULE = 518,
594a49301eSmrg	RBUG_OP_CONTEXT_FLUSH = 519,
604a49301eSmrg	RBUG_OP_CONTEXT_LIST_REPLY = -512,
614a49301eSmrg	RBUG_OP_CONTEXT_INFO_REPLY = -513,
624a49301eSmrg	RBUG_OP_CONTEXT_DRAW_BLOCKED = 517,
634a49301eSmrg	RBUG_OP_SHADER_LIST = 768,
644a49301eSmrg	RBUG_OP_SHADER_INFO = 769,
654a49301eSmrg	RBUG_OP_SHADER_DISABLE = 770,
664a49301eSmrg	RBUG_OP_SHADER_REPLACE = 771,
674a49301eSmrg	RBUG_OP_SHADER_LIST_REPLY = -768,
684a49301eSmrg	RBUG_OP_SHADER_INFO_REPLY = -769
694a49301eSmrg};
704a49301eSmrg
714a49301eSmrg/**
724a49301eSmrg * Header for demarshaled message.
734a49301eSmrg */
744a49301eSmrgstruct rbug_header
754a49301eSmrg{
764a49301eSmrg	enum rbug_opcode opcode;
774a49301eSmrg	void *__message;
784a49301eSmrg};
794a49301eSmrg
804a49301eSmrg/**
814a49301eSmrg * Header for a message in wire format.
824a49301eSmrg */
834a49301eSmrgstruct rbug_proto_header
844a49301eSmrg{
854a49301eSmrg	int32_t opcode;
864a49301eSmrg	uint32_t length;
874a49301eSmrg};
884a49301eSmrg
894a49301eSmrg/**
904a49301eSmrg * Forward declare connection here, as this file is included by all users.
914a49301eSmrg */
924a49301eSmrgstruct rbug_connection;
934a49301eSmrg
943464ebd5Sriastradh/**
953464ebd5Sriastradh * Get printable string for opcode.
963464ebd5Sriastradh */
973464ebd5Sriastradhconst char* rbug_proto_get_name(enum rbug_opcode opcode);
983464ebd5Sriastradh
994a49301eSmrg#endif
100