view tests/001_090722/001.c @ 0:42f240cc4bc6

From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Sep 2009 13:44:18 +0900
parents
children
line wrap: on
line source

#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>

#include "../../include/ioctl.h"
#include "../../include/spe_process.h"


int main(int argc, char *argv[])
{
	int fd;
	fd = open("/dev/spe_manager", O_RDWR);
	printf("fd: %d\n", fd);

	spe_process_context_write_data_t spe_write = { 0 };
	spe_process_context_read_data_t  spe_read;

	lseek(fd, 0, SEEK_SET);
	write(fd, &spe_write, sizeof(spe_write));

	ioctl(fd, SPE_MANAGER_IOCTL_START_PROCESS);

	do
	{
		lseek(fd, 0, SEEK_SET);
		read(fd, &spe_read, sizeof(spe_read));
	}
	while (spe_read.status != SPE_PROCESS_CONTEXT_STATUS_NOT_RELEASED);

	close(fd);
	return 0;
}