/*
 * Whee.. Weird sysv syscall. 
 */
SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
{
	int retval = -EINVAL;

	switch (option) {
		case 1:
			retval = fs_index((const char __user *) arg1);
			break;

		case 2:
			retval = fs_name(arg1, (char __user *) arg2);
			break;

		case 3:
			retval = fs_maxindex();
			break;
	}
	return retval;
}
Example #2
0
/*
 * Whee.. Weird sysv syscall. 
 */
asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2)
{
	int retval = -EINVAL;

	switch (option) {
		case 1:
			retval = fs_index((const char __user *) arg1);
			break;

		case 2:
			retval = fs_name(arg1, (char __user *) arg2);
			break;

		case 3:
			retval = fs_maxindex();
			break;
	}
	return retval;
}
Example #3
0
/*
 * Whee.. Weird sysv syscall. 
 */
asmlinkage int sys_sysfs(int option, unsigned long arg1, unsigned long arg2)
{
	int retval = -EINVAL;

	lock_kernel();
	switch (option) {
		case 1:
			retval = fs_index((const char *) arg1);
			break;

		case 2:
			retval = fs_name(arg1, (char *) arg2);
			break;

		case 3:
			retval = fs_maxindex();
			break;
	}
	unlock_kernel();
	return retval;
}
Example #4
0
Program RenderProg::make(const AppData& app_data)
{
	Program prog;

	ResourceFile vs_source("glsl", "render", ".vs.glsl");
	prog << VertexShader(GLSLSource::FromStream(vs_source));

	ResourceFile pk_source("glsl", "pack", ".fs.glsl");
	prog << FragmentShader(GLSLSource::FromStream(pk_source));

	ResourceFile dc_source("glsl", "decode", ".fs.glsl");
	prog << FragmentShader(GLSLSource::FromStream(dc_source));

	std::string fs_name("render-");
	fs_name.append(app_data.finish_shader);
	ResourceFile fs_source("glsl", fs_name, ".fs.glsl");
	prog << FragmentShader(GLSLSource::FromStream(fs_source));

	prog.Link().Use();

	Optional<Uniform<GLfloat>>(prog, "Near").TrySet(app_data.cam_near);
	Optional<Uniform<GLfloat>>(prog, "Far").TrySet(app_data.cam_far);

	Optional<Uniform<Vec3f>>(prog, "LightPos").TrySet(Vec3f(
		app_data.light_x,
		app_data.light_y,
		app_data.light_z
	));
	Optional<Uniform<GLfloat>>(prog, "HighLight").TrySet(app_data.high_light);
	Optional<Uniform<GLfloat>>(prog, "AmbiLight").TrySet(app_data.ambi_light);

	Optional<Uniform<GLfloat>>(prog, "PlanetRadius").TrySet(app_data.planet_radius);
	Optional<Uniform<GLfloat>>(prog, "AtmThickness").TrySet(app_data.atm_thickness);

	return std::move(prog);
}