1
0

physalloc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .TH PHYSALLOC 9
  2. .SH NAME
  3. physalloc, physfree, phystag, physinit, physallocdump \- kernel buddy allocator for physical addresses
  4. .SH SYNOPSIS
  5. .ta \w'\fLuintmem 'u
  6. .de PB
  7. .PP
  8. .ft L
  9. .nf
  10. ..
  11. .PB
  12. void physinit(uintmem pa, u64int size)
  13. .PB
  14. uintmem physalloc(u64int size, int *colorp, void *tag)
  15. .PB
  16. void* phystag(uintmem pa)
  17. .PB
  18. void physfree(uintmem pa, u64int size)
  19. .PB
  20. char* seprintphysstats(char *s, char *e)
  21. .SH DESCRIPTION
  22. The kernel contains a buddy allocator to hand out large chunks of
  23. memory outside the kernel heap. The buddy allocator does not
  24. assign virtual addresses. The map is populated by one or more calls to
  25. .IR physinit .
  26. .I Physalloc
  27. allocates a region of the given color with the given tag. If the color
  28. is -1, then any memory color may be used, otherwise only memory
  29. of the given color will be allocated. The
  30. .B tag
  31. is user-defined. Calls to
  32. .I phystag
  33. map addresses in the allocation back to
  34. .BR tag .
  35. Allocated regions are freed with
  36. .IR physfree .
  37. Stats may be put in a buffer with
  38. .IR seprintstats ,
  39. which takes a pointer to a buffer and its end as
  40. .IR seprint .
  41. .SH SOURCE
  42. .B /sys/src/9k/k10/physalloc.c
  43. .SH "SEE ALSO"
  44. .IR qmalloc (9k),