Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212689
b: refs/heads/master
c: b693fff
h: refs/heads/master
i:
  212687: 193a178
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Aug 5, 2010
1 parent 1d693ed commit 7cfc328
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e2b904026e9debf95f500b8980a00c43ac0f31c
refs/heads/master: b693fffb189fbfe7e1e8317ce5838808be8666a0
1 change: 0 additions & 1 deletion trunk/include/linux/memblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ extern int memblock_is_memory(u64 addr);
extern int memblock_is_region_memory(u64 base, u64 size);
extern int __init memblock_is_reserved(u64 addr);
extern int memblock_is_region_reserved(u64 base, u64 size);
extern int memblock_find(struct memblock_region *res);

extern void memblock_dump_all(void);

Expand Down
32 changes: 0 additions & 32 deletions trunk/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,35 +531,3 @@ int memblock_is_region_reserved(u64 base, u64 size)
return memblock_overlaps_region(&memblock.reserved, base, size) >= 0;
}

/*
* Given a <base, len>, find which memory regions belong to this range.
* Adjust the request and return a contiguous chunk.
*/
int memblock_find(struct memblock_region *res)
{
int i;
u64 rstart, rend;

rstart = res->base;
rend = rstart + res->size - 1;

for (i = 0; i < memblock.memory.cnt; i++) {
u64 start = memblock.memory.regions[i].base;
u64 end = start + memblock.memory.regions[i].size - 1;

if (start > rend)
return -1;

if ((end >= rstart) && (start < rend)) {
/* adjust the request */
if (rstart < start)
rstart = start;
if (rend > end)
rend = end;
res->base = rstart;
res->size = rend - rstart + 1;
return 0;
}
}
return -1;
}

0 comments on commit 7cfc328

Please sign in to comment.