Changes between Version 9 and Version 10 of kernel_syscalls


Ignore:
Timestamp:
Oct 29, 2014, 5:07:08 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_syscalls

    v9 v10  
    11= GIET-VM  / Syscall Handler =
    22
    3 The [source:soft/giet_vm/giet_kernel/sys_handler.c sys_handler.c] and [source:soft/giet_vm/giet_kernel/sys_handler.h sys_handler.h] files define the kernel data structure and functions that are used to handle the system calls. They are prefixed by ''_'' to remind that they can only be executed by a processor in kernel mode.
     3The [source:soft/giet_vm/giet_kernel/sys_handler.c sys_handler.c] and [source:soft/giet_vm/giet_kernel/sys_handler.h sys_handler.h] files define the kernel data structure and functions that are used to handle the system calls. These functions are prefixed by ''_'' to remind that they can only be executed by a processor in kernel mode.
    44
    55[[PageOutline]]
     
    6363
    6464
     65== __ FBF related syscall handlers__==
     66
     67There exist two methods to access the ''vci_framebuffer'':
     68 * The _sys_fbf_sync_write() and _sys_fbf_sync_read() functions use a memcpy strategy to implement the transfer between a data buffer (user space) and the frame buffer (kernel space). They are blocking until completion of the transfer.
     69 * The _sys_fbf_cma_alloc(), _sys_fbf_cma_start(),  _sys_fbf_cma_display(), and _sys_fbf_cma_stop() functions use the ''vci_chbuf_dma'' component to transfer a stream of images from an user space chained buffer (two buffers) to the frame buffer.
     70 
     71 === int '''_sys_fbf_sync_write'''( unsigned int offset,  void* buffer,   unsigned int length ) ===
     72This function transfer data from an user buffer to the frame_buffer device using a memcpy.
     73 * '''offset''' : offset (in bytes) in the frame buffer.
     74 * '''buffer''' : base address of the memory buffer.
     75 * '''length''' : number of bytes to be transfered.
     76
     77 === int '''_sys_fbf_sync_read'''( unsigned int offset,  void* buffer,   unsigned int length ) ===
     78This function transfer data from the frame_buffer device to anuser buffer using a memcpy.
     79 * '''offset''' : offset (in bytes) in the frame buffer.
     80 * '''buffer''' : base address of the memory buffer.
     81 * '''length''' : number of bytes to be transfered.
     82
     83 === int '''_sys_fbf_cma_alloc'''() ===
     84This function allocates a private CMA channel to the calling task, and register the channel index in the task context.
     85Return -1 if no CMA channel available.
     86 
     87 === int '''_sys_fbf_cma_start'''( void* vbase0,  void* vbase1,  unsigned int length ) ===
     88This function initializes the CMA channel to start the transfer of a stream of images from an user chbuf (two buffers) to the frame buffer chbuf (one single buffer). The user buffers must be aligned on a word boundary.
     89 * '''vbase0''' : virtual base address of the first user buffer.
     90 * '''vbase1''' : virtual base address of the second user buffer.
     91 * '''length''' : buffer length (bytes)
     92It uses the _fbf_chbuf[] and _fbf_chbuf_paddr[] arrays, that are both indexed by the channel index, and makes the following actions:
     931. it computes the physical addresses for the two source user buffers, for the destination frame buffer, and initializes the channel descriptor _fbf_chbuf[i].
     942. it computes the physical address for the chbuf descriptor and register it in the _fbf_chbuf_paddr[i].
     953. it makes a SYNC request to L2 cache for channel descriptor if the IOB is used, because the channel descriptor is directly accessed in XRAM by the CMA component.
     964. it Starts the CMA hardware channel, that will poll the channel descriptor to fransfer an user buffer to the frame buffer as soon as the source user buffer is marked valid.
     97Return 0 in case of success.
     98Return -1 if no CMA channel allocated to the calling task, or if user buffers not aligned on a word boundary.
     99
     100 === int '''_sys_fbf_cma_display'''( unsigned int index ) ===
     101This function is used in conjunction with the _fbf_cma_start() function, and must be called each time a new user buffer is available for display, to set the user buffer status in the chbuf descriptor.
     102The '''buffer'''  argument define the user buffer index (0 => buf0 / not 0 => buf1).
     103It makes the following actions if the IO Bridge component is used:
     1041. it makes an INVAL request for the channel descriptor, before testing the source buffer status, because it is modified in XRAM by the CMA component.
     1052. it makes a SYNC request for the source user buffer before activating the CMA  transfer, because the data will be read from XRAM by the CMA component.
     1063. it makes a SYNC request for the channel descriptor after modification of the SRC and DST status, because these descriptors will be read from XRAM by the CMA component.
     107Return 0 in case of success.
     108Return -1 if no CMA channel allocated to the calling task.
     109
     110 === int '''_sys_fbf_cma_stop'''() ===
     111This function  desactivares the CMA channel  allocated to the calling task.
     112Return 0 in case of success.
     113Return -1 if no CMA channel allocated to the calling task.
     114
     115
     116
     117
    65118== __Miscelaneous syscall handlers__ ==
    66119