Re: Cute kernel trick, or communistic ploy?

From: Werner Almesberger (wa@almesberger.net)
Date: Fri May 30 2003 - 23:08:05 EST


I wrote:
> (I shouldn't need to kmalloc $data or the casts in kfree.
> Two more things to fix ...)

Ancient history. With the current version
http://umlsim.sourceforge.net/umlsim-37.tar.gz
it can be written as

#define GFP_ATOMIC 0x20
$uml = $run_uml("A","no-such-script",1);
$page = (char *) kmalloc(4096,GFP_ATOMIC);
$start = (char **) kmalloc(4,GFP_ATOMIC);
$eof = (int *) kmalloc(4,GFP_ATOMIC);
uptime_read_proc($page,$start,0,0,$eof,0);
kfree($eof);
printk(*$start);
kfree($start);
kfree($page);

- Werner

--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina wa@xxxxxxxxxxxxxxx /
/_http://www.almesberger.net/____________________________________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/