2010-10-15 10:36:06     I tried to add a new system call for dma control, but it didn't work. QQ

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-10-15 10:36:06     I tried to add a new system call for dma control, but it didn't work. QQ

Fisher Ho (TAIWAN)

Message: 94564   

 

Dear Sirs,

 

    I knew there are two intefaces iotcl and dma_memcpy() for  DMA.

 

   But there are few troubles.

 

   First,

 

        iotcl has long latency so that I can't get benefit using it in my code.

 

  Second,

 

        dma_memcpy() is too simple .  I need more complex manipulation.

 

 

 

  So I add a new system call in linux by mimicking dma_memcpy() and export it to uClibc.

 

  Bu tI failed.    I pose  below where I modified codes. Please help me check where I ignored.

 

 

 

----------------------------------------------------------------------------

 

Linux kernel modified:

 

----------------------------------------------------------------------------

 

/arch/blackfin/mach-common/entrt.S

 

    .long _sys_recvmmsg        /* 370 */

    .long _sys_my_dma_memcpy    /*fisher*/

 

    .rept NR_syscalls-(.-_sys_call_table)/4

    .long _sys_ni_syscall

 

 

 

 

 

/arch/blackfin/kernel/sys_bfin.c

 

asmlinkage void *sys_dma_memcpy(void *dest, const void *src, size_t len)

{

    return safe_dma_memcpy(dest, src, len);

}

 

//fisher

asmlinkage void *sys_my_dma_memcpy(void *dest, const void *src, size_t len)

{

    return safe_dma_memcpy(dest, src, len);

}

 

 

 

/arch/blackfin/include/asm/unistd.h

 

 

 

#define __NR_rt_tgsigqueueinfo    368

#define __NR_perf_event_open    369

#define __NR_recvmmsg        370

 

#define __NR_my_dma_memcpy        371

#define __NR_syscall        372

 

#define NR_syscalls        __NR_syscall

 

 

 

----------------------------------------------------------------------

 

uclibc source code

 

----------------------------------------------------------------------

 

add a file my-dma-memcpy.c. This is mimicked form dma-memcpy.c

 

Makefile also be changed to add my-dma-memcpy.o

 

#include <unistd.h>

#include <errno.h>

#include <sys/syscall.h>

 

 

_syscall3 (__ptr_t, my_dma_memcpy, __ptr_t, dest, __ptr_t, src, size_t, len);

 

 

 

 

 

uClibc/lib/sysdeps/linux/bfin/bfin_sram.h

 

 

 

extern void *dma_memcpy(void *dest, const void *src, size_t len)

    __nonnull((1, 2));

extern void *my_dma_memcpy(void *dest, const void *src, size_t len)

    __nonnull((1, 2));

 

 

 

After building toolchain and kernel, I could find

 

bfin_sram.h and unistd.h are successfully exported to bfin-linux-uclibc

 

 

 

I coud compile  user-programs by bfin-linux-uclibc-gcc, but faile to run on bf561.

 

It showed "can't resolve symbol......."..

 

 

 

Plz help me , I really need this new system call.

TranslateQuoteReplyEditDelete

 

 

2010-10-15 14:01:46     Re: I tried to add a new system call for dma control, but it didn't work. QQ

Mike Frysinger (UNITED STATES)

Message: 94569   

 

adding new system calls is absolutely not supported.  we will not assist you in this endeavor.

 

if you want a low latency DMA controller, use the bfin-dma driver that already exists.

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin-dma

QuoteReplyEditDelete

 

 

2010-10-19 03:32:05     Re: I tried to add a new system call for dma control, but it didn't work. QQ

Fisher Ho (TAIWAN)

Message: 94726   

 

Oh...Thanks anyway

 

 

 

But I figured it out..., My sytem call works.

 

 

 

What I forgot is only.......................I didn't update shared library on the target enviroment...           What a stupid error.

Attachments

    Outcomes