xref: /plan9-contrib/sys/src/cmd/aux/vmware/all.h (revision 06d2afa6aa61b39f2ff8184391f0458258bcc86a)
1 #include <u.h>
2 #include <libc.h>
3 #include <ureg.h>
4 #include <draw.h>
5 
6 typedef struct Msgchan Msgchan;
7 typedef struct Ureg Ureg;
8 
9 typedef ulong uint32;
10 typedef int       int32;
11 typedef short     int16;
12 typedef char      int8;
13 typedef uvlong	uint64;
14 typedef vlong 	int64;
15 typedef char	Bool;
16 
17 struct Msgchan
18 {
19 	ushort id;
20 	uchar *a;
21 	int na;
22 };
23 
24 enum
25 {
26 	/* low bits of u.cx */
27 	BackGetmhz		= 1,
28 	BackApm			= 2,
29 	BackGetdiskgeo	= 3,
30 	BackGetptrloc		= 4,
31 	BackSetptrloc		= 5,
32 	BackGetsellength	= 6,
33 	BackGetnextpiece	= 7,
34 	BackSetsellength	= 8,
35 	BackSetnextpiece	= 9,
36 	BackGetversion		= 10,
37 	BackGetdevlistel	= 11,
38 	BackToggledev		= 12,
39 	BackGetguiopt		= 13,
40 	BackSetguiopt		= 14,
41 	BackGetscreensize	= 15,
42 	BackGetpcisvgaen	= 16,
43 	BackSetpcisvgaen	= 17,
44 	/* 18-20 not used */
45 	BackHostcopy		= 21,
46 	BackGetos2intcurs	= 22,
47 	BackGettime		= 23,
48 	BackStopcatchup	= 24,
49 	BackPutchr		= 25,
50 	BackEnablemsg	= 26,
51 	BackGototcl		= 27,
52 	BackInitscsiprom	= 28,
53 	BackInt13			= 29,
54 	BackMessage		= 30,
55 
56 	BackMagic		= 0x564D5868,
57 	VersionMagic		= 6,
58 	BackPort			= 0x5658,
59 
60 };
61 
62 void		asmbackdoor(Ureg*);
63 void		backdoor(Ureg*, int);
64 int		backdoorbell(void*, char*);
65 int		closemsg(Msgchan*);
66 int		getdeviceinfo(uint, uint, uint*);
67 Point		getmousepoint(void);
68 int		getsnarflength(void);
69 uint		getsnarfpiece(void);
70 Msgchan*	openmsg(ulong);
71 int		recvmsg(Msgchan*, void**);
72 int		sendmsg(Msgchan*, void*, int);
73 int		setdevicestate(uint, int);
74 void		setmousepoint(Point);
75 void		setsnarflength(uint);
76 void		setsnarfpiece(uint);
77 int		getversion(void);
78 void		setguistate(uint);
79 uint		getguistate(void);
80 uint		copystep(uint);
81 void		gettime(uint*, uint*, uint*);
82 void		stopcatchup(void);
83 
84 extern	jmp_buf	backdoorjmp;
85