| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |  | 
 | 17 | #ifndef __MEM_PIECES_H__ | 
 | 18 | #define	__MEM_PIECES_H__ | 
 | 19 |  | 
 | 20 | #include <asm/prom.h> | 
 | 21 |  | 
 | 22 | #ifdef __cplusplus | 
 | 23 | extern "C" { | 
 | 24 | #endif | 
 | 25 |  | 
 | 26 |  | 
 | 27 | /* Type Definitions */ | 
 | 28 |  | 
 | 29 | #define	MEM_PIECES_MAX	32 | 
 | 30 |  | 
 | 31 | struct mem_pieces { | 
 | 32 |     int n_regions; | 
 | 33 |     struct reg_property regions[MEM_PIECES_MAX]; | 
 | 34 | }; | 
 | 35 |  | 
 | 36 | /* Function Prototypes */ | 
 | 37 |  | 
 | 38 | extern void	*mem_pieces_find(unsigned int size, unsigned int align); | 
 | 39 | extern void	 mem_pieces_remove(struct mem_pieces *mp, unsigned int start, | 
 | 40 | 				   unsigned int size, int must_exist); | 
 | 41 | extern void	 mem_pieces_coalesce(struct mem_pieces *mp); | 
 | 42 | extern void	 mem_pieces_sort(struct mem_pieces *mp); | 
 | 43 |  | 
 | 44 | #ifdef __cplusplus | 
 | 45 | } | 
 | 46 | #endif | 
 | 47 |  | 
 | 48 | #endif /* __MEM_PIECES_H__ */ |