aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Miao <eric.miao@canonical.com>2010-09-07 03:10:14 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-09-24 21:47:03 -0400
commitcfc6a554d7a364997a43964b4b1290487f890447 (patch)
treef9e780f3ec8b791f98085ee82832e11a1d0ba0a4
parent32c4dad8f872fadb0ae3caa15d26e73934982217 (diff)
ARM: pxa: fix cpu_is_pxa*() not expanding to zero when not configured
When CONFIG_PXA3xx is not selected, cpu_is_pxa3xx() doesn't expand to zero, which in some places doesn't result in correct optimization. Signed-off-by: Eric Miao <eric.y.miao@gmail.com> Reported-and-tested-by: Marek Vasut <marek.vasut@gmail.com>
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index 7f64d24cd564..b03650059d15 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -264,23 +264,35 @@
264 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x 264 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
265 * == 0x3 for pxa300/pxa310/pxa320 265 * == 0x3 for pxa300/pxa310/pxa320
266 */ 266 */
267#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
267#define __cpu_is_pxa2xx(id) \ 268#define __cpu_is_pxa2xx(id) \
268 ({ \ 269 ({ \
269 unsigned int _id = (id) >> 13 & 0x7; \ 270 unsigned int _id = (id) >> 13 & 0x7; \
270 _id <= 0x2; \ 271 _id <= 0x2; \
271 }) 272 })
273#else
274#define __cpu_is_pxa2xx(id) (0)
275#endif
272 276
277#ifdef CONFIG_PXA3xx
273#define __cpu_is_pxa3xx(id) \ 278#define __cpu_is_pxa3xx(id) \
274 ({ \ 279 ({ \
275 unsigned int _id = (id) >> 13 & 0x7; \ 280 unsigned int _id = (id) >> 13 & 0x7; \
276 _id == 0x3; \ 281 _id == 0x3; \
277 }) 282 })
283#else
284#define __cpu_is_pxa3xx(id) (0)
285#endif
278 286
287#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935)
279#define __cpu_is_pxa93x(id) \ 288#define __cpu_is_pxa93x(id) \
280 ({ \ 289 ({ \
281 unsigned int _id = (id) >> 4 & 0xfff; \ 290 unsigned int _id = (id) >> 4 & 0xfff; \
282 _id == 0x683 || _id == 0x693; \ 291 _id == 0x683 || _id == 0x693; \
283 }) 292 })
293#else
294#define __cpu_is_pxa93x(id) (0)
295#endif
284 296
285#define cpu_is_pxa2xx() \ 297#define cpu_is_pxa2xx() \
286 ({ \ 298 ({ \
opt">, void *, u32); }; int register_rpmsg_device(struct rpmsg_channel *dev); void unregister_rpmsg_device(struct rpmsg_channel *dev); int register_rpmsg_driver(struct rpmsg_driver *drv); void unregister_rpmsg_driver(struct rpmsg_driver *drv); void rpmsg_destroy_ept(struct rpmsg_endpoint *); struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_channel *, rpmsg_rx_cb_t cb, void *priv, u32 addr); int rpmsg_send_offchannel_raw(struct rpmsg_channel *, u32, u32, void *, int, bool); /** * rpmsg_send() - send a message across to the remote processor * @rpdev: the rpmsg channel * @data: payload of message * @len: length of payload * * This function sends @data of length @len on the @rpdev channel. * The message will be sent to the remote processor which the @rpdev * channel belongs to, using @rpdev's source and destination addresses. * In case there are no TX buffers available, the function will block until * one becomes available, or a timeout of 15 seconds elapses. When the latter * happens, -ERESTARTSYS is returned. * * Can only be called from process context (for now). * * Returns 0 on success and an appropriate error value on failure. */ static inline int rpmsg_send(struct rpmsg_channel *rpdev, void *data, int len) { u32 src = rpdev->src, dst = rpdev->dst; return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true); } /** * rpmsg_sendto() - send a message across to the remote processor, specify dst * @rpdev: the rpmsg channel * @data: payload of message * @len: length of payload * @dst: destination address * * This function sends @data of length @len to the remote @dst address. * The message will be sent to the remote processor which the @rpdev * channel belongs to, using @rpdev's source address. * In case there are no TX buffers available, the function will block until * one becomes available, or a timeout of 15 seconds elapses. When the latter * happens, -ERESTARTSYS is returned. * * Can only be called from process context (for now). * * Returns 0 on success and an appropriate error value on failure. */ static inline int rpmsg_sendto(struct rpmsg_channel *rpdev, void *data, int len, u32 dst) { u32 src = rpdev->src; return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true); } /** * rpmsg_send_offchannel() - send a message using explicit src/dst addresses * @rpdev: the rpmsg channel * @src: source address * @dst: destination address * @data: payload of message * @len: length of payload * * This function sends @data of length @len to the remote @dst address, * and uses @src as the source address. * The message will be sent to the remote processor which the @rpdev * channel belongs to. * In case there are no TX buffers available, the function will block until * one becomes available, or a timeout of 15 seconds elapses. When the latter * happens, -ERESTARTSYS is returned. * * Can only be called from process context (for now). * * Returns 0 on success and an appropriate error value on failure. */ static inline int rpmsg_send_offchannel(struct rpmsg_channel *rpdev, u32 src, u32 dst, void *data, int len) { return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true); } /** * rpmsg_send() - send a message across to the remote processor * @rpdev: the rpmsg channel * @data: payload of message * @len: length of payload * * This function sends @data of length @len on the @rpdev channel. * The message will be sent to the remote processor which the @rpdev * channel belongs to, using @rpdev's source and destination addresses. * In case there are no TX buffers available, the function will immediately * return -ENOMEM without waiting until one becomes available. * * Can only be called from process context (for now). * * Returns 0 on success and an appropriate error value on failure. */ static inline int rpmsg_trysend(struct rpmsg_channel *rpdev, void *data, int len) {