diff options
| author | Iliyan Malchev <malchev@google.com> | 2009-10-23 18:58:19 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-23 18:58:19 -0700 |
| commit | f1729553e310b55eef8ee784c95cd9dd8ffd24fd (patch) | |
| tree | 28887d23e21d7933e8af752973cb68bc8a11ee6f /linker/ba.h | |
| parent | 943043583a8f3a8de34970b550a3e8e8a6fb0fb8 (diff) | |
| parent | 9e78de3e3c90ec3c2970431d8eae7378fdc0dac6 (diff) | |
| download | bionic-f1729553e310b55eef8ee784c95cd9dd8ffd24fd.zip bionic-f1729553e310b55eef8ee784c95cd9dd8ffd24fd.tar.gz bionic-f1729553e310b55eef8ee784c95cd9dd8ffd24fd.tar.bz2 | |
am 9e78de3e: am 70bba516: am 763ac283: Merge changes Ibcba4b4f,I9af341e1 into eclair
Merge commit '9e78de3e3c90ec3c2970431d8eae7378fdc0dac6'
* commit '9e78de3e3c90ec3c2970431d8eae7378fdc0dac6':
bionic/linker: make the buddy allocator compute max_order on its own
bionic/linker: change the buddy allocator to take a handle to the managed area
Diffstat (limited to 'linker/ba.h')
| -rw-r--r-- | linker/ba.h | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/linker/ba.h b/linker/ba.h index 78f4626..c11017b 100644 --- a/linker/ba.h +++ b/linker/ba.h @@ -29,10 +29,31 @@ #ifndef __LINKER_BA_H #define __LINKER_BA_H -extern void ba_init(void); -extern int ba_allocate(unsigned long len); -extern int ba_free(int index); -extern unsigned long ba_start_addr(int index); -extern unsigned long ba_len(int index); +struct ba_bits { + unsigned allocated:1; /* 1 if allocated, 0 if free */ + unsigned order:7; /* size of the region in ba space */ +}; + +struct ba { + /* start address of the ba space */ + unsigned long base; + /* total size of the ba space */ + unsigned long size; + /* the smaller allocation that can be made */ + unsigned long min_alloc; + /* the order of the largest allocation that can be made */ + unsigned long max_order; + /* number of entries in the ba space */ + int num_entries; + /* the bitmap for the region indicating which entries are allocated + * and which are free */ + struct ba_bits *bitmap; +}; + +extern void ba_init(struct ba *ba); +extern int ba_allocate(struct ba *ba, unsigned long len); +extern int ba_free(struct ba *ba, int index); +extern unsigned long ba_start_addr(struct ba *ba, int index); +extern unsigned long ba_len(struct ba *ba, int index); #endif |
