Re: [PATCH] fix spu_callbacks BUILD_BUG_ON

From: Jan Engelhardt
Date: Fri Apr 21 2006 - 09:15:24 EST



>--- linus-2.6.orig/arch/powerpc/platforms/cell/spu_callbacks.c
>+++ linus-2.6/arch/powerpc/platforms/cell/spu_callbacks.c
>@@ -317,17 +317,16 @@ void *spu_syscall_table[] = {
> [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
> [__NR_unshare] sys_unshare,
> [__NR_splice] sys_splice,
>+ [__NR_tee] sys_tee,

+ [__NR_syscalls] = NULL,

> };
>
> long spu_sys_callback(struct spu_syscall_block *s)
> {
> long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
>
>- BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls);
>-
> syscall = spu_syscall_table[s->nr_ret];
>
>- if (s->nr_ret >= __NR_syscalls) {
>+ if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {

+ if(syscall == NULL) {



That way, syscalls could be added in the master table while spu does not
break. Comments?


Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/