/* * SV_BotFrame */ void SV_BotFrame(int time) { if(!bot_enable) return; /* NOTE: maybe the game is already shutdown */ if(!gvm) return; vmcall(gvm, BOTAI_START_FRAME, time); }
void l2_guest_code(void) { GUEST_SYNC(6); GUEST_SYNC(7); /* Done, exit to L1 and never come back. */ vmcall(); }
int hsocket(int domain, int type, int protocol) { struct {int d; int t; int p;} arg; arg.d = domain; arg.t = type; arg.p = protocol; return vmcall(0, (int)&arg, sizeof(arg)); }
void l2_guest_code(void) { GUEST_SYNC(6); /* Exit to L1 */ vmcall(); /* L1 has now set up a shadow VMCS for us. */ GUEST_ASSERT(vmreadz(GUEST_RIP) == 0xc0ffee); GUEST_SYNC(10); GUEST_ASSERT(vmreadz(GUEST_RIP) == 0xc0ffee); GUEST_ASSERT(!vmwrite(GUEST_RIP, 0xc0fffee)); GUEST_SYNC(11); GUEST_ASSERT(vmreadz(GUEST_RIP) == 0xc0fffee); GUEST_ASSERT(!vmwrite(GUEST_RIP, 0xc0ffffee)); GUEST_SYNC(12); /* Done, exit to L1 and never come back. */ vmcall(); }
int hrecv(int fd,void *buf,int len,int flags) { struct {int fd; uvlong buf; int len; int flg;} arg; arg.fd = fd; arg.buf = (uvlong)(uintptr)buf; arg.len = len; arg.flg = flags; return vmcall(3, (int)&arg, sizeof(arg)); }
int hconnect(int fd, int portno, char *hostname) { struct {int fd; uvlong hn; int len; int pn;} arg; arg.fd = fd; arg.hn = (uvlong)(uintptr)hostname; arg.len = strlen(hostname); arg.pn = portno; return vmcall(1, (int)&arg, sizeof(arg)); }
int hclose(int fd) { return vmcall(4, fd, 0); }