[Cbe-oss-dev] [PATCH] Fix for syscall names in libspe-1.2.0

Julio M. Merino Vidal jmerino at ac.upc.edu
Mon May 28 03:58:41 EST 2007


Any news on this?  The problem is still present in the SVN  
repository.  (Note that libspe2 has a spu.h file which is correct in  
this regard.  Maybe libspe's spe.h should be renamed to spu.h too  
alongside all its contents.)



On 22/03/2007, at 10:31, Julio M. Merino Vidal wrote:

> Hi,
>
> Here goes a patch that fixes an inconsistency between the syscall
> "names" defined
> in libspe (include/sys/spe.h) and those defined by the kernel.  More
> details in
> the patch header below.
>
> Subject: Fix syscall names
>
> The unistd.h header exposes symbolic names for syscall numbers.
> Those used
> by the SPE's syscalls are prefixed with '__NR_spu', not '__NR_spe',
> but the
> code here was using the latter to refer to them.  Therefore, it never
> had
> a chance of using the values provided by the system and it felt back
> to the
> ones hardcoded here.
> Index: libspe-1.2.0/include/sys/spe.h
> ===================================================================
> --- libspe-1.2.0.orig/include/sys/spe.h
> +++ libspe-1.2.0/include/sys/spe.h
> @@ -4,12 +4,12 @@
> #include <sys/syscall.h>
> #include <unistd.h>
> -#ifndef __NR_spe_run
> -#define __NR_spe_run 278
> +#ifndef __NR_spu_run
> +#define __NR_spu_run 278
> #endif
> -#ifndef __NR_spe_create
> -#define __NR_spe_create 279
> +#ifndef __NR_spu_create
> +#define __NR_spu_create 279
> #endif
> #define SPU_CREATE_EVENTS_ENABLED 0x0001
> @@ -20,12 +20,12 @@
> static inline int spe_run(int fd, unsigned int *npc, unsigned int
> *status)
> {
> -	return syscall(__NR_spe_run, fd, npc, status);
> +	return syscall(__NR_spu_run, fd, npc, status);
> }
> static inline int spe_create(const char * path, int flags, mode_t  
> mode)
> {
> -	return syscall(__NR_spe_create, path, flags, mode);
> +	return syscall(__NR_spu_create, path, flags, mode);
> }
> #endif
>
> -- 
> Julio M. Merino Vidal <jmerino at ac.upc.edu>
>
>
> _______________________________________________
> cbe-oss-dev mailing list
> cbe-oss-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/cbe-oss-dev

-- 
Julio M. Merino Vidal <jmerino at ac.upc.edu>





More information about the cbe-oss-dev mailing list