Arm Linux 2.6.24 添加系统调用(2)

#if 0
        /* Print data in ASCII characters */
        printk ("    ");
        for (i = 0; i < linelen * width; i++)
            fputc (isprint (ucp[i]) && (ucp[i] < 0x80) ? ucp[i] : '.', stdout);

fputc ('\n', stdout);
#endif
        printk("\n");
        /* update references */
        addr += linelen * width;
        count -= linelen;
    }
    return 0;
}

asmlinkage int sys_kmd(unsigned int v_addr)
{
    ulong length = 64, p_addr = 0, size = 4;
    if (0 == v_addr)
    {
        printk("v_addr = %x\n", (unsigned int)v_addr);
        return -1;
    }
    p_addr = virt_to_phys((void *)v_addr);
    printk("v_addr   <--> p_addr\n");
    printk("%08x <--> %08x\n", (unsigned int)v_addr,
                    (unsigned int)p_addr);
    print_buffer (v_addr, (void *) v_addr, size, length,
                        DISP_LINE_LEN / size);

return 0;
}
#endif

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/25348.html