diff options
author | Timur Tabi <timur@freescale.com> | 2007-05-08 15:46:36 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-05-10 00:01:43 -0400 |
commit | 4c35630ccda56ed494f6102d2e147fefe14b78d2 (patch) | |
tree | 4f04754fb0ec6978923b3c1e0318997e420f6551 /include/asm-powerpc | |
parent | 742226c579c573c24386aaf41969a01ee058b97e (diff) |
[POWERPC] Change rheap functions to use ulongs instead of pointers
The rheap allocation functions return a pointer, but the actual value is based
on how the heap was initialized, and so it can be anything, e.g. an offset
into a buffer. A ulong is a better representation of the value returned by
the allocation functions.
This patch changes all of the relevant rheap functions to use a unsigned long
integers instead of a pointer. In case of an error, the value returned is
a negative error code that has been cast to an unsigned long. The caller can
use the IS_ERR_VALUE() macro to check for this.
All code which calls the rheap functions is updated accordingly. Macros
IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE().
Also added error checking to rh_attach_region().
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/qe.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h index a62168ec535f..9d304b1f1608 100644 --- a/include/asm-powerpc/qe.h +++ b/include/asm-powerpc/qe.h | |||
@@ -38,11 +38,11 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input); | |||
38 | void qe_setbrg(u32 brg, u32 rate); | 38 | void qe_setbrg(u32 brg, u32 rate); |
39 | int qe_get_snum(void); | 39 | int qe_get_snum(void); |
40 | void qe_put_snum(u8 snum); | 40 | void qe_put_snum(u8 snum); |
41 | u32 qe_muram_alloc(u32 size, u32 align); | 41 | unsigned long qe_muram_alloc(int size, int align); |
42 | int qe_muram_free(u32 offset); | 42 | int qe_muram_free(unsigned long offset); |
43 | u32 qe_muram_alloc_fixed(u32 offset, u32 size); | 43 | unsigned long qe_muram_alloc_fixed(unsigned long offset, int size); |
44 | void qe_muram_dump(void); | 44 | void qe_muram_dump(void); |
45 | void *qe_muram_addr(u32 offset); | 45 | void *qe_muram_addr(unsigned long offset); |
46 | 46 | ||
47 | /* Buffer descriptors */ | 47 | /* Buffer descriptors */ |
48 | struct qe_bd { | 48 | struct qe_bd { |
@@ -448,10 +448,5 @@ struct ucc_slow_pram { | |||
448 | #define UCC_FAST_FUNCTION_CODE_DTB_LCL 0x02 | 448 | #define UCC_FAST_FUNCTION_CODE_DTB_LCL 0x02 |
449 | #define UCC_FAST_FUNCTION_CODE_BDB_LCL 0x01 | 449 | #define UCC_FAST_FUNCTION_CODE_BDB_LCL 0x01 |
450 | 450 | ||
451 | static inline long IS_MURAM_ERR(const u32 offset) | ||
452 | { | ||
453 | return offset > (u32) - 1000L; | ||
454 | } | ||
455 | |||
456 | #endif /* __KERNEL__ */ | 451 | #endif /* __KERNEL__ */ |
457 | #endif /* _ASM_POWERPC_QE_H */ | 452 | #endif /* _ASM_POWERPC_QE_H */ |