/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc1* All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/**************************************************************************//**34@File xx_ext.h3536@Description Prototypes, externals and typedefs for system-supplied37(external) routines38*//***************************************************************************/3940#ifndef __XX_EXT_H41#define __XX_EXT_H4243#include "std_ext.h"44#include "xx_common.h"45#include "part_ext.h"46474849/**************************************************************************//**50@Group xx_id XX Interface (System call hooks)5152@Description Prototypes, externals and typedefs for system-supplied53(external) routines5455@{56*//***************************************************************************/5758#ifdef DEBUG_XX_MALLOC59void * XX_MallocDebug(uint32_t size, char *fname, int line);6061void * XX_MallocSmartDebug(uint32_t size,62int memPartitionId,63uint32_t alignment,64char *fname,65int line);6667#define XX_Malloc(sz) \68XX_MallocDebug((sz), __FILE__, __LINE__)6970#define XX_MallocSmart(sz, memt, al) \71XX_MallocSmartDebug((sz), (memt), (al), __FILE__, __LINE__)7273#else /* not DEBUG_XX_MALLOC */74/**************************************************************************//**75@Function XX_Malloc7677@Description allocates contiguous block of memory.7879@Param[in] size - Number of bytes to allocate.8081@Return The address of the newly allocated block on success, NULL on failure.82*//***************************************************************************/83void * XX_Malloc(uint32_t size);8485/**************************************************************************//**86@Function XX_MallocSmart8788@Description Allocates contiguous block of memory in a specified89alignment and from the specified segment.9091@Param[in] size - Number of bytes to allocate.92@Param[in] memPartitionId - Memory partition ID; The value zero must93be mapped to the default heap partition.94@Param[in] alignment - Required memory alignment (in bytes).9596@Return The address of the newly allocated block on success, NULL on failure.97*//***************************************************************************/98void * XX_MallocSmart(uint32_t size, int memPartitionId, uint32_t alignment);99100int XX_MallocSmartInit(void);101#endif /* not DEBUG_XX_MALLOC */102103/**************************************************************************//**104@Function XX_FreeSmart105106@Description Frees the memory block pointed to by "p".107Only for memory allocated by XX_MallocSmart108109@Param[in] p_Memory - pointer to the memory block.110111@Return None.112*//***************************************************************************/113void XX_FreeSmart(void *p_Memory);114115/**************************************************************************//**116@Function XX_Free117118@Description frees the memory block pointed to by "p".119120@Param[in] p_Memory - pointer to the memory block.121122@Return None.123*//***************************************************************************/124void XX_Free(void *p_Memory);125126/**************************************************************************//**127@Function XX_Print128129@Description print a string.130131@Param[in] str - string to print.132133@Return None.134*//***************************************************************************/135void XX_Print(char *str, ...);136137/**************************************************************************//**138@Function XX_SetIntr139140@Description Set an interrupt service routine for a specific interrupt source.141142@Param[in] irq - Interrupt ID (system-specific number).143@Param[in] f_Isr - Callback routine that will be called when the interrupt occurs.144@Param[in] handle - The argument for the user callback routine.145146@Return E_OK on success; error code otherwise..147*//***************************************************************************/148t_Error XX_SetIntr(uintptr_t irq, t_Isr *f_Isr, t_Handle handle);149150/**************************************************************************//**151@Function XX_FreeIntr152153@Description Free a specific interrupt and a specific callback routine.154155@Param[in] irq - Interrupt ID (system-specific number).156157@Return E_OK on success; error code otherwise..158*//***************************************************************************/159t_Error XX_FreeIntr(uintptr_t irq);160161/**************************************************************************//**162@Function XX_EnableIntr163164@Description Enable a specific interrupt.165166@Param[in] irq - Interrupt ID (system-specific number).167168@Return E_OK on success; error code otherwise..169*//***************************************************************************/170t_Error XX_EnableIntr(uintptr_t irq);171172/**************************************************************************//**173@Function XX_DisableIntr174175@Description Disable a specific interrupt.176177@Param[in] irq - Interrupt ID (system-specific number).178179@Return E_OK on success; error code otherwise..180*//***************************************************************************/181t_Error XX_DisableIntr(uintptr_t irq);182183/**************************************************************************//**184@Function XX_DisableAllIntr185186@Description Disable all interrupts by masking them at the CPU.187188@Return A value that represents the interrupts state before the189operation, and should be passed to the matching190XX_RestoreAllIntr() call.191*//***************************************************************************/192uint32_t XX_DisableAllIntr(void);193194/**************************************************************************//**195@Function XX_RestoreAllIntr196197@Description Restore previous state of interrupts level at the CPU.198199@Param[in] flags - A value that represents the interrupts state to restore,200as returned by the matching call for XX_DisableAllIntr().201202@Return None.203*//***************************************************************************/204void XX_RestoreAllIntr(uint32_t flags);205206207t_Error XX_PreallocAndBindIntr(device_t dev, uintptr_t irq, unsigned int cpu);208t_Error XX_DeallocIntr(uintptr_t irq);209210/**************************************************************************//**211@Function XX_Exit212213@Description Stop execution and report status (where it is applicable)214215@Param[in] status - exit status216*//***************************************************************************/217void XX_Exit(int status);218219220/*****************************************************************************/221/* Tasklet Service Routines */222/*****************************************************************************/223typedef t_Handle t_TaskletHandle;224225/**************************************************************************//**226@Function XX_InitTasklet227228@Description Create and initialize a tasklet object.229230@Param[in] routine - A routine to be ran as a tasklet.231@Param[in] data - An argument to pass to the tasklet.232233@Return Tasklet handle is returned on success. NULL is returned otherwise.234*//***************************************************************************/235t_TaskletHandle XX_InitTasklet (void (*routine)(void *), void *data);236237/**************************************************************************//**238@Function XX_FreeTasklet239240@Description Free a tasklet object.241242@Param[in] h_Tasklet - A handle to a tasklet to be free.243244@Return None.245*//***************************************************************************/246void XX_FreeTasklet (t_TaskletHandle h_Tasklet);247248/**************************************************************************//**249@Function XX_ScheduleTask250251@Description Schedule a tasklet object.252253@Param[in] h_Tasklet - A handle to a tasklet to be scheduled.254@Param[in] immediate - Indicate whether to schedule this tasklet on255the immediate queue or on the delayed one.256257@Return 0 - on success. Error code - otherwise.258*//***************************************************************************/259int XX_ScheduleTask(t_TaskletHandle h_Tasklet, int immediate);260261/**************************************************************************//**262@Function XX_FlushScheduledTasks263264@Description Flush all tasks there are in the scheduled tasks queue.265266@Return None.267*//***************************************************************************/268void XX_FlushScheduledTasks(void);269270/**************************************************************************//**271@Function XX_TaskletIsQueued272273@Description Check if task is queued.274275@Param[in] h_Tasklet - A handle to a tasklet to be scheduled.276277@Return 1 - task is queued. 0 - otherwise.278*//***************************************************************************/279int XX_TaskletIsQueued(t_TaskletHandle h_Tasklet);280281/**************************************************************************//**282@Function XX_SetTaskletData283284@Description Set data to a scheduled task. Used to change data of already285scheduled task.286287@Param[in] h_Tasklet - A handle to a tasklet to be scheduled.288@Param[in] data - Data to be set.289*//***************************************************************************/290void XX_SetTaskletData(t_TaskletHandle h_Tasklet, t_Handle data);291292/**************************************************************************//**293@Function XX_GetTaskletData294295@Description Get the data of scheduled task.296297@Param[in] h_Tasklet - A handle to a tasklet to be scheduled.298299@Return handle to the data of the task.300*//***************************************************************************/301t_Handle XX_GetTaskletData(t_TaskletHandle h_Tasklet);302303/**************************************************************************//**304@Function XX_BottomHalf305306@Description Bottom half implementation, invoked by the interrupt handler.307308This routine handles all bottom-half tasklets with interrupts309enabled.310311@Return None.312*//***************************************************************************/313void XX_BottomHalf(void);314315316/*****************************************************************************/317/* Spinlock Service Routines */318/*****************************************************************************/319320/**************************************************************************//**321@Function XX_InitSpinlock322323@Description Creates a spinlock.324325@Return Spinlock handle is returned on success; NULL otherwise.326*//***************************************************************************/327t_Handle XX_InitSpinlock(void);328329/**************************************************************************//**330@Function XX_FreeSpinlock331332@Description Frees the memory allocated for the spinlock creation.333334@Param[in] h_Spinlock - A handle to a spinlock.335336@Return None.337*//***************************************************************************/338void XX_FreeSpinlock(t_Handle h_Spinlock);339340/**************************************************************************//**341@Function XX_LockSpinlock342343@Description Locks a spinlock.344345@Param[in] h_Spinlock - A handle to a spinlock.346347@Return None.348*//***************************************************************************/349void XX_LockSpinlock(t_Handle h_Spinlock);350351/**************************************************************************//**352@Function XX_UnlockSpinlock353354@Description Unlocks a spinlock.355356@Param[in] h_Spinlock - A handle to a spinlock.357358@Return None.359*//***************************************************************************/360void XX_UnlockSpinlock(t_Handle h_Spinlock);361362/**************************************************************************//**363@Function XX_LockIntrSpinlock364365@Description Locks a spinlock (interrupt safe).366367@Param[in] h_Spinlock - A handle to a spinlock.368369@Return A value that represents the interrupts state before the370operation, and should be passed to the matching371XX_UnlockIntrSpinlock() call.372*//***************************************************************************/373uint32_t XX_LockIntrSpinlock(t_Handle h_Spinlock);374375/**************************************************************************//**376@Function XX_UnlockIntrSpinlock377378@Description Unlocks a spinlock (interrupt safe).379380@Param[in] h_Spinlock - A handle to a spinlock.381@Param[in] intrFlags - A value that represents the interrupts state to382restore, as returned by the matching call for383XX_LockIntrSpinlock().384385@Return None.386*//***************************************************************************/387void XX_UnlockIntrSpinlock(t_Handle h_Spinlock, uint32_t intrFlags);388389390/*****************************************************************************/391/* Timers Service Routines */392/*****************************************************************************/393394/**************************************************************************//**395@Function XX_CurrentTime396397@Description Returns current system time.398399@Return Current system time (in milliseconds).400*//***************************************************************************/401uint32_t XX_CurrentTime(void);402403/**************************************************************************//**404@Function XX_CreateTimer405406@Description Creates a timer.407408@Return Timer handle is returned on success; NULL otherwise.409*//***************************************************************************/410t_Handle XX_CreateTimer(void);411412/**************************************************************************//**413@Function XX_FreeTimer414415@Description Frees the memory allocated for the timer creation.416417@Param[in] h_Timer - A handle to a timer.418419@Return None.420*//***************************************************************************/421void XX_FreeTimer(t_Handle h_Timer);422423/**************************************************************************//**424@Function XX_StartTimer425426@Description Starts a timer.427428The user can select to start the timer as periodic timer or as429one-shot timer. The user should provide a callback routine that430will be called when the timer expires.431432@Param[in] h_Timer - A handle to a timer.433@Param[in] msecs - Timer expiration period (in milliseconds).434@Param[in] periodic - TRUE for a periodic timer;435FALSE for a one-shot timer..436@Param[in] f_TimerExpired - A callback routine to be called when the437timer expires.438@Param[in] h_Arg - The argument to pass in the timer-expired439callback routine.440441@Return None.442*//***************************************************************************/443void XX_StartTimer(t_Handle h_Timer,444uint32_t msecs,445bool periodic,446void (*f_TimerExpired)(t_Handle h_Arg),447t_Handle h_Arg);448449/**************************************************************************//**450@Function XX_StopTimer451452@Description Frees the memory allocated for the timer creation.453454@Param[in] h_Timer - A handle to a timer.455456@Return None.457*//***************************************************************************/458void XX_StopTimer(t_Handle h_Timer);459460/**************************************************************************//**461@Function XX_ModTimer462463@Description Updates the expiration time of a timer.464465This routine adds the given time to the current system time,466and sets this value as the new expiration time of the timer.467468@Param[in] h_Timer - A handle to a timer.469@Param[in] msecs - The new interval until timer expiration470(in milliseconds).471472@Return None.473*//***************************************************************************/474void XX_ModTimer(t_Handle h_Timer, uint32_t msecs);475476/**************************************************************************//**477@Function XX_Sleep478479@Description Non-busy wait until the desired time (in milliseconds) has passed.480481@Param[in] msecs - The requested sleep time (in milliseconds).482483@Return Zero if the requested time has elapsed; Otherwise, the value484returned will be the unslept amount) in milliseconds.485486@Cautions This routine enables interrupts during its wait time.487*//***************************************************************************/488uint32_t XX_Sleep(uint32_t msecs);489490/**************************************************************************//**491@Function XX_UDelay492493@Description Busy-wait until the desired time (in microseconds) has passed.494495@Param[in] usecs - The requested delay time (in microseconds).496497@Return None.498499@Cautions It is highly unrecommended to call this routine during interrupt500time, because the system time may not be updated properly during501the delay loop. The behavior of this routine during interrupt502time is unexpected.503*//***************************************************************************/504void XX_UDelay(uint32_t usecs);505506507/*****************************************************************************/508/* Other Service Routines */509/*****************************************************************************/510511/**************************************************************************//**512@Function XX_PhysToVirt513514@Description Translates a physical address to the matching virtual address.515516@Param[in] addr - The physical address to translate.517518@Return Virtual address.519*//***************************************************************************/520void * XX_PhysToVirt(physAddress_t addr);521522/**************************************************************************//**523@Function XX_VirtToPhys524525@Description Translates a virtual address to the matching physical address.526527@Param[in] addr - The virtual address to translate.528529@Return Physical address.530*//***************************************************************************/531physAddress_t XX_VirtToPhys(void *addr);532533534/**************************************************************************//**535@Group xx_ipc XX Inter-Partition-Communication API536537@Description The following API is to be used when working with multiple538partitions configuration.539540@{541*//***************************************************************************/542543#define XX_IPC_MAX_ADDR_NAME_LENGTH 16 /**< Maximum length of an endpoint name string;544The IPC service can use this constant to limit545the storage space for IPC endpoint names. */546547548/**************************************************************************//**549@Function t_IpcMsgCompletion550551@Description Callback function used upon IPC non-blocking transaction completion552to return message buffer to the caller and to forward reply if available.553554This callback function may be attached by the source endpoint to any outgoing555IPC message to indicate a non-blocking send (see also XX_IpcSendMessage() routine).556Upon completion of an IPC transaction (consisting of a message and an optional reply),557the IPC service invokes this callback routine to return the message buffer to the sender558and to provide the received reply, if requested.559560User provides this function. Driver invokes it.561562@Param[in] h_Module - Abstract handle to the sending module - the same handle as was passed563in the XX_IpcSendMessage() function; This handle is typically used to point564to the internal data structure of the source endpoint.565@Param[in] p_Msg - Pointer to original (sent) message buffer;566The source endpoint can free (or reuse) this buffer when message567completion callback is called.568@Param[in] p_Reply - Pointer to (received) reply buffer;569This pointer is the same as was provided by the source endpoint in570XX_IpcSendMessage().571@Param[in] replyLength - Length (in bytes) of actual data in the reply buffer.572@Param[in] status - Completion status - E_OK or failure indication, e.g. IPC transaction completion573timeout.574575@Return None576*//***************************************************************************/577typedef void (t_IpcMsgCompletion)(t_Handle h_Module,578uint8_t *p_Msg,579uint8_t *p_Reply,580uint32_t replyLength,581t_Error status);582583/**************************************************************************//**584@Function t_IpcMsgHandler585586@Description Callback function used as IPC message handler.587588The IPC service invokes message handlers for each IPC message received.589The actual function pointer should be registered by each destination endpoint590via the XX_IpcRegisterMsgHandler() routine.591592User provides this function. Driver invokes it.593594@Param[in] h_Module - Abstract handle to the message handling module - the same handle as595was passed in the XX_IpcRegisterMsgHandler() function; this handle is596typically used to point to the internal data structure of the destination597endpoint.598@Param[in] p_Msg - Pointer to message buffer with data received from peer.599@Param[in] msgLength - Length (in bytes) of message data.600@Param[in] p_Reply - Pointer to reply buffer, to be filled by the message handler and then sent601by the IPC service;602The reply buffer is allocated by the IPC service with size equals to the603replyLength parameter provided in message handler registration (see604XX_IpcRegisterMsgHandler() function);605If replyLength was initially specified as zero during message handler registration,606the IPC service may set this pointer to NULL and assume that a reply is not needed;607The IPC service is also responsible for freeing the reply buffer after the608reply has been sent or dismissed.609@Param[in,out] p_ReplyLength - Pointer to reply length, which has a dual role in this function:610[In] equals the replyLength parameter provided in message handler611registration (see XX_IpcRegisterMsgHandler() function), and612[Out] should be updated by message handler to the actual reply length; if613this value is set to zero, the IPC service must assume that a reply should614not be sent;615Note: If p_Reply is not NULL, p_ReplyLength must not be NULL as well.616617@Return E_OK on success; Error code otherwise.618*//***************************************************************************/619typedef t_Error (t_IpcMsgHandler)(t_Handle h_Module,620uint8_t *p_Msg,621uint32_t msgLength,622uint8_t *p_Reply,623uint32_t *p_ReplyLength);624625/**************************************************************************//**626@Function XX_IpcRegisterMsgHandler627628@Description IPC mailbox registration.629630This function is used for registering an IPC message handler in the IPC service.631This function is called by each destination endpoint to indicate that it is ready632to handle incoming messages. The IPC service invokes the message handler upon receiving633a message addressed to the specified destination endpoint.634635@Param[in] addr - The address name string associated with the destination endpoint;636This address must be unique across the IPC service domain to ensure637correct message routing.638@Param[in] f_MsgHandler - Pointer to the message handler callback for processing incoming639message; invoked by the IPC service upon receiving a message640addressed to the destination endpoint specified by the addr641parameter.642@Param[in] h_Module - Abstract handle to the message handling module, passed unchanged643to f_MsgHandler callback function.644@Param[in] replyLength - The maximal data length (in bytes) of any reply that the specified message handler645may generate; the IPC service provides the message handler with buffer646for reply according to the length specified here (refer also to the description647of #t_IpcMsgHandler callback function type);648This size shall be zero if the message handler never generates replies.649650@Return E_OK on success; Error code otherwise.651*//***************************************************************************/652t_Error XX_IpcRegisterMsgHandler(char addr[XX_IPC_MAX_ADDR_NAME_LENGTH],653t_IpcMsgHandler *f_MsgHandler,654t_Handle h_Module,655uint32_t replyLength);656657/**************************************************************************//**658@Function XX_IpcUnregisterMsgHandler659660@Description Release IPC mailbox routine.661662This function is used for unregistering an IPC message handler from the IPC service.663This function is called by each destination endpoint to indicate that it is no longer664capable of handling incoming messages.665666@Param[in] addr - The address name string associated with the destination endpoint;667This address is the same as was used when the message handler was668registered via XX_IpcRegisterMsgHandler().669670@Return E_OK on success; Error code otherwise.671*//***************************************************************************/672t_Error XX_IpcUnregisterMsgHandler(char addr[XX_IPC_MAX_ADDR_NAME_LENGTH]);673674/**************************************************************************//**675@Function XX_IpcInitSession676677@Description This function is used for creating an IPC session between the source endpoint678and the destination endpoint.679680The actual implementation and representation of a session is left for the IPC service.681The function returns an abstract handle to the created session. This handle shall be used682by the source endpoint in subsequent calls to XX_IpcSendMessage().683The IPC service assumes that before this function is called, no messages are sent from684the specified source endpoint to the specified destination endpoint.685686The IPC service may use a connection-oriented approach or a connectionless approach (or both)687as described below.688689@par Connection-Oriented Approach690691The IPC service may implement a session in a connection-oriented approach - when this function is called,692the IPC service should take the necessary steps to bring up a source-to-destination channel for messages693and a destination-to-source channel for replies. The returned handle should represent the internal694representation of these channels.695696@par Connectionless Approach697698The IPC service may implement a session in a connectionless approach - when this function is called, the699IPC service should not perform any particular steps, but it must store the pair of source and destination700addresses in some session representation and return it as a handle. When XX_IpcSendMessage() shall be701called, the IPC service may use this handle to provide the necessary identifiers for routing the messages702through the connectionless medium.703704@Param[in] destAddr - The address name string associated with the destination endpoint.705@Param[in] srcAddr - The address name string associated with the source endpoint.706707@Return Abstract handle to the initialized session, or NULL on error.708*//***************************************************************************/709t_Handle XX_IpcInitSession(char destAddr[XX_IPC_MAX_ADDR_NAME_LENGTH],710char srcAddr[XX_IPC_MAX_ADDR_NAME_LENGTH]);711712/**************************************************************************//**713@Function XX_IpcFreeSession714715@Description This function is used for terminating an existing IPC session between a source endpoint716and a destination endpoint.717718The IPC service assumes that after this function is called, no messages shall be sent from719the associated source endpoint to the associated destination endpoint.720721@Param[in] h_Session - Abstract handle to the IPC session - the same handle as was originally722returned by the XX_IpcInitSession() function.723724@Return E_OK on success; Error code otherwise.725*//***************************************************************************/726t_Error XX_IpcFreeSession(t_Handle h_Session);727728/**************************************************************************//**729@Function XX_IpcSendMessage730731@Description IPC message send routine.732733This function may be used by a source endpoint to send an IPC message to a destination734endpoint. The source endpoint cannot send a message to the destination endpoint without735first initiating a session with that destination endpoint via XX_IpcInitSession() routine.736737The source endpoint must provide the buffer pointer and length of the outgoing message.738Optionally, it may also provide a buffer for an expected reply. In the latter case, the739transaction is not considered complete by the IPC service until the reply has been received.740If the source endpoint does not provide a reply buffer, the transaction is considered741complete after the message has been sent. The source endpoint must keep the message (and742optional reply) buffers valid until the transaction is complete.743744@par Non-blocking mode745746The source endpoint may request a non-blocking send by providing a non-NULL pointer to a message747completion callback function (f_Completion). Upon completion of the IPC transaction (consisting of a748message and an optional reply), the IPC service invokes this callback routine to return the message749buffer to the sender and to provide the received reply, if requested.750751@par Blocking mode752753The source endpoint may request a blocking send by setting f_Completion to NULL. The function is754expected to block until the IPC transaction is complete - either the reply has been received or (if no reply755was requested) the message has been sent.756757@Param[in] h_Session - Abstract handle to the IPC session - the same handle as was originally758returned by the XX_IpcInitSession() function.759@Param[in] p_Msg - Pointer to message buffer to send.760@Param[in] msgLength - Length (in bytes) of actual data in the message buffer.761@Param[in] p_Reply - Pointer to reply buffer - if this buffer is not NULL, the IPC service762fills this buffer with the received reply data;763In blocking mode, the reply data must be valid when the function returns;764In non-blocking mode, the reply data is valid when f_Completion is called;765If this pointer is NULL, no reply is expected.766@Param[in,out] p_ReplyLength - Pointer to reply length, which has a dual role in this function:767[In] specifies the maximal length (in bytes) of the reply buffer pointed by768p_Reply, and769[Out] in non-blocking mode this value is updated by the IPC service to the770actual reply length (in bytes).771@Param[in] f_Completion - Pointer to a completion callback to be used in non-blocking send mode;772The completion callback is invoked by the IPC service upon773completion of the IPC transaction (consisting of a message and an optional774reply);775If this pointer is NULL, the function is expected to block until the IPC776transaction is complete.777@Param[in] h_Arg - Abstract handle to the sending module; passed unchanged to the f_Completion778callback function as the first argument.779780@Return E_OK on success; Error code otherwise.781*//***************************************************************************/782t_Error XX_IpcSendMessage(t_Handle h_Session,783uint8_t *p_Msg,784uint32_t msgLength,785uint8_t *p_Reply,786uint32_t *p_ReplyLength,787t_IpcMsgCompletion *f_Completion,788t_Handle h_Arg);789790791/** @} */ /* end of xx_ipc group */792/** @} */ /* end of xx_id group */793794795void XX_PortalSetInfo(device_t dev);796#endif /* __XX_EXT_H */797798799