mem_pieces.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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