diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-12 19:09:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-27 12:23:59 -0400 |
commit | d75fc8bbccf7c019994bcfd6255d5b56335ed21d (patch) | |
tree | 51eee480485d640e2b7b1efd9e98eadb683fadcd /kernel | |
parent | cf7c712c11fb881842534efe98a07f36f1c86c65 (diff) |
[PATCH] 64bit resource: change resource core to use resource_size_t
Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/resource.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index ea5f7811a408..54835c02ab37 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -151,8 +151,8 @@ __initcall(ioresources_init); | |||
151 | /* Return the conflict entry if you can't request it */ | 151 | /* Return the conflict entry if you can't request it */ |
152 | static struct resource * __request_resource(struct resource *root, struct resource *new) | 152 | static struct resource * __request_resource(struct resource *root, struct resource *new) |
153 | { | 153 | { |
154 | unsigned long start = new->start; | 154 | resource_size_t start = new->start; |
155 | unsigned long end = new->end; | 155 | resource_size_t end = new->end; |
156 | struct resource *tmp, **p; | 156 | struct resource *tmp, **p; |
157 | 157 | ||
158 | if (end < start) | 158 | if (end < start) |
@@ -236,11 +236,10 @@ EXPORT_SYMBOL(release_resource); | |||
236 | * Find empty slot in the resource tree given range and alignment. | 236 | * Find empty slot in the resource tree given range and alignment. |
237 | */ | 237 | */ |
238 | static int find_resource(struct resource *root, struct resource *new, | 238 | static int find_resource(struct resource *root, struct resource *new, |
239 | unsigned long size, | 239 | resource_size_t size, resource_size_t min, |
240 | unsigned long min, unsigned long max, | 240 | resource_size_t max, resource_size_t align, |
241 | unsigned long align, | ||
242 | void (*alignf)(void *, struct resource *, | 241 | void (*alignf)(void *, struct resource *, |
243 | unsigned long, unsigned long), | 242 | resource_size_t, resource_size_t), |
244 | void *alignf_data) | 243 | void *alignf_data) |
245 | { | 244 | { |
246 | struct resource *this = root->child; | 245 | struct resource *this = root->child; |
@@ -282,11 +281,10 @@ static int find_resource(struct resource *root, struct resource *new, | |||
282 | * Allocate empty slot in the resource tree given range and alignment. | 281 | * Allocate empty slot in the resource tree given range and alignment. |
283 | */ | 282 | */ |
284 | int allocate_resource(struct resource *root, struct resource *new, | 283 | int allocate_resource(struct resource *root, struct resource *new, |
285 | unsigned long size, | 284 | resource_size_t size, resource_size_t min, |
286 | unsigned long min, unsigned long max, | 285 | resource_size_t max, resource_size_t align, |
287 | unsigned long align, | ||
288 | void (*alignf)(void *, struct resource *, | 286 | void (*alignf)(void *, struct resource *, |
289 | unsigned long, unsigned long), | 287 | resource_size_t, resource_size_t), |
290 | void *alignf_data) | 288 | void *alignf_data) |
291 | { | 289 | { |
292 | int err; | 290 | int err; |
@@ -378,10 +376,10 @@ EXPORT_SYMBOL(insert_resource); | |||
378 | * arguments. Returns -EBUSY if it can't fit. Existing children of | 376 | * arguments. Returns -EBUSY if it can't fit. Existing children of |
379 | * the resource are assumed to be immutable. | 377 | * the resource are assumed to be immutable. |
380 | */ | 378 | */ |
381 | int adjust_resource(struct resource *res, unsigned long start, unsigned long size) | 379 | int adjust_resource(struct resource *res, resource_size_t start, resource_size_t size) |
382 | { | 380 | { |
383 | struct resource *tmp, *parent = res->parent; | 381 | struct resource *tmp, *parent = res->parent; |
384 | unsigned long end = start + size - 1; | 382 | resource_size_t end = start + size - 1; |
385 | int result = -EBUSY; | 383 | int result = -EBUSY; |
386 | 384 | ||
387 | write_lock(&resource_lock); | 385 | write_lock(&resource_lock); |
@@ -428,7 +426,9 @@ EXPORT_SYMBOL(adjust_resource); | |||
428 | * | 426 | * |
429 | * Release-region releases a matching busy region. | 427 | * Release-region releases a matching busy region. |
430 | */ | 428 | */ |
431 | struct resource * __request_region(struct resource *parent, unsigned long start, unsigned long n, const char *name) | 429 | struct resource * __request_region(struct resource *parent, |
430 | resource_size_t start, resource_size_t n, | ||
431 | const char *name) | ||
432 | { | 432 | { |
433 | struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); | 433 | struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); |
434 | 434 | ||
@@ -464,7 +464,8 @@ struct resource * __request_region(struct resource *parent, unsigned long start, | |||
464 | 464 | ||
465 | EXPORT_SYMBOL(__request_region); | 465 | EXPORT_SYMBOL(__request_region); |
466 | 466 | ||
467 | int __check_region(struct resource *parent, unsigned long start, unsigned long n) | 467 | int __check_region(struct resource *parent, resource_size_t start, |
468 | resource_size_t n) | ||
468 | { | 469 | { |
469 | struct resource * res; | 470 | struct resource * res; |
470 | 471 | ||
@@ -479,10 +480,11 @@ int __check_region(struct resource *parent, unsigned long start, unsigned long n | |||
479 | 480 | ||
480 | EXPORT_SYMBOL(__check_region); | 481 | EXPORT_SYMBOL(__check_region); |
481 | 482 | ||
482 | void __release_region(struct resource *parent, unsigned long start, unsigned long n) | 483 | void __release_region(struct resource *parent, resource_size_t start, |
484 | resource_size_t n) | ||
483 | { | 485 | { |
484 | struct resource **p; | 486 | struct resource **p; |
485 | unsigned long end; | 487 | resource_size_t end; |
486 | 488 | ||
487 | p = &parent->child; | 489 | p = &parent->child; |
488 | end = start + n - 1; | 490 | end = start + n - 1; |