Пример #1
0
int add_udp_headers(struct request_state* req)
{
	/* fill in headers in the space left for us at req->udpheaders */
	struct memcache_udp_header* udp = req->udpheaders;
	
	// TODO: this needs to deal with fragmentation of UDP packets for > TXBUF size
	udp->req = htons(req->reqid);
	udp->seq = htons(0);
	udp->count = htons(1);
	udp->reserved = 0x0;

#ifdef DEBUG
	PRINT("[Unbuckle] Adding UDP headers to an outbound message.\n");
	PRINTARGS("[Unbuckle] UDP headers: \n"
		"*Req ID: %d\n"
		"*Seq Num: %d\n"
		"*Count: %d\n"
		"*Reserved: %d\n",
		ntohs(udp->req),
		ntohs(udp->seq),
		ntohs(udp->count),
		ntohs(udp->reserved)
	);
#endif

	return 0;
}
Пример #2
0
void updateTopScore() {
  char buf[7];

  // Выводим счет игрока
  i2s(buf, hiScores[0].score);
  SET_COLOR(COLOR_GREEN);
  print1(PIXELCOORDS(3,7),1,5,buf);

  // Выводим имя игрока
  print1(PRINTARGS(5,19),7|0x80,hiScores[0].name);
}
Пример #3
0
int ub_core_run(void)
{
	int res;
	
	struct request_state* req = (struct request_state*) 
		ALLOCMEM(sizeof(struct request_state), GFP_KERNEL);
#ifdef __KERNEL__
	allow_signal(SIGKILL | SIGSTOP);
#endif
	if (!req
#ifdef __KERNEL__
		|| ksize(req) < sizeof(struct request_state)
#endif
		)
		return -ENOMEM;
	memset(req, 0, sizeof(struct request_state));

	if ((res = udpserver_start(req)) < 0)
	{
#ifdef DEBUG
		PRINTARGS(
#ifdef __KERNEL__
		KERN_ERR 
#endif
		"Something went wrong starting the UDP server %d\n", res);
#endif
		FREEMEM(req);
		return res;
	}
	res = process_slowpath(req);

	udpserver_exit();

	if (req)
	{
		FREEMEM(req);
		req = NULL;
	}

	return res;
}
Пример #4
0
static void print_ddr3_timings(void)
{
	printf("\nDDR3\n");
	printf("clock:\t\t%d MHz\n", DDR_PLL_FREQ);
	printf("device:\t\t%s\n", settings.ddr3.manu_name);
	printf("marking:\t%s\n", settings.ddr3.manu_marking);
	printf("timing parameters\n");
	printf("diff\teeprom\tdefault\n");
	PRINTARGS(magic);
	PRINTARGS(version);
	PRINTARGS(ddr3_sratio);
	PRINTARGS(iclkout);

	PRINTARGS(dt0rdsratio0);
	PRINTARGS(dt0wdsratio0);
	PRINTARGS(dt0fwsratio0);
	PRINTARGS(dt0wrsratio0);

	PRINTARGS(sdram_tim1);
	PRINTARGS(sdram_tim2);
	PRINTARGS(sdram_tim3);

	PRINTARGS(emif_ddr_phy_ctlr_1);

	PRINTARGS(sdram_config);
	PRINTARGS(ref_ctrl);
	PRINTARGS(ioctr_val);
}
Пример #5
0
static void print_ddr3_timings(void)
{
	printf("\n\nDDR3 Timing parameters:\n");
	printf("Diff     Eeprom  Default\n");
	PRINTARGS(magic);
	PRINTARGS(version);
	PRINTARGS(ddr3_sratio);
	PRINTARGS(iclkout);

	PRINTARGS(dt0rdsratio0);
	PRINTARGS(dt0wdsratio0);
	PRINTARGS(dt0fwsratio0);
	PRINTARGS(dt0wrsratio0);

	PRINTARGS(sdram_tim1);
	PRINTARGS(sdram_tim2);
	PRINTARGS(sdram_tim3);

	PRINTARGS(emif_ddr_phy_ctlr_1);

	PRINTARGS(sdram_config);
	PRINTARGS(ref_ctrl);
	PRINTARGS(ioctr_val);
}