My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
echo_task.c File Reference
#include <sw_types.h>
#include <sw_buddy.h>
#include <sw_debug.h>
#include <cpu_data.h>
#include <global.h>
#include <task.h>
#include <dispatcher_task.h>
#include <sw_string_functions.h>
#include <sw_mem_functions.h>
#include <sw_wait.h>
#include <sw_semaphores.h>
#include <otz_common.h>
#include <otz_id.h>
#include <cpu.h>
#include <task_control.h>
#include <echo_task.h>
#include <mmap.h>
#include <otz_app_eg.h>
#include <sw_io.h>

Functions

int process_otz_echo_send_cmd (void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len)
 Echo the data for the user supplied buffer. More...
 
int process_otz_echo_send_cmd_shared_buf (void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len)
 Echo the data for the shared buffer. More...
 
int process_otz_echo_ipi_send_cmd (void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len)
 Echo the data for IPI testing. More...
 
int process_otz_echo_svc (u32 svc_cmd_id, void *req_buf, u32 req_buf_len, void *resp_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len)
 Process echo service. More...
 
void echo_task (int task_id, sw_tls *tls)
 Echo task entry point. More...
 
int echo_task_init (sa_config_t *psa_config)
 : Echo task init More...
 
int echo_task_exit (void *data)
 Echo task exit. More...
 

Function Documentation

void echo_task ( int  task_id,
sw_tls tls 
)

Echo task entry point.

This function implements the commands to echo the input buffer using copying the buffer and using shared memory

Parameters
task_idtask identifier
tlsPointer to task local storage
int echo_task_exit ( void *  data)

Echo task exit.

This function gets called before the task deletion

Parameters
dataPrivate data which need to be freed.
Returns
otz_return_t: OTZ_OK
OTZ_FAIL
int echo_task_init ( sa_config_t psa_config)

: Echo task init

This function initializes echo task parameters

Parameters
psa_configConfiguration parameter for the task and its get called before the task creation
Returns
otz_return_t: OTZ_OK
OTZ_* - An implementation-defined error code for any other error.
int process_otz_echo_ipi_send_cmd ( void *  req_buf,
u32  req_buf_len,
void *  res_buf,
u32  res_buf_len,
struct otzc_encode_meta meta_data,
u32 *  ret_res_buf_len 
)

Echo the data for IPI testing.

This function copies the request buffer to response buffer to show the IPI functionality

Parameters
req_bufVirtual address of the request buffer
req_buf_lenRequest buffer length
res_bufVirtual address of the response buffer
res_buf_lenResponse buffer length
meta_dataVirtual address of the meta data of the encoded data
ret_res_buf_lenReturn length of the response buffer
Returns
SMC return codes: SMC_SUCCESS: API processed successfully.
SMC_*: An implementation-defined error code for any other error.
int process_otz_echo_send_cmd ( void *  req_buf,
u32  req_buf_len,
void *  res_buf,
u32  res_buf_len,
struct otzc_encode_meta meta_data,
u32 *  ret_res_buf_len 
)

Echo the data for the user supplied buffer.

This function copies the request buffer to response buffer to show the non-zero copy functionality

Parameters
req_bufVirtual address of the request buffer
req_buf_lenRequest buffer length
res_bufVirtual address of the response buffer
res_buf_lenResponse buffer length
meta_dataVirtual address of the meta data of the encoded data
ret_res_buf_lenReturn length of the response buffer
Returns
SMC return codes: SMC_SUCCESS: API processed successfully.
SMC_*: An implementation-defined error code for any other error.
int process_otz_echo_send_cmd_shared_buf ( void *  req_buf,
u32  req_buf_len,
void *  res_buf,
u32  res_buf_len,
struct otzc_encode_meta meta_data,
u32 *  ret_res_buf_len 
)

Echo the data for the shared buffer.

This function copies the request buffer to response buffer to show the zero copy functionality

Parameters
req_bufVirtual address of the request buffer
req_buf_lenRequest buffer length
res_bufVirtual address of the response buffer
res_buf_lenResponse buffer length
meta_dataVirtual address of the meta data of the encoded data
ret_res_buf_lenReturn length of the response buffer
Returns
SMC return codes: SMC_SUCCESS: API processed successfully.
SMC_*: An implementation-defined error code for any other error.
int process_otz_echo_svc ( u32  svc_cmd_id,
void *  req_buf,
u32  req_buf_len,
void *  resp_buf,
u32  res_buf_len,
struct otzc_encode_meta meta_data,
u32 *  ret_res_buf_len 
)

Process echo service.

This function process the echo service commands

Parameters
svc_cmd_idCommand identifer to process the echo service command
req_bufVirtual address of the request buffer
req_buf_lenRequest buffer length
resp_bufVirtual address of the response buffer
res_buf_lenResponse buffer length
meta_dataVirtual address of the meta data of the encoded data
ret_res_buf_lenReturn length of the response buffer
Returns
SMC return codes: SMC_SUCCESS: Echo service command processed successfully.
SMC_*: An implementation-defined error code for any other error.