File: pi-syspkt.h

package info (click to toggle)
pilot-link 0.12.5-dfsg-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 6,868 kB
  • ctags: 5,811
  • sloc: ansic: 53,153; sh: 10,459; java: 2,584; perl: 2,247; python: 1,044; makefile: 991; yacc: 662; cpp: 551; xml: 39
file content (153 lines) | stat: -rw-r--r-- 4,221 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
 * $Id: pi-syspkt.h,v 1.22 2006/10/17 13:24:07 desrod Exp $
 *
 * pi-syspkt.h
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Library General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
 * General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef _PILOT_SYSPKT_H
#define _PILOT_SYSPKT_H

#include "pi-args.h"

#ifdef __cplusplus
extern "C" {
#endif

	struct Pilot_registers {
		unsigned long A[7];
		unsigned long D[8];
		unsigned long USP, SSP;
		unsigned long PC, SR;
	};

	struct Pilot_breakpoint {
		unsigned long address;
		int enabled;
	};

	struct Pilot_state {
		struct Pilot_registers regs;
		int reset;
		int exception;
		int instructions[30];
		struct Pilot_breakpoint breakpoint[6];
		unsigned long func_start, func_end;
		char func_name[32];
		int trap_rev;
	};

	struct Pilot_watch {
		unsigned long address;
		unsigned long length;
		unsigned long checksum;
	};

	struct RPC_param {
		int byRef;
		size_t size;
		int invert;
		int arg;
		void *data;
	};

	struct RPC_params {
		int trap;
		int reply;
		int args;
		struct RPC_param param[20];
	};

	extern int sys_UnpackState
	    PI_ARGS((void *buffer, struct Pilot_state * s));

	extern int sys_UnpackRegisters
	    PI_ARGS((void *buffer, struct Pilot_registers * r));


	extern int sys_Continue
	    PI_ARGS((int sd, struct Pilot_registers * r,
		     struct Pilot_watch * w));
	extern int sys_Step PI_ARGS((int sd));

	extern int sys_QueryState PI_ARGS((int sd));
	extern int sys_ReadMemory
	    PI_ARGS((int sd, unsigned long addr, unsigned long len,
		     void *buf));
	extern int sys_WriteMemory
	    PI_ARGS((int sd, unsigned long addr, unsigned long len,
		     void *buf));

	extern int sys_ToggleDbgBreaks PI_ARGS((int sd));

	extern int sys_SetTrapBreaks PI_ARGS((int sd, int *traps));
	extern int sys_GetTrapBreaks PI_ARGS((int sd, int *traps));

	extern int sys_SetBreakpoints
	    PI_ARGS((int sd, struct Pilot_breakpoint * b));
	extern int sys_Find
	    PI_ARGS((int sd, unsigned long startaddr,
		     unsigned long stopaddr, size_t len, int caseinsensitive,
		     void *data, unsigned long *found));

	extern int sys_RemoteEvent
	    PI_ARGS((int sd, int penDown, int x, int y, int keypressed,
		     int keymod, int keyasc, int keycode));

	extern int sys_RPC
	    PI_ARGS((int sd, int sock, int trap, long *D0, long *A0,
		     int params, struct RPC_param * param, int rep));

#define RPC_Byte(data) (-2),((unsigned int)htons((data)<<8))
#define RPC_Short(data) (-2),((unsigned int)htons((data)))
#define RPC_Long(data) (-4),((unsigned int)htonl((data)))
#define RPC_Ptr(data,len) (len),((void*)(data)),0
#define RPC_LongPtr(ptr) (4),((void*)(ptr)),1
#define RPC_ShortPtr(ptr) (2),((void*)(ptr)),1
#define RPC_BytePtr(ptr) (2),((void*)(ptr)),2
#define RPC_LongRef(ref) (4),((void*)(&(ref))),1
#define RPC_ShortRef(ref) (2),((void*)(&(ref))),1
#define RPC_ByteRef(ref) (2),((void*)(&(ref))),2
#define RPC_NullPtr RPC_Long(0)
#define RPC_End 0

#define RPC_IntReply  2
#define RPC_PtrReply  1
#define RPC_NoReply 0

	extern int RPC
	    PI_ARGS((int sd, int sock, int trap, int ret, ...));

	extern void InvertRPC PI_ARGS((struct RPC_params * p));
	extern void UninvertRPC PI_ARGS((struct RPC_params * p));

	extern int PackRPC
	    PI_ARGS((struct RPC_params * p, int trap, int reply, ...));

	extern unsigned long DoRPC
	    PI_ARGS((int sd, int sock, struct RPC_params * p,
		     int *error));

	extern int dlp_ProcessRPC
	    PI_ARGS((int sd, int trap, int ret, ...));

	extern int RPC_Int_Void PI_ARGS((int sd, int trap));
	extern int RPC_Ptr_Void PI_ARGS((int sd, int trap));

#ifdef __cplusplus
}
#endif
#endif				/*_PILOT_SYSPKT_H_*/