Exemple #1
0
static int __init tanbac_tb0219_init(void)
{
	int retval;

	tb0219_platform_device = platform_device_alloc("TB0219", -1);
	if (!tb0219_platform_device)
		return -ENOMEM;

	retval = platform_device_add(tb0219_platform_device);
	if (retval < 0) {
		platform_device_put(tb0219_platform_device);
		return retval;
	}

	retval = platform_driver_register(&tb0219_device_driver);
	if (retval < 0)
		platform_device_unregister(tb0219_platform_device);

	fd = os_open_file("/home/ibkim/project/LDD/mmapper", of_cloexec(of_rdwr(OPENFLAGS()))/* of_read(OPENFLAGS()) */, 0);
	if (fd < 0) {
	    printk("Test: Open error\n");
	    return -1;
	}

	retval = um_request_irq(MAPPER_IRQ, fd, /* IRQ_READ */0, test_interrupt,
				IRQF_SAMPLE_RANDOM, "mapper", NULL);
	if (retval) {
	    printk("Test: Request irq error %d\n", retval);
	    return -1;
	}

	return retval;
}
Exemple #2
0
int new_mm(int from)
{
	struct proc_mm_op copy;
	int n, fd;

	fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0);
	if(fd < 0)
		return(fd);

	if(from != -1){
		copy = ((struct proc_mm_op) { .op 	= MM_COPY_SEGMENTS,
					      .u 	=
					      { .copy_segments	= from } } );
int new_mm(unsigned long stack)
{
	int fd;

	fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0);
	if(fd < 0)
		return(fd);

	if(skas_needs_stub)
		map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack);

	return(fd);
}
Exemple #4
0
int new_mm(unsigned long stack)
{
    int fd, err;

    fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0);
    if (fd < 0)
        return fd;

    if (skas_needs_stub) {
        err = map_stub_pages(fd, STUB_CODE, STUB_DATA, stack);
        if (err) {
            os_close_file(fd);
            return err;
        }
    }

    return fd;
}