Add sized_kzmalloc()
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 7 Sep 2016 16:27:15 +0000 (12:27 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 7 Sep 2016 16:38:17 +0000 (12:38 -0400)
commit74ac14dca44a84e31feea7809b33310ad5f71216
tree6e02cb627145406bcfc76603bfc864280cbfe6bd
parentc7c388e82aea5b1f37028641a0b67f8ce049cdfb
Add sized_kzmalloc()

Synthetic drivers often need to generate some text, based on some command,
and then let read()s copy parts of that buffer out.  Those drivers know the
size too, and would like an easy way to manage their memory.  Enter the
sized_allloc.

It's just a buffer and a size, which is sufficient for drivers.  Free the
whole thing with kfree.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/kmalloc.h
kern/src/kmalloc.c