xref: /plan9-contrib/sys/man/9k/physalloc (revision 9a45c011ebb706952407e415a3edd55793286a9e)
PHYSALLOC 9
NAME
physalloc, physfree, phystag, physinit, physallocdump - kernel buddy allocator for physical addresses
SYNOPSIS

..

B void physinit(uintmem pa, u64int size)

B uintmem physalloc(u64int size, int *colorp, void *tag)

B void* phystag(uintmem pa)

B void physfree(uintmem pa, u64int size)

B char* seprintphysstats(char *s, char *e)

DESCRIPTION
The kernel contains a buddy allocator to hand out large chunks of memory outside the kernel heap. The buddy allocator does not assign virtual addresses. The map is populated by one or more calls to physinit . Physalloc allocates a region of the given color with the given tag. If the color is -1, then any memory color may be used, otherwise only memory of the given color will be allocated. The tag is user-defined. Calls to phystag map addresses in the allocation back to tag . Allocated regions are freed with physfree . Stats may be put in a buffer with seprintstats , which takes a pointer to a buffer and its end as seprint .
SOURCE
/sys/src/9k/k10/physalloc.c
"SEE ALSO"
qmalloc (9k),