mem_pieces.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
  3. * Changes to accommodate Power Macintoshes.
  4. * Cort Dougan <cort@cs.nmt.edu>
  5. * Rewrites.
  6. * Grant Erickson <grant@lcse.umn.edu>
  7. * General rework and split from mm/init.c.
  8. *
  9. * Module name: mem_pieces.h
  10. *
  11. * Description:
  12. * Routines and data structures for manipulating and representing
  13. * phyiscal memory extents (i.e. address/length pairs).
  14. *
  15. */
  16. #ifndef __MEM_PIECES_H__
  17. #define __MEM_PIECES_H__
  18. #include <asm/prom.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /* Type Definitions */
  23. #define MEM_PIECES_MAX 32
  24. struct mem_pieces {
  25. int n_regions;
  26. struct reg_property regions[MEM_PIECES_MAX];
  27. };
  28. /* Function Prototypes */
  29. extern void *mem_pieces_find(unsigned int size, unsigned int align);
  30. extern void mem_pieces_remove(struct mem_pieces *mp, unsigned int start,
  31. unsigned int size, int must_exist);
  32. extern void mem_pieces_coalesce(struct mem_pieces *mp);
  33. extern void mem_pieces_sort(struct mem_pieces *mp);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* __MEM_PIECES_H__ */