git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git]
/
arch
/
powerpc
/
boot
/
simple_alloc.c
diff --git
a/arch/powerpc/boot/simple_alloc.c
b/arch/powerpc/boot/simple_alloc.c
index
cfe3a75
..
65ec135
100644
(file)
--- a/
arch/powerpc/boot/simple_alloc.c
+++ b/
arch/powerpc/boot/simple_alloc.c
@@
-19,24
+19,24
@@
#define ENTRY_IN_USE 0x02
static struct alloc_info {
#define ENTRY_IN_USE 0x02
static struct alloc_info {
- u
32
flags;
- u
32
base;
- u
32
size;
+ u
nsigned long
flags;
+ u
nsigned long
base;
+ u
nsigned long
size;
} *alloc_tbl;
} *alloc_tbl;
-static u
32
tbl_entries;
-static u
32
alloc_min;
-static u
32
next_base;
-static u
32
space_left;
+static u
nsigned long
tbl_entries;
+static u
nsigned long
alloc_min;
+static u
nsigned long
next_base;
+static u
nsigned long
space_left;
/*
* First time an entry is used, its base and size are set.
* An entry can be freed and re-malloc'd but its base & size don't change.
* Should be smart enough for needs of bootwrapper.
*/
/*
* First time an entry is used, its base and size are set.
* An entry can be freed and re-malloc'd but its base & size don't change.
* Should be smart enough for needs of bootwrapper.
*/
-static void *simple_malloc(u
32
size)
+static void *simple_malloc(u
nsigned long
size)
{
{
- u
32
i;
+ u
nsigned long
i;
struct alloc_info *p = alloc_tbl;
if (size == 0)
struct alloc_info *p = alloc_tbl;
if (size == 0)
@@
-67,13
+67,14
@@
err_out:
static struct alloc_info *simple_find_entry(void *ptr)
{
static struct alloc_info *simple_find_entry(void *ptr)
{
- u
32
i;
+ u
nsigned long
i;
struct alloc_info *p = alloc_tbl;
for (i=0; i<tbl_entries; i++,p++) {
if (!(p->flags & ENTRY_BEEN_USED))
break;
struct alloc_info *p = alloc_tbl;
for (i=0; i<tbl_entries; i++,p++) {
if (!(p->flags & ENTRY_BEEN_USED))
break;
- if ((p->flags & ENTRY_IN_USE) && (p->base == (u32)ptr))
+ if ((p->flags & ENTRY_IN_USE) &&
+ (p->base == (unsigned long)ptr))
return p;
}
return NULL;
return p;
}
return NULL;
@@
-122,10
+123,10
@@
static void *simple_realloc(void *ptr, unsigned long size)
* Returns addr of first byte after heap so caller can see if it took
* too much space. If so, change args & try again.
*/
* Returns addr of first byte after heap so caller can see if it took
* too much space. If so, change args & try again.
*/
-void *simple_alloc_init(char *base, u
32 heap_size, u32 granularity
,
-
u32
max_allocs)
+void *simple_alloc_init(char *base, u
nsigned long heap_size
,
+
unsigned long granularity, unsigned long
max_allocs)
{
{
- u
32
heap_base, tbl_size;
+ u
nsigned long
heap_base, tbl_size;
heap_size = _ALIGN_UP(heap_size, granularity);
alloc_min = granularity;
heap_size = _ALIGN_UP(heap_size, granularity);
alloc_min = granularity;
@@
-136,7
+137,7
@@
void *simple_alloc_init(char *base, u32 heap_size, u32 granularity,
alloc_tbl = (struct alloc_info *)_ALIGN_UP((unsigned long)base, 8);
memset(alloc_tbl, 0, tbl_size);
alloc_tbl = (struct alloc_info *)_ALIGN_UP((unsigned long)base, 8);
memset(alloc_tbl, 0, tbl_size);
- heap_base = _ALIGN_UP((u
32
)alloc_tbl + tbl_size, alloc_min);
+ heap_base = _ALIGN_UP((u
nsigned long
)alloc_tbl + tbl_size, alloc_min);
next_base = heap_base;
space_left = heap_size;
next_base = heap_base;
space_left = heap_size;