QueueGprot.h
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:10k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * QueueGprot.h
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for message queue handle.
- *
- * Author:
- * -------
- * -------
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #ifndef _QUEUE_GPROT_H
- #define _QUEUE_GPROT_H
- // #include "MMIDataType.h"
- #include "OslMemory.h"
- /*****************************************************************************
- * Define
- *****************************************************************************/
- #ifdef MMI_ON_WIN32
- #if (!defined LOCAL_PARA_HDR) && (!defined __NEWSIMULATOR )
- #define LOCAL_PARA_HDR
- U8 ref_count;
- U16 msg_len;
- #endif /* (!defined LOCAL_PARA_HDR) && (!defined __NEWSIMULATOR ) */
- #endif /* MMI_ON_WIN32 */
- #ifndef MMI_ON_WIN32
- #include "kal_release.h"
- #include "stack_common.h"
- #include "stack_msgs.h"
- #include "task_main_func.h"
- #include "app_ltlcom.h"
- #include "lcd_ip_cqueue.h"
- #include "stack_types.h"
- #include "task_config.h"
- #include "syscomp_config.h"
- #include "stack_init.h"
- #include "stack_ltlcom.h"
- #include "app_buff_alloc.h"
- #define MYQUEUE ilm_struct
- #define oslMsgqid kal_msgqid
- #define OslReceiveMsgExtQ receive_msg_ext_q
- #define OslGetMyTaskIndex kal_get_my_task_index
- #define OslStackSetActiveModuleID stack_set_active_module_id
- /* define LOCAL_PARA_HDR
- U8 ref_count;
- U16 msg_len; */
- #define oslModuleType module_type
- #define oslMsgType msg_type
- #define oslParaType local_para_struct
- #define oslSrcId src_mod_id
- #define oslDestId dest_mod_id
- #define oslMsgId msg_id
- #define oslSapId sap_id
- #define oslDataPtr local_para_ptr
- #define oslPeerBuffPtr peer_buff_ptr
- #define OSLWAITMODE kal_wait_mode
- #define OSL_NO_WAIT KAL_NO_WAIT
- #define OSL_INFINITE_WAIT KAL_INFINITE_WAIT
- extern U32 OslIntReceiveMsgExtQ(oslMsgqid msgqid, MYQUEUE *Message);
- extern void OslIntMsgSendExtQueue(MYQUEUE *Message);
- extern void *OslIntConstructDataPtr(U32 size);
- extern void OslIntFreeDataPtr(void *ptr);
- extern U32 OslIntSizeofDataPtr(void *ptr);
- extern void OslIntFreeInterTaskMsg(void *Message);
- #define OslCreateMsgQ kal_create_msg_q
- #define OslDeleteMsgQ kal_delete_msg_q
- #define OslWriteMsgQ kal_enque_msg
- #define OslReadMsgQ kal_deque_msg
- #define OslMsgSendExtQueue OslIntMsgSendExtQueue
- #define OslConstructDataPtr OslIntConstructDataPtr
- #define OslFreeDataPtr OslIntFreeDataPtr
- #define OslSizeofDataPtr OslIntSizeofDataPtr
- #define OslFreeInterTaskMsg OslIntFreeInterTaskMsg
- #else /* MMI_ON_WIN32 */
- #define MYQUEUE WINTERTASKMSG
- #define oslModuleType U32
- #define oslMsgType U32
- #define oslParaType void
- #define oslPeerParaPtr void
- #define oslSrcId wSrcId
- #define oslDestId wDestId
- #define oslMsgId wMsgId
- #define oslSapId wSapId
- #define oslDataPtr wDataPtr
- #define oslPeerBuffPtr wPeerBuffPtr
- #define OslCreateMsgQ OslIntCreateMsgQ
- #define OslDeleteMsgQ OslIntDeleteMsgQ
- #define OslWriteMsgQ OslIntWriteMsgQ
- #define OslReadMsgQ OslIntReadMsgQ
- typedef struct wintertaskmsgstruct
- {
- oslModuleType wSrcId;
- oslModuleType wDestId;
- oslMsgType wMsgId;
- oslMsgType wSapId;
- oslParaType *wDataPtr;
- oslPeerParaPtr *wPeerBuffPtr;
- } WINTERTASKMSG;
- extern oslMsgqid OslIntCreateMsgQ(
- PS8 queue_name,
- U32 max_msg_size,
- /* Size of Message in bytes (divisible by 4) */ U32 max_msgs); /* Max No. of Messages */
- extern void OslIntDeleteMsgQ(oslMsgqid msgqid);
- extern OSLSTATUS OslIntWriteMsgQ(oslMsgqid msgqid, void *msgPtr, U32 msgSize, OSLWAITMODE wait_mode);
- extern OSLSTATUS OslIntReadMsgQ(oslMsgqid msgqid, void *msgPtr, U32 *msgSize, OSLWAITMODE wait_mode);
- extern U32 OslIntReceiveMsgExtQ(oslMsgqid msgqid, MYQUEUE *Message);
- extern void OslIntMsgSendExtQueue(MYQUEUE *Message);
- extern void *OslIntConstructDataPtr(U32 size);
- extern void OslIntFreeDataPtr(void *ptr);
- extern U32 OslIntSizeofDataPtr(void *ptr);
- extern void OslIntFreeInterTaskMsg(void *Message);
- #define OslCreateMsgQ OslIntCreateMsgQ
- #define OslDeleteMsgQ OslIntDeleteMsgQ
- #define OslWriteMsgQ OslIntWriteMsgQ
- #define OslReadMsgQ OslIntReadMsgQ
- #define OslReceiveMsgExtQ OslIntReceiveMsgExtQ
- #define OslMsgSendExtQueue OslIntMsgSendExtQueue
- #define OslGetMyTaskIndex
- #define OslStackSetActiveModuleID
- // #define OslConstructDataPtr OslIntConstructDataPtr
- #define OslConstructDataPtr(size) lastMemory= (void *)((((U8 *)OslMalloc((size)+sizeof(TSIZE))) + sizeof(TSIZE)));
- lastSize=(TSIZE *)lastMemory - 1;
- lastSize->s=(U32)(size);
- #define OslFreeDataPtr(frp) if((frp)) OslMfree((U8 *)(frp) - sizeof(TSIZE));
- #define OslSizeofDataPtr ((TSIZE *)((TSIZE *)(ptr) - 1))->s
- #define OslFreeInterTaskMsg(frp)
- {
- extern MYQUEUE* qPtr;
- qPtr = (MYQUEUE*)frp;
- if(qPtr->oslSrcId==MOD_L4C)
- {
- qPtr->oslSrcId=MOD_MMI;
- qPtr->oslDestId=MOD_L4C;
- qPtr->oslMsgId = 0;
- OslMsgSendExtQueue(qPtr);
- }
- else
- {
- if(*(frp.oslDataPtr) != NULL)
- {
- void *actualAddress;
- actualAddress=(void *)((U8 *)(*(frp.oslDataPtr)) - sizeof(TSIZE));
- OslMfree(actualAddress);
- }
- }
- }
- extern U8 OslNumOfQMsgs(void);
- #endif /* MMI_ON_WIN32 */
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- /*****************************************************************************
- * Extern Global Variable
- *****************************************************************************/
- /*****************************************************************************
- * Extern Global Function
- *****************************************************************************/
- /* hold_local_para */
- #define OslHoldDataPtr(ptr)
- do {
- MMI_ASSERT(((local_para_struct*)(ptr))->ref_count != 0);
- hold_local_para((local_para_struct*)(ptr));
- } while(0)
- extern U8 OslReadCircularQ(void *msgPtr);
- extern U8 OslLookUpLastCircularQMsg(void *msgPtr);
- extern U8 OslWriteCircularQ(void *msgPtr);
- extern U8 OslNumOfCircularQMsgs(void);
- extern U8 OslIsCircularQFull(void);
- #endif /* _QUEUE_GPROT_H */