[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/cp/ps/plat/inc/mmp/mmp_amr_api.h b/cp/ps/plat/inc/mmp/mmp_amr_api.h
new file mode 100644
index 0000000..7cbb6af
--- /dev/null
+++ b/cp/ps/plat/inc/mmp/mmp_amr_api.h
@@ -0,0 +1,141 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : 

+* ÎÄ ¼þ Ãû : 

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : 

+* ×÷    Õß : 

+* °æ    ±¾ : 

+* Íê³ÉÈÕÆÚ : 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+/**************************************************************************

+* Ð޸ıàºÅ : 

+* ÐÞ ¸Ä ÈË : 

+* ÐÞ¸ÄÈÕÆÚ : 

+* ÐÞ¸ÄÄÚÈÝ : 

+**************************************************************************/

+#ifndef _MMP_AMR_API_H

+#define _MMP_AMR_API_H

+

+/**************************************************************************

+* #includeÇø 

+**************************************************************************/

+#include"oss_api.h"

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/**************************************************************************

+* ºê¶¨ÒåÇø

+**************************************************************************/

+#define ZAMR_ERROR                   (0)    

+#define ZAMR_SUCCESS                 (1)

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+typedef enum 

+{

+    ZMMP_AMR_ENC_MODE_0,     /* NB:4.75 kbit/s, WB:6.60 kbit/s  */

+    ZMMP_AMR_ENC_MODE_1,     /* NB:5.15 kbit/s, WB:8.85 kbit/s  */	

+    ZMMP_AMR_ENC_MODE_2,     /* NB:5.90 kbit/s, WB:12.65 kbit/s */

+    ZMMP_AMR_ENC_MODE_3,     /* NB:6.70 kbit/s, WB:14.25 kbit/s */

+    ZMMP_AMR_ENC_MODE_4,     /* NB:7.40 kbit/s, WB:15.85 kbit/s */

+    ZMMP_AMR_ENC_MODE_5,     /* NB:7.95 kbit/s, WB:18.25 kbit/s */

+    ZMMP_AMR_ENC_MODE_6,     /* NB:10.2 kbit/s, WB:19.85 kbit/s */

+    ZMMP_AMR_ENC_MODE_7,     /* NB:12.2 kbit/s, WB:23.05 kbit/s */

+    ZMMP_AMR_ENC_MODE_8,     /* NB:DTX,         WB:23.85 kbit/s */

+    ZMMP_AMR_ENC_MODE_9,     /* NB:ÎÞЧ,        WB:DTX          */

+    ZMMP_AMR_ENC_MODE_INVALID     /* NB:ÎÞЧ,   WB:ÎÞЧ          */

+}T_zMmp_AmrEncMode;

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ªAMR½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ 

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     AMR½âÂëÆ÷ÉÏÏÂÎÄ,NULLΪ´ò¿ª½âÂëÆ÷ʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/

+VOID*  zMmp_AmrDecOpen(VOID);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ªAMR±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý) isDtxEnable:      FALSE:²»Ö§³Ödtx£¬TRUE:Ö§³Ödtx 

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     AMR±àÂëÆ÷ÉÏÏÂÎÄ£¬NULLΪ´ò¿ª±àÂëÆ÷ʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/

+

+VOID*  zMmp_AmrEncOpen(BOOL isDtxEnable);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ½âÒ»Ö¡AMRÊý¾Ý

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pCodecContext: AMR½âÂëÉÏÏÂÎÄ

+                pAmr:          ÊäÈëAMRÊý¾ÝÆðʼµØÖ· ,¿Õ¼ä×îÉÙ17¸ö°ë×Ö(16 + 1(¹Ì¶¨0x2))

+*   (´«³ö²ÎÊý)  pPcm:          Êä³öPCMÊý¾ÝÆðʼµØÖ· ,¿Õ¼ä×îÉÙ160¸ö°ë×Ö

+* ·µ »Ø Öµ:     ZAMR_ERROR                   (0)    

+                ZAMR_SUCCESS                 (1)

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/

+

+UINT16 zMmp_AmrDecode(VOID *pCodecContext, const UINT16 *pAmr, UINT16 *pPcm);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ±àÒ»Ö¡PCMÊý¾Ý

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pCodecContext: AMR±àÂëÉÏÏÂÎÄ

+                mode:          ±àÂëģʽ

+                pPcm:          PCMÊý¾ÝÆðʼµØÖ·  ,¿Õ¼ä×îÉÙ160¸ö°ë×Ö

+*   (´«³ö²ÎÊý)  pAmr:          Êä³öAMRÊý¾ÝÆðʼµØÖ·,¿Õ¼ä×îÉÙ17¸ö°ë×Ö(16 + 1(¹Ì¶¨0x2))

+* ·µ »Ø Öµ:     ZAMR_ERROR                   (0)    

+                ZAMR_SUCCESS                 (1)

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/

+

+UINT16 zMmp_AmrEncode(VOID *pCodecContext, T_zMmp_AmrEncMode mode, const UINT16 *pPcm,  UINT16 *pAmr);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pCodecContext: AMR½âÂëÉÏÏÂÎÄ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ÎÞ

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/

+

+VOID   zMmp_AmrDecClose(VOID *pCodecContext);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pCodecContext: AMR±àÂëÉÏÏÂÎÄ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ÎÞ

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/

+

+VOID   zMmp_AmrEncClose(VOID *pCodecContext);

+

+/**************************************************************************

+* È«¾Ö³£Á¿/±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif

diff --git a/cp/ps/plat/inc/mmp/mmp_efr_api.h b/cp/ps/plat/inc/mmp/mmp_efr_api.h
new file mode 100644
index 0000000..6e08438
--- /dev/null
+++ b/cp/ps/plat/inc/mmp/mmp_efr_api.h
@@ -0,0 +1,115 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : efr±à½âÂëÄ£¿é

+* ÎÄ ¼þ Ãû : mmp_efr_api.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : efr±à½âÂë¶ÔÍâÌṩͷÎļþ

+* ×÷    Õß : myp

+* °æ    ±¾ : 

+* Íê³ÉÈÕÆÚ : 2013Äê09ÔÂ10ÈÕ

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+

+#ifndef _MMP_EFR_API_H

+#define _MMP_EFR_API_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#include "oss_api.h"

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+#define ZEFR_ERROR                   (0)    

+#define ZEFR_SUCCESS                 (1)

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ª±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  isDtxEnable:DTX¿ª¹Ø

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+

+UINT16 zMmp_EfrEncOpen (BOOL isDtxEnable);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö: ±àÂëÒ»Ö¡PCMÊý¾Ý   

+* ²ÎÊý˵Ã÷:    

+*   (´«Èë²ÎÊý)  pPcm:pcmÆðʼµØÖ·£¬×îС¿Õ¼äΪ160¸ö°ë×Ö

+*   (´«³ö²ÎÊý)  pEfr:efrÆðʼµØÖ·£¬efr²ÎÊý59¸ö°ë×Ö£¬°üÀ¨57¸ö²ÎÊý(244bit)£¬»¹ÓÐÁ½¸ö°ë×ÖµÄÖ¡Í·(Ò»¸ö¹Ì¶¨Îª0x2£¬»¹ÓÐÒ»¸ö¼ûÆäËû˵Ã÷)

+* ·µ »Ø Öµ:     ³É¹¦·µ»ØZFR_SUCCESS,ʧ°Ü·µ»ØZFR_ERROR

+* ÆäËü˵Ã÷:     01000000000SP0000

+**************************************************************************/ 

+

+UINT16 zMmp_EfrEncode (UINT16 * pPcm, UINT16 * pEfr);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+UINT16 zMmp_EfrEncClose (VOID);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ª½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+

+UINT16 zMmp_EfrDecOpen (VOID);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:    ½âÂëÒ»Ö¡efrÊý¾Ý

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pEfr:  efrÊý¾ÝÆðʼµØÖ·£¬×îС¿Õ¼ä59¸ö°ë×Ö£¬°üÀ¨57¸ö²ÎÊý(244bit),»¹°üÀ¨Á½¸ö°ë×ÖµÄÖ¡Í·(Ò»¸ö¹Ì¶¨Îª0x2£¬»¹ÓÐÒ»¸ö¼ûÆäËû˵Ã÷)

+*   (´«³ö²ÎÊý)  pPcm:  pcmÊý¾ÝÆðʼµØÖ·£¬×îС¿Õ¼ä160¸ö°ë×Ö

+* ·µ »Ø Öµ:     ³É¹¦·µ»ØZFR_SUCCESS,ʧ°Ü·µ»ØZFR_ERROR

+* ÆäËü˵Ã÷:     010 TAF 00 SID SID 000 BFI 0000

+**************************************************************************/ 

+

+UINT16 zMmp_EfrDecode ( UINT16 *pEfr, UINT16 *pPcm);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+

+UINT16 zMmp_EfrDecClose (VOID);

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _MMP_EFR_API_H */

+

+

diff --git a/cp/ps/plat/inc/mmp/mmp_fr_api.h b/cp/ps/plat/inc/mmp/mmp_fr_api.h
new file mode 100644
index 0000000..f206c4a
--- /dev/null
+++ b/cp/ps/plat/inc/mmp/mmp_fr_api.h
@@ -0,0 +1,118 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : fr±à½âÂëÄ£¿é

+* ÎÄ ¼þ Ãû : mmp_fr_api.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : fr±à½âÂë¶ÔÍâÌṩͷÎļþ

+* ×÷    Õß : ´ÔÏæÏã

+* °æ    ±¾ : 

+* Íê³ÉÈÕÆÚ : 2013Äê08ÔÂ30ÈÕ

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+

+#ifndef _MMP_FR_API_H

+#define _MMP_FR_API_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#include "oss_api.h"

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+#define ZFR_ERROR                   (0)    

+#define ZFR_SUCCESS                 (1)

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ª±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ·µ»Ø±àÂëÆ÷¾ä±ú£¬NULLΪ³õʼ»¯Ê§°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+

+VOID*  zMmp_FrEncOpen (bool isDtxEnable);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ª½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ·µ»Ø½âÂëÆ÷¾ä±ú£¬NULLΪ³õʼ»¯Ê§°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+VOID*  zMmp_FrDecOpen (VOID);

+

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ±àÒ»Ö¡ÒôƵÊý¾Ý

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pEncHandle£º±àÂëÆ÷¾ä±ú

+*   (´«Èë²ÎÊý)  pPcm£ºÊäÈëÒ»Ö¡´ý±àÂëµÄpcmÊý¾Ý£¬¿Õ¼ä×îС160¸ö°ë×Ö

+*   (´«³ö²ÎÊý)  pFr£º±à³öÒ»Ö¡frÊý¾Ý£¬¿Õ¼ä×îС78¸ö°ë×Ö£¬(76 + 2(ÆäÖÐÒ»¸ö¹Ì¶¨Îª0x2,»¹ÓÐÒ»¸ö¸ñʽ¼ûÆäËû˵Ã÷))

+* ·µ »Ø Öµ:     ZFR_ERROR                   (0)    

+                ZFR_SUCCESS                 (1)

+* ÆäËü˵Ã÷:    Ö¡Í·¸ñʽ: 00000000000SP0000

+**************************************************************************/ 

+

+UINT16 zMmp_FrEncode (VOID* pEncHandle, UINT16 * pPcm, UINT16 * pFr);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ½âÒ»Ö¡ÒôƵÊý¾Ý

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pDecHandle£º½âÂëÆ÷¾ä±ú

+*   (´«Èë²ÎÊý)  pFr£ºÊäÈëÒ»Ö¡´ý½âÂëfrÊý¾Ý, ¿Õ¼ä×îС78¸ö°ë×Ö£¬(76 + 2(ÆäÖÐÒ»¸ö¹Ì¶¨Îª0x2,»¹ÓÐÒ»¸ö¸ñʽ¼ûÆäËû˵Ã÷))

+*   (´«³ö²ÎÊý)  pPcm£º½â³öÒ»Ö¡pcmÓïÒôÊý¾Ý£¬¿Õ¼ä×îС160¸ö°ë×Ö

+* ·µ »Ø Öµ:     ZFR_ERROR                   (0)    

+                ZFR_SUCCESS                 (1)

+* ÆäËü˵Ã÷:     Ö¡Í·¸ñʽ: 00 UFI TAF 00 SID SID 000 BFI 0000

+**************************************************************************/ 

+

+UINT16 zMmp_FrDecode (VOID* pDecHandle, UINT16 *pFr, UINT16 *pPcm);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pEncHandle£º±àÂëÆ÷¾ä±ú

+* ·µ »Ø Öµ:     ÎÞ

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+

+VOID   zMmp_FrEncClose (VOID* pEncHandle );

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pDecHandle£º½âÂëÆ÷¾ä±ú

+* ·µ »Ø Öµ:     ÎÞ

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+

+VOID   zMmp_FrDecClose (VOID* pDecHandle );

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _MMP_FR_API_H */

+

+

diff --git a/cp/ps/plat/inc/mmp/mmp_hr_api.h b/cp/ps/plat/inc/mmp/mmp_hr_api.h
new file mode 100644
index 0000000..acf32e8
--- /dev/null
+++ b/cp/ps/plat/inc/mmp/mmp_hr_api.h
@@ -0,0 +1,118 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : 

+* ÎÄ ¼þ Ãû : 

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : 

+* ×÷    Õß : 

+* °æ    ±¾ : 

+* Íê³ÉÈÕÆÚ : 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+/**************************************************************************

+* Ð޸ıàºÅ : 

+* ÐÞ ¸Ä ÈË : 

+* ÐÞ¸ÄÈÕÆÚ : 

+* ÐÞ¸ÄÄÚÈÝ : 

+**************************************************************************/

+#ifndef _MMP_HR_API_H

+#define _MMP_HR_API_H

+

+#include "oss_api.h"

+

+#ifdef __cplusplus

+extern "C" 

+{

+#endif

+ 

+/**************************************************************************

+* ºê¶¨ÒåÇø

+**************************************************************************/

+#define ZHR_ERROR                   (0)    

+#define ZHR_SUCCESS                 (1)

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* ¾Ö²¿º¯ÊýÔ­ÐÍ

+**************************************************************************/

+

+/**************************************************************************

+* È«¾Ö³£Á¿/±äÁ¿

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýʵÏÖ

+**************************************************************************/

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ª±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+UINT16 zMmp_HrEncOpen (UINT32 dtxEnable);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö: ±àÂëÒ»Ö¡PCMÊý¾Ý   

+* ²ÎÊý˵Ã÷:    

+*   (´«Èë²ÎÊý)  pPcm:pcmÆðʼµØÖ·,×îС¿Õ¼ä160¸ö°ë×Ö

+*   (´«³ö²ÎÊý)  pHr:hrÆðʼµØÖ·£¬×îС¿Õ¼äΪ22¸ö°ë×Ö£¬°üÀ¨18¸ö²ÎÊý£¬vad ºÍ sp ±ê¼Ç,»¹ÓÐÁ½¸ö°ë×ÖµÄÖ¡Í·²¿(ÆäÖÐÒ»¸ö¹Ì¶¨Îª0x2,»¹ÓÐÒ»¸ö¼ûÆäËû˵Ã÷)

+* ·µ »Ø Öµ:     ³É¹¦·µ»ØZFR_SUCCESS,ʧ°Ü·µ»ØZFR_ERROR

+* ÆäËü˵Ã÷:     Ö¡Í·¸ñʽ:10000000000SP0000

+**************************************************************************/ 

+UINT16 zMmp_HrEncode(UINT16 *pPcm, UINT16 *pHr);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ±àÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+UINT16 zMmp_HrEncClose (VOID);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ´ò¿ª½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+UINT16 zMmp_HrDecOpen (VOID);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:    ½âÂëÒ»Ö¡hrÊý¾Ý

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  pHr:   hrÊý¾ÝÆðʼµØÖ·£¬×îÉÙ¿Õ¼äΪ24¸ö°ë×Ö£¬°üÀ¨18¸ö²ÎÊý£¬BFI UFI SID TAFËĸö±ê¼Ç£¬»¹ÓÐÁ½¸ö°ë×ÖµÄÖ¡Í·(ÆäÖÐÒ»¸ö¹Ì¶¨Îª0x2,»¹ÓÐÒ»¸ö¼ûÆäËû˵Ã÷)

+*   (´«³ö²ÎÊý)  pPcm:  pcmÊý¾ÝÆðʼµØÖ·

+* ·µ »Ø Öµ:     ³É¹¦·µ»ØZFR_SUCCESS,ʧ°Ü·µ»ØZFR_ERROR

+* ÆäËü˵Ã÷:     Ö¡Í·¸ñʽ:10UFI TAF 00 SID SID 000 BFI 0000

+**************************************************************************/ 

+UINT16 zMmp_HrDecode(UINT16 *pHr, UINT16 *pPcm);

+

+/**************************************************************************

+* ¹¦ÄÜÃèÊö:     ¹Ø±Õ½âÂëÆ÷

+* ²ÎÊý˵Ã÷:     

+*   (´«Èë²ÎÊý)  ÎÞ

+*   (´«³ö²ÎÊý)  ÎÞ

+* ·µ »Ø Öµ:     ZHR_SUCCESS³É¹¦£¬ZHR_ERRORʧ°Ü

+* ÆäËü˵Ã÷:     ÎÞ

+**************************************************************************/ 

+UINT16 zMmp_HrDecClose (VOID);

+

+#ifdef __cplusplus

+}

+#endif

+#endif

diff --git a/cp/ps/plat/inc/mmp/zmmp_amr_fnc.h b/cp/ps/plat/inc/mmp/zmmp_amr_fnc.h
new file mode 100644
index 0000000..da981e7
--- /dev/null
+++ b/cp/ps/plat/inc/mmp/zmmp_amr_fnc.h
@@ -0,0 +1,88 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : 

+* ÎÄ ¼þ Ãû : 

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : 

+* ×÷    Õß : 

+* °æ    ±¾ : 

+* Íê³ÉÈÕÆÚ : 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+/**************************************************************************

+* Ð޸ıàºÅ : 

+* ÐÞ ¸Ä ÈË : 

+* ÐÞ¸ÄÈÕÆÚ : 

+* ÐÞ¸ÄÄÚÈÝ : 

+**************************************************************************/

+#ifndef _ZMMP_AMR_FNC_H

+#define _ZMMP_AMR_FNC_H

+

+/**************************************************************************

+* #includeÇø 

+**************************************************************************/

+#include"oss_api.h"

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/**************************************************************************

+* ºê¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+typedef enum 

+{

+	ZMMP_CODEC_AMR_NB_IF1, 

+	ZMMP_CODEC_AMR_NB_IF2,

+	ZMMP_CODEC_AMR_NB_IETF,

+	ZMMP_CODEC_AMR_WB_IF1,

+	ZMMP_CODEC_AMR_WB_IF2,

+	ZMMP_CODEC_AMR_WB_IETF

+}T_zMmp_CodecType;

+

+

+typedef enum 

+{

+    ZMMP_AMR_ENC_MODE_0,     /* NB:4.75 kbit/s, WB:6.60 kbit/s  */

+    ZMMP_AMR_ENC_MODE_1,     /* NB:5.15 kbit/s, WB:8.85 kbit/s  */	

+    ZMMP_AMR_ENC_MODE_2,     /* NB:5.90 kbit/s, WB:12.65 kbit/s */

+    ZMMP_AMR_ENC_MODE_3,     /* NB:6.70 kbit/s, WB:14.25 kbit/s */

+    ZMMP_AMR_ENC_MODE_4,     /* NB:7.40 kbit/s, WB:15.85 kbit/s */

+    ZMMP_AMR_ENC_MODE_5,     /* NB:7.95 kbit/s, WB:18.25 kbit/s */

+    ZMMP_AMR_ENC_MODE_6,     /* NB:10.2 kbit/s, WB:19.85 kbit/s */

+    ZMMP_AMR_ENC_MODE_7,     /* NB:12.2 kbit/s, WB:23.05 kbit/s */

+    ZMMP_AMR_ENC_MODE_8,     /* NB:DTX,         WB:23.85 kbit/s */

+    ZMMP_AMR_ENC_MODE_9,     /* NB:ÎÞЧ,        WB:DTX          */

+    ZMMP_AMR_ENC_MODE_INVALID     /* NB:ÎÞЧ,   WB:ÎÞЧ          */

+}T_zMmp_AmrEncMode;

+

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+VOID*  mmp_AmrDecOpen  (T_zMmp_CodecType codecType);

+VOID*  mmp_AmrEncOpen  (T_zMmp_CodecType codecType, BOOL isDtxEnable);

+UINT16 mmp_AmrDecode   (VOID *pCodecContext, const UINT8 *pAmr, UINT16 *pPcm);

+UINT16 mmp_AmrEncode   (VOID *pCodecContext, T_zMmp_AmrEncMode mode, const UINT16 *pPcm,  UINT8 *pAmr);

+VOID   mmp_AmrDecClose (VOID *pCodecContext);

+VOID   mmp_AmrEncClose (VOID *pCodecContext);

+

+/**************************************************************************

+* È«¾Ö³£Á¿/±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif

diff --git a/cp/ps/plat/inc/msp/zte_audio.h b/cp/ps/plat/inc/msp/zte_audio.h
new file mode 100644
index 0000000..35db9d5
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_audio.h
@@ -0,0 +1,118 @@
+/************************************************************

+*************************************************************

+            MSP±¾µØÒôƵ²¥·ÅºÍ¼Òô¶ÔÍâ½Ó¿ÚÍ·Îļþ

+*************************************************************

+************************************************************/

+

+#ifndef ZTE_AUDIO_H

+#define ZTE_AUDIO_H

+

+#ifndef FOR_2960

+#include "mm_error.h"

+#endif

+#include "msm_type.h"

+#include "mm_def.h"

+#include "zte_display.h"

+

+typedef VOID (*MSP_NOTIFY_ERROR) (MM_MODULE_ID_E uiModule, DWORD dwParam);

+typedef VOID (*MSP_NOTIFY_END) (MM_MODULE_ID_E uiModule);

+

+typedef enum

+{

+    dd_volume_lev_0,

+    dd_volume_lev_1,

+    dd_volume_lev_2,

+    dd_volume_lev_3,

+    dd_volume_lev_4,

+    dd_volume_lev_5,        

+}VOLUME_DD_level;

+

+typedef enum

+{

+    DD_RECEIVER = 1,

+    DD_SPEAKER,

+    DD_HEADPHONE,

+    DD_SPEAKER_AND_HEADPHONE,

+    DD_BLUETOOTH_PHONE,     

+}DD_CODEC_PATHOUT;

+

+SINT32 Msp_SetEndCallback(MSP_NOTIFY_END EndCallbackFunc);

+SINT32 Msp_SetErrorCallback(MSP_NOTIFY_ERROR ErrorCallbackFunc);

+

+AUDIO_RESULT_E	Audio_Init(void);

+

+AUDIO_RESULT_E	Audio_Release(void);

+

+FILE_HANDLE		Audio_Open_File(unsigned char *filename);

+

+AUDIO_RESULT_E	Audio_Close(FILE_HANDLE handle);

+

+AUDIO_RESULT_E	PLAYER_AUDIO_StartPlay(FILE_HANDLE handle, unsigned long offset, unsigned short play_times);

+

+AUDIO_RESULT_E	Audio_StopPlay(FILE_HANDLE handle);

+

+AUDIO_RESULT_E	Audio_PausePlay(FILE_HANDLE handle);

+

+AUDIO_RESULT_E	Audio_ResumePlay(FILE_HANDLE handle);

+

+

+AUDIO_RESULT_E	Audio_GetCurTime(FILE_HANDLE handle, long *curtime);

+

+AUDIO_RESULT_E	Audio_GetTotalTime(FILE_HANDLE handle, unsigned long *totaltime);

+

+AUDIO_RESULT_E	Audio_Seek(FILE_HANDLE handle, unsigned long offset);

+

+

+AUDIO_RESULT_E	Audio_Mute(FILE_HANDLE handle, BOOL enable_mute);

+

+AUDIO_RESULT_E	Audio_Volume_Get(FILE_HANDLE handle, AUDIO_VOLUME_LEVEL_E *volume_level);

+

+AUDIO_RESULT_E	Audio_Volume_Set(FILE_HANDLE handle, AUDIO_VOLUME_LEVEL_E volume_level);

+

+

+AUDIO_RESULT_E	Audio_ChannelOut_Set(FILE_HANDLE handle, AUDIO_CHANNEL_OUT_E channel);

+

+/*

+AUDIO_RESULT_E Audio_Effect3D_Set(FILE_HANDLE handle,UINT8 *enable);

+

+AUDIO_RESULT_E Audio_EQmode_Set(FILE_HANDLE handle,MM_AUDIO_EQMODE_E audioEqMode);

+

+AUDIO_RESULT_E Audio_GetAuthorInfo(FILE_HANDLE handle, MP3_ID3_INFO_T *info);

+

+AUDIO_RESULT_E Audio_GetFileInfo(FILE_HANDLE handle, T_MM_AUDIO_PLAY_INFO *info);

+*/

+

+DRECORDER_RETURN_E REC_Open(BOOL record_in_cc, SINT32 uiVoiceFd);

+

+DRECORDER_RETURN_E REC_Close(void);

+

+RECORD_HANDLE REC_StartRecord(AUDIORECORDER_START_RECORD_T *record_param);

+

+DRECORDER_RETURN_E REC_StopRecord(RECORD_HANDLE handle);

+

+DRECORDER_RETURN_E REC_PauseRecord(RECORD_HANDLE handle);

+

+DRECORDER_RETURN_E REC_ResumeRecord(FILE_HANDLE handle);

+

+DRECORDER_RETURN_E  REC_GetCurTime(UINT32 *cur_time, FILE_HANDLE handle);

+

+

+/*LFX 20090507 for tone play begin*/

+AUDIO_RESULT_E Tone_Play(char toneID, char volume_level, char Priority);

+

+AUDIO_RESULT_E Tone_Stop(char toneID, char stop_type);

+/*LFX 20090507 for tone play end*/

+

+/* zhanghaoting add for 2960 tone 2009-08-14 */

+#ifdef FOR_2960

+extern void Audio_Open_Tone(VOID);

+

+extern void Audio_Play_Tone(T_MM_TONE_PARAM *ptParam);

+

+extern void Audio_Stop_Tone(VOID);

+

+extern void Audio_Close_Tone(VOID);

+#endif

+/* zhanghaoting add for 2960 tone 2009-08-14 end */

+

+#endif

diff --git a/cp/ps/plat/inc/msp/zte_dc.h b/cp/ps/plat/inc/msp/zte_dc.h
new file mode 100644
index 0000000..0648fed
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_dc.h
@@ -0,0 +1,114 @@
+/*****************************************************************************

+ *  °æ±¾ËùÓÐ (C)2008ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾

+ *  Ä£¿éÃû £º

+ *  ʵÏÖ¹¦ÄÜ £º

+ *  ×÷Õß £º

+ *  °æ±¾ £º

+ *  Íê³ÉÈÕÆÚ £º

+ *  ÆäËü˵Ã÷ £º MSPÅÄÕÕ¶ÔÍâ½Ó¿ÚÍ·Îļþ

+ *  ÐÞ¸ÄÈÕÆÚ     °æ±¾ºÅ      ÐÞ¸ÄÈË	     ÐÞ¸ÄÄÚÈÝ

+ *  ---------------------------------------------------------------------

+ *  2008/08/01	 V1.0	     XXXX	      XXXX

+************************************************************************/

+#ifndef	ZTE_DC_H

+#define	ZTE_DC_H

+

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+#include "zte_display.h"

+

+/**************************************************************************

+ *                        ºê                                     *

+ **************************************************************************/

+

+ 

+/**************************************************************************

+ *                        Êý¾ÝÀàÐÍ                                     *

+ **************************************************************************/

+/*³ß´ç*/

+typedef struct

+{

+    UINT16 dwWidth;

+    UINT16 dwHeight;

+}CAM_SIZE;

+typedef struct

+{

+    LCD_ID_E  			     lcd_id;

+    APP_PREVIEW_E          previewtype;

+    DCAMERA_SENSOR_E       sensor;

+    RECT_T		           disp_rect;		  // ÏÔÊ¾ÇøÓò

+    EFFECT_TYPE_E          effect;           //ÌØÊâЧ¹û

+    ZOOM_LEVEL_E           zoomlevel;        //Ëõ·Åˮƽ

+    MAN_ROTATE_TYPE	     rotation_mode;	  // Ðýת½Ç¶È	

+    BRITENESS_E            brightness;       //ÁÁ¶È

+    CONTRAST_E             contrastness;     //¶Ô±È¶È

+    CAPTURE_MODE_E         mode;             //ģʽ

+    CAM_SIZE               resolution;       //·Ö±çÂÊ

+    QUALITY_MODE_E         quality;          //ÖÊÁ¿

+    WHITEBALANCE_MODE_E    whitebalance;     //°×ƽºâ

+    MIRROR_PARAM_T         mirror;           //¾µÏñ

+}PREVIEW_PARAM_T;

+

+typedef struct

+{

+    UINT8                 *data_buffer;

+    UINT32                 data_length;

+    CHAR                  *data_display_ptr;  //ÔÚLCDÉÏÏÔʾµÄbufferÖ¸Õë

+    BOOL	                 flash_enable;		//ÊÇ·ñÉÁ¹â	

+    UINT16                  photonumber;

+}SNAPSHOT_PARAM_T;

+

+typedef struct

+{

+    UINT8                 *data_buffer;

+    UINT32                 data_length;

+    CHAR                  *data_display_ptr;  //ÔÚLCDÉÏÏÔʾµÄbufferÖ¸Õë

+    RECT_T  		           display_rect;	   // ÏÔʾÕÕÆ¬ÇøÓò

+    MAN_ROTATE_TYPE	     rotation_mode;	   // Ðýת½Ç¶È	

+}REVIEW_PARAM_T;

+

+typedef struct

+{	

+    UINT8                 *buf_ptr;          //Êý¾ÝÖ¸Õë

+    UINT16                 color;	         //͸Ã÷É«                      

+}FRAME_PARAM_T;

+

+/**************************************************************************

+ *                        º¯ÊýÔ­ÐÍ                                    *

+ **************************************************************************/

+DCAMERA_RETURN_VALUE_E DC_Open(DCAMERA_SENSOR_E param);

+

+DCAMERA_RETURN_VALUE_E DC_Close(void);

+

+DCAMERA_RETURN_VALUE_E DC_Startpreview(PREVIEW_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E DC_Stoppreview(void);

+

+DCAMERA_RETURN_VALUE_E DC_CaptureOne(SNAPSHOT_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E DC_PhotoReview(REVIEW_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E DC_SetRotate(MAN_ROTATE_TYPE param);

+

+DCAMERA_RETURN_VALUE_E DC_SetZoom(ZOOM_LEVEL_E param);

+

+DCAMERA_RETURN_VALUE_E DC_SetBright(BRITENESS_E level);

+

+DCAMERA_RETURN_VALUE_E DC_SetContrast(CONTRAST_E level);

+

+DCAMERA_RETURN_VALUE_E DC_SetEffect(EFFECT_TYPE_E effect);

+

+DCAMERA_RETURN_VALUE_E DC_SetCaputureMode(CAPTURE_MODE_E mode);

+

+DCAMERA_RETURN_VALUE_E DC_SetFrame(FRAME_PARAM_T *frame);

+

+DCAMERA_RETURN_VALUE_E DC_SetWhiteBalance(WHITEBALANCE_MODE_E param);

+

+DCAMERA_RETURN_VALUE_E DC_SetResolution(CAM_SIZE *param);

+

+DCAMERA_RETURN_VALUE_E DC_SetQuality(QUALITY_MODE_E param);

+

+DCAMERA_RETURN_VALUE_E DC_SetMirror(MIRROR_PARAM_T *param);

+

+#endif

diff --git a/cp/ps/plat/inc/msp/zte_dv.h b/cp/ps/plat/inc/msp/zte_dv.h
new file mode 100644
index 0000000..0f08bb5
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_dv.h
@@ -0,0 +1,91 @@
+/*****************************************************************************

+ *  °æ±¾ËùÓÐ (C)2008ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾

+ *  Ä£¿éÃû £º

+ *  ʵÏÖ¹¦ÄÜ £º

+ *  ×÷Õß £º

+ *  °æ±¾ £º

+ *  Íê³ÉÈÕÆÚ £º

+ *  ÆäËü˵Ã÷ £ºMSPÉãÏñ¶ÔÍâ½Ó¿ÚÍ·Îļþ

+ *  ÐÞ¸ÄÈÕÆÚ     °æ±¾ºÅ      ÐÞ¸ÄÈË	     ÐÞ¸ÄÄÚÈÝ

+ *  ---------------------------------------------------------------------

+ *  2008/08/01	 V1.0	     XXXX	      XXXX

+************************************************************************/

+#ifndef ZTE_DV_H

+#define ZTE_DV_H

+

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+#include "zte_display.h"

+/**************************************************************************

+ *                        ºê                                     *

+ **************************************************************************/

+

+ 

+/**************************************************************************

+ *                        Êý¾ÝÀàÐÍ                                     *

+ **************************************************************************/

+typedef enum

+{

+    VIDEO_MIC = 1,

+    VIDEO_HEADSET	

+}VIDEO_CODEC_PATH;

+

+typedef enum

+{

+    FILE_3GP,

+    FILE_MP4

+}VIDEO_FILE_TYPE;

+

+typedef enum

+{

+    DV_TYPE,

+    VIDEO_TYPE,

+    STREAM_TYPE,

+    VT_TYPE

+}DV_APP_TYPE;

+

+typedef struct

+{	

+    CHAR                            *savefile_path;		 

+    VIDEO_CODEC_PATH     codec_path;

+    RECT_T                         rec_rect;

+    MIRROR_PARAM_T         mirror;

+    MAN_ROTATE_TYPE        rotate;

+    QUALITY_MODE_E          quality; 

+    UINT32                          maxStreamSize;

+    BOOL                            audioenable;

+    EFFECT_TYPE_E             effect;

+    VIDEO_FILE_TYPE          filetype;

+}DV_RECORD_START_PARAM_T;

+

+/**************************************************************************

+ *                        º¯ÊýÔ­ÐÍ                                    *

+ **************************************************************************/

+DCAMERA_RETURN_VALUE_E DV_Open(DCAMERA_SENSOR_E param);

+

+DCAMERA_RETURN_VALUE_E DV_Close(void);

+

+DCAMERA_RETURN_VALUE_E DV_StartRecord(DV_RECORD_START_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E DV_StopRecord(void);

+

+DCAMERA_RETURN_VALUE_E DV_PauseRecord(void);

+

+DCAMERA_RETURN_VALUE_E DV_ResumeRecord(void);

+

+DCAMERA_RETURN_VALUE_E DV_SetRotate(MAN_ROTATE_TYPE param);

+

+DCAMERA_RETURN_VALUE_E DV_SetZoom(ZOOM_LEVEL_E param);

+

+DCAMERA_RETURN_VALUE_E DV_SetBright(BRITENESS_E level);

+

+DCAMERA_RETURN_VALUE_E DV_SetContrast(CONTRAST_E level);

+

+DCAMERA_RETURN_VALUE_E DV_SetEffect(EFFECT_TYPE_E effect);

+

+DCAMERA_RETURN_VALUE_E DV_GetFileSize(UINT32 *length);

+

+DCAMERA_RETURN_VALUE_E DV_GetCurTime(UINT32 *uitime);

+

+#endif

diff --git a/cp/ps/plat/inc/msp/zte_osd.h b/cp/ps/plat/inc/msp/zte_osd.h
new file mode 100644
index 0000000..ccfd77b
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_osd.h
@@ -0,0 +1,119 @@
+/************************************************************************

+* °æÈ¨ËùÓÐ(C)2007,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£

+* Ä£¿éÃû  £º OSD²Ù×÷Ä£¿é

+* ÎļþÃû³Æ£º zte_osd.h

+* Îļþ±êʶ£º 

+* ÄÚÈÝÕªÒª£º ´ËÎļþÊÇMSP¶ÔÍâÌṩµÄÍ·Îļþ

+* 

+* ÐÞ¸ÄÈÕÆÚ      °æ±¾ºÅ     Ð޸ıê¼Ç       ÐÞ¸ÄÈË       ÐÞ¸ÄÄÚÈÝ      

+* ----------------------------------------------------------------------

+* 2009/3/25    1.0                        ³ÂÓÐöÎ                        

+************************************************************************/

+

+#ifndef ZTE_OSD_H

+#define ZTE_OSD_H

+

+#ifdef __cplusplus

+   extern "C"

+   {

+#endif 

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+//#include "pub.h"

+/**************************************************************************

+ *                         ³£Á¿                                           *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         ºê¶¨Òå                                         *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         Êý¾ÝÀàÐÍ                                       *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         ÀàÉùÃ÷ £¨¶ÔÓÚCÓïÑÔµÄÍ·Îļþ£¬¿É²Ã¼ô£©           *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         Ä£°å  £¨¶ÔÓÚCÓïÑÔµÄÍ·Îļþ£¬¿É²Ã¼ô£©            *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         È«¾Ö±äÁ¿ÉùÃ÷                                    *

+ **************************************************************************/

+

+/**************************************************************************

+ *                        È«¾Öº¯ÊýÔ­ÐÍ                                     *

+ **************************************************************************/ 

+

+/**

+ * º¯ÊýÃû³Æ£º Zte_SetTransformColor 

+ * ¹¦ÄÜÃèÊö£º OSDÄ£¿é͸Ã÷É«ºÍ͸Ã÷¶ÈÉèÖÃ

+ * ²ÎÊý˵Ã÷£º (IN) uiTransColoor: ͸Ã÷É«

+                   uiAlpha      : ͸Ã÷¶È

+ * ·µ »Ø Öµ£º ÎÞ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+VOID Zte_SetLcdFd(UINT32 uiLcdFd);

+

+

+/**

+ * º¯ÊýÃû³Æ£º Zte_SetTransformColor 

+ * ¹¦ÄÜÃèÊö£º OSDÄ£¿é͸Ã÷É«ºÍ͸Ã÷¶ÈÉèÖÃ

+ * ²ÎÊý˵Ã÷£º (IN) uiTransColoor: ͸Ã÷É«

+                   uiAlpha      : ͸Ã÷¶È

+ * ·µ »Ø Öµ£º ÎÞ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+VOID Zte_SetTransformColor(UINT16 uiTransColoor, UINT8 uiAlpha);

+

+

+/**

+ * º¯ÊýÃû³Æ£º Zte_SetScreenSize 

+ * ¹¦ÄÜÃèÊö£º ÉèÖÃÆÁÄ»¿í¸ß

+ * ²ÎÊý˵Ã÷£º (IN) uiWidth : ¿í¶È

+                   uiHeight: ¸ß¶È

+ * ·µ »Ø Öµ£º ÎÞ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+VOID Zte_SetScreenSize(UINT32 uiWidth, UINT32 uiHeight);

+

+/**

+ * º¯ÊýÃû³Æ£º Zte_GuiDestroyUpdateScreenThread 

+ * ¹¦ÄÜÃèÊö£º ³õʼ»¯Ê±´´½¨µÄË¢ÐÂÏ̵߳ĽӿÚ

+ * ²ÎÊý˵Ã÷£º (IN) priority       ÐèÒª´´½¨Ï̵߳ÄÓÅÏȼ¶

+ *            (IN) stack_size     ÐèÒªµÄÕ»¿Õ¼ä´óС

+ *            (IN) LcdFd          LCDµÄÉ豸¾ä±ú

+ *            (IN) pBuffer        LCDµÄÉ豸ÏÔ´æ

+ * ·µ »Ø Öµ£º BOOL    FALSE: ´´½¨Ê§°ÜºÍÈë²Î´íÎó

+ *                    TRUE:  ´´½¨³É¹¦          

+ * ÆäËü˵Ã÷£º Õâ¸öº¯ÊýÔÚGUI³õʼ»¯Ê±µ÷Ó㬵«ÒªÔڳɹ¦´ò¿ªLCDÉ豸֮ºó£¬¾Í·ÅÔÚsystem_initializeº¯ÊýµÄ×îºóÃæ

+ */

+BOOL Zte_GuiCreateUpdateScreenThread(UINT32 priority, UINT32 stack_size, VOID *pBuffer);

+

+

+/**

+ * º¯ÊýÃû³Æ£º Zte_GuiUpdateScreenRect 

+ * ¹¦ÄÜÃèÊö£º GUIË¢ÆÁ֪ͨº¯Êý

+ * ²ÎÊý˵Ã÷£º (IN) left        ¾Ö²¿Ë¢ÐÂµÄÆðʼx×ø±ê

+ *            (IN) top         ¾Ö²¿Ë¢ÐÂµÄÆðʼy×ø±ê

+ *            (IN) right       ¾Ö²¿Ë¢ÐµÄÖÕÖ¹x×ø±ê

+ *            (IN) bottom      ¾Ö²¿Ë¢ÐµÄÖÕÖ¹y×ø±ê

+ *            (IN) pAlphaTable ÓÉMMIÉèÖõÄ͸Ã÷¶È±í£¬´óСΪ240*320¡£Ö»ÓÐÔÚOSD״̬ÏÂÓÐЧ

+ *                             Õý³£×´Ì¬Îª¿Õ

+ * ·µ »Ø Öµ£º ÎÞ

+ * ÆäËü˵Ã÷£º Õâ¸öº¯ÊýÔÚprimaryUpdateRegionÖÐʹÓÃ,Ìæ»»µô֮ǰˢÆÁµÄ²¿·Ö.

+ */

+VOID Zte_GuiUpdateScreenRect(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom,  unsigned char  *pAlphaTable);

+

+

+

+#ifdef __cplusplus

+   } 

+#endif

+

+#endif

+

diff --git a/cp/ps/plat/inc/msp/zte_pcm.h b/cp/ps/plat/inc/msp/zte_pcm.h
new file mode 100644
index 0000000..712baaf
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_pcm.h
@@ -0,0 +1,154 @@
+/************************************************************************

+ * °æÈ¨ËùÓÐ (C)2007,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£

+ * Ä£¿éÃû  £º PCMÊý¾ÝÒôƵ²¥·ÅÄ£¿é

+ * ÎļþÃû³Æ£º Zte_pcmdriver.h

+ * Îļþ±êʶ£º 

+ * ÄÚÈÝÕªÒª£º Ö÷Òª¶¨ÒåPCMÊý¾ÝÒôƵ²¥·ÅÄ£¿éµÄºê¶¨Òå¡¢³£Á¿¡¢È«¾Ö±äÁ¿ÒÔ¼°º¯ÊýµÄÉùÃ÷

+ *                      ´Ë½Ó¿ÚÖ÷ÒªÊÇÓÃÓڹ̶¨Ì¨ÓïÒô²¥±¨

+ *

+ * ÐÞ¸ÄÈÕÆÚ      °æ±¾ºÅ     Ð޸ıê¼Ç    ÐÞ¸ÄÈË          ÐÞ¸ÄÄÚÈÝ      

+ * ----------------------------------------------------------------------

+ * 2010/01/13    1.0                    Âíΰ          ´´½¨

+ ************************************************************************/

+

+#ifndef ZTE_PCMDRIVER_H

+#define ZTE_PCMDRIVER_H

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         ³£Á¿                                           *

+ **************************************************************************/

+typedef enum 

+{

+    PCM_MONO_CHANNEL,

+    PCM_DUAL_CHANNEL

+}DD_PCM_CHANNEL;

+

+typedef enum

+{

+    PCM_VOL_LEV_0,

+	PCM_VOL_LEV_1,

+	PCM_VOL_LEV_2,

+	PCM_VOL_LEV_3,

+	PCM_VOL_LEV_4,

+	PCM_VOL_LEV_5

+}DD_PCM_VOL_LEVEL;

+

+typedef enum

+{

+    DD_PCM_OUTPUT_RECEIVER = 1,       /* ÌýͲ         */

+    DD_PCM_OUTPUT_SPEAKER,            /* ÑïÉùÆ÷       */

+    DD_PCM_OUTPUT_HEADPHONE,          /* ¶ú»ú         */

+    DD_PCM_OUTPUT_SPEAKER_HEADPHONE,  /* ÑïÉùÆ÷ºÍ»°Í² */

+    DD_PCM_OUTPUT_BLUETOOTH           /* À¶ÑÀ         */

+}DD_PCM_CHANNEL_OUTPUT;

+

+typedef enum 

+{

+    DD_PCMRATE_8_KHZ = 0,

+    DD_PCMRATE_11_KHZ,

+    DD_PCMRATE_16_KHZ,

+    DD_PCMRATE_44_1_KHZ,

+    DD_PCMRATE_UNKNOW

+}DD_PCM_SAMPLERATE;

+

+/**************************************************************************

+ *                         ºê¶¨Òå                                         *

+ **************************************************************************/

+                         

+/**************************************************************************

+ *                         Êý¾ÝÀàÐÍ                                       *

+ **************************************************************************/

+typedef struct PCM_PLAY_PARAM_

+{

+	DD_PCM_CHANNEL    eChannel;

+	DD_PCM_VOL_LEVEL      eVol;

+	DD_PCM_CHANNEL_OUTPUT eChannelOutput;

+	DD_PCM_SAMPLERATE eSampleRate;

+}PCM_PLAY_PARAM;

+

+

+/**************************************************************************

+ *                         È«¾Ö±äÁ¿ÉùÃ÷                                    *

+ **************************************************************************/

+

+/**************************************************************************

+ *                        È«¾Öº¯ÊýÔ­ÐÍ                                     *

+ **************************************************************************/

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Init

+ * ¹¦ÄÜÃèÊö£º PCMÒôƵģ¿é³õʼ»¯

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ´ò¿ªÉ豸³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º 

+ */

+SINT32 PCM_Audio_Init(void);

+

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Release

+ * ¹¦ÄÜÃèÊö£º ÊÍ·ÅPCMÒôƵģ¿é

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ÊÍ·ÅÉ豸³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º 

+ */

+SINT32 PCM_Audio_Release(void);

+

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Open_Buffer

+ * ¹¦ÄÜÃèÊö£º ´ò¿ªPCMÊý¾Ýbuffer

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º 

+ */

+SINT32 PCM_Audio_Open_Buffer(PCM_PLAY_PARAM tPcmPlayParam, VOID *pPcmBuffer, UINT32 uiBufSize);

+

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Play

+ * ¹¦ÄÜÃèÊö£º PCMÊý¾Ý¿ªÊ¼²¥·Å

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ

+ */

+SINT32 PCM_Audio_Play(UINT32 uiOffset, UINT32 uiRepeatCount);

+

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Data_Input

+ * ¹¦ÄÜÃèÊö£º PCMÊý¾ÝÊäÈë

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ

+ */

+SINT32 PCM_Audio_Data_Input(VOID *pDataBuf, UINT32 uiDataLen);

+

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Stop

+ * ¹¦ÄÜÃèÊö£º PCMÊý¾ÝÍ£Ö¹²¥·Å

+ * ²ÎÊý˵Ã÷£º (IN)ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º 

+ */

+SINT32 PCM_Audio_Stop(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º PCM_Audio_Close

+ * ¹¦ÄÜÃèÊö£º PCMÒôƵ²¥·ÅÄ£¿é¹Ø±Õ

+ * ²ÎÊý˵Ã÷£º (IN)ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»Ø0;·ñÔò·µ»Ø-1¡£

+ * ÆäËü˵Ã÷£º 

+ */

+SINT32 PCM_Audio_Close(VOID);

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* ZTE_PCMDRIVER_H */

+

diff --git a/cp/ps/plat/inc/msp/zte_stream.h b/cp/ps/plat/inc/msp/zte_stream.h
new file mode 100644
index 0000000..b792199
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_stream.h
@@ -0,0 +1,183 @@
+/************************************************************************

+ * °æÈ¨ËùÓÐ (C)2007,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£

+ * Ä£¿éÃû  £º Á÷ýÌåÄ£¿é

+ * ÎļþÃû³Æ£º Zte_stream.h

+ * Îļþ±êʶ£º 

+ * ÄÚÈÝÕªÒª£º Ö÷Òª¶¨ÒåÁ÷ýÌåÄ£¿éµÄºê¶¨Òå¡¢³£Á¿¡¢È«¾Ö±äÁ¿ÒÔ¼°º¯ÊýµÄÉùÃ÷

+ *

+ * ÐÞ¸ÄÈÕÆÚ      °æ±¾ºÅ     Ð޸ıê¼Ç    ÐÞ¸ÄÈË          ÐÞ¸ÄÄÚÈÝ      

+ * ----------------------------------------------------------------------

+ * 2009/06/08    1.0                    ½¯±¾±ø          ´´½¨

+ ************************************************************************/

+

+#ifndef ZTE_STREAM_H

+#define ZTE_STREAM_H

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         ³£Á¿                                           *

+ **************************************************************************/

+typedef enum 

+{

+    DD_STREAMING_NONE = 0,

+    DD_STREAMING_MP3 = 0x80,

+    DD_STREAMING_MIDI,

+    DD_STREAMING_ONE,

+    DD_STREAMING_AMR_NB,

+    DD_STREAMING_AAC,

+    DD_STREAMING_DRA,

+    DD_STREAMING_UNKNOW

+}DD_STEAMING_AUDIO;

+

+/**************************************************************************

+ *                         ºê¶¨Òå                                         *

+ **************************************************************************/

+                         

+/**************************************************************************

+ *                         Êý¾ÝÀàÐÍ                                       *

+ **************************************************************************/

+

+

+typedef struct _DD_AUDIO_STREAM_AAC_PARAM_

+{

+	UINT32 headerLength;

+	UINT8 *headerAddr;

+}DD_AUDIO_STREAM_AAC_PARAM;

+

+typedef struct DD_STREAM_AUDIO_SET_

+{

+   

+   UINT8 *bConfig;

+   DD_AUDIO_STREAM_AAC_PARAM dd_aac;

+      

+}DD_STREAM_AUDIO_SET;

+

+typedef struct STREAM_AUDIO_PARAM_

+{

+

+    DD_STEAMING_AUDIO stream_audio_type;

+    

+    DD_STREAM_AUDIO_SET stream_param_set;

+    

+

+}STREAM_AUDIO_PARAM;

+

+typedef STREAM_AUDIO_PARAM *STREAM_AUDIO_HANDLE;

+

+/* ÊÓÆµ¸ñʽ */

+typedef enum

+{

+    STREAM_VIDEO_NONE =0,

+    STREAM_VIDEO_H263,         /* H263 */

+    STREAM_VIDEO_H264,         /* H264 */

+    STREAM_VIDEO_MP4,          /* MP4  */

+    STREAM_VIDEO_MAX

+}STREAM_VIDEO_FORMAT;

+

+/**************************************************************************

+ *                         È«¾Ö±äÁ¿ÉùÃ÷                                    *

+ **************************************************************************/

+

+/**************************************************************************

+ *                        È«¾Öº¯ÊýÔ­ÐÍ                                     *

+ **************************************************************************/

+/**

+ * º¯ÊýÃû³Æ£º Stream_Video_Open

+ * ¹¦ÄÜÃèÊö£º ´ò¿ªÁ÷ýÌåÊÓÆµÉ豸¡£

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ´ò¿ªÉ豸³É¹¦·µ»ØDCAMERA_OP_SUCCESS;·ñÔò·µ»ØDCAMERA_OP_ERROR¡£

+ * ÆäËü˵Ã÷£º 

+ */

+DCAMERA_RETURN_VALUE_E Stream_Video_Open(void);

+

+/**

+ * º¯ÊýÃû³Æ£º Stream_Video_Close

+ * ¹¦ÄÜÃèÊö£º ÊÍ·ÅÁ÷ýÌå´ò¿ªµÄÊÓÆµÉ豸¡£

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ÊÍ·ÅÉ豸³É¹¦·µ»ØDCAMERA_OP_SUCCESS;·ñÔò·µ»ØDCAMERA_OP_ERROR¡£

+ * ÆäËü˵Ã÷£º 

+ */

+DCAMERA_RETURN_VALUE_E Stream_Video_Close(void);

+

+/**

+ * º¯ÊýÃû³Æ£º Stream_Video_Init

+ * ¹¦ÄÜÃèÊö£º Á÷ýÌåÄ£¿é³õʼ»¯¡£

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS;·ñÔò·µ»ØDCAMERA_OP_ERROR¡£

+ * ÆäËü˵Ã÷£º 

+ */

+DCAMERA_RETURN_VALUE_E Stream_Video_Init(STREAM_VIDEO_FORMAT eStreamVideoType);

+

+/**

+ * º¯ÊýÃû³Æ£º Stream_Video_Release

+ * ¹¦ÄÜÃèÊö£º ÊÍ·ÅÁ÷ýÌåÄ£¿é×ÊÔ´¡£

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS;·ñÔò·µ»ØDCAMERA_OP_ERROR¡£

+ * ÆäËü˵Ã÷£º Óë³õʼ»¯º¯Êý³É¶ÔʹÓÃ

+ */

+DCAMERA_RETURN_VALUE_E Stream_Video_Release(void);

+

+/**

+ * º¯ÊýÃû³Æ£º Stream_Video_Decode

+ * ¹¦ÄÜÃèÊö£º Á÷ýÌåÊÓÆµ½âÂë¡¢Êä³ö¡£

+ * ²ÎÊý˵Ã÷£º (IN)param:ÊÓÆµÊý¾Ý½á¹¹Ö¸Õ룬°üÀ¨Êý¾ÝÖ¸ÕëÓ볤¶È

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS;·ñÔò·µ»ØDCAMERA_OP_ERROR¡£

+ * ÆäËü˵Ã÷£º ¸Ãº¯Êý²»½öÌṩ½âÂë¶øÇÒ°üÀ¨½âÂëºóµÄÊÓÆµÊä³ö¹¦ÄÜ

+ */

+DCAMERA_RETURN_VALUE_E Stream_Video_Decode(STREAM_DATA *param);

+

+/**

+ * º¯ÊýÃû³Æ£º Stream_Video_SetParam

+ * ¹¦ÄÜÃèÊö£º Á÷ýÌåÊÓÆµÉèÖá£

+ * ²ÎÊý˵Ã÷£º (IN)param:ÉèÖòÎÊý£¬ÉèÖÃÊÓÆµÏÔʾµÄÇøÓò¼°Ðýת½Ç¶È

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS;·ñÔò·µ»ØDCAMERA_OP_ERROR¡£

+ * ÆäËü˵Ã÷£º 

+ */

+DCAMERA_RETURN_VALUE_E Stream_Video_SetParam(STREAM_SET_PARAM *param);

+

+/**

+ * º¯ÊýÃû³Æ£ºStream_Audio_Open

+ * ¹¦ÄÜÃèÊö£º´ò¿ªÁ÷ýÌåÒôƵÉ豸¡£

+ * ²ÎÊý˵Ã÷£º(IN)data_type:Á÷ýÌåÊý¾ÝÀàÐÍ

+ *           (IN)stream_param:ÉèÖòÎÊý

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØÁ÷ýÌåÒôƵ²¥·Å¾ä±ú;·ñÔò·µ»ØNULL¡£

+ * ÆäËü˵Ã÷£º 

+ */

+STREAM_AUDIO_HANDLE Stream_Audio_Open(DD_STEAMING_AUDIO data_type, DD_STREAM_AUDIO_SET *stream_param);

+

+/**

+ * º¯ÊýÃû³Æ£ºStream_Audio_Close

+ * ¹¦ÄÜÃèÊö£º¹Ø±ÕÁ÷ýÌåÒôƵÉ豸¡£

+ * ²ÎÊý˵Ã÷£º(IN)handle:Á÷ýÌåÒôƵ²¥·Å¾ä±ú

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØAUDIO_NO_ERROR;·ñÔò·µ»ØÏàÓ¦µÄ´íÎóÂë¡£

+ * ÆäËü˵Ã÷£º 

+ */

+AUDIO_RESULT_E Stream_Audio_Close(STREAM_AUDIO_HANDLE handle);

+

+/**

+ * º¯ÊýÃû³Æ£ºStream_Audio_Open

+ * ¹¦ÄÜÃèÊö£ºÁ÷ýÌåÒôƵÊý¾Ý½âÂëÊä³ö¡£

+ * ²ÎÊý˵Ã÷£º(IN)handle:Á÷ýÌåÒôƵ²¥·Å¾ä±ú

+ *           (IN)buffer:ÒôƵÊý¾ÝÖ¸Õë

+ *           (IN)buffer_size:ÒôƵÊý¾Ý³¤¶È

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØAUDIO_NO_ERROR;·ñÔò·µ»ØÏàÓ¦µÄ´íÎóÂë¡£

+ * ÆäËü˵Ã÷£º 

+ */

+AUDIO_RESULT_E Stream_Audio_Decode(STREAM_AUDIO_HANDLE handle,

+                                   UINT32 *buffer,

+                                   UINT32 buffer_size);

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* ZTE_STREAM_H */

+

diff --git a/cp/ps/plat/inc/msp/zte_video.h b/cp/ps/plat/inc/msp/zte_video.h
new file mode 100644
index 0000000..5c5083d
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_video.h
@@ -0,0 +1,129 @@
+/*****************************************************************************

+ *  °æ±¾ËùÓÐ (C)2008ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾

+ *  Ä£¿éÃû £º

+ *  ʵÏÖ¹¦ÄÜ £º

+ *  ×÷Õß £º

+ *  °æ±¾ £º

+ *  Íê³ÉÈÕÆÚ £º

+ *  ÆäËü˵Ã÷ £ºMSPÊÓÆµ²¥·Å¶ÔÍâ½Ó¿ÚÍ·Îļþ

+ *  ÐÞ¸ÄÈÕÆÚ     °æ±¾ºÅ      ÐÞ¸ÄÈË	     ÐÞ¸ÄÄÚÈÝ

+ *  ---------------------------------------------------------------------

+ *  2008/08/01	 V1.0	     XXXX	      XXXX

+************************************************************************/

+#ifndef	ZTE_VIDEO_H

+#define	ZTE_VIDEO_H

+

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+#include "zte_display.h"

+

+/**************************************************************************

+ *                        ºê                                     *

+ **************************************************************************/

+#define  VIDEO_MAX_PATH_LEN     1024

+/**************************************************************************

+ *                        Êý¾ÝÀàÐÍ                                     *

+ **************************************************************************/

+typedef enum

+{

+    VIDEO_FILE_TYPE_MP4,

+    VIDEO_FILE_TYPE_3GP,

+    VIDEO_FILE_TYPE_K3G,

+    VIDEO_FILE_TYPE_UNKNOWN

+} VIDEO_BUFFER_FILE_TYPE_E;

+

+typedef enum

+{

+    CHANNEL_OUT_RECEIVER = 1,              /*ÌýͲ*/

+    CHANNEL_OUT_SPEAKER ,                    /*speaker*/		 

+    CHANNEL_OUT_EARPHONE,                   /*¶ú»ú*/

+    CHANNEL_OUT_SPEAKER_EARPHONE,   /*¶ú»ú + SpeakerͬʱÊä³ö*/

+    CHANNEL_OUT_BLUETOOTH

+}VIDEO_CHANNEL_OUT_TYPE_E;

+

+typedef enum

+{

+    VIDEO_VOLUME_LEVEL_0,

+    VIDEO_VOLUME_LEVEL_1,

+    VIDEO_VOLUME_LEVEL_2,

+    VIDEO_VOLUME_LEVEL_3,

+    VIDEO_VOLUME_LEVEL_4,

+    VIDEO_VOLUME_LEVEL_5

+}VIDEO_VOLUME_LEVEL_E;

+

+typedef enum

+{

+    VIDEO_SEEK_FROM_CUR,      /*´Óµ±Ç°Î»ÖÃseek*/

+    VIDEO_SEEK_FROM_BEGIN   /*´Ó¿ªÊ¼Seek*/

+}VIDEO_PLAY_SEEK_MODE;

+

+typedef enum

+{

+    VIDEO_PLAY_STATE_IDLE,

+    VIDEO_PLAY_STATE_READY,

+    VIDEO_PLAY_STATE_PLAY,

+    VIDEO_PLAY_STATE_PAUSE,

+    VIDEO_PLAY_STATE_STOP

+}VIDEO_PLAY_STATE;

+

+typedef struct

+{	

+    char                       filepath[VIDEO_MAX_PATH_LEN+1];  /*ÊÓÆµµÄ×ÊԴ·¾¶*/

+    RECT_T                     play_rect;

+    MAN_ROTATE_TYPE            rotate;                

+    VIDEO_CHANNEL_OUT_TYPE_E   channel;

+    VIDEO_VOLUME_LEVEL_E       volume;

+    VIDEO_PLAY_STATE           curstate;

+    UINT8                     *videoBuf;            /* Ö¸ÏòÊÓÆµbufferÊý¾ÝµÄÖ¸Õë */

+    UINT32                     videoBuffSize;      /* ÊÓÆµbufferµÄ´óС */

+    VIDEO_BUFFER_FILE_TYPE_E   videotype;           /* ÊÓÆµÀàÐÍ */

+}VIDEO_PLAY_PARAM_T;

+

+typedef struct

+{

+    UINT32                pos;

+    VIDEO_PLAY_SEEK_MODE  seekmode;

+}VIDEO_PLAY_SEEK_T; 

+

+typedef struct

+{   

+    UINT32          dwTotalTime;

+    DISPLAY_SIZE_T  tsize;              

+    UINT32          dwOnlyHaveAudio;

+}VIDEO_PLAY_INFO;

+

+/**************************************************************************

+ *                        º¯ÊýÔ­ÐÍ                                    *

+ **************************************************************************/

+DCAMERA_RETURN_VALUE_E Video_Open(void);

+

+DCAMERA_RETURN_VALUE_E Video_Close(void);

+

+DCAMERA_RETURN_VALUE_E Video_Play_Init(VIDEO_PLAY_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E Video_Play_Buffer_Init(VIDEO_PLAY_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E Video_Play_Release(void);

+

+DCAMERA_RETURN_VALUE_E Video_StartPlay(VIDEO_PLAY_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E Video_StopPlay(void);

+

+DCAMERA_RETURN_VALUE_E Video_PausePlay(void);

+

+DCAMERA_RETURN_VALUE_E Video_ResumePlay(void);

+

+DCAMERA_RETURN_VALUE_E Video_Seek(VIDEO_PLAY_SEEK_T *param);

+

+DCAMERA_RETURN_VALUE_E Video_Rotate(VIDEO_PLAY_PARAM_T *param);

+

+DCAMERA_RETURN_VALUE_E Video_GetCurTime(unsigned long *param);

+

+DCAMERA_RETURN_VALUE_E Video_GetTotalTime(unsigned long *param);

+

+DCAMERA_RETURN_VALUE_E Video_GetFileInfo(VIDEO_PLAY_INFO *param);

+

+#endif

+

+

diff --git a/cp/ps/plat/inc/msp/zte_vtdriver.h b/cp/ps/plat/inc/msp/zte_vtdriver.h
new file mode 100644
index 0000000..f3b5e9c
--- /dev/null
+++ b/cp/ps/plat/inc/msp/zte_vtdriver.h
@@ -0,0 +1,521 @@
+/************************************************************************

+* °æÈ¨ËùÓÐ(C)2007,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£

+* Ä£¿éÃû  £º ¿ÉÊӵ绰ҵÎñÖжàýÌåÇý¶¯Ä£¿é

+* ÎļþÃû³Æ£º zte_vtdriver.h

+* Îļþ±êʶ£º 

+* ÄÚÈÝÕªÒª£º 

+* 

+* ÐÞ¸ÄÈÕÆÚ      °æ±¾ºÅ     Ð޸ıê¼Ç       ÐÞ¸ÄÈË       ÐÞ¸ÄÄÚÈÝ      

+* ----------------------------------------------------------------------

+* 2009/6/3    1.0                        ´ú¿µ                        

+************************************************************************/

+

+#ifndef ZTE_VT_DRIVER_H

+#define ZTE_VT_DRIVER_H

+

+#ifdef __cplusplus

+   extern "C"

+   {

+#endif 

+/**************************************************************************

+ *                        Í·Îļþ°üº¬                                      *

+ **************************************************************************/

+ 

+/**************************************************************************

+ *                         ³£Á¿                                           *

+ **************************************************************************/

+typedef enum

+{

+    VT_VIDEO_H263 = 1,

+    VT_VIDEO_MP4

+}VT_VIDEO_FORMAT;

+

+/* AMRµÄÖ¡ÂÊ */

+typedef enum {

+    VT_VOICE_FRAME_MR475 = 0,

+    VT_VOICE_FRAME_MR515,

+    VT_VOICE_FRAME_MR59,

+    VT_VOICE_FRAME_MR67,

+    VT_VOICE_FRAME_MR74,

+    VT_VOICE_FRAME_MR795,

+    VT_VOICE_FRAME_MR102,

+    VT_VOICE_FRAME_MR122,

+

+    VT_MAX_VOICE_FRAME_TYPE 

+}VT_VOICE_FRAME_TYPE;

+

+/* AMRµÄÖ¡¸ñʽ */

+typedef enum {

+    VT_VOICE_AMR_IF2,

+    VT_VOICE_AMR_IF1,

+

+    VT_MAX_VOICE_AMR_IF

+}VT_VOICE_AMRIF;

+

+/* º¯Êý·µ»ØÖµ */

+typedef enum 

+{

+    MM_COM_OP_SUCCESS     = 0,             /* ²Ù×÷³É¹¦          */

+    MM_COM_OP_ERROR       = -1,            /* ²Ù×÷ʧ°Ü          */

+    MM_OPEN_AUDIO_FAILE   = -2,            /* ´ò¿ªAudioÉ豸ʧ°Ü */

+    MM_OPEN_VIDEO_FAILE   = -3,            /* ´ò¿ªVideoÉ豸ʧ°Ü */

+    MM_OPEN_CAM_FAILE     = -4,            /* ´ò¿ªCAMÉ豸ʧ°Ü   */

+    MM_AUDIO_DEV_UNOPENED = -5,            /* AudioÉ豸û´ò¿ª   */

+    MM_VIDEO_DEV_UNOPENED = -6,            /* VideoÉ豸û´ò¿ª   */

+    MM_CAM_DEV_UNOPENED   = -7,            /* CAMÉ豸û´ò¿ª     */

+    MM_PARAM_ERROR        = -8,            /* ²ÎÊýÊäÈë´íÎó      */

+}MM_COM_ERRCODE;

+

+/* ÊäÈëÒôÁ¿ */

+typedef enum

+{

+    MM_INPUT_VOLUME_LEVEL_0 = 0,

+    MM_INPUT_VOLUME_LEVEL_1,

+    MM_INPUT_VOLUME_LEVEL_2,

+    MM_INPUT_VOLUME_LEVEL_3,

+    MM_INPUT_VOLUME_LEVEL_4,

+    MM_INPUT_VOLUME_LEVEL_5,

+} T_MM_INPUT_VOLUME_LEVEL;

+

+/* Êä³öÒôÁ¿ */

+typedef enum

+{

+    MM_OUTPUT_VOLUME_LEVEL_0 = 0,

+    MM_OUTPUT_VOLUME_LEVEL_1,

+    MM_OUTPUT_VOLUME_LEVEL_2,

+    MM_OUTPUT_VOLUME_LEVEL_3,

+    MM_OUTPUT_VOLUME_LEVEL_4,

+    MM_OUTPUT_VOLUME_LEVEL_5,

+} T_MM_OUTPUT_VOLUME_LEVEL;

+

+/* ÊäÈëͨµÀ */

+typedef enum

+{

+    MM_CHANNEL_INPUT_MICPHONE    = 1,    /* Âó¿Ë·ç   */                 

+    MM_CHANNEL_INPUT_HEADSET,            /* ¶ú»ú»°Í² */                             

+

+} T_MM_CHANNEL_INPUT;

+

+/* Êä³öͨµÀ */

+typedef enum

+{

+    MM_CHANNEL_OUTPUT_RECEIVER = 1,              /* ÌýͲ */

+    MM_CHANNEL_OUTPUT_SPEAKER,                   /* ÑïÉùÆ÷ */

+    MM_CHANNEL_OUTPUT_HEADPHONE,                 /* ¶ú»ú */

+    MM_CHANNEL_OUTPUT_SPEAKER_HEADPHONE,         /* ÑïÉùÆ÷ºÍ»°Í² */

+    MM_CHANNEL_OUTPUT_BLUETOOTH,                 /* À¶ÑÀ */

+}T_MM_CHANNEL_OUTPUT;

+

+/* Ö÷¸±ÉãÏñÍ· */

+typedef enum

+{

+    MM_SENSOR_MAIN = 0,

+    MM_SENSOR_SUB

+} T_MM_CAM_SENSOR;

+

+/* »­ÃæËõ·Å */

+typedef enum

+{

+    MM_ZOOM_LEVEL_1= 0,          /* level 1 */

+    MM_ZOOM_LEVEL_2,             /* level 2 */

+    MM_ZOOM_LEVEL_3,             /* level 3 */

+    MM_ZOOM_LEVEL_4,             /* level 4 */

+    MM_ZOOM_LEVEL_5,             /* level 5 */

+} T_MM_ZOOM_LEVEL;

+

+

+/* ÉãÏñÍ·ÁÁ¶È */

+typedef enum

+{

+    MM_BRIGHTNESS_LEVEL_0 = 0,     /* level 0  */

+    MM_BRIGHTNESS_LEVEL_1,         /* level 1  */

+    MM_BRIGHTNESS_LEVEL_2,         /* level 2  */

+    MM_BRIGHTNESS_LEVEL_3,         /* level 3  */

+    MM_BRIGHTNESS_LEVEL_4,         /* level 4  */

+} T_MM_CamBrightness;

+

+/* ÉãÏñÍ·¶Ô±È¶È */

+typedef enum

+{

+    MM_CONTRAST_LEVEL_0 = 0,       /* level 0 */

+    MM_CONTRAST_LEVEL_1,           /* level 1 */

+    MM_CONTRAST_LEVEL_2,           /* level 2 */

+    MM_CONTRAST_LEVEL_3,           /* level 3 */

+    MM_CONTRAST_LEVEL_4,           /* level 4 */

+} T_MM_CamContrast;

+

+/* ÉãÏñͷЧ¹û */

+typedef enum

+{

+    MM_EFFECT_NORMAL,

+    MM_EFFECT_BLACK_AND_WHITE,

+    MM_EFFECT_NEGATIVE,      

+    MM_EFFECT_ANTIQUE,    

+    MM_EFFECT_BLUISH,

+    MM_EFFECT_GREENISH,

+    MM_EFFECT_REDISH,

+    MM_EFFECT_BW_NEGATIVE,

+} T_MM_CamEffect;

+

+/* °×ƽºâ */

+typedef enum

+{

+    MM_WHITEBALANCE_AUTO = 0,

+    MM_WHITEBALANCE_DAYLIGHT,

+    MM_WHITEBALANCE_CLOUDY,

+    MM_WHITEBALANCE_INCANDESCENCE,

+    MM_WHITEBALANCE_FLUORESCENCE

+} T_MM_WHITE_BALANCE;

+

+/* ÏÔÊ¾ÇøÓò */

+typedef struct

+{

+    UINT32 x;        /* Æðµãºá×ø±ê */

+    UINT32 y;        /* Æðµã×Ý×ø±ê */

+    UINT32 width;    /* ¿í¶È       */

+    UINT32 height;   /* ¸ß¶È       */

+} T_MM_DISPLAY_RECT;

+

+

+

+/**************************************************************************

+ *                         ºê¶¨Òå                                         *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         Êý¾ÝÀàÐÍ                                       *

+ **************************************************************************/

+/* ÓïÒôAMRÖ¡ÀàÐÍÐÅÏ¢ */

+typedef struct _VT_VOICE_AMRINFO_T

+{

+    VT_VOICE_AMRIF       amrif;     /* AMRµÄÖ¡ÀàÐÍ */

+    VT_VOICE_FRAME_TYPE  frametype; /* AMRµÄÖ¡ÂÊ   */    

+}VT_VOICE_AMRINFO_T;

+

+typedef struct _VT_VOICE_PARAM_T

+{

+    VT_VOICE_AMRINFO_T  tVoiceInfo;  /* ÓïÒôÅäÖÃÐÅÏ¢ */

+}VT_VOICE_PARAM_T;

+

+typedef struct _VT_VIDEO_DISPARAM_T

+{

+    RECT_T  tLocalRect;              /* ±¾¶ËͼÏñÏÔÊ¾ÇøÓò */

+    RECT_T  tRemoteRect;             /* ¶Ô¶ËͼÏñÏÔÊ¾ÇøÓò */

+}VT_VIDEO_DISPARAM_T;

+

+typedef struct _VT_ENCODE_PARAM_T

+{

+    UINT32           uiWidth;        /* ±àÂëÊä³öͼÏñ¿í¶È */

+    UINT32           uiHeight;       /* ±àÂëÊä³öͼÏñ¸ß¶È */

+    UINT32           uiFramerate;    /* ±àÂëÊä³öͼÏñÖ¡ÂÊ */

+    UINT32           uiBitrate;      /* ±àÂëÊä³öͼÏñλÂÊ */

+    VT_VIDEO_FORMAT  tVideoFormat;   /* ±àÂëÊä³öͼÏñ¸ñʽ */

+}VT_ENCPARAM_T;

+

+typedef struct _VT_DECPARAM_T

+{

+    UINT32           uiWidth;        /* ½âÂëÊäÈëͼÏñ¿í¶È */

+    UINT32           uiHeight;       /* ½âÂëÊäÈëͼÏñ¸ß¶È */

+    VT_VIDEO_FORMAT  tVideoFormat;   /* ½âÂëÊäÈëͼÏñ¸ñʽ */

+}VT_DECPARAM_T;

+

+typedef struct _VT_CODEC_PARAM_T

+{

+    VT_ENCPARAM_T        tEncParam;  /* ±¾¶ËͼÏñ±àÂë²ÎÊý   */

+    VT_DECPARAM_T        tDecParam;  /* ¶Ô¶ËͼÏñ½âÂë²ÎÊý   */

+    VT_VIDEO_DISPARAM_T  tDisParam;  /* ±¾¶Ô¶ËͼÏñÏÔÊ¾ÇøÓò */

+}VT_VIDEO_PARAM_T;

+

+/**************************************************************************

+ *                         ÀàÉùÃ÷ £¨¶ÔÓÚCÓïÑÔµÄÍ·Îļþ£¬¿É²Ã¼ô£©           *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         Ä£°å  £¨¶ÔÓÚCÓïÑÔµÄÍ·Îļþ£¬¿É²Ã¼ô£©            *

+ **************************************************************************/

+

+/**************************************************************************

+ *                         È«¾Ö±äÁ¿ÉùÃ÷                                    *

+ **************************************************************************/

+

+/**************************************************************************

+ *                        È«¾Öº¯ÊýÔ­ÐÍ                                     *

+ **************************************************************************/ 

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_Open 

+ * ¹¦ÄÜÃèÊö£º ´ò¿ªVTÓïÒôÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º (IN) iVoiceFd:VoiceÉ豸¾ä±ú

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Voice_Open(SINT32  iVoiceFd);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_Close 

+ * ¹¦ÄÜÃèÊö£º ¹Ø±ÕVTÓïÒôÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º (IN) ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Voice_Close(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_Init 

+ * ¹¦ÄÜÃèÊö£º ³õʼ»¯VTÓïÒôÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º (IN) pVoiceParam VTÓïÒôÇý¶¯Í¨µÀ³õʼ»¯²ÎÊý

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Voice_Init(VT_VOICE_PARAM_T *pVoiceParam);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_Release 

+ * ¹¦ÄÜÃèÊö£º ÊÍ·ÅVTÓïÒôÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º (IN) ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Voice_Release(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_Read 

+ * ¹¦ÄÜÃèÊö£º VTÓïÒôÊý¾Ý¶ÁÈ¡£¬Ò»´Î¶Áȡһ֡ÓïÒô

+ * ²ÎÊý˵Ã÷£º (IN/OUT) pVoiceBuf ´æ·Å¶ÁÈ¡µÄÓïÒôÊý¾Ý(AMR)

+ *            (IN)     uiBufLen  pVoiceBufµÄ³¤¶È£¬±ØÐë´óÓÚ32×Ö½Ú

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØÒѶÁÈ¡µÄ×Ö½ÚÊý£¬Ê§°Ü·µ»ØÐ¡ÓÚ0µÄÖµ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+SINT32 VT_Voice_Read(CHAR *pVoiceBuf, UINT32 uiBufLen);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_Write 

+ * ¹¦ÄÜÃèÊö£º VTÓïÒôÊý¾ÝÊä³ö£¬Ò»´ÎÊä³öÒ»Ö¡ÓïÒô

+ * ²ÎÊý˵Ã÷£º (IN) pVoiceBuf ´ýÊä³öµÄÓïÒôÊý¾Ý(AMR)µØÖ·

+ *            (IN) uiBufLen  ´ýÊä³öµÄÓïÒôÊý¾Ý(AMR)³¤¶È

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØÊä³öµÄ×Ö½ÚÊý£¬Ê§°Ü·µ»ØÐ¡ÓÚ0µÄÖµ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+SINT32 VT_Voice_Write(CHAR *pVoiceBuf, UINT32 uiBufLen);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Voice_SetCodecParam 

+ * ¹¦ÄÜÃèÊö£º ÉèÖÃVTÓïÒô±à½âÂë²ÎÊý

+ * ²ÎÊý˵Ã÷£º (IN) 

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ´Ë½Ó¿Ú±£Áô

+ */

+DCAMERA_RETURN_VALUE_E VT_Voice_SetCodecParam(VT_VOICE_AMRINFO_T *pVoiceInfo);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_Open 

+ * ¹¦ÄÜÃèÊö£º ´ò¿ªVTÊÓÆµÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_Open(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_Open 

+ * ¹¦ÄÜÃèÊö£º ¹Ø±ÕVTÊÓÆµÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_Close(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_Init 

+ * ¹¦ÄÜÃèÊö£º ³õʼ»¯VTÊÓÆµÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º (IN) pVodieParam VTÊÓÆµÇý¶¯Í¨µÀ³õʼ»¯²ÎÊý

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º Ŀǰ½öÖ§³Ö±à½âÂë¾ùΪH263¸ñʽ£¬±àÂë½öÖ§³ÖQCIF(176 * 144)

+ *            ¸ñʽµÄͼÏñ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_Init(VT_VIDEO_PARAM_T  *pCodecParam);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_Release 

+ * ¹¦ÄÜÃèÊö£º ÊÍ·ÅVTÊÓÆµÇý¶¯Í¨µÀ

+ * ²ÎÊý˵Ã÷£º (IN) ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_Release(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_LocalOpen 

+ * ¹¦ÄÜÃèÊö£º ±¾¶ËÏÔʾ´ò¿ª

+ * ²ÎÊý˵Ã÷£º (IN) ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_LocalOpen(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_LocalClose 

+ * ¹¦ÄÜÃèÊö£º ±¾¶ËÏÔʾ¹Ø±Õ

+ * ²ÎÊý˵Ã÷£º (IN) ÎÞ

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_LocalClose(VOID);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_Read 

+ * ¹¦ÄÜÃèÊö£º VTÊÓÆµÊý¾Ý¶ÁÈ¡

+ * ²ÎÊý˵Ã÷£º (IN/OUT) pFrameBuf ´æ·Å¶ÁÈ¡µÄÊÓÆµÍ¼ÏñÊý¾Ý

+ *            (IN)     uiBufLen  pFrameBufµÄ³¤¶È

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØÒѶÁÈ¡µÄ×Ö½ÚÊý£¬Ê§°Ü·µ»ØÐ¡ÓÚ0µÄÖµ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+SINT32 VT_Video_Read(CHAR *pFrameBuf, UINT32 uiBufLen);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_Write 

+ * ¹¦ÄÜÃèÊö£º VTÊÓÆµÊý¾ÝÊä³ö

+ * ²ÎÊý˵Ã÷£º (IN) pFrameBuf ´ýÊä³öµÄÊÓÆµÍ¼ÏñÊý¾ÝµØÖ·

+ *            (IN) uiBufLen  ´ýÊä³öµÄÊÓÆµÍ¼ÏñÊý¾Ý³¤¶È

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØÊä³öµÄ×Ö½ÚÊý£¬Ê§°Ü·µ»ØÐ¡ÓÚ0µÄÖµ

+ * ÆäËü˵Ã÷£º ÎÞ

+ */

+SINT32 VT_Video_Write(CHAR *pFrameBuf, UINT32 uiBufLen);

+

+/**

+ * º¯ÊýÃû³Æ£º VT_Video_SetDisplayParam 

+ * ¹¦ÄÜÃèÊö£º VTÊÓÆµÏÔÊ¾ÇøÓòÉèÖÃ

+ * ²ÎÊý˵Ã÷£º (IN) pDisplayParam VTÊÓÆµ±¾¶Ô¶ËͼÏñÏÔÊ¾ÇøÓò

+ * ·µ »Ø Öµ£º ³É¹¦·µ»ØDCAMERA_OP_SUCCESS

+ * ÆäËü˵Ã÷£º ½Ó¿Ú±ØÐëÔÚVT_Video_Initºóµ÷Óã¬ÓÉÓÚÊÜÓ²¼þÏÞÖÆ

+ *            ×ø±ê¡¢¿í¡¢¸ß²»ÄÜÊÇÈÎÒâµÄ×éºÏ

+ */

+DCAMERA_RETURN_VALUE_E VT_Video_SetDisplayParam(VT_VIDEO_DISPARAM_T *pDisplayParam);

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_inputvolume

+* ¹¦ÄÜÃèÊö£º  ÉèÖÃÉùÒôÊäÈëÒôÁ¿

+* ²ÎÊý˵Ã÷£º  (IN)£º InputVol: ÊäÈëÒôÁ¿´óС

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_inputvolume(T_MM_INPUT_VOLUME_LEVEL InputVol);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_volume

+* ¹¦ÄÜÃèÊö£º  ÉèÖÃÉùÒôÊä³öÒôÁ¿

+* ²ÎÊý˵Ã÷£º  (IN)£º OutPutVol: Êä³öÒôÁ¿´óС

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_volume(T_MM_OUTPUT_VOLUME_LEVEL OutPutVol);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_inputchannel

+* ¹¦ÄÜÃèÊö£º  ÉèÖÃÉùÒôÊäÈëͨµÀ

+* ²ÎÊý˵Ã÷£º  (IN)£º InChannel: ÉùÒôÊäÈëͨµÀ

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_inputchannel(T_MM_CHANNEL_INPUT InChannel);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_outputchannel

+* ¹¦ÄÜÃèÊö£º  ÉèÖÃÉùÒôÊä³öͨµÀ

+* ²ÎÊý˵Ã÷£º  (IN)£º OutChannel: ÉùÒôÊä³öͨµÀ

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_outputchannel(T_MM_CHANNEL_OUTPUT OutChannel);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_mute

+* ¹¦ÄÜÃèÊö£º  ÉèÖþ²Òô

+* ²ÎÊý˵Ã÷£º  (IN)£º bFlag: True : ÉèÖþ²Òô

+                            False: È¡Ïû¾²Òô

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_mute(BOOL bFlag);

+

+

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_zoom

+* ¹¦ÄÜÃèÊö£º  ÉèÖû­ÃæËõ·Å

+* ²ÎÊý˵Ã÷£º  (IN)£º ZoomLevel: »­ÃæËõ·Åˮƽ

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_zoom(T_MM_ZOOM_LEVEL ZoomLevel);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_brightness

+* ¹¦ÄÜÃèÊö£º  ÉèÖû­ÃæÁÁ¶È

+* ²ÎÊý˵Ã÷£º  (IN)  Brightness£º»­ÃæÁÁ¶È

+*             (OUT) ÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS: ³É¹¦

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_brightness(T_MM_CamBrightness Brightness);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_contrast

+* ¹¦ÄÜÃèÊö£º  ÉèÖû­Ãæ¶Ô±È¶È

+* ²ÎÊý˵Ã÷£º  (IN)  Contrast£º»­Ãæ¶Ô±È¶È

+*             (OUT) ÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS: ³É¹¦

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_contrast(T_MM_CamContrast Contrast);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_effect

+* ¹¦ÄÜÃèÊö£º  ÉèÖû­ÃæÐ§¹û

+* ²ÎÊý˵Ã÷£º  (IN)  Effect£º»­ÃæÐ§¹û

+*             (OUT) ÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS: ³É¹¦

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_effect(T_MM_CamEffect Effect);

+

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_set_whitebalance

+* ¹¦ÄÜÃèÊö£º  ÉèÖû­ÃæÐ§¹û

+* ²ÎÊý˵Ã÷£º  (IN)  WhiteBalance£º°×ƽºâÖµ

+*             (OUT) ÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS: ³É¹¦

+* ÆäËü˵Ã÷£º  

+**************************************************************************/

+SINT32 mm_dvm_set_whitebalance(T_MM_WHITE_BALANCE WhiteBalance);

+

+/**************************************************************************

+* º¯ÊýÃû³Æ£º  mm_dvm_camswitch

+* ¹¦ÄÜÃèÊö£º  Ñ¡ÔñÖ÷¸±ÉãÏñÍ·

+* ²ÎÊý˵Ã÷£º  (IN)£º Sensor: ÉãÏñÍ·ÀàÐÍ

+*             (OUT)£ºÎÞ

+* ·µ »Ø Öµ£º  MM_COM_OP_SUCCESS:  ³É¹¦ 

+* ÆäËü˵Ã÷£º  ±ØÐëÏȶԵ±Ç°µÄÉãÏñÍ·¹Ø±Õ£¬¶øºóÔÙÇл»

+**************************************************************************/

+SINT32 mm_dvm_camswitch(T_MM_CAM_SENSOR Sensor);

+

+#ifdef __cplusplus

+   } 

+#endif

+

+#endif

+

diff --git a/cp/ps/plat/inc/msp_api.h b/cp/ps/plat/inc/msp_api.h
new file mode 100644
index 0000000..b172bb4
--- /dev/null
+++ b/cp/ps/plat/inc/msp_api.h
@@ -0,0 +1,52 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_MSP

+* ÎÄ ¼þ Ãû : msp_api.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : mspÄ£¿é¶ÔÍâÍ·Îļþ

+* ×÷    Õß : 

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10 

+* ÆäËü˵Ã÷ : msp_XXX.h      »ù±¾ÀàÐÍ¡¢Ä£¿éºÅ¡¢´íÎóºÅ¡¢Ê¼þºÅ¶¨Òå         

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _MSP_API_H

+#define _MSP_API_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/    

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/ 

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _MSP_API_H */

+

diff --git a/cp/ps/plat/inc/oss/os_ose.h b/cp/ps/plat/inc/oss/os_ose.h
new file mode 100644
index 0000000..145f1b4
--- /dev/null
+++ b/cp/ps/plat/inc/oss/os_ose.h
@@ -0,0 +1,2 @@
+#include "../oss_api.h"

+

diff --git a/cp/ps/plat/inc/oss/os_win.h b/cp/ps/plat/inc/oss/os_win.h
new file mode 100644
index 0000000..145f1b4
--- /dev/null
+++ b/cp/ps/plat/inc/oss/os_win.h
@@ -0,0 +1,2 @@
+#include "../oss_api.h"

+

diff --git a/cp/ps/plat/inc/oss/osa_api.h b/cp/ps/plat/inc/oss/osa_api.h
new file mode 100644
index 0000000..145f1b4
--- /dev/null
+++ b/cp/ps/plat/inc/oss/osa_api.h
@@ -0,0 +1,2 @@
+#include "../oss_api.h"

+

diff --git a/cp/ps/plat/inc/oss/oss_api.h b/cp/ps/plat/inc/oss/oss_api.h
new file mode 100644
index 0000000..145f1b4
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_api.h
@@ -0,0 +1,2 @@
+#include "../oss_api.h"

+

diff --git a/cp/ps/plat/inc/oss/oss_clib.h b/cp/ps/plat/inc/oss/oss_clib.h
new file mode 100644
index 0000000..9e1c883
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_clib.h
@@ -0,0 +1,279 @@
+/**

+ * @file oss_clib.h

+ * @brief C¿âÍ·Îļþ

+ *

+ * Copyright (C) 2017 Sanechips Technology Co., Ltd.

+ * 

+ */

+#ifndef _OSS_CLIB_H

+#define _OSS_CLIB_H

+

+#define _USE_CLIB

+

+#ifdef _USE_CLIB

+/*******************************************************************************

+ *                           Include header files                              *

+ ******************************************************************************/

+#if defined (_OS_LINUX)

+#include <linux/kernel.h>

+#include <linux/slab.h>

+#include <linux/string.h>

+#else

+#include <stdio.h>

+#include <stdlib.h>

+#include <string.h>

+#include <assert.h>

+#include <time.h>

+#include <math.h>

+#include <ctype.h>

+#endif

+

+#ifdef _OS_WIN

+#include <stddef.h>

+#endif

+#include "oss_pub.h"

+#include "oss_compiler.h"

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/*******************************************************************************

+ *                             Macro definitions                               *

+ ******************************************************************************/

+#ifdef _OS_LINUX

+/*

+ * stdio.h

+ */

+#define printf(fmt, ...)  printk(fmt, ##__VA_ARGS__)

+

+/*

+ * random

+ */

+#define RAND_MAX        (0x7FFFFFFF)

+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))

+# define srand(s)        prandom_seed(s)

+# define rand()          (prandom_u32() & RAND_MAX)

+#else

+# define srand(s)        srandom32(s)

+# define rand()          (random32() & RAND_MAX)

+#endif

+

+/*

+ * stdlib.h

+ */

+#define atol(nptr)      simple_strtol(nptr, (char **)NULL, 10)

+#define atoi(nptr)      simple_strtoul(nptr, (char **)NULL, 10)

+

+#define strtol          simple_strtol

+#define strtoul         simple_strtoul

+

+#define malloc(size)    kmalloc(size, GFP_ATOMIC)

+#define free(ptr)       kfree(ptr)

+

+/*

+ * assert.h

+ */

+#define assert(exp)     zOss_ASSERT(exp)

+

+/*

+ * time

+ */

+#define settimeofday    sys_settimeofday

+

+/*

+ * unistd.h

+ */

+#define exit(nr)        do_exit(nr)

+

+#define zOss_Malloc(size)                           kmalloc(size, GFP_ATOMIC)  

+#define zOss_MallocEx(size)                         kmalloc(size, GFP_KERNEL | __GFP_PAGEMODEM)

+#define zOss_Realloc(mem_ptr, new_size)             krealloc(mem_ptr, new_size, GFP_ATOMIC)

+#define zOss_Free(mem_ptr)                          kfree(mem_ptr) 

+#define zOss_Memcpy(dest_ptr, src_ptr, size)        memcpy(dest_ptr, src_ptr, size)

+#define zOss_Memset(dest_ptr, value, size)          memset(dest_ptr, value, size)

+    

+#define zOss_Memmove(dest_ptr, src_ptr, count)      memmove(dest_ptr, src_ptr, count)

+#define zOss_Memcmp(f_buf_ptr, s_buf_ptr, count)    memcmp(f_buf_ptr, s_buf_ptr, count)

+

+#else

+/**

+ * @brief ¶¯Ì¬ÉêÇëÄڴ溯Êýºê

+ * @param size Èë²Î£¬ÉêÇëÄÚ´æµÄ´óС

+ * @return ³É¹¦·µ»Ø·ÖÅäµÄÄÚ´æÖ¸Õ룬ʧ°Ü·µ»Ø¿ÕÖ¸Õë

+ * @retval void*ÀàÐ͵ÄÖ¸Õë   ³É¹¦

+ * @retval NULL              ʧ°Ü

+ */

+#define zOss_Malloc(size)                           mem_malloc(size, ZOSS_FILE, ZOSS_LINE)    

+

+/**

+ * @brief ¶¯Ì¬ÄÚ´æµ÷Õûº¯Êýºê

+ * @param mem_ptr  Èë²Î£¬Òªµ÷ÕûµÄÄÚ´æÖ¸Õë

+ * @param new_size Èë²Î£¬Òªµ÷ÕûµÄÄÚ´æ´óС

+ * @return ³É¹¦·µ»Øµ÷ÕûºóµÄÄÚ´æÖ¸Õ룬ʧ°Ü·µ»Ø¿ÕÖ¸Õë

+ * @retval void*ÀàÐ͵ÄÖ¸Õë   ³É¹¦

+ * @retval NULL              ʧ°Ü

+ */

+#define zOss_Realloc(mem_ptr, new_size)             mem_re_alloc(mem_ptr, new_size, ZOSS_FILE, ZOSS_LINE)

+

+/**

+ * @brief ÊÍ·ÅÄڴ溯Êýºê

+ * @param mem_ptr Èë²Î£¬ÒªÊͷŵÄÄÚ´æÖ¸Õë

+ * @return void

+ */

+#define zOss_Free(mem_ptr)                          mem_free_extend(mem_ptr, ZOSS_FILE, ZOSS_LINE) 

+

+/**

+ * @brief Äڴ濽±´º¯Êýºê

+ * @param dest_ptr  Èë²Î£¬Ä¿±êÄÚ´æÖ¸Õë

+ * @param src_ptr   Èë²Î£¬Ô´ÄÚ´æÖ¸Õë

+ * @param size      Èë²Î£¬Òª¿½±´µÄ´óС

+ * @return ·µ»Ødest_ptrµÄÖ¸Õë

+ */

+#define zOss_Memcpy(dest_ptr, src_ptr, size)        mem_memcpy(dest_ptr, src_ptr, size, ZOSS_FILE, ZOSS_LINE)

+

+/**

+ * @brief ÄÚ´æ³õʼ»¯º¯Êýºê

+ * @param dest_ptr  Èë²Î£¬Òª³õʼ»¯µÄÄ¿±êÄÚ´æÖ¸Õë

+ * @param value     Èë²Î£¬³õʼ»¯µÄÖµ

+ * @param size      Èë²Î£¬³õʼ»¯µÄÄÚ´æ´óС

+ * @return ·µ»Ø±»³õʼ»¯ÄÚ´æµÄÖ¸Õ루void*£©

+ */

+#define zOss_Memset(dest_ptr, value, size)          mem_memset(dest_ptr, value, size, ZOSS_FILE, ZOSS_LINE)

+    

+/**

+ * @brief ÄÚ´æ°áÒÆ

+ * @param dest_ptr  Èë²Î£¬Òª°áÒÆµÄÄ¿±êÄÚ´æÖ¸Õë

+ * @param src_ptr   Èë²Î£¬°áÒÆµÄÔ´ÄÚ´æÖ¸Õë

+ * @param count     Èë²Î£¬°áÒÆÄÚ´æ´óС

+ * @return ·µ»Ødest_ptrµÄÖ¸Õë

+ */

+#define zOss_Memmove(dest_ptr, src_ptr, count)      mem_memmove(dest_ptr, src_ptr, count)

+

+/**

+ * @brief ÄÚ´æ±È½Ïº¯Êýºê

+ * @param f_buf_ptr  Èë²Î£¬Òª±È½ÏµÄÒ»·½ÄÚ´æÖ¸Õë

+ * @param s_buf_ptr  Èë²Î£¬Òª±È½ÏµÄÁíÒ»·½ÄÚ´æÖ¸Õë

+ * @param count      Èë²Î£¬Òª±È½ÏµÄÄÚ´æ´óС

+ * @return Ïàͬ·µ»Ø0£¬·ñÔò²»Ïàͬ

+ */

+#define zOss_Memcmp(f_buf_ptr, s_buf_ptr, count)    mem_memcmp(f_buf_ptr, s_buf_ptr, count)

+

+#endif

+

+/*******************************************************************************

+ *                             Type definitions                                *

+ ******************************************************************************/

+

+/**

+ * @brief ZOSS_TIME_TµÄÀàÐͶ¨Òå

+ */

+typedef UINT32  ZOSS_TIME_T;

+

+/*******************************************************************************

+ *                       Global variable declarations                          *

+ ******************************************************************************/

+

+

+/*******************************************************************************

+ *                       Global function declarations                          *

+ ******************************************************************************/

+/**

+ * @brief ·µ»Ø´Ó¹«Ôª1970Äê1ÔÂ1ÈÕµÄUTCʱ¼ä´Ó0ʱ0·Ö0ÃëËãÆðµ½ÏÖÔÚËù¾­¹ýµÄÃëÊý

+ * @param t       ³ö²Î£¬±£´æ´Ó¹«Ôª1970Äê1ÔÂ1ÈÕµÄUTCʱ¼ä´Ó0ʱ0·Ö0ÃëËãÆðµ½ÏÖÔÚËù¾­¹ýµÄ

+                    ÃëÊý£¬¸Ã²ÎÊý¿ÉΪNULL

+ * @return ´Ó¹«Ôª1970Äê1ÔÂ1ÈÕµÄUTCʱ¼ä´Ó0ʱ0·Ö0ÃëËãÆðµ½ÏÖÔÚËù¾­¹ýµÄÃëÊý

+ * @note 

+ * @warning 

+ */

+ZOSS_TIME_T zOss_Time(ZOSS_TIME_T *t);

+

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+

+VOID *zOss_CacheMalloc(UINT32 size);

+

+VOID zOss_CacheFree(VOID *ptr);

+

+/* ÕûÊýת³É×Ö·û */

+char *itoa(int num, char *str, int radix);

+

+/*******************************************************************************

+ *                      Inline function implementations                        *

+ ******************************************************************************/

+#if defined(_MEM_USE_HEAP)

+

+#if defined (_OS_TOS)

+static inline VOID *mem_malloc(UINT32 size, const CHAR *file, UINT32 line)

+{

+    return (VOID *)tos_heap_alloc(size, file, line);

+}

+

+static inline VOID *mem_re_alloc(VOID *mem_ptr, UINT32 new_size, const CHAR *file, UINT32 line)

+{

+    return (VOID *)tos_heap_realloc(mem_ptr, new_size, file, line);

+}

+

+static inline VOID mem_free_extend(VOID *mem_ptr, const CHAR *file, UINT32 line)

+{

+    (VOID)tos_heap_free(mem_ptr, file, line);

+}

+#elif defined (_OS_LINUX)

+static inline VOID *mem_malloc(UINT32 size, const CHAR *file, UINT32 line)

+{

+    return (VOID *)kmalloc(size, GFP_KERNEL);

+}

+

+static inline VOID *mem_re_alloc(VOID *mem_ptr, UINT32 new_size, const CHAR *file, UINT32 line)

+{

+    return (VOID *)krealloc(mem_ptr, new_size, GFP_KERNEL);

+}

+

+static inline VOID mem_free_extend(VOID *mem_ptr, const CHAR *file, UINT32 line)

+{

+    (VOID)kfree(mem_ptr);

+}

+#endif

+

+static inline VOID *mem_memcpy(VOID *dest_ptr, const VOID *src_ptr, UINT32 size, const CHAR *file, UINT32 line)

+{

+    return memcpy(dest_ptr, src_ptr, size);

+}

+

+static inline VOID *mem_memset(VOID *dest_ptr, SINT32 value, UINT32 size, const CHAR *file, UINT32 line)

+{

+    return memset(dest_ptr, value, size);

+}

+

+static inline VOID *mem_memmove(VOID *dest_ptr, const VOID *src_ptr, UINT32 count)

+{

+    return memmove(dest_ptr, src_ptr, count);

+}

+

+static inline SINT32 mem_memcmp(const VOID *f_buf_ptr, const VOID *s_buf_ptr, UINT32 count)

+{

+    return memcmp(f_buf_ptr, s_buf_ptr, count);

+}

+

+#else

+

+VOID *mem_malloc(UINT32 size, const CHAR *file, UINT32 line);

+VOID *mem_re_alloc(VOID *mem_ptr, UINT32 new_size, const CHAR *file, UINT32 line);

+VOID mem_free_extend(VOID *mem_ptr, const CHAR *file, UINT32 line);

+VOID *mem_memcpy(VOID *dest_ptr, const VOID *src_ptr, UINT32 size, const CHAR *file, UINT32 line);

+VOID *mem_memset(VOID *dest_ptr, SINT32 value, UINT32 size, const CHAR *file, UINT32 line);

+VOID *mem_memmove(VOID *dest_ptr, const VOID *src_ptr, UINT32 count);

+SINT32 mem_memcmp(const VOID *f_buf_ptr, const VOID *s_buf_ptr, UINT32 count);

+

+#endif

+

+#endif//#ifndef DOXYGEN_SHOULD_SKIP_THIS

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif //#ifdef _USE_CLIB

+

+#endif //#ifndef _OSS_CLIB_H

+

diff --git a/cp/ps/plat/inc/oss/oss_compiler.h b/cp/ps/plat/inc/oss/oss_compiler.h
new file mode 100755
index 0000000..320dfb1
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_compiler.h
@@ -0,0 +1,167 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_compiler.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : Óë±àÒëÆ÷ºêÏà¹ØµÄºê¶¨Òå

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_COMPILER_H

+#define _OSS_COMPILER_H

+

+#define _USE_COMPILER

+#ifdef _USE_COMPILER

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef _OS_TOS

+# include "tos_link_info.h"

+#endif

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+#ifdef _OS_LINUX

+

+#ifdef _USE_TCM

+# define __tcm_func          __tcmfunc

+# define __tcm_call_func     __attribute__((long_call))

+# define __tcm_local_func    __tcmlocalfunc

+# define __tcm_data          __tcmdata

+# define __tcm_const         __tcmconst

+# define __gprof             __attribute__((section(".gprof"), instrument_functions))

+#else

+# define __tcm_func

+# define __tcm_call_func

+# define __tcm_local_func

+# define __tcm_data

+# define __tcm_const

+# define __gprof

+#endif

+#ifdef CONFIG_MODEM_CODE_IS_MAPPING

+# define __ps_static_func         __attribute__((section(".ps_static_func"), long_call)) noinline

+# define __ps_4g_func             __attribute__((section(".ps_4g_func"), long_call)) noinline

+# define __ps_3g_func             __attribute__((section(".ps_3g_func"), long_call)) noinline

+# define __ps_2g_func             __attribute__((section(".ps_2g_func"), long_call)) noinline

+# define __ps_comm_func             __attribute__((section(".ps_comm_func"), long_call)) noinline

+#else

+# define __ps_static_func         

+# define __ps_4g_func             

+# define __ps_3g_func             

+# define __ps_2g_func             

+# define __ps_comm_func           

+#endif

+#else   // #ifdef _OS_LINUX

+

+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ == 2)

+# define barrier()  asm volatile( "" : : : "memory" )

+#else

+# define barrier()

+#endif

+

+#if defined(__GNUC__) && defined (_USE_TCM)

+# define __tcm_func         __attribute__((section(".itcm"), long_call)) noinline

+# define __tcm_call_func    __attribute__((long_call))

+# define __tcm_data         __attribute__((section(".dtcm")))

+# define __gprof            __attribute__((section(".gprof"), instrument_functions))

+#elif defined (__ARMCC_VERSION) && defined (_USE_TCM)

+# define __tcm_func         __attribute__((section(".itcm")))

+# define __tcm_call_func    

+# define __tcm_data         __attribute__((section(".dtcm")))

+# define __gprof 

+#else

+# define __tcm_func

+# define __tcm_call_func

+# define __tcm_data

+# define __gprof

+#endif

+

+#ifdef __GNUC__

+# define inline         __inline__

+# define always_inline  __inline__ __attribute__((always_inline))

+# define noinline       __attribute__((noinline))

+#elif defined (__ARMCC_VERSION)

+# define inline         __inline

+# define always_inline  __forceinline

+# define noinline

+#elif defined (_MSC_VER)

+# define inline         inline

+# define always_inline  inline

+# define noinline

+#else

+# define inline

+# define always_inline

+# define noinline

+#endif

+

+#endif  // #ifdef _OS_LINUX

+

+#ifdef __GNUC__

+//#pragma GCC optimize("-O0")

+//#pragma GCC optimize("-O2")

+# define __optimize(x)  __attribute__((optimize(__str(x))))

+#else

+# define __optimize(x)

+#endif

+

+#ifdef __ARMCC_VERSION

+# define PRAGMA(X)          _Pragma(#X)

+# define RODATA_BEGIN(X)    PRAGMA(arm section rodata=#X)   

+# define RWDATA_BEGIN(X)    PRAGMA(arm section rwdata=#X)   

+# define ZIDATA_BEGIN(X)    PRAGMA(arm section zidata=#X)  

+# define CODE_BEGIN(X)      PRAGMA(arm section code=#X)   

+

+# define RODATA_END         _Pragma("arm section rodata")

+# define RWDATA_END         _Pragma("arm section rwdata")

+# define ZIDATA_END         _Pragma("arm section zidata")

+# define CODE_END           _Pragma("arm section code")

+#else

+# define PRAGMA(X)

+# define RODATA_BEGIN(X)

+# define RWDATA_BEGIN(X)

+# define ZIDATA_BEGIN(X)

+# define CODE_BEGIN(X)

+

+# define RODATA_END

+# define RWDATA_END

+# define ZIDATA_END

+# define CODE_END

+#endif

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _USE_COMPILER    */

+

+#endif  /* _OSS_COMPILER_H  */

+

+

diff --git a/cp/ps/plat/inc/oss/oss_fs.h b/cp/ps/plat/inc/oss/oss_fs.h
new file mode 100644
index 0000000..2ed7e13
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_fs.h
@@ -0,0 +1,147 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_fs.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : Îļþϵͳ

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_FS_H

+#define _OSS_FS_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+/* ¶ÁдλÖà */

+#define ZOSS_SEEK_SET               0x0           /* set to offset                            */

+#define ZOSS_SEEK_CUR               0x1           /* set to current position plus offset      */

+#define ZOSS_SEEK_END               0x2           /* set to the size of the file plus offset  */

+

+/* ÅäÖòÎÊý */

+#define ZOSS_MAX_FILENAME_LEN       255         /* Îļþ¡¢Ä¿Â¼Ãû×î´ó³¤¶È, °üº¬Â·¾¶   */

+

+/* Îļþ¡¢Ä¿Â¼ÊôÐÔ£¬°Ë½øÖƱíʾ */

+#define ZOSS_ATTR_IFDIR             040000      /* Ä¿¼λ                       */

+    

+#define ZOSS_ATTR_RD_USR            0400        /* user¶Á                       */

+#define ZOSS_ATTR_WR_USR            0200        /* userд                       */

+#define ZOSS_ATTR_EX_USR            0100        /* userÖ´ÐÐ                     */

+    

+#define ZOSS_ATTR_RD_GRP            0040        /* group¶Á                      */

+#define ZOSS_ATTR_WR_GRP            0020        /* groupд                      */

+#define ZOSS_ATTR_EX_GRP            0010        /* groupÖ´ÐÐ                    */

+    

+#define ZOSS_ATTR_RD_OTH            0004        /* other¶Á                      */

+#define ZOSS_ATTR_WR_OTH            0002        /* otherд                      */

+#define ZOSS_ATTR_EX_OTH            0001        /* otherÖ´ÐÐ                    */

+    

+#define ZOSS_ATTR_RWX_USR           0700        /* userµÄ¶ÁдִÐÐ               */

+#define ZOSS_ATTR_RWX_GRP           0070        /* groupµÄ¶ÁдִÐÐ              */

+#define ZOSS_ATTR_RWX_OTH           0007        /* otherµÄ¶ÁдִÐÐ              */

+    

+#define ZOSS_ATTR_RD_ALL            0444        /* user,group,otherµÄ¶Á         */

+#define ZOSS_ATTR_WR_ALL            0222        /* user,group,otherµÄд         */

+#define ZOSS_ATTR_EX_ALL            0111        /* user£¬group,otherµÄÖ´ÐÐ      */

+    

+#define ZOSS_ATTR_RWX_ALL           0777        /* user£¬group,otherµÄ¶ÁдִÐÐ  */

+

+#ifdef _OS_LINUX

+# define FILE   int

+#endif

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+typedef struct  

+{

+#if defined(_OS_TOS) && defined(CYGPKG_FILEIO_DIRENT_DTYPE)

+    mode_t  d_type;

+#endif

+

+    CHAR    d_name[ZOSS_MAX_FILENAME_LEN + 1];

+}ZOSS_S_DIRENT;

+

+typedef struct  

+{

+    UINT32  st_dev;     /* Device ID number             */

+    UINT32  st_ino;     /* File serial number           */

+    mode_t  st_mode;    /* Mode of file                 */

+    UINT16  st_nlink;   /* Number of hard links to file */

+    UINT32  st_uid;     /* User ID of file              */

+    UINT32  st_gid;     /* Group ID of file             */

+    UINT32  st_rdev;    /* Device ID if special file    */

+    UINT32  st_size;    /* File size in bytes           */

+    time_t  st_atime;   /* Time of last access          */

+    time_t  st_mtime;   /* Time of last modification    */

+    time_t  st_ctime;   /* Time of last status change   */

+}ZOSS_S_STAT;

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+UINT32  zOss_FCreate(const CHAR *filename);

+FILE   *zOss_FOpen(const CHAR *filename, const CHAR *mode);

+UINT32  zOss_FSeek(FILE *stream, SINT32 offset, SINT32 whence);

+SSIZE_T zOss_FRead(VOID *data, SSIZE_T size, SSIZE_T count, FILE *stream);

+SSIZE_T zOss_FWrite(const VOID *data, SSIZE_T size, SSIZE_T count, FILE *stream);

+UINT32  zOss_FEof(FILE *stream);

+UINT32  zOss_FError(FILE *stream);

+UINT32  zOss_FTruncate(FILE *stream, UINT32 size);

+UINT32  zOss_FFlush(FILE *stream);

+UINT32  zOss_FTell(FILE *stream);

+UINT32  zOss_FClose(FILE *stream);

+UINT32  zOss_FRename(const CHAR *old_filename, const CHAR *new_filename);

+UINT32  zOss_FDelete(const CHAR *filename);

+UINT32  zOss_FLength(FILE *stream);

+BOOL    zOss_FExist(const CHAR *filename);

+UINT32  zOss_Mkdir(const CHAR *dirname);

+UINT32  zOss_Rmdir(const CHAR *dirname);

+UINT32  zOss_Rndir(const CHAR *old_dirname, const CHAR *new_dirname);

+UINT32  zOss_GetPwd(CHAR *dirname, UINT32 dirnamelen);

+UINT32  zOss_ChDir(CHAR *dirname);

+BOOL    zOss_IsDir(const CHAR *dirname);

+UINT32  zOss_OpenDir(const CHAR *dirname, VOID **dir_entry_ptr);

+UINT32  zOss_CloseDir(VOID **dir_entry_ptr);

+UINT32  zOss_ReadDir(VOID **dir_entry_ptr, ZOSS_S_DIRENT *dir_item_ptr);

+VOID    zOss_Rewinddir(VOID *dir_entry_ptr);

+UINT32  zOss_ChMod(const CHAR *pathname, mode_t attrs);

+UINT32  zOss_Stat(const CHAR *pathname, ZOSS_S_STAT *buf);

+UINT32  zOss_MountDisk(CHAR diskname);

+UINT32  zOss_UnMountDisk(CHAR diskname);

+UINT32  zOss_UnMountAllDisk(VOID);

+UINT32  zOss_GetDiskFreeSpace(CHAR diskname, UINT64 *space);

+UINT32  zOss_GetDiskCapacity(CHAR diskname, UINT64 *space);

+UINT32  zOss_GetAllDynamicDisk(CHAR *disk, UINT32 size);

+UINT32  zOss_SyncFS(VOID);

+UINT32  zOss_MountDynamicDisk(CHAR *pWinDir, CHAR *pLinuxDir, CHAR *pDevName, char *pFsName);

+UINT32  zOss_UnMountDynamicDisk(CHAR *pWinDir);

+UINT32  zOss_FsMount(VOID);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_FS_H    */

+

diff --git a/cp/ps/plat/inc/oss/oss_irq.h b/cp/ps/plat/inc/oss/oss_irq.h
new file mode 100644
index 0000000..5314d39
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_irq.h
@@ -0,0 +1,292 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_irq.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : ÖжÏÇëÇóÄ£¿é

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_IRQ_H

+#define _OSS_IRQ_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef _OS_LINUX

+#include <linux/irqflags.h>

+#endif

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+#ifdef _OS_TOS

+extern long tos_irq_level;

+extern long tos_isr_level;

+extern long tos_dsr_level;

+#endif

+

+#if defined _OS_TOS    

+#define TOS_STATISTIC_IRQ

+    

+#define TOS_TRACE_IRQ

+    

+#define TOS_DISABLE_IRQ()                               \

+        {                                               \

+            CYG_INTERRUPT_STATE old_intr;               \

+                                                        \

+            HAL_DISABLE_INTERRUPTS(old_intr);

+    

+#define TOS_ENABLE_IRQ()                                \

+            HAL_RESTORE_INTERRUPTS(old_intr);           \

+        }

+    

+/* TOS 3.0²Ù×÷ϵͳµÄȥʹÄÜ¡¢Ê¹ÄÜ¡¢±£´æ¡¢»Ö¸´ÖжϷ½°¸ */

+#define TOS_DISABLE_IRQ_FAST()      HAL_DISABLE_INTERRUPTS(old_intr)

+#define TOS_ENABLE_IRQ_FAST()       HAL_RESTORE_INTERRUPTS(old_intr)

+#define TOS_SAVE_IRQ(old_intr)      HAL_DISABLE_INTERRUPTS(old_intr)

+#define TOS_RESTORE_IRQ(old_intr)   HAL_RESTORE_INTERRUPTS(old_intr)

+#define TOS_QUERY_IRQ(old_intr)     HAL_QUERY_INTERRUPTS(old_intr)

+    

+/* Ö§³ÅµÄȥʹÄÜ¡¢Ê¹ÄÜ¡¢±£´æ¡¢»Ö¸´ÖжϷ½°¸£¬ÐèÒªÕë¶Ô²»Í¬µÄ²Ù×÷ϵͳƽ̨½øÐÐÒÆÖ² */

+#define ZOSS_INTR                   CYG_INTERRUPT_STATE

+#define ZOSS_DISABLE_IRQ()          TOS_DISABLE_IRQ()

+#define ZOSS_ENABLE_IRQ()           TOS_ENABLE_IRQ()

+#define ZOSS_DISABLE_IRQ_FAST()     TOS_DISABLE_IRQ_FAST()

+#define ZOSS_ENABLE_IRQ_FAST()      TOS_ENABLE_IRQ_FAST()

+#define ZOSS_SAVE_IRQ(old_intr)     TOS_SAVE_IRQ(old_intr)

+#define ZOSS_RESTORE_IRQ(old_intr)  TOS_RESTORE_IRQ(old_intr)

+#define ZOSS_QUERY_IRQ(old_intr)    TOS_QUERY_IRQ(old_intr)

+    

+/* ÊÊÅäÔ­ÓдúÂëÖеÄȥʹÄÜ¡¢Ê¹ÄÜ¡¢±£´æ¡¢»Ö¸´ÖжϷ½°¸ */

+#define LOCK_SAVE(old_intr)         ZOSS_SAVE_IRQ(old_intr)

+#define LOCK_RESTORE(old_intr)      ZOSS_RESTORE_IRQ(old_intr)

+#elif defined _OS_OSE

+#define ZOSS_INTR   unsigned long

+    

+#define ZOSS_DISABLE_IRQ()              \

+        {                               \

+            unsigned long msr;          \

+            LOCK_SAVE(msr);

+     

+#define ZOSS_ENABLE_IRQ()               \

+            LOCK_RESTORE(msr);          \

+        }      

+    

+#define ZOSS_DISABLE_IRQ_FAST()     LOCK_SAVE(old_intr)

+#define ZOSS_ENABLE_IRQ_FAST()      LOCK_RESTORE(old_intr)

+    

+#define ZOSS_SAVE_IRQ(old_intr)     LOCK_SAVE(old_intr)

+#define ZOSS_RESTORE_IRQ(old_intr)  LOCK_RESTORE(old_intr)

+#elif defined _OS_LINUX

+#define LINUX_STATISTIC_IRQ

+#define LINUX_TRACE_IRQ

+#define LINUX_DISABLE_IRQ()                             \

+        {                                               \

+            unsigned long flags;                        \

+                                                        \

+            local_irq_save(flags);

+    

+#define LINUX_ENABLE_IRQ()                              \

+            local_irq_restore(flags);                   \

+        }

+

+/* LINUX ²Ù×÷ϵͳµÄȥʹÄÜ¡¢Ê¹ÄÜ¡¢±£´æ¡¢»Ö¸´ÖжϷ½°¸ */

+#define LINUX_DISABLE_IRQ_FAST()    local_irq_save(old_intr)

+#define LINUX_ENABLE_IRQ_FAST()     local_irq_restore(old_intr)

+#define LINUX_SAVE_IRQ(old_intr)    local_irq_save(old_intr)

+#define LINUX_RESTORE_IRQ(old_intr) local_irq_restore(old_intr)

+#define LINUX_QUERY_IRQ(old_intr)   local_save_flags(old_intr)

+

+/* Ö§³ÅµÄȥʹÄÜ¡¢Ê¹ÄÜ¡¢±£´æ¡¢»Ö¸´ÖжϷ½°¸£¬ÐèÒªÕë¶Ô²»Í¬µÄ²Ù×÷ϵͳƽ̨½øÐÐÒÆÖ² */

+#define ZOSS_INTR                   unsigned long

+#define ZOSS_DISABLE_IRQ()          LINUX_DISABLE_IRQ()

+#define ZOSS_ENABLE_IRQ()           LINUX_ENABLE_IRQ()

+#define ZOSS_DISABLE_IRQ_FAST()     LINUX_DISABLE_IRQ_FAST()

+#define ZOSS_ENABLE_IRQ_FAST()      LINUX_ENABLE_IRQ_FAST()

+#define ZOSS_SAVE_IRQ(old_intr)     LINUX_SAVE_IRQ(old_intr)

+#define ZOSS_RESTORE_IRQ(old_intr)  LINUX_RESTORE_IRQ(old_intr)

+#define ZOSS_QUERY_IRQ(old_intr)    LINUX_QUERY_IRQ(old_intr)

+    

+/* ÊÊÅäÔ­ÓдúÂëÖеÄȥʹÄÜ¡¢Ê¹ÄÜ¡¢±£´æ¡¢»Ö¸´ÖжϷ½°¸ */

+#define LOCK_SAVE(old_intr)         ZOSS_SAVE_IRQ(old_intr)

+#define LOCK_RESTORE(old_intr)      ZOSS_RESTORE_IRQ(old_intr)

+#endif

+

+#define zDrv_DisableIrq()           ZOSS_DISABLE_IRQ()

+#define zDrv_EnableIrq()            ZOSS_ENABLE_IRQ()

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+#ifdef _OS_TOS

+typedef UINT32 tos_isr_t(UINT32 vector, UINT32 data);

+typedef VOID tos_dsr_t(UINT32 vector, UINT32 count, UINT32 data);

+#elif defined _OS_LINUX

+typedef UINT32 linux_isr_t(UINT32 vector, UINT32 data);

+typedef VOID linux_dsr_t(UINT32 vector, UINT32 count, UINT32 data);

+#endif

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+#ifdef _OS_TOS

+UINT32 tos_default_isr( UINT32 vector, UINT32 data);

+#ifdef _USE_OSS_MIN

+UINT32 tos_create_irq(UINT32 vector, UINT32 priority, UINT32 data, tos_isr_t isr, tos_dsr_t dsr, cyg_interrupt *interrupt); 

+#else

+UINT32 tos_create_irq(UINT32 vector, UINT32 priority, UINT32 data, tos_isr_t isr, tos_dsr_t dsr); 

+#endif

+void tos_delete_irq(UINT32 interrupt_handle);

+    

+#ifdef TOS_STATISTIC_IRQ

+void tos_statistic_irq_open(void);

+void tos_statistic_irq_close(void);

+void tos_statistic_irq_assert(void);

+void tos_statistic_irq_thread_start(void);

+void tos_statistic_irq_thread_end(void);

+#endif

+    

+#ifdef TOS_TRACE_IRQ

+void tos_trace_irq_open(void);

+void tos_trace_irq_close(void);

+void tos_trace_irq_assert(void);

+#endif

+    

+static inline SINT32 tos_get_irq_nesting_level(VOID)

+{

+    return tos_irq_level;

+}

+

+static inline SINT32 tos_get_isr_nesting_level(VOID)

+{

+    return tos_isr_level;

+}

+

+static inline SINT32 tos_get_dsr_nesting_level(VOID)

+{

+    return tos_dsr_level;

+}

+

+#ifdef _USE_OSS_MIN

+static inline UINT32 tos_create_isr(UINT32 vector,           /* ÖжÏÏòÁ¿         */

+                                     UINT32 priority,           /* ÖжÏÓÅÏȼ¶       */

+                                     UINT32 data,               /* Êý¾ÝÖ¸Õë         */

+                                     tos_isr_t isr,             /* ÖжϷþÎñÀý³Ì     */

+                                     cyg_interrupt *interrupt)  /* ÖжϽṹÌåÖ¸Õë   */

+{

+    return tos_create_irq(vector,       /* ÖжÏÏòÁ¿         */

+                           priority,    /* ÖжÏÓÅÏȼ¶       */

+                           data,        /* Êý¾ÝÖ¸Õë         */

+                           isr,         /* ÖжϷþÎñÀý³Ì     */

+                           NULL,        /* ÖжÏÑÓ³Ù·þÎñÀý³Ì */

+                           interrupt);  /* ÖжϽṹÌåÖ¸Õë   */

+}

+

+static inline UINT32 tos_create_dsr(UINT32 vector,          /* ÖжÏÏòÁ¿         */

+                                     UINT32 priority,           /* ÖжÏÓÅÏȼ¶       */

+                                     UINT32 data,               /* Êý¾ÝÖ¸Õë         */

+                                     tos_dsr_t dsr,             /* ÖжϷþÎñÀý³Ì     */

+                                     cyg_interrupt *interrupt)  /* ÖжϽṹÌåÖ¸Õë   */

+{

+    return tos_create_irq(vector,           /* ÖжÏÏòÁ¿         */

+                           priority,        /* ÖжÏÓÅÏȼ¶       */

+                           data,            /* Êý¾ÝÖ¸Õë         */

+                           tos_default_isr, /* ÖжϷþÎñÀý³Ì     */

+                           dsr,             /* ÖжÏÑÓ³Ù·þÎñÀý³Ì */

+                           interrupt);      /* ÖжϽṹÌåÖ¸Õë   */

+}

+#else

+static inline UINT32 tos_create_isr(UINT32 vector,      /* ÖжÏÏòÁ¿     */

+                                    UINT32 priority,    /* ÖжÏÓÅÏȼ¶   */

+                                    UINT32 data,        /* Êý¾ÝÖ¸Õë     */

+                                    tos_isr_t isr)      /* ÖжϷþÎñÀý³Ì */

+{

+    return tos_create_irq(vector, 

+                          priority, 

+                          data, 

+                          isr, 

+                          NULL);                        /* ÖжϷþÎñÀý³Ì */

+}

+

+static inline UINT32 tos_create_dsr(UINT32 vector,      /* ÖжÏÏòÁ¿     */

+                                    UINT32 priority,    /* ÖжÏÓÅÏȼ¶   */

+                                    UINT32 data,        /* Êý¾ÝÖ¸Õë     */

+                                    tos_dsr_t dsr)      /* ÖжϷþÎñÀý³Ì */

+{

+    return tos_create_irq(vector, 

+                          priority, 

+                          data, 

+                          tos_default_isr,              /* ÖжϷþÎñÀý³Ì */

+                          dsr);  

+}

+#endif

+

+static inline VOID tos_delete_isr(UINT32 interrupt_handle)

+{

+    tos_delete_irq(interrupt_handle);

+}

+

+static inline VOID tos_delete_dsr(UINT32 interrupt_handle)

+{

+    tos_delete_irq(interrupt_handle);

+}

+#elif defined _OS_LINUX

+UINT32 linux_default_isr( UINT32 vector, UINT32 data);

+

+UINT32 linux_create_irq(UINT32 vector, UINT32 priority, UINT32 data, linux_isr_t isr, linux_dsr_t dsr); 

+

+void linux_delete_irq(UINT32 interrupt_handle);

+

+static inline UINT32 linux_create_isr(UINT32 vector,      /* ÖжÏÏòÁ¿     */

+                                    UINT32 priority,    /* ÖжÏÓÅÏȼ¶   */

+                                    UINT32 data,        /* Êý¾ÝÖ¸Õë     */

+                                    linux_isr_t isr)      /* ÖжϷþÎñÀý³Ì */

+{

+    return 0x00;

+}

+

+static inline UINT32 linux_create_dsr(UINT32 vector,      /* ÖжÏÏòÁ¿     */

+                                    UINT32 priority,    /* ÖжÏÓÅÏȼ¶   */

+                                    UINT32 data,        /* Êý¾ÝÖ¸Õë     */

+                                    linux_dsr_t dsr)      /* ÖжϷþÎñÀý³Ì */

+{

+    return 0x00;

+}

+

+static inline VOID linux_delete_isr(UINT32 interrupt_handle)

+{

+    linux_delete_irq(interrupt_handle);

+}

+

+static inline VOID linux_delete_dsr(UINT32 interrupt_handle)

+{

+    linux_delete_irq(interrupt_handle);

+}

+#endif

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_IRQ_H */

+

+

diff --git a/cp/ps/plat/inc/oss/oss_kernel.h b/cp/ps/plat/inc/oss/oss_kernel.h
new file mode 100644
index 0000000..6c05ab7
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_kernel.h
@@ -0,0 +1,634 @@
+/**

+ * @file oss_kernel.h

+ * @brief ²Ù×÷ϵͳÊÊÅä²ã½Ó¿ÚÍ·Îļþ

+ *

+ * Copyright (C) 2017 Sanechips Technology Co., Ltd.

+ * 

+ * 

+ */

+

+#ifndef _OSS_KERNEL_H

+#define _OSS_KERNEL_H

+

+/*******************************************************************************

+ *                           Include header files                              *

+ ******************************************************************************/

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/*******************************************************************************

+ *                             Macro definitions                               *

+ ******************************************************************************/

+/* ¶ÏÑÔ */

+/**

+ * @brief assert¶ÏÑÔ

+ * @param _EXP Èë²Î£¬Òì³£±í´ïʽ

+ */

+#ifdef _DEBUG

+# if defined _OS_WIN

+#  define zOss_ASSERT(_EXP) do {if(!(_EXP)) EXP_Handler(#_EXP, __FILE__, NULL, __LINE__);} while(0)

+# else

+#  define zOss_ASSERT(_EXP) do {if(!(_EXP)) EXP_Handler(#_EXP, NULL, NULL, __LINE__);} while(0)

+# endif

+#else

+# define zOss_ASSERT(_EXP)

+#endif

+    

+/**

+ * @brief ´ø·µ»ØÖµµÄassert¶ÏÑÔ

+ * @param _EXP Èë²Î£¬Òì³£±í´ïʽ

+ * @param _RET Èë²Î£¬·µ»ØÖµ

+ */

+#define zOss_AssertEx(_EXP, _RET) do {if(!(_EXP)) {zOss_ASSERT((_EXP)); return (_RET);}} while(0)

+

+/**

+ * @brief ´ø·µ»ØÖµºÍ¸½¼ÓÖ´ÐвÙ×÷µÄassert¶ÏÑÔ

+ * @param _EXP Èë²Î£¬Òì³£±í´ïʽ

+ * @param _ACT Èë²Î£¬¸½¼ÓÖ´ÐвÙ×÷

+ * @param _RET Èë²Î£¬·µ»ØÖµ

+ */

+#define zOss_AssertExA(_EXP, _ACT, _RET) do {if(!(_EXP)) {zOss_ASSERT((_EXP)); _ACT; return (_RET);}} while(0)

+

+/**

+ * @brief ²»´ø·µ»ØÖµµÄassert¶ÏÑÔ

+ * @param _EXP Èë²Î£¬Òì³£±í´ïʽ

+ */

+#define zOss_AssertExN(_EXP) do {if(!(_EXP)) {zOss_ASSERT((_EXP)); return;}} while(0)

+

+/* ³£Ó÷µ»ØÖµ */

+/**

+ * @brief ZOSS_SUCCESSºê¶¨Òå

+ */

+#define ZOSS_SUCCESS            0x0

+

+/**

+ * @brief ZOSS_ERRORºê¶¨Òå

+ */

+#define ZOSS_ERROR              0xffffffff

+

+/**

+ * @brief ZOSS_NULLºê¶¨Òå

+ */

+#define ZOSS_NULL               NULL        

+

+/**

+ * @brief ÎÞЧÏß³ÌIDºê¶¨Òå

+ */

+#define ZOSS_INVALID_THREAD_ID  NULL

+

+/**

+ * @brief ÎÞЧÈÎÎñIDºê¶¨Òå

+ */

+#define ZOSS_INVALID_TASK_ID    NULL    

+

+/**

+ * @brief ÎÞЧ¶¨Ê±Æ÷IDºê¶¨Òå

+ */

+#define ZOSS_INVALID_TIMER_ID   NULL

+

+/**

+ * @brief Ïß³ÌÃû×î´ó³¤¶È

+ */ 

+#define MAX_THREADNAME_LEN      63

+

+/**

+ * @brief ¼ÆÊýÐźÅÁ¿Ãû³Æ×î´ó³¤¶È

+ */

+#define MAX_SEMNAME_LEN         63

+

+/**

+ * @brief »¥³âÐźÅÁ¿Ãû³Æ×î´ó³¤¶È

+ */

+#define MAX_MUTEXNAME_LEN       63

+

+

+/**

+ * @brief µÈ´ý³¬Ê±ÊôÐÔ£¬²»µÈ´ý

+ */

+#define ZOSS_NO_WAIT            0x0          

+

+/**

+ * @brief µÈ´ý³¬Ê±ÊôÐÔ£¬Ò»Ö±µÈ´ýÏÂÈ¥

+ */

+#define ZOSS_WAIT_FOREVER       0xffffffff

+    

+

+/**

+ * @brief »¥³âÌåÊôÐÔ£¬°´ÓÅÏȼ¶»ñÈ¡

+ */

+#define ZOSS_INHERIT            0x1

+

+/**

+ * @brief »¥³âÌåÊôÐÔ£¬°´Ë³Ðò»ñÈ¡

+ */

+#define ZOSS_NO_INHERIT         0x0

+

+#ifdef _OS_LINUX

+# define ZOSS_PREEMPT_IRQ_THREAD    (0xffffffff)

+#endif

+

+/*******************************************************************************

+ *                             Type definitions                                *

+ ******************************************************************************/

+/**

+ * @brief ÐźÅÁ¿IDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_SEMAPHORE_ID;

+

+/**

+ * @brief »¥³âÌåIDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_MUTEX_ID;

+

+/**

+ * @brief ¶¨Ê±Æ÷IDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_TIMER_ID;

+

+/**

+ * @brief Ïß³ÌIDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_THREAD_ID;

+

+/**

+ * @brief ÈÎÎñIDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_TASK_ID;

+

+/**

+ * @brief ¶ÓÁÐIDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_QUEUE_ID;

+

+/**

+ * @brief ʼþIDÊý¾ÝÀàÐͶ¨Òå

+ */

+typedef VOID    *ZOSS_EVENT_ID;

+

+/**

+ * @brief Ï̺߳¯ÊýÀàÐͶ¨Òå

+ */

+typedef VOID    (*ZOSS_THREAD_FUN)(SINT32);

+

+/**

+ * @brief ¶¨Ê±Æ÷»Øµ÷º¯ÊýÀàÐͶ¨Òå

+ */

+typedef VOID    (*ZOSS_TIMER_FUN)(SINT32);

+

+/**

+ * @brief Ï̹߳³×Óº¯ÊýÀàÐͶ¨Òå

+ */

+typedef UINT32  (*THREAD_MSG_HOOK)(UINT32 msg_id, VOID *p_buf, UINT32 buf_size, UINT8 dire);

+

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/* Ï̹߳ÜÀí */

+/**

+ * @brief Ï̹߳ÜÀí½á¹¹

+ * @param threadid         Ïß³Ìid

+ * @param threadname       Ïß³ÌÃû³Æ

+ * @param runstatus        Ïß³ÌÔËÐÐ״̬

+ * @param priority         Ïß³ÌÓÅÏȼ¶

+ * @param maxstack         Ïß³ÌÕ»×î´óջʹÓÃÂÊ

+ * @param cpupercent       Ïß³ÌCPUÕ¼ÓÃÂÊ

+ * @param stacksize        Ï̶߳ÑÕ»´óС 

+ * @param cputime          Ïß³ÌCPUÕ¼ÓÃÂÊʱ¼ä 

+ * @param topstack         Ïß³ÌÕ»¶¥µØÖ· 

+ * @param runtime          Ïß³ÌÔËÐÐʱ¼ä 

+ * @param RunTimeInMs      

+ * @param msgnum           Ïß³ÌÏûÏ¢¶ÓÁÐÏûÏ¢Êý 

+ * @param runcount         Ïß³ÌÔËÐдÎÊý 

+ * @param curpath          Ï̵߳±Ç°Â·¾¶£¬ÓëosÓÐ¹Ø 

+ * @param ptrf             µ÷ÊÔÏ̵߳ǼDZí 

+ * @param curtaskid        µ±Ç°ÈÎÎñID 

+ * @param heapsize         Ïß³ÌÉêÇë¶ÑÄÚ´æ´óС 

+ * @param ubsize           Ïß³ÌÉêÇëÄÚ´æ³Ø´óС 

+ * @param psmCpuTime       Ïß³Ìpsm¼ÆÊ±Ê±¼ä 

+ * @param sleepTimerId     Ïß³Ì˯Ãßʱ´´½¨µÄ¶¨Ê±Æ÷ID 

+ * @param sleepsem         Ïß³Ì˯Ãßʱ´´½¨µÄÐźÅÁ¿ID 

+ */

+typedef struct

+{

+    ZOSS_THREAD_ID    threadid;                           /* Ïß³ÌID                   */

+    CHAR              threadname[MAX_THREADNAME_LEN + 1]; /* Ïß³ÌÃû                   */

+    UINT8             runstatus;                          /* Ïß³ÌÔËÐÐ״̬             */

+    UINT8             priority;                           /* Ïß³ÌÓÅÏȼ¶               */

+    UINT8             maxstack;                           /* Ïß³ÌÕ»×î´óջʹÓÃÂÊ       */

+    FLOAT             cpupercent;                         /* Ïß³ÌCPUÕ¼ÓÃÂÊ            */ 

+    UINT32            stacksize;                          /* Ï̶߳ÑÕ»´óС             */

+    UINT32            cputime;                            /* Ïß³ÌCPUÕ¼ÓÃÂÊʱ¼ä        */

+    UINT32            topstack;                           /* Ïß³ÌÕ»¶¥µØÖ·             */

+    UINT32            runtime;                            /* Ïß³ÌÔËÐÐʱ¼ä             */

+    UINT32            RunTimeInMs;

+    UINT32            msgnum;                             /* Ïß³ÌÏûÏ¢¶ÓÁÐÏûÏ¢Êý       */

+    UINT32            runcount;                           /* Ïß³ÌÔËÐдÎÊý             */

+    CHAR              *curpath;                           /* Ï̵߳±Ç°Â·¾¶£¬ÓëosÓÐ¹Ø   */

+    VOID              *ptrf;                              /* µ÷ÊÔÏß³ÌµÇ¼Ç±í           */

+    VOID              *curtaskid;                         /* µ±Ç°ÈÎÎñID               */ 

+    UINT32            heapsize;                           /* Ïß³ÌÉêÇë¶ÑÄÚ´æ´óС       */

+    UINT32            ubsize;                             /* Ïß³ÌÉêÇëÄÚ´æ³Ø´óС       */

+    UINT32            psmCpuTime;                         /* Ïß³Ìpsm¼ÆÊ±Ê±¼ä          */

+    ZOSS_TIMER_ID     sleepTimerId;                       /* Ïß³Ì˯Ãßʱ´´½¨µÄ¶¨Ê±Æ÷ID */

+    ZOSS_SEMAPHORE_ID sleepsem;                           /* Ïß³Ì˯Ãßʱ´´½¨µÄÐźÅÁ¿ID */    

+}T_ZOsa_ThreadUserArea;                                   /* Ïß³ÌÓû§¿Õ¼ä             */

+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/*******************************************************************************

+ *                       Global variable declarations                          *

+ ******************************************************************************/

+

+/*******************************************************************************

+ *                       Global function declarations                          *

+ ******************************************************************************/

+/* Ï̹߳ÜÀí */

+ 

+ /**

+ * @brief »ñÈ¡ÓÅÏȼ¶Öµ½Ó¿Ú

+ * @param offset Èë²Î£¬È¡Öµ0~31

+ * @return Èô³É¹¦£¬·µ»ØÓÅÏȼ¶ÊýÖµ£»·ñÔò·µ»ØZOSS_ERROR

+ * @retval ÓÅÏȼ¶ÊýÖµ   ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note

+ * @warning 

+ */

+UINT32 zOss_GetPrioCfg(UINT8 offset);

+

+/**

+ * @brief ´´½¨Ï߳̽ӿÚ

+ * @param thread_name     Èë²Î£¬Ïß³ÌÃû³Æ

+ * @param entry           Èë²Î£¬Ïß³ÌÈë¿ÚʵÌ庯Êý

+ * @param arg             Èë²Î£¬Ïß³ÌʵÌ庯ÊýµÄ²ÎÊý

+ * @param stack_size      Èë²Î£¬Ïß³ÌÓµÓеĶÑÕ»´óС

+ * @param priority        Èë²Î£¬Ï̵߳ÄÓÅÏȵȼ¶0~31

+ * @param preempt         Èë²Î£¬Í¬ÓÅÏȼ¶Ïß³ÌÊÇ·ñÔÊÐíÇÀÕ¼£¬·Ç0ֵΪÇÀÕ¼Ị̈߳¬·ñÔòΪ²»¿ÉÇÀÕ¼Ị̈߳¬¼´Ö´ÐÐʱ¼äƬµ÷¶È

+ * @param auto_start      Èë²Î£¬´´½¨Ï̺߳óÊÇ·ñ×Ô¶¯Ö´ÐÐ

+ * @return Èç¹û´´½¨³É¹¦·µ»ØÏß³ÌID£¬Ê§°Ü·µ»ØZOSS_INVALID_THREAD_ID

+ * @retval ZOSS_THREAD_IDÀàÐ͵ÄÏß³Ìid    ³É¹¦

+ * @retval ZOSS_INVALID_THREAD_ID        ʧ°Ü

+ * @note   

+ * @warning 

+ */

+ZOSS_THREAD_ID zOss_CreateThread(const CHAR *thread_name, VOID (*entry)(SINT32), SINT32 arg, UINT32 stack_size, UINT32 priority, UINT32 preempt, UINT32 auto_start);

+

+/**

+ * @brief Í˳öµ±Ç°Ï߳̽ӿÚ

+ * @param void

+ * @return void

+ * @note   

+ * @warning 

+ */

+VOID zOss_ExitThread(VOID);

+

+/**

+ * @brief Ïß³Ì¹ÒÆð½Ó¿Ú

+ * @param thread_id     Èë²Î£¬ÐèÒª¹ÒÆðµÄÏß³Ìid

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note   ±¾º¯Êý¿ÉÒÔÓÃÓÚÏ̵߳Ä×ÔÎÒ¹ÒÆð

+ * @warning 

+ */

+UINT32 zOss_SuspendThread(ZOSS_THREAD_ID thread_id);

+

+/**

+ * @brief Ïָ̻߳´½Ó¿Ú

+ * @param thread_id     Èë²Î£¬ÐèÒª»Ö¸´µÄÏß³Ìid

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note

+ * @warning 

+ */

+UINT32 zOss_ResumeThread(ZOSS_THREAD_ID thread_id);

+

+/**

+ * @brief Ïß³Ì˯Ãß½Ó¿Ú

+ * @param time_in_ms     Èë²Î£¬Ï߳̽«ÒªË¯ÃßµÄʱ¼ä£¬µ¥Î»£ºms

+ * @return void

+ * @note

+ * @warning 

+ */

+VOID zOss_Sleep(UINT32 time_in_ms);

+

+/**

+ * @brief Ïß³Ìɾ³ý½Ó¿Ú

+ * @param thread_id     Èë²Î£¬±»É¾³ýµÄÏß³Ìid

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note   zOss_CreateThreadº¯ÊýÖÐÉêÇëµÄÏß³ÌÕ»¿Õ¼äºÍÏ߳̿ØÖÆ¿é½á¹¹¿Õ¼ä»áÔÚ

+ *         Cyg_Thread::exitº¯ÊýÖÐÊÍ·Å£¬ÒòΪÔÚcyg_thread_deleteº¯ÊýÖ´ÐÐÍêºó£¬

+ *         ºóÃæµÄËùÓдúÂëËæ×ű¾Ï̵߳ÄÏûÍö¶ø±äµÃÎÞЧÁË¡£

+ * @warning 

+ */

+UINT32 zOss_DeleteThread(ZOSS_THREAD_ID thread_id);

+

+/**

+ * @brief »ñÈ¡µ±Ç°Ïß³Ìid½Ó¿Ú

+ * @param void

+ * @return µ±Ç°Ïß³Ìid

+ * @note

+ * @warning 

+ */

+ZOSS_THREAD_ID zOss_GetCurThreadID(VOID);

+

+/**

+ * @brief ¸ù¾Ý²ÎÊýÌṩµÄÏß³ÌÃû³Æ£¬²éÕÒ¸ÃÏ̵߳ÄÏß³Ìid

+ * @param thread_name     Èë²Î£¬Ïß³ÌÃû³Æ

+ * @return Èô²éÕҳɹ¦£¬·µ»ØÏ̵߳ÄÓÐЧÏß³Ìid£»·ñÔòϵͳ¶ÏÑÔ

+ * @note

+ * @warning 

+ */

+ZOSS_THREAD_ID zOss_GetThreadIDByName(const CHAR *thread_name); 

+

+/**

+ * @brief ¸ù¾Ý²ÎÊýÌṩµÄÏß³Ìid£¬»ñÈ¡¸ÃÏ̵߳ÄÏß³ÌÃû³Æ

+ * @param thread_id     Èë²Î£¬´ý»ñÈ¡Ïß³ÌÃû³ÆµÄÏß³Ìid

+ * @param thread_name   ³ö²Î£¬Ïß³ÌÃû³Æ´æ·ÅµØÖ·

+ * @return Èô³É¹¦£¬·µ»ØÏß³ÌÃû³ÆÖ¸Õ룻·ñÔòϵͳ¶ÏÑÔ»ò·µ»Ø¿ÕÖ¸Õë

+ * @retval Ïß³ÌÃû³ÆÖ¸Õë ³É¹¦

+ * @retval NULL   ʧ°Ü

+ * @note

+ * @warning 

+ */

+CHAR *zOss_GetThreadName(ZOSS_THREAD_ID thread_id, CHAR *thread_name);

+

+/**

+ * @brief ¸ù¾Ý²ÎÊýÌṩµÄÏß³Ìid£¬»ñÈ¡¸ÃÏ̵߳ÄÏß³ÌÐÅÏ¢

+ * @param thread_id     Èë²Î£¬´ý»ñÈ¡Ïß³ÌÐÅÏ¢µÄÏß³Ìid

+ * @param thread_name   ³ö²Î£¬Ïß³ÌÃû³Æ´æ·ÅµØÖ·

+ * @param stat          ³ö²Î£¬Ïß³Ì״̬´æ·ÅµØÖ·

+ * @param priority      ³ö²Î£¬Ïß³ÌÓÅÏȼ¶´æ·ÅµØÖ·

+ * @param preempt       ³ö²Î£¬Ï߳̿ÉÇÀÕ¼´æ·ÅµØÖ·

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note

+ * @warning 

+ */

+UINT32 zOss_GetThreadInfo(ZOSS_THREAD_ID thread_id, CHAR *thread_name, UINT32 *stat, UINT32 *priority, UINT32 *preempt);

+

+/**

+ * @brief ¸ù¾Ý²ÎÊýÌṩµÄÏß³Ìid£¬ÉèÖøÃÏ̵߳ÄÏß³ÌÓÅÏȼ¶

+ * @param thread_id     Èë²Î£¬´ýÉèÖÃÓÅÏȼ¶µÄÏß³Ìid

+ * @param priority      Èë²Î£¬Ï߳̽«±»ÉèÖõÄÓÅÏȼ¶

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note

+ * @warning 

+ */

+UINT32 zOss_SetThreadPri(ZOSS_THREAD_ID thread_id, UINT32 priority);

+

+/**

+ * @brief ¸ù¾Ý²ÎÊýÌṩµÄÏß³Ìid£¬»ñÈ¡¸ÃÏ̵߳ÄÏß³ÌÓÅÏȼ¶

+ * @param thread_id     Èë²Î£¬´ýÉèÖÃÓÅÏȼ¶µÄÏß³Ìid

+ * @param priority      ³ö²Î£¬»ñÈ¡µÄÏß³ÌÓÅÏȼ¶´æ·ÅµØÖ·

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note

+ * @warning 

+ */

+UINT32 zOss_GetThreadPri(ZOSS_THREAD_ID thread_id, UINT32 *priority);

+

+/**

+ * @brief ÑéÖ¤Ò»¸öÏß³ÌÊÇ·ñÓÐЧ

+ * @param threadID     Èë²Î£¬´ýÑéÖ¤µÄÏß³Ìid

+ * @return ÈôÏß³ÌÓÐЧ£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note

+ * @warning 

+ */

+UINT32 zOss_IdentifyThread(ZOSS_THREAD_ID threadID);

+

+/* Ïß³ÌÏûÏ¢¹ÜÀíÄ£¿é */

+/**

+ * @brief ´ÓÄÚ´æ³ØÉêÇëÏûϢͷ+»º³åÇø£¬²¢·µ»Ø»º³åÇøÖ¸Õë

+ * @param size     Èë²Î£¬»º³åÇø´óС

+ * @return »º³åÇøÖ¸Õë

+ * @note ¸ÃÉêÇë½Ó¿Ú£¬»á´ø×ÅÏûϢͷһÆðÉêÇ룬µ«·µ»Ø¸øÓû§µÄÊǰþÀëÁËÏûϢͷµÄÓû§Ê¹ÓÃ¿Õ¼äµØÖ·

+ * @warning ±ØÐëºÍzOss_ThreadRetMsgBufÅä¶ÔʵÏÖ

+ */

+VOID *zOss_ThreadGetMsgBuf(UINT32 size); 

+

+/**

+ * @brief ÏòÄÚ´æ³ØÊÍ·ÅÏûϢͷ+»º³åÇø

+ * @param p_buf     Èë²Î£¬»º³åÇøÖ¸Õë

+ * @return void

+ * @note ¸ÃÊÍ·Å½Ó¿Ú»á´ø×ÅÏûϢͷһÆðÊÍ·Å

+ * @warning ±ØÐëºÍzOss_ThreadGetMsgBufÅä¶ÔʵÏÖ

+ */

+VOID zOss_ThreadRetMsgBuf(VOID *p_buf);

+

+/**

+ * @brief Ïòthread_idÏ̷߳¢ËÍÏûÏ¢

+ * @param msg_id       Èë²Î£¬ÏûÏ¢id

+ * @param p_buf        Èë²Î£¬»º³åÇøÖ¸Õë

+ * @param buf_size     Èë²Î£¬»º³åÇø´óС

+ * @param thread_id    Èë²Î£¬Ä¿±êÏß³Ìid

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note ±ØÐëºÍzOss_ThreadRecvMsgÅä¶ÔʵÏÖ

+ * @warning 

+ */

+UINT32 zOss_ThreadSendMsg(UINT32 msg_id, VOID *p_buf, UINT16 buf_size, ZOSS_THREAD_ID thread_id);

+

+/**

+ * @brief Ï߳̽ÓÊÕÏûÏ¢

+ * @param p_msg_id     Èë²Î£¬ÏûÏ¢idµÄ´æ·ÅµØÖ·

+ * @param p_buf        Èë²Î£¬ÏûÏ¢Ö¸ÕëµÄ´æ·ÅµØÖ·

+ * @param p_buf_size   Èë²Î£¬ÏûÏ¢´óСµÄ´æ·ÅµØÖ·

+ * @param timeout      Èë²Î£¬½ÓÊÕÏûÏ¢µÄ³¬Ê±Ê±¼ä

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  ±ØÐëºÍzOss_ThreadSendMsgÅä¶ÔʵÏÖ

+ * @warning 

+ */

+UINT32 zOss_ThreadRecvMsg(UINT32 *p_msg_id, VOID **p_buf, UINT32 *p_buf_size, UINT32 timeout);

+

+/**

+ * @brief ×¢²áÏß³ÌÏûÏ¢¹³×Óº¯Êý

+ * @param thread_id   Èë²Î£¬Ïß³Ìid

+ * @param type        Èë²Î£¬¹³×Óº¯ÊýÀàÐÍ

+ * @param dire        Èë²Î£¬¹³×Óº¯ÊýÅäÖÃ

+ * @param func        Èë²Î£¬¹³×Óº¯ÊýÖ¸Õë

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_RegThreadMsgHook(ZOSS_THREAD_ID thread_id, UINT8 type, UINT8 dire, THREAD_MSG_HOOK func);

+

+/* ÏûϢͨѶ */

+

+/**

+ * @brief ÏòÖ¸¶¨µÄÏ̷߳¢ËÍÏûÏ¢

+ * @param thread_id     Èë²Î£¬Ä¿±êÏ̵߳ÄÏß³Ìid

+ * @param msg_ptr       Èë²Î£¬ÏûÏ¢Êý¾ÝµÄÖ¸Õë

+ * @param size          Èë²Î£¬ÏûÏ¢µÄ´óС

+ * @param timeout       Èë²Î£¬·¢ËÍÏûÏ¢µÄ³¬Ê±Ê±¼ä

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  Èô²ÎÊýtimeoutÊÇZOSS_WAIT_FOREVER£¬ÔòÒ»Ö±µÈ´ýÏûÏ¢·¢Ëͳɹ¦ÔÙ·µ»Ø£»

+          Èô²ÎÊýtimeoutÊÇZOSS_NO_WAIT£¬Ôò³¢ÊÔ·¢ËÍÏûÏ¢£¬·¢ËÍʧ°Ü£¬Ö±½Ó·µ»Ø£»

+          ·ñÔòtimeoutÊdz¬Ê±µÄʱ¼ä£¬¼ÆËã·½·¨Êǽ«µ±Ç°ÏµÍ³Ê±¼äºÍtimeoutÏà¼Ó£¬

+                ³ÉΪabs_timeout,È»ºóÆô¶¯Ò»¸ö¶¨Ê±Æ÷£¬Ö±ÖÁÏûÏ¢·¢Ëͳɹ¦»ò³¬Ê±

+ * @warning 

+ */

+UINT32 zOss_SendMsg(ZOSS_THREAD_ID thread_id, VOID *msg_ptr, UINT32 size, UINT32 timeout);

+

+/**

+ * @brief ½ÓÊÕÏûÏ¢

+ * @param msg_ptr     ³ö²Î£¬ÏûÏ¢Ö¸ÕëµÄ´æ·ÅµØÖ·

+ * @param size        ³ö²Î£¬ÏûÏ¢Êý¾Ý´óСµÄ´æ·ÅµØÖ·

+ * @param timeout     Èë²Î£¬½ÓÊÕÏûÏ¢µÄ³¬Ê±Ê±¼ä

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  Èô²ÎÊýtimeoutÊÇZOSS_WAIT_FOREVER£¬ÔòÒ»Ö±µÈ´ýÏûÏ¢·¢Ëͳɹ¦ÔÙ·µ»Ø£»

+          Èô²ÎÊýtimeoutÊÇZOSS_NO_WAIT£¬Ôò³¢ÊÔ·¢ËÍÏûÏ¢£¬·¢ËÍʧ°Ü£¬Ö±½Ó·µ»Ø£»

+          ·ñÔòtimeoutÊdz¬Ê±µÄʱ¼ä£¬¼ÆËã·½·¨Êǽ«µ±Ç°ÏµÍ³Ê±¼äºÍtimeoutÏà¼Ó£¬

+                ³ÉΪabs_timeout,È»ºóÆô¶¯Ò»¸ö¶¨Ê±Æ÷£¬Ö±ÖÁÏûÏ¢·¢Ëͳɹ¦»ò³¬Ê±

+ * @warning 

+ */

+UINT32 zOss_RecvMsg(VOID **msg_ptr, UINT32 *size, UINT32 timeout);

+

+/* ¼ÆÊýÐźÅÁ¿ */

+/**

+ * @brief ´´½¨ÐźÅÁ¿

+ * @param name_ptr        Èë²Î£¬ÐźÅÁ¿µÄÃû³Æ

+ * @param initial_count   Èë²Î£¬ÐźÅÁ¿µÄ³õʼ¼ÆÊýÖµ

+ * @return ´´½¨³É¹¦£¬·µ»ØÐźÅÁ¿µÄ¾ä±ú£»·ñÔòϵͳ¶ÏÑÔ

+ * @note  

+ * @warning 

+ */

+ZOSS_SEMAPHORE_ID zOss_CreateSemaphore(const CHAR *name_ptr, UINT32 initial_count);

+

+/**

+ * @brief »ñÈ¡ÐźÅÁ¿

+ * @param sem_id   Èë²Î£¬ÕýÔÚ»ñÈ¡µÄÐźÅÁ¿id

+ * @param timeout  Èë²Î£¬³¬Ê±¼ÆÊý

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  Èô²ÎÊýtimeoutÊÇZOSS_WAIT_FOREVER£¬ÔòÒ»Ö±µÈ´ýÏûÏ¢·¢Ëͳɹ¦ÔÙ·µ»Ø£»

+                Èô²ÎÊýtimeoutÊÇZOSS_NO_WAIT£¬Ôò³¢ÊÔ·¢ËÍÏûÏ¢£¬·¢ËÍʧ°Ü£¬Ö±½Ó·µ»Ø£»

+                ·ñÔòtimeoutÊdz¬Ê±µÄʱ¼ä£¬¼ÆËã·½·¨Êǽ«µ±Ç°ÏµÍ³Ê±¼äºÍtimeoutÏà¼Ó£¬

+                ³ÉΪabs_timeout,È»ºóÆô¶¯Ò»¸ö¶¨Ê±Æ÷£¬Ö±ÖÁÏûÏ¢·¢Ëͳɹ¦»ò³¬Ê±

+ * @warning 

+ */

+UINT32 zOss_GetSemaphore(ZOSS_SEMAPHORE_ID sem_id, UINT32 timeout);

+

+/**

+ * @brief ÊÍ·ÅÐźÅÁ¿

+ * @param sem_id   Èë²Î£¬ÕýÔÚÊͷŵÄÐźÅÁ¿id

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_PutSemaphore(ZOSS_SEMAPHORE_ID sem_id);

+

+/**

+ * @brief »ñÈ¡ÐźÅÁ¿µÄµ±Ç°¼ÆÊýÖµ

+ * @param sem_id   Èë²Î£¬ÕýÔÚ±»»ñÈ¡¼ÆÊýÖµµÄÐźÅÁ¿id

+ * @return ¸ÃÐźÅÁ¿µÄµ±Ç°¼ÆÊýÖµ

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_GetSemaphoreCount(ZOSS_SEMAPHORE_ID sem_id);

+

+/**

+ * @brief ɾ³ýÐźÅÁ¿

+ * @param sem_id   Èë²Î£¬±»É¾³ýµÄÐźÅÁ¿id

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_DeleteSemaphore(ZOSS_SEMAPHORE_ID sem_id);

+

+/* »¥³âÐźÅÁ¿ */

+/**

+ * @brief ´´½¨»¥³âÌå

+ * @param name_ptr          Èë²Î£¬»¥³âÌåÃû³Æ

+ * @param priority_inherit  Èë²Î£¬»¥³âÌåÊôÐÔ£¬Èç¹ûÊÇZOSS_INHERIT£¬ÔòÏß³ÌÖ®¼ä°´

+                ÓÅÏȼ¶Ë³Ðò»ñÈ¡»¥³âÌ壻Èç¹ûÊÇZOSS_NO_INHERIT£¬Ôò°´µÈ´ýµÄ˳Ðò»ñÈ¡

+                »¥³âÌå

+ * @return Èô³É¹¦£¬·µ»Ø´´½¨µÄ»¥³âÌå¾ä±ú£»·ñÔòϵͳ¶ÏÑÔ

+ * @note 

+ * @warning 

+ */

+ZOSS_MUTEX_ID zOss_CreateMutex(const CHAR *name_ptr, UINT32 priority_inherit);

+

+/**

+ * @brief »ñÈ¡»¥³âÌå

+ * @param mutex_id   Èë²Î£¬´ý»ñÈ¡µÄ»¥³âÌåid

+ * @param timeout    Èë²Î£¬»ñÈ¡µÄ³¬Ê±Ê±¼ä

+ * @return ³É¹¦£¬·µ»ØZOSS_SUCCESS£¬·ñÔò·µ»ØZOSS_ERROR

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_GetMutex(ZOSS_MUTEX_ID mutex_id, UINT32 timeout);

+

+/**

+ * @brief ÊÍ·Å»¥³âÌå

+ * @param mutex_id   Èë²Î£¬´ýÊͷŵĻ¥³âÌåid

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note 

+ * @warning 

+ */

+UINT32 zOss_PutMutex(ZOSS_MUTEX_ID mutex_id);

+

+/**

+ * @brief Ïú»Ù»¥³âÌå

+ * @param mutex_id   Èë²Î£¬´ýÏú»ÙµÄ»¥³âÌåid

+ * @return Èô³É¹¦£¬·µ»ØZOSS_SUCCESS£»·ñÔòϵͳ¶ÏÑÔ

+ * @retval ZOSS_SUCCESS ³É¹¦

+ * @retval ZOSS_ERROR   ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_DeleteMutex(ZOSS_MUTEX_ID mutex_id);

+

+/* ʱ¼ä */

+/**

+ * @brief »ñÈ¡²Ù×÷ϵͳµÄµ±Ç°µÎ´ðÊý

+ * @param void 

+ * @return ·µ»Ø²Ù×÷ϵͳµÄµ±Ç°µÎ´ðÊý

+ * @retval µÎ´ðÊý

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_GetTickCount(VOID);

+

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/* CPUʹÓÃÂÊͳ¼Æ */

+UINT8 zOss_GetCPU(VOID);

+

+/* Òì³£´¦Àí */

+VOID EXP_Handler(const CHAR *pExp, const CHAR *pcFileName, const CHAR *pcFuncName, SINT32 dwLineNum);

+

+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/*******************************************************************************

+ *                      Inline function implementations                        *

+ ******************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  // #ifndef _OSS_KERNEL_H

+

diff --git a/cp/ps/plat/inc/oss/oss_mem.h b/cp/ps/plat/inc/oss/oss_mem.h
new file mode 100644
index 0000000..0c5383c
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_mem.h
@@ -0,0 +1,195 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_mem.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : ÄÚ´æÉêÇë¡¢ÊͷŽӿÚ

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_MEM_H

+#define _OSS_MEM_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef _OS_TOS

+#include "tos_pool.h"

+#include "tos_heap.h"

+#elif defined _OS_LINUX

+#include "oss_pool.h"

+#include "linux/mm.h"

+#endif

+#include "oss_pub.h"

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+/* UB */

+#define zOss_GetUB(size)            mem_getub(size, ZOSS_FILE, ZOSS_LINE)

+#define zOss_RetUB(msg_ptr)         mem_retub(msg_ptr, ZOSS_FILE, ZOSS_LINE)

+

+/* UBÄÚ´æÅäÖòÎÊý */

+#define MEM_MAX_LEAK_UB             200     /* ÄÚ´æÐ¹Â¶²éѯ·µ»ØµÄ×î´óÌõÊý   */ 

+#define ZOSS_UB_MAX_POOLNUM         15      /* ÄÚ´æ³Ø¸öÊý, ×î´ó²»Äܳ¬¹ý255  */

+#define ZOSS_UBHEAD_FILENAME_LEN    31      /* UBÄÚ´æÉêÇëÎļþÃû             */

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+typedef VOID *ZOSS_UB_BLOCK;    /* ÄÚ´æ¿éµØÖ·Ö¸Õë */

+

+typedef struct 

+{

+    UINT32 nMemUsed;            /* ÒÑʹÓÃÄÚ´æ´óС£¬ÒÔ×Ö½Ú±íʾ   */

+    UINT32 nMemTotal;           /* ÄÚ´æ×ܵĴóС£¬ÒÔ×Ö½Ú±íʾ     */

+    UINT32 nMemMaxFree;			/* ¿ÉÒÔÉêÇëµÄ×î´óÄÚ´æ           */

+}T_Mem_MemInfo;              /* ÄÚ´æ»ù±¾ÐÅÏ¢                 */

+

+typedef struct 

+{

+    UINT32  pool_size;          /* ÄÚ´æ³Ø´óС,µ¥Î»Îªbyte    */

+    UINT32  total_block_num;    /* Ô¤¶¨ÄÚ´æ¿éÊýÄ¿           */

+}T_ZOss_UBPOOL;              /* ÄÚ´æ³ØÅäÖÃ±í             */

+

+typedef struct 

+{

+    UINT32  pool_size;          /* ÄÚ´æ³Ø´óС,µ¥Î»Îªbyte    */

+    UINT16  total_block_num;    /* ÄÚ´æ¿é×ÜÊýÄ¿             */

+    UINT16  free_block_num;     /* ¿ÕÏÐÄÚ´æ¿éÊýÄ¿           */

+    UINT32  peak_value;         /* ÄÚ´æ¿é×î´óʹÓøöÊý       */

+}T_Mem_UBPoolInfo;          /* ÄÚ´æ³ØÐÅÏ¢               */

+

+typedef struct 

+{

+    ZOSS_UB_BLOCK   ubBlock;                            /* ÄÚ´æ¿éÖ¸Õë               */

+    UINT32          ubBlockSize;                        /* ÄÚ´æ¿é´óС,µ¥Î»Îªbyte    */

+    UINT32          usingSize;                          /* ʵ¼ÊÕ¼ÓôóС             */

+    CHAR            name[ZOSS_UBHEAD_FILENAME_LEN + 1]; /* ÉêÇëλÖÃÎļþÃû           */

+    UINT32          line;                               /* ÉêÇëλÖÃÐкŠ            */

+    ZOSS_THREAD_ID  threadId;                           /* ÉêÇëÏß³ÌID               */

+    ZOSS_TASK_ID    taskId;                             /* ÉêÇëÈÎÎñºÅ               */

+    UINT32          applyTimeTick;                      /* ÉêÇëʱ¼ä(TICK)           */

+}T_Mem_UBBlockInfo;                                 /* й¶ÄÚ´æ¿éÄÚ´æÍ·ÐÅÏ¢     */

+

+typedef struct 

+{

+    UINT8               pool_num;   /* ÄÚ´æ³Ø×ÜÊý   */

+    T_Mem_UBPoolInfo    pool_info[ZOSS_UB_MAX_POOLNUM];

+}T_Mem_UBPoolGrpInfo;           /* ÄÚ´æ³Ø×ÜÐÅÏ¢ */

+ 

+typedef struct 

+{

+    UINT16              ub_leak_num;    /* ÄÚ´æÐ¹Â¶ÊýÄ¿,×î´óΪMEM_MAX_LEAK_UB   */

+    T_Mem_UBBlockInfo   ubHeadInfo[MEM_MAX_LEAK_UB];

+}T_Mem_UBLeakInfo;                  /* ÄÚ´æÐ¹Â¶ÐÅÏ¢                         */

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/    

+#ifdef _OS_LINUX

+

+#if defined(_UB_USE_HEAP_DEBUG)

+extern void *ub_debug_alloc(unsigned long size, const char *file, unsigned long line);

+extern void ub_debug_free(void *ptr);

+static inline VOID *mem_getub(UINT32 size, const CHAR *file, UINT32 line)

+{

+	return ub_debug_alloc(size, file, line);

+}

+static inline UINT32 mem_retub(VOID *msg_ptr, const CHAR *file, UINT32 line)

+{

+	ub_debug_free(msg_ptr);

+

+    return ZOSS_SUCCESS;

+}

+#elif defined(_UB_USE_HEAP)

+static inline VOID *mem_getub(UINT32 size, const CHAR *file, UINT32 line)

+{

+	//zOss_ASSERT(PAGE_SIZE == 4096);

+	if(size <= PAGE_SIZE)

+		return kmalloc(size, GFP_KERNEL);

+	else

+		return vmalloc(size);

+}

+static inline UINT32 mem_retub(VOID *msg_ptr, const CHAR *file, UINT32 line)

+{

+	if(!is_vmalloc_addr(msg_ptr))

+		kfree(msg_ptr);

+	else

+		vfree(msg_ptr);

+

+    return ZOSS_SUCCESS;

+}

+#elif defined(_UB_USE_POOL)

+static inline VOID *mem_getub(UINT32 size, const CHAR *file, UINT32 line)

+{

+    return pool_alloc(size, file, line);

+}

+static inline UINT32 mem_retub(VOID *msg_ptr, const CHAR *file, UINT32 line)

+{

+    pool_free(msg_ptr, file, line);

+    return ZOSS_SUCCESS;

+}

+#endif

+

+#else

+

+#if defined(_UB_USE_HEAP)

+static inline VOID *mem_getub(UINT32 size, const CHAR *file, UINT32 line)

+{

+    return tos_heap_alloc(size, file, line);

+}

+static inline UINT32 mem_retub(VOID *msg_ptr, const CHAR *file, UINT32 line)

+{

+    tos_heap_free(msg_ptr, file, line);

+    return ZOSS_SUCCESS;

+}

+#elif defined(_UB_USE_POOL)

+static inline VOID *mem_getub(UINT32 size, const CHAR *file, UINT32 line)

+{

+    return pool_alloc(size, file, line);

+}

+static inline UINT32 mem_retub(VOID *msg_ptr, const CHAR *file, UINT32 line)

+{

+    pool_free(msg_ptr, file, line);

+    return ZOSS_SUCCESS;

+}

+#else

+VOID *mem_getub(UINT32 size, const CHAR *file, UINT32 line);

+UINT32 mem_retub(VOID *msg_ptr, const CHAR *file, UINT32 line);

+#endif

+

+#endif  // #ifdef _OS_LINUX

+

+FLOAT zOss_GetUBFreeRate(UINT32 ubSize);

+VOID zOss_MemLeakStart(UINT32 leak_threadhold);

+VOID zOss_MemLeakEnd(VOID);

+VOID zOss_CheckMem(VOID);

+VOID zOss_SetUbDbgSwitch(UINT32 dbgFlag);

+BOOL zOss_GetMemInitState(VOID);

+UINT32 zOss_GetSysMemInfo(T_Mem_MemInfo *mem_info);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_MEM_H */

+

diff --git a/cp/ps/plat/inc/oss/oss_monitor.h b/cp/ps/plat/inc/oss/oss_monitor.h
new file mode 100644
index 0000000..861ddf1
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_monitor.h
@@ -0,0 +1,336 @@
+/*******************************************************************************

+* °æÈ¨ËùÓÐ (C)2012, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£

+* 

+* ÎļþÃû³Æ:     oss_monitor.h

+* Îļþ±êʶ:     oss_monitor.h

+* ÄÚÈÝÕªÒª:     Ö§³Å²ã¼à¿ØÄ£¿éÍ·Îļþ£¬ele±íʾelement

+* ʹÓ÷½·¨:     #include "oss_monitor.h"

+* 

+* ÐÞ¸ÄÈÕÆÚ        °æ±¾ºÅ      Ð޸ıê¼Ç        ÐÞ¸ÄÈË          ÐÞ¸ÄÄÚÈÝ

+* ------------------------------------------------------------------------------

+* 2012/09/20      V1.0        Create          ÁõÑÇÄÏ          ´´½¨

+* 

+*******************************************************************************/

+

+#ifndef _OSS_MONITOR_H

+#define _OSS_MONITOR_H

+

+/*******************************************************************************

+*                                   Í·Îļþ                                     *

+*******************************************************************************/

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/*******************************************************************************

+*                                   ºê¶¨Òå                                     *

+*******************************************************************************/

+#define OSS_MON_PERCENT_RADIO           100    

+

+/*¼à¿ØÐÅÏ¢×î´óÖµ*/

+#define OSS_MON_INFO_MAX_NUMBER         (0x64)

+

+/*Ïß³Ì״̬ */

+#define OSS_MON_THREAD_RUNNING          (0x01)

+#define OSS_MON_THREAD_READY            (0x02)

+#define OSS_MON_THREAD_WAITING          (0x04)

+

+/*ÈÎÎñ״̬ */

+#define OSS_MON_TASK_STOPPED            (0x01)

+#define OSS_MON_TASK_IDLE               (0x02)

+#define OSS_MON_TASK_READY              (0x03)

+#define OSS_MON_TASK_RUN                (0x04)

+

+/*¼à¿ØÏ̺߳ÍDSRµÄ¹ì¼£ */

+#define OSS_MON_EVENT_THREAD_SWAPIN     (0x00) 

+#define OSS_MON_EVENT_THREAD_SWAPOUT    (0x01)

+#define OSS_MON_EVENT_DSR_SWAPIN        (0x02)

+#define OSS_MON_EVENT_DSR_SWAPOUT       (0x03)

+

+/*MMUµÄÊôÐÔ*/

+#define OSS_MON_MMU_PERMISSION_RW       (0x01)

+#define OSS_MON_MMU_PERMISSION_RO       (0x02)

+#define OSS_MON_MMU_ACCESS_WRITEBACK    (0x04)

+#define OSS_MON_MMU_ACCESS_WRITETHROUGH (0x08)

+

+/*¼à¿Ø¿ª¹Ø±êÖ¾*/

+#define OSS_MON_FLAG_OFF                (0x0)

+#define OSS_MON_FLAG_ON                 (0x1)

+

+/*ÏûÏ¢¶¨ÒåÀàÐÍ*/

+#define OSS_MON_INVALID                 (-1)

+#define OSS_MON_BASE                    (0x00)

+#define OSS_MON_VERSION                 (OSS_MON_BASE + 0)

+#define OSS_MON_CPU_FREQUENCY           (OSS_MON_BASE + 1)

+#define OSS_MON_CPU_LOAD                (OSS_MON_BASE + 2)

+#define OSS_MON_POOL                    (OSS_MON_BASE + 3)

+#define OSS_MON_POOL_ALLOC              (OSS_MON_BASE + 4)

+#define OSS_MON_POOL_LEAK               (OSS_MON_BASE + 5)

+#define OSS_MON_HEAP                    (OSS_MON_BASE + 6)

+#define OSS_MON_THREAD                  (OSS_MON_BASE + 7)

+#define OSS_MON_TASK                    (OSS_MON_BASE + 8)

+#define OSS_MON_EVENT                   (OSS_MON_BASE + 9)

+#define OSS_MON_MSG                     (OSS_MON_BASE + 10)

+#define OSS_MON_RAMLOG                  (OSS_MON_BASE + 11)

+#define OSS_MON_GET_VAR_REQ             (OSS_MON_BASE + 12)

+#define OSS_MON_GET_VAR_ACK             (OSS_MON_BASE + 13)

+#define OSS_MON_SET_VAR                 (OSS_MON_BASE + 14)

+#define OSS_MON_TIMER                   (OSS_MON_BASE + 15)

+#define OSS_MON_MMU                     (OSS_MON_BASE + 16)

+#define OSS_MON_SET_FLAG                (OSS_MON_BASE + 17)

+

+/*******************************************************************************

+*                                Êý¾ÝÀàÐͶ¨Òå                                  *

+*******************************************************************************/

+/*¼à¿Ø°æ±¾*/

+typedef struct

+{

+    const CHAR *version;

+} T_ZOss_Mon_Version;

+

+/*cpu µÄÖ÷Ƶ*/

+typedef struct

+{

+    UINT16  frequency;

+} T_ZOss_Mon_Cpu_Frequency;

+

+/*cpu ¸ºÔØ (load/100)*/

+typedef struct

+{

+    UINT16  load;

+} T_ZOss_Mon_Cpu_Load;

+

+/*pool ÅäÖÃÐÅÏ¢*/

+typedef struct

+{

+    UINT32  size;

+    UINT32  total;

+    UINT32  used;

+    UINT32  max_used;

+} T_ZOss_Mon_Pool_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Pool_Ele *ele;

+} T_ZOss_Mon_Pool;

+

+/*pool alloc ÐÅÏ¢*/

+typedef struct

+{

+    UINT32      addr;

+    UINT32      owner;

+    UINT32      timestamp;

+    const CHAR *file;

+    UINT32      line;

+} T_ZOss_Mon_Pool_Alloc_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Pool_Alloc_Ele *ele;

+} T_ZOss_Mon_Pool_Alloc;

+

+/*pool leak ÐÅÏ¢*/

+typedef struct

+{

+    UINT32      addr;

+    UINT32      owner;

+    UINT32      timestamp;

+    const CHAR  *file;

+    UINT32      line;

+} T_ZOss_Mon_Pool_Leak_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Pool_Leak_Ele *ele;

+} T_ZOss_Mon_Pool_Leak;

+

+/*heap ÐÅÏ¢*/

+typedef struct

+{

+    UINT32  base;

+    UINT32  size;

+    UINT32  used;

+} T_ZOss_Mon_Heap;

+

+/*Ïß³ÌÐÅÏ¢*/

+typedef struct

+{

+    CHAR    *name;

+    UINT32  handle;

+    UINT32  msg_num;

+    UINT8   status;

+    UINT8   priority;

+    UINT16  stack_used;

+    UINT16  stack_max_used;

+    UINT16  cpu_load;

+} T_ZOss_Mon_Thread_Ele;

+

+typedef struct

+{

+    unsigned int num;

+    T_ZOss_Mon_Thread_Ele *ele;

+} T_ZOss_Mon_Thread;

+

+/*ÈÎÎñÐÅÏ¢*/

+typedef struct

+{

+    CHAR    *name;

+    UINT32  handle;

+    UINT32  thread_handle;

+    UINT8   status;

+} T_ZOss_Mon_Task_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Task_Ele *ele;

+} T_ZOss_Mon_Task;

+

+/*Ï̺߳ÍÖжϹ켣ÐÅÏ¢*/

+typedef struct

+{

+    UINT8   event;

+    CHAR    *name;

+    UINT32  handle;

+    UINT64  tickstamp;

+} T_ZOss_Mon_Event_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Event_Ele *ele;

+} T_ZOss_Mon_Event;

+

+/*ÏûÏ¢ÊÕ·¢ÐÅÏ¢*/

+typedef struct

+{   

+    UINT32  msgId;

+    UINT32  ptr;

+    UINT32  size;

+    CHAR    *sender;

+    CHAR    *receiver;

+    UINT32  timestamp;

+} T_ZOss_Mon_Msg_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Msg_Ele  *ele;

+} T_ZOss_Mon_Msg;

+

+/*ramlog ÐÅÏ¢*/

+typedef struct

+{   

+    UINT32  size;

+    const CHAR *ramlog;

+} T_ZOss_Mon_Ramlog;

+

+/*»ñÈ¡±äÁ¿ÇëÇó*/

+typedef struct

+{

+    UINT32  base;

+    UINT32  size;

+} T_ZOss_Mon_Get_Var_Req;

+

+/*»ñÈ¡±äÁ¿È·ÈÏÐÅÏ¢*/

+typedef struct

+{

+    UINT32  size;

+    UINT8   *value;

+} T_ZOss_Mon_Get_Var_Ack;

+

+/*ÉèÖñäÁ¿*/

+typedef struct

+{

+    UINT32  base;

+    UINT32  size;

+    UINT8   *value;

+} T_ZOss_Mon_Set_Var;

+

+/*¶¨Ê±Æ÷ÐÅÏ¢*/

+typedef struct

+{

+    UINT32  start_time;

+    UINT32  expire_time;

+    UINT32  callback_func;

+    UINT8   is_period;

+    UINT32  handle;

+} T_ZOss_Mon_Timer_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Timer_Ele *ele;

+} T_ZOss_Mon_Timer;

+

+/*MMU ÐÅÏ¢*/

+typedef struct

+{

+    CHAR    *name;

+    UINT32  vir_addr;

+    UINT32  phy_addr;

+    UINT32  size;

+    UINT8   attr; /* permission and access */

+} T_ZOss_Mon_Mmu_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Mmu_Ele *ele;

+} T_ZOss_Mon_Mmu;

+

+/*MPU ÐÅÏ¢*/

+typedef struct

+{

+    CHAR   *name;

+    UINT32 num;

+    UINT32 base;

+    UINT32 size;

+    UINT32 attr;

+    UINT32 subRegion;

+} T_ZOss_Mon_Mpu_Ele;

+

+typedef struct

+{

+    UINT32  num;

+    T_ZOss_Mon_Mpu_Ele *ele;

+} T_ZOss_Mon_Mpu;

+

+typedef struct

+{

+    UINT32  flag;

+} T_ZOss_Mon_Set_Flag;

+

+/*******************************************************************************

+*                                È«¾Ö±äÁ¿ÉùÃ÷                                  *

+*******************************************************************************/

+#ifdef _USE_MONITOR

+extern UINT32   gOsa_MonitorFlag;

+#endif

+

+/*******************************************************************************

+*                                È«¾Öº¯ÊýÉùÃ÷                                  *

+*******************************************************************************/

+/* TOS¸ú×ÙÄ£¿é */

+VOID zTos_GetMmuConfigTable(T_ZOss_Mon_Mmu *pMonMmuInfo);

+VOID pool_used_info(T_ZOss_Mon_Pool *pMonPoolInfo);

+VOID pool_alloc_info(T_ZOss_Mon_Pool_Alloc *pMonPoolAllocInfo);

+VOID pool_leak_info(T_ZOss_Mon_Pool_Leak *pMonPoolLeakInfo);

+VOID z0ss_GetMsgInfo(T_ZOss_Mon_Msg *pMonMsgInfo);

+VOID z0ss_GetEventInfo(T_ZOss_Mon_Event *pMonEventInfo);

+VOID zOss_GetAllTaskInfo(T_ZOss_Mon_Task *pMonTaskInfo);

+VOID z0ss_GetAllThreadInfo(T_ZOss_Mon_Thread *pMonThreadInfo);

+VOID zOss_GetTimerInfo(T_ZOss_Mon_Timer *pMonTimerInfo);

+VOID z0ss_GetRamlogInfo(T_ZOss_Mon_Ramlog *pMonRamlogInfo);

+VOID z0ss_GetHeapInfo(T_ZOss_Mon_Heap *pMonHeapInfo);

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif // #ifndef _OSS_MONITOR_H

+

diff --git a/cp/ps/plat/inc/oss/oss_pool.h b/cp/ps/plat/inc/oss/oss_pool.h
new file mode 100644
index 0000000..80f6972
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_pool.h
@@ -0,0 +1,122 @@
+/*******************************************************************************

+* °æÈ¨ËùÓÐ (C)2014, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£

+* 

+* ÎļþÃû³Æ:     oss_pool.h

+* Îļþ±êʶ:     oss_pool.h

+* ÄÚÈÝÕªÒª:     ossÖ§³Å²ãÄÚ´æ³Ø¹ÜÀíÄ£¿éÍ·Îļþ

+* ʹÓ÷½·¨:     #include "oss_api.h"

+* 

+* ÐÞ¸ÄÈÕÆÚ        °æ±¾ºÅ      Ð޸ıê¼Ç        ÐÞ¸ÄÈË          ÐÞ¸ÄÄÚÈÝ

+* ------------------------------------------------------------------------------

+* 2014/08/25      V1.0        Create          ÁõÑÇÄÏ          ´´½¨

+* 

+*******************************************************************************/

+

+#ifndef _OSS_POOL_H

+#define _OSS_POOL_H

+

+/*******************************************************************************

+*                                   Í·Îļþ                                     *

+*******************************************************************************/

+

+/*******************************************************************************

+*                                   ºê¶¨Òå                                     *

+*******************************************************************************/

+#if defined(_DEBUG) && !defined(_USE_OSS_MIN)

+# define POOL_DEBUG

+# define POOL_LEAK_CHECK

+# define POOL_INIT_CHECK

+#endif

+

+#ifdef POOL_DEBUG

+# define palloc(size)           pool_alloc(size, __FILE__, __LINE__)

+# define pfree(ptr)             pool_free(ptr, __FILE__, __LINE__)

+# define prealloc(ptr, size)    pool_realloc(ptr, size, __FILE__, __LINE__)

+# define psize(ptr)             pool_node_size(ptr, __FILE__, __LINE__)

+#else

+# define palloc(size)           pool_alloc(size, NULL, 0x00)

+# define pfree(ptr)             pool_free(ptr, NULL, 0x00)

+# define prealloc(ptr, size)    pool_realloc(ptr, size, NULL, 0x00)

+# define psize(ptr)             pool_node_size(ptr, NULL, 0x00)

+#endif

+

+#define POOL_INDEX_0_NUM    (4096)    /* the number of index 0 pool node  */

+#define POOL_INDEX_0_SIZE   (4)       /* the size of index 0 pool node    */

+

+#define POOL_INDEX_1_NUM    (4096)    /* the number of index 1 pool node  */

+#define POOL_INDEX_1_SIZE   (8)       /* the size of index 1 pool node    */

+

+#define POOL_INDEX_2_NUM    (256)     /* the number of index 2 pool node  */

+#define POOL_INDEX_2_SIZE   (16)      /* the size of index 2 pool node    */

+

+#define POOL_INDEX_3_NUM    (2048)    /* the number of index 3 pool node  */

+#define POOL_INDEX_3_SIZE   (32)      /* the size of index 3 pool node    */

+

+#define POOL_INDEX_4_NUM    (3072)    /* the number of index 4 pool node  */

+#define POOL_INDEX_4_SIZE   (64)      /* the size of index 4 pool node    */

+

+#define POOL_INDEX_5_NUM    (512)     /* the number of index 5 pool node  */

+#define POOL_INDEX_5_SIZE   (128)     /* the size of index 5 pool node    */

+

+#define POOL_INDEX_6_NUM    (512)     /* the number of index 6 pool node  */

+#define POOL_INDEX_6_SIZE   (256)     /* the size of index 6 pool node    */

+

+#define POOL_INDEX_7_NUM    (300)     /* the number of index 7 pool node  */

+#define POOL_INDEX_7_SIZE   (512)     /* the size of index 7 pool node    */

+

+#define POOL_INDEX_8_NUM    (300)     /* the number of index 8 pool node  */

+#define POOL_INDEX_8_SIZE   (1024)    /* the size of index 8 pool node    */

+

+#define POOL_INDEX_9_NUM    (100)     /* the number of index 9 pool node  */

+#define POOL_INDEX_9_SIZE   (2048)    /* the size of index 9 pool node    */

+

+#define POOL_INDEX_10_NUM   (21)      /* the number of index 10 pool node */

+#define POOL_INDEX_10_SIZE  (4096)    /* the size of index 10 pool node   */

+

+#define POOL_INDEX_11_NUM   (60)      /* the number of index 11 pool node */

+#define POOL_INDEX_11_SIZE  (8192)    /* the size of index 11 pool node   */

+

+#define POOL_INDEX_12_NUM   (15)      /* the number of index 12 pool node */

+#define POOL_INDEX_12_SIZE  (16384)   /* the size of index 12 pool node   */

+

+#define POOL_INDEX_13_NUM   (5)       /* the number of index 13 pool node */

+#define POOL_INDEX_13_SIZE  (32768)   /* the size of index 13 pool node   */

+

+#define POOL_INDEX_14_NUM   (5)       /* the number of index 14 pool node */

+#define POOL_INDEX_14_SIZE  (65536)   /* the size of index 14 pool node   */

+

+#define POOL_INDEX_15_NUM   (1)       /* the number of index 15 pool node */

+#define POOL_INDEX_15_SIZE  (131072)  /* the size of index 15 pool node   */

+

+#define POOL_LEAK_CHECK_TIMEOUT     (100)

+

+#define POOL_ALLOC_STATISTIC_NUM    (8)

+

+#define POOL_MBOX_ITEM_COUNT        (3000)  /* the total available items(msgs) for system */

+

+

+/*******************************************************************************

+*                                Êý¾ÝÀàÐͶ¨Òå                                  *

+*******************************************************************************/

+

+/*******************************************************************************

+*                                È«¾Ö±äÁ¿ÉùÃ÷                                  *

+*******************************************************************************/

+

+/*******************************************************************************

+*                                È«¾Öº¯ÊýÉùÃ÷                                  *

+*******************************************************************************/

+void pool_init(void);

+__tcm_call_func void *pool_alloc(unsigned long size, const char *file, unsigned long line);

+__tcm_call_func void pool_free(void *ptr, const char *file, unsigned long line);

+void *pool_realloc(void *old_ptr, unsigned long new_size, const char *file, unsigned long line);

+unsigned long pool_node_size(void *ptr, const char *file, unsigned long line);

+void pool_print_leak(unsigned long timeout);

+void pool_print_alloc_fail(void);

+void pool_print_alloc_statistic(void);

+void pool_print_free(void);

+void pool_trace_leak_start(void);

+void pool_trace_leak_end(unsigned long timeout);

+

+#endif  // #ifndef _OSS_POOL_H

+

diff --git a/cp/ps/plat/inc/oss/oss_posix.h b/cp/ps/plat/inc/oss/oss_posix.h
new file mode 100644
index 0000000..9effacb
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_posix.h
@@ -0,0 +1,106 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_posix.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : posix¿âÍ·Îļþ

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_POSIX_H

+#define _OSS_POSIX_H

+

+#define _USE_POSIX

+#ifdef _USE_POSIX

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef _OS_TOS

+#include <sys/time.h>

+#include <sys/types.h>

+#elif defined (_OS_LINUX)

+

+#else

+#include "sys/types.h"

+#endif

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+/* ʱ¼ä¶¨Òå */

+#ifndef _OS_WIN

+typedef struct timeval  ZOSS_S_TIMEVAL;

+typedef struct timezone ZOSS_S_TIMEZONE;

+typedef struct timespec ZOSS_S_TIMESPEC;

+#else

+# ifndef _USE_OS_SOCK

+typedef struct timeval

+# else

+typedef struct

+# endif

+{

+    SINT32  tv_sec;        

+    SINT32  tv_usec;     

+}ZOSS_S_TIMEVAL;

+

+typedef struct timezone

+{

+    SINT32  tz_minuteswest; /*  minutes west of Greenwich,ºÍGreenwich ʱ¼ä²îÁ˶àÉÙ·ÖÖÓ  */

+    SINT32  tz_dsttime;     /*  type of dst correction to apply ,ÈÕ¹â½ÚԼʱ¼äµÄ״̬Ëù´ú±íµÄ״̬ÈçÏÂ

+                                DST_NONE    ²»Ê¹ÓÃ

+                                DST_USA     ÃÀ¹ú

+                                DST_AUST    °ÄÖÞ

+                                DST_WET     Î÷Å·

+                                DST_MET     ÖÐÅ·

+                                DST_EET     ¶«Å·

+                                DST_CAN     ¼ÓÄôó

+                                DST_GB      ´ó²»Áеß

+                                DST_RUM     ÂÞÂíÄáÑÇ

+                                DST_TUR     ÍÁ¶úÆä

+                                DST_AUSTALT °ÄÖÞ(1986ÄêÒÔºó)    */

+}ZOSS_S_TIMEZONE;

+

+typedef struct timespec 

+{

+    SINT32  tv_sec;

+    SINT32  tv_nsec;

+}ZOSS_S_TIMESPEC;

+#endif

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+UINT32 zOss_Gettimeofday(ZOSS_S_TIMEVAL *tv, ZOSS_S_TIMEZONE *tz);

+UINT32 zOss_Settimeofday(ZOSS_S_TIMEVAL *tv, ZOSS_S_TIMEZONE *tz);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _USE_POSIX   */

+

+#endif  /* _OSS_POSIX_H */

+

diff --git a/cp/ps/plat/inc/oss/oss_psm.h b/cp/ps/plat/inc/oss/oss_psm.h
new file mode 100644
index 0000000..0427f46
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_psm.h
@@ -0,0 +1,46 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_psm.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : Ê¡µç¹ÜÀíÄ£¿é

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+       

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef _USE_PSM_NEW_FRAMEWORK

+#include "oss_psm_new_framework.h"       /*7510ºóÐøÍ·Îļþ      */

+#else

+#include "oss_psm_old_framework.h"       /*ÒÔǰ°æ±¾µÄÍ·Îļþ    */

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+

+

diff --git a/cp/ps/plat/inc/oss/oss_psm_new_framework.h b/cp/ps/plat/inc/oss/oss_psm_new_framework.h
new file mode 100644
index 0000000..29b98fc
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_psm_new_framework.h
@@ -0,0 +1,127 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_psm.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : Ê¡µç¹ÜÀíÄ£¿é

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_PSM_H

+#define _OSS_PSM_H

+       

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+typedef VOID *ZOSS_COMPENSATE_ID;                       /* ˯Ãß²¹³¥ID           */

+typedef VOID (*psm_SleepInitHook)(VOID);                /* ˯Ãß³õʼ»¯hook       */

+typedef VOID (*psm_SleepFinishHook)(VOID);              /* ˯Ãß½áÊøhook         */

+typedef VOID (*psm_SleepBeforeHook)(VOID);              /* ˯Ãßǰhook           */

+typedef VOID (*psm_SleepAfterHook)(VOID);               /* ˯Ãߺóhook           */

+typedef VOID (*psm_CompensateHook)(UINT32 sleepTime);   /* ˯Ãßʱ¼ä²¹³¥¹³×Óº¯Êý */

+

+typedef enum

+{

+    PSM_BOOT_DEFAULT,   /* Æô¶¯³õʼֵ                           */

+    PSM_SYSINIT_FINISH, /* ϵͳ³õʼ»¯Íê³É,ÈçÐͺŻúÍê³ÉSysEntry  */

+    PSM_BOOT_FINISH     /* ¿ª»úÍê³É£¬ÈçÐͺŻú³öÏÖ´ý»ú½çÃæ       */

+}T_zPsm_BootStage;  /* Æô¶¯½×¶Î                             */

+

+#ifdef _USE_CPU_DFM

+typedef struct  

+{

+    UINT32  cpuClk;

+    BOOL    isUsed;

+}T_zPsm_CpuFreq;                    /* Á¢¼´µ÷Ƶ½á¹¹     */

+

+typedef struct  

+{

+    UINT32  pullCpuPercent;

+    UINT32  upCpuPercent;

+    UINT32  downCpuPercent;

+}T_zPsm_CpuPercentThreshold;    /* CPUµ÷Ƶ·§Öµ½á¹¹  */

+

+typedef struct 

+{

+    UINT32  curCpuFreq;

+    UINT32  downCpuFreq; 

+    UINT32  upCpuFreq;

+    UINT32  pullCpuFreq;

+}T_zPsm_CpuFm;                      /* CPUµ÷Ƶ½á¹¹      */

+#endif

+

+typedef struct 

+{ 

+    UINT32          deepSleepTimeThreshold; /* ϵͳÉî˯Ãߵķ§Öµ             */

+    UINT32          shadowSleepTimeThreshold;        

+#ifdef _USE_CPU_DFM

+    UINT32          dfmPeriod;              /* µ÷ƵµÄÖÜÆÚ£¬½¨ÒéÖÜÆÚÔÚ5msÒÔÉÏ*/

+    UINT32          dfmThrdPri;             /* µ÷ƵµÄÓÅÏȼ¶                 */

+    UINT32          dfmCnt;                 /* µ÷ƵµÄ´ÎÊý                   */

+    T_zPsm_CpuFm    *desClk;                /* δ²åusbÉèÖÃcpuµ÷Ƶ           */

+    UINT32          desClkNum;              /* δ²åusbÉèÖÃcpuµ÷ƵµÄ¸öÊý     */

+    T_zPsm_CpuFm    *usbDesClk;             /* ²åÉÏusbÉèÖÃcpuµ÷Ƶ           */

+    UINT32          usbDesClkNum;           /* ²åÉÏusbÉèÖÃcpuµ÷ƵµÄ¸öÊý     */

+    T_zPsm_CpuFreq  *minClk;                /* Á¢¼´µ÷Ƶ                     */

+    T_zPsm_CpuPercentThreshold scaleCpuPcnt;/* cpuµ÷ƵµÄ·§Öµ                */

+    CHAR            **pIgnoreThreadNameArry;/* ºöÂÔÏ̵߳ÄÃû×ÖÊý×é           */

+    UINT32          ignoreThreadCnt;        /* ºöÂÔÏ̵߳ĸöÊý               */

+    UINT32          *usbSysClk;             /* ²åÉÏusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ    */

+    UINT32          usbSysClkNum;           /* ²åÉÏusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ¸öÊý*/

+    UINT32          *sysClk;                /* δ²åusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ    */

+    UINT32          sysClkNum;              /* δ²åusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ¸öÊý*/

+#endif

+    UINT32          chargeringSleepTime;    /* ³äµçÖÐ˯Ãßʱ¼ä£¬µ¥Î»ms       */

+    UINT32          airPlaneSleepTime;      /* ·ÉÐÐģʽϵÄ˯Ãßʱ¼ä£¬µ¥Î»ms */

+    UINT32          bootOverClk;            /* boot sleep ½áÊøºóµÄ¿ª»úÖ÷Ƶ  */

+}T_zPsm_Param;  /* Ê¡µçÅäÖòÎÊý½á¹¹Ìå            */

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+UINT32 zOss_PsmInit(VOID);

+VOID   zOss_SetBootStage(T_zPsm_BootStage stage);

+UINT32 zOss_SetPSMAppIdle(UINT32 appId);

+UINT32 zOss_SetPSMAppActive(UINT32 appId);

+UINT32 zOss_ApplyCpuFreq(UINT32 appId, BOOL isUsed);

+VOID   zOss_SetSleepHookOpt(psm_SleepInitHook  initHook, psm_SleepFinishHook  finishHook, psm_SleepBeforeHook  beforeHook, psm_SleepAfterHook afterHook);

+ZOSS_COMPENSATE_ID zOss_RegSleepCompensateFunc(psm_CompensateHook funcOpt);

+VOID   zOss_DeregSleepCompensateFunc(ZOSS_COMPENSATE_ID psmCmpnstId);

+VOID   zOss_SetIgnoreThreadTimeRate(FLOAT timeRate);

+VOID   zOss_DfmSettingInit(VOID);

+VOID   zOss_SetIgnoreThread(ZOSS_THREAD_ID threadId);

+VOID   zOss_PsmTraceInfo(VOID);

+VOID   zOss_DfmTraceInfo(VOID);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_PSM_H */

+

+

diff --git a/cp/ps/plat/inc/oss/oss_psm_old_framework.h b/cp/ps/plat/inc/oss/oss_psm_old_framework.h
new file mode 100644
index 0000000..4b88027
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_psm_old_framework.h
@@ -0,0 +1,171 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_psm.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : Ê¡µç¹ÜÀíÄ£¿é

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_PSM_H

+#define _OSS_PSM_H

+       

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+typedef VOID (*PSM_SleepFunc)(SINT32 arg);  /* Ê¡µç¹ÜÀí˯Ãߺ¯ÊýÀàÐÍ     */

+typedef VOID (*PSM_SleepHookFunc)(VOID);    /* Ê¡µç¹ÜÀí˯ÃßHOOKº¯ÊýÀàÐÍ */ 

+

+typedef enum 

+{

+    PSM_MODULE_APP = 1,     /* ÉϲãÓ¦Óà             */

+    PSM_MODULE_PS,          /* ЭÒéÕ»               */

+    PSM_MODULE_DRV          /* ϲãÇý¶¯             */

+}T_PSM_IdleModule;          /* Ê¡µç¹ÜÀíËù»®·ÖµÄÄ£¿é */       

+

+typedef enum

+{

+    PSM_NO_SLEEP,

+    PSM_KENEL_SLEEP,

+    PSM_SHALLOW_SLEEP,

+    PSM_DEEP_SLEEP,

+    PSM_BOOTING_SLEEP,      /* ¿ª»úÊäÈëPINÂë¡¢ÊÖ»úÃÜÂëÊ¡µç˯Ãß  */

+    PSM_LOSSCOVERAGE_SLEEP, /* ¶ªÊ§¸²¸ÇÊ¡µç˯Ãß                 */

+    PSM_AIRPLANE_SLEEP,     /* ·ÉÐÐģʽʡµç˯Ãß                 */

+    PSM_CHARGERING_SLEEP,   /* ³äµç¿ª»úÊ¡µç˯Ãß                 */

+    PSM_MAX_SLEEP

+}T_Psm_SleepMode;           /* ˯Ãßģʽ                         */

+

+typedef enum

+{

+    PSM_BOOT_DEFAULT,       /* Æô¶¯³õʼֵ                           */

+    PSM_SYSINIT_FINISH,     /* ϵͳ³õʼ»¯Íê³É,ÈçÐͺŻúÍê³ÉSysEntry  */

+    PSM_BOOT_FINISH         /* ¿ª»úÍê³É£¬ÈçÐͺŻú³öÏÖ´ý»ú½çÃæ       */

+}T_Psm_BootStage;           /* Æô¶¯½×¶Î                             */

+

+#ifdef _USE_APPFLAG_DFM

+typedef struct  

+{

+    UINT32  PSM_AppPowFlag;

+    UINT32  PSM_AppPow;

+}T_ZOss_PSM_AppPow;         /* Ó¦Óñê־λµ÷Ƶ½á¹¹ */

+#endif

+

+#ifdef _USE_CPU_DFM

+typedef struct  

+{

+    UINT32  CPUCLK;

+    BOOL    isUsed;

+}T_ZOSS_CPU_Clock;          /* Á¢¼´µ÷Ƶ½á¹¹ */

+

+typedef struct  

+{

+    UINT32  pullCpuPercent;

+    UINT32  upCpuPercent;

+    UINT32  downCpuPercent;

+}ARMScaleCpu;               /* CPUµ÷Ƶ·§Öµ½á¹¹ */

+

+typedef struct 

+{

+    CHAR *threadname;

+}PSM_IgnoreThread;          /* ºöÂÔÏ߳̽ṹ */

+

+typedef struct 

+{

+    UINT32  currentARMClock;

+    UINT32  downARMCLock;

+    UINT32  upARMClock;

+    UINT32  pushARMClock;

+}T_ZPSM_ARMClockSet;        /* CPUµ÷Ƶ½á¹¹ */

+#endif

+

+#ifdef _USE_PSM  

+typedef struct 

+{ 

+    UINT32              deepSleepTimeLen;       /* ϵͳÉî˯Ãߵķ§Öµ                 */

+    UINT32              secondSleepTimeLen;     /* ϵͳµÚ¶þ´Î˯Ãߵķ§Öµ             */

+    UINT32              shadowSleepTimeLen;        

+    UINT32              tddT1PichSleepTimeLen;

+#ifdef _USE_APPFLAG_DFM

+    T_ZOss_PSM_AppPow   *appDfm;                /* δ²åusbÓ¦Óõ÷Ƶ                  */

+    UINT32              appDfmNum;              /* δ²åusbÓ¦Óõ÷ƵµÄ¸öÊý            */

+    T_ZOss_PSM_AppPow   *appUsbDfm;             /* ²åÉÏusbÓ¦Óõ÷Ƶ                  */

+    UINT32              appUsbDfmNum;           /* ²åÉÏusbÓ¦Óõ÷ƵµÄ¸öÊý            */

+#endif 

+#ifdef _USE_CPU_DFM

+    UINT32              minTimeLen;             /* µ÷ƵµÄÖÜÆÚ                       */

+    UINT32              cpuThreadPrior;         /* µ÷ƵµÄÓÅÏȼ¶                     */

+    UINT32              cpuAdjustNum;           /* µ÷ƵµÄ´ÎÊý                       */

+    T_ZPSM_ARMClockSet  *desClock;              /* δ²åusbÉèÖÃcpuµ÷Ƶ               */

+    UINT32              desClockNum;            /* δ²åusbÉèÖÃcpuµ÷ƵµÄ¸öÊý         */

+    T_ZPSM_ARMClockSet  *usbDesClock;           /* ²åÉÏusbÉèÖÃcpuµ÷Ƶ               */

+    UINT32              usbDesClockNum;         /* ²åÉÏusbÉèÖÃcpuµ÷ƵµÄ¸öÊý         */

+    T_ZOSS_CPU_Clock    *minClock;              /* Á¢¼´µ÷Ƶ                         */

+    UINT32              minClockNum;

+    ARMScaleCpu         scaleCpuPcnt;           /* cpuµ÷ƵµÄ·§Öµ                    */

+    PSM_IgnoreThread    *psmThreadName;         /* ºöÂÔÏ̵߳ÄÃû×Ö                   */

+    UINT32              psmThrdNameNum;         /* ºöÂÔÏ̵߳ĸöÊý                   */

+    UINT32              *usbSysClk;             /* ²åÉÏusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ        */

+    UINT32              usbSysClkNum;           /* ²åÉÏusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ¸öÊý    */

+    UINT32              *sysClk;                /* δ²åusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ        */

+    UINT32              sysClkNum;              /* δ²åusbʱ£¬ÏµÍ³Ö§³ÖµÄÖ÷Ƶ¸öÊý    */

+#endif

+    UINT32              chargeringSleepTime;    /* ³äµçÖÐ˯Ãßʱ¼ä£¬µ¥Î»ms           */

+}T_PSM_PARAM;

+#endif

+

+typedef struct 

+{

+    PSM_SleepHookFunc   SleepHook;  /* ϵͳ˯ÃßǰµÄ»Øµ÷º¯Êý */

+    PSM_SleepHookFunc   WakeupHook; /* ϵͳ¼¤»îºóµÄ»Øµ÷º¯Êý */

+}T_ZOSS_PSM_HOOK;

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+VOID zOss_InstallSleep(PSM_SleepFunc shallowSleep, PSM_SleepFunc deepSleep, PSM_SleepFunc kernelSleep);

+VOID zOss_InstallPsmHook(T_ZOSS_PSM_HOOK *hook);

+VOID zOss_SetBootStage(T_Psm_BootStage stage);

+VOID zOss_SetLcdPsmFlag(BOOL flag);

+UINT32 zOss_SetAppIdle(UINT32 appId);

+UINT32 zOss_SetAppActive(UINT32 appId);

+UINT32 zOss_SetPSMAppIdle(UINT32 appId);

+UINT32 zOss_SetPSMAppActive(UINT32 appId);

+UINT32 zOss_SetDevIdle(UINT32 devId);

+UINT32 zOss_SetDevActive(UINT32 devId);

+UINT32 zOss_ApplyCpuFreq(UINT32 appId, BOOL isUsed);

+UINT32 zOss_PsmClearArm1SleepTime(VOID);

+UINT32 zOss_GetSleepTimeForGui(VOID);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_PSM_H */

+

+

diff --git a/cp/ps/plat/inc/oss/oss_pub.h b/cp/ps/plat/inc/oss/oss_pub.h
new file mode 100644
index 0000000..d052478
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_pub.h
@@ -0,0 +1,300 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_pub.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : »ù±¾ÀàÐÍ¡¢Ä£¿éºÅ¡¢´íÎóºÅ¡¢ÏûÏ¢ºÅ¶¨Òå

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10 

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_PUB_H

+#define _OSS_PUB_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#if defined _OS_TOS

+#include <pkgconf/kernel.h>

+#include <cyg/hal/hal_intr.h>

+#include <cyg/kernel/kapi.h>

+#elif defined _OS_OSE

+#include "ose.h"

+#include "osetypes.h"

+#include "ose_spi/arm/cpu_intlock.h"

+#elif defined (_OS_LINUX)

+#include <linux/types.h>

+#include <linux/kernel.h>

+#include <linux/jiffies.h>

+#include <asm/param.h>

+#ifdef _USE_TCM

+#include <asm/tcm.h>

+#endif

+#elif defined _OS_WIN

+# ifndef _USE_OS_SOCK

+#define _WINSOCK2_H  

+#define _WINSOCK_H 

+#define _WINSOCK2API_ 

+#define _WINSOCKAPI_

+# endif

+#include <windows.h>

+#endif

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+/* ²Ù×÷ϵͳ´íÎóºÅ, 0x00001000 --- 0x00001fff */

+#define ZOSS_ERR                (0x00001000)

+

+

+/* ƽ̨ÏûÏ¢ */

+#define EV_ZPLAT_BASE           (0x00001000)

+

+/* ²Ù×÷ϵͳÏûÏ¢, ¸öÊý0x1000 */

+#define EV_ZOSS_BASE            (EV_ZPLAT_BASE)

+

+/* ƽ̨ÏûÏ¢Çø¼ä */

+#define EV_ZOSS_SCHE_BASE       (EV_ZOSS_BASE)

+#define EV_ZOSS_SYSM_BASE       (EV_ZOSS_BASE + 50)

+#define EV_ZOSS_EXCEP_BASE      (EV_ZOSS_BASE + 100)

+#define EV_ZOSS_TRACE_BASE      (EV_ZOSS_BASE + 150)

+#define EV_ZOSS_MEM_BASE        (EV_ZOSS_BASE + 300)

+#define EV_ZOSS_COMM_BASE       (EV_ZOSS_BASE + 350)

+

+/* ϵͳ¹ÜÀíÄ£¿éÏûÏ¢ */

+#define EV_INIT                 (EV_ZOSS_SYSM_BASE + 0) /* ÈÎÎñ³õʼ»¯ÏûÏ¢   */

+#define EV_POWERON              (EV_ZOSS_SYSM_BASE + 1) /* ÈÎÎñÉϵçÏûÏ¢     */

+#define EV_POWEROFF             (EV_ZOSS_SYSM_BASE + 2) /* ÈÎÎñϵçÏûÏ¢     */

+#define EV_POWERON_OK           (EV_ZOSS_SYSM_BASE + 3) /* ÈÎÎñÉϵçÍê³ÉÏûÏ¢ */

+#define EV_PS_START             (EV_ZOSS_SYSM_BASE + 4) /* ЭÒéÕ»Æô¶¯ÏûÏ¢   */

+#define EV_TASKSTOP             (EV_ZOSS_SYSM_BASE + 5) /* ЭÒéÕ»ÔÝÍ£ÏûÏ¢   */

+#define EV_TASKRESUM            (EV_ZOSS_SYSM_BASE + 6) /* ЭÒéÕ»»Ö¸´ÏûÏ¢   */

+#define EV_SYSM_DOWN            (EV_ZOSS_SYSM_BASE + 7) /* ¹Ø»úÏûÏ¢         */

+

+/* GUIÏûÏ¢ */

+#define EV_ZGUI_BASE            (0x00002000)

+

+/* ЭÒéÕ»²âÊÔ¹¤¾ßÏûÏ¢ */

+#define EV_ZPTE_BASE            (EV_ZPLAT_BASE + 0x00008000) 

+

+/* ϵͳ¹«¹²´òÓ¡Ä£¿éºÅ */

+#define SUBMDL_SYSBASE          (1)

+#define SUBMDL_PUB              (SUBMDL_SYSBASE + 0)    /* ϵͳ¹«¹²     */

+#define SUBMDL_RAM              (SUBMDL_SYSBASE + 1)    /* ÍùRAM´òÓ¡    */

+#define SUBMDL_FILE             (SUBMDL_SYSBASE + 2)    /* ÍùÎļþ´òÓ¡   */

+#define SUBMDL_LCD              (SUBMDL_SYSBASE + 3)    /* ÍùLCD´òÓ¡    */

+

+/* OSS´òÓ¡Ä£¿éºÅ */

+#define SUBMDL_OSSBASE          (10)

+#define SUBMDL_COMMON           (SUBMDL_OSSBASE + 0)    /* ¹«¹²Ä£¿é         */

+#define SUBMDL_OSA              (SUBMDL_OSSBASE + 1)    /* OSAÄ£¿é          */

+#define SUBMDL_SCHE             (SUBMDL_OSSBASE + 2)    /* µ÷¶ÈͨѶ         */

+#define SUBMDL_MEM              (SUBMDL_OSSBASE + 3)    /* ÄÚ´æ¹ÜÀí         */

+#define SUBMDL_SYSM             (SUBMDL_OSSBASE + 4)    /* SYSMÄ£¿é         */

+#define SUBMDL_TIMER            (SUBMDL_OSSBASE + 5)    /* ¶¨Ê±Æ÷Ä£¿é       */

+#define SUBMDL_EXCEP            (SUBMDL_OSSBASE + 6)    /* Òì³£´¦Àí         */

+#define SUBMDL_NET              (SUBMDL_OSSBASE + 7)    /* NETÄ£¿é          */

+#define SUBMDL_FS               (SUBMDL_OSSBASE + 8)    /* Îļþ´úÀíÄ£¿é     */

+#define SUBMDL_TRACE            (SUBMDL_OSSBASE + 9)    /* traceÄ£¿é        */

+#define SUBMDL_TEST             (SUBMDL_OSSBASE + 10)   /* testÄ£¿é         */

+#define SUBMDL_EVENT            (SUBMDL_OSSBASE + 11)   /* EventÄ£¿é        */

+#define SUBMDL_NV               (SUBMDL_OSSBASE + 12)   /* NV´úÀíÄ£¿é       */

+#define SUBMDL_SHELL            (SUBMDL_OSSBASE + 13)   /* SHELL´úÀíÄ£¿é    */

+#define SUBMDL_AMT              (SUBMDL_OSSBASE + 14)   /* AMT´úÀíÄ£¿é      */

+

+/* ЭÒéÕ»²âÊÔ¹¤¾ßÄ£¿éºÅ */

+#define SUBMDL_PTE              (SUBMDL_OSSBASE + 15) 

+

+/* DRV´òÓ¡Ä£¿éºÅ */

+#define SUBMDL_DRVBASE          (25)

+#define SUBMDL_DAL              (SUBMDL_DRVBASE + 0)    /* DALÄ£¿é  */

+#define SUBMDL_DD               (SUBMDL_DRVBASE + 1)    /* DDÄ£¿é   */

+#define SUBMDL_HAL              (SUBMDL_DRVBASE + 2)    /* HALÄ£¿é  */

+#define SUBMDL_MUX              (SUBMDL_DRVBASE + 3)    /* MUXÄ£¿é  */

+

+#define SUBMDL_IMS              (31)                    /* IMSÐÅÁîÄ£¿é */

+

+/* MULTIMEDIA´òÓ¡Ä£¿éºÅ */

+#define SUBMDL_MMBASE           (60)

+/* MONITOR¸ú×ÙÄ£¿éºÅ */

+#define SUBMDL_MONAGENT         (128)

+

+#define SUBMDL_Z_EXTMOD         (BYTE)0xff

+#define SUBMDL_ZPS_EXTMOD       SUBMDL_Z_EXTMOD

+

+/* FALSE/TRUE¶¨Òå */

+#ifndef _OS_WIN

+#ifdef  TRUE

+#undef  TRUE

+#endif

+#define TRUE    (BOOL)1

+            

+#ifdef  FALSE

+#undef  FALSE

+#endif

+#define FALSE   (BOOL)0

+

+/* ×î´óÖµ/×îСֵ¶¨Òå */

+#ifdef _OS_LINUX

+# define oss_max(a,b)   (((a) > (b)) ? (a) : (b))

+# define oss_min(a,b)   (((a) < (b)) ? (a) : (b))

+#else

+# define max(a,b)       (((a) > (b)) ? (a) : (b))

+# define min(a,b)       (((a) < (b)) ? (a) : (b))

+#endif

+

+#endif

+

+#ifdef _DEBUG

+# define ZOSS_FILE __FILE__

+# define ZOSS_LINE __LINE__

+#else

+# define ZOSS_FILE NULL

+# define ZOSS_LINE 0

+#endif

+

+#define ___str(x)   #x

+#define __str(x)    ___str(x)

+

+#define ZOSS_UNUSED_PARAM(_name_)   _name_ = _name_;

+#define ZOSS_UNUSED_PTR(_name_)     if (_name_) _name_ = _name_;

+#define ZOSS_MACRO_START            do {

+#define ZOSS_MACRO_END              } while (0)

+

+#define ALIGN_TO(base, align)       ((base + (align - 1)) & ~(align - 1))

+#ifndef _OS_LINUX

+#define ARRAY_SIZE(array)           (sizeof(array)/sizeof(array[0]))

+#endif

+#define ARRAY_START(array)          (&array[0])

+#define ARRAY_END(array)            (&array[sizeof(array)/sizeof(array[0])])

+

+/* 1¸öϵͳµÎ´ðËùÐèµÄºÁÃëÊý */

+#if defined _OS_TOS

+# define ZOSS_MS_PER_TICK   (CYGNUM_HAL_RTC_PERIOD / 1000)   

+#elif defined _OS_OSE

+# define ZOSS_MS_PER_TICK   (system_tick() / 1000) 

+#elif defined _OS_WIN

+# define ZOSS_MS_PER_TICK   1

+#elif defined _OS_LINUX

+# define ZOSS_MS_PER_TICK   1

+#endif

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+/* »ù±¾ÀàÐÍ */

+typedef signed char         SINT8;

+typedef unsigned char       UINT8;

+typedef short               SINT16;

+typedef unsigned short      UINT16;

+typedef long                SINT32;

+typedef UINT8               BITS;

+

+#ifndef _OS_WIN

+typedef unsigned long       UINT32;

+typedef unsigned long long  UINT64;

+typedef long long           SINT64;

+typedef float               FLOAT;

+typedef double              DOUBLE;

+typedef int                 BOOL;

+

+#ifndef VOID

+#define VOID                void

+#endif

+

+#ifndef CHAR

+#define CHAR                char

+#endif

+ 

+typedef UINT32              SSIZE_T;

+typedef UINT8               BYTE;

+typedef SINT16              SHORT;

+typedef SINT32              LONG;

+typedef UINT16              WORD;

+typedef UINT32              DWORD;

+typedef UINT32              HANDLE;

+typedef SINT8               *PSTR;

+typedef UINT8               *PBYTE;

+typedef UINT16              *PWORD;

+typedef UINT32              *PDWORD;

+typedef VOID                *PVOID;

+typedef UINT32              *PHANDLE;

+#else 

+typedef __int64             SINT64;  

+typedef unsigned __int64    UINT64;

+typedef int                 mode_t; 

+#endif

+

+#if defined (_OS_TOS) || defined(_OS_LINUX)

+typedef SINT8   S8;

+typedef UINT8   U8;

+typedef SINT16  S16;

+typedef UINT16  U16;

+typedef SINT32  S32; 

+typedef UINT32  U32;

+

+typedef UINT32  PROCESS;

+typedef UINT32  OSADDRESS;

+typedef UINT8   OSPRIORITY;

+typedef UINT32  OSTIME;

+typedef UINT32  SIGSELECT;

+typedef UINT16  OSVECTOR;

+typedef UINT32  OSUSER;

+

+typedef VOID (OSENTRYPOINT)(VOID);

+

+enum PROCESS_TYPE 

+{

+    OS_PRI_PROC = 0,

+    OS_BG_PROC  = 64,

+    OS_INT_PROC = 128,

+    OS_TI_PROC  = 256,

+    OS_PHANTOM  = 512,

+    OS_BLOCK    = 1024,

+    OS_ZOOMBIE  = 2048,

+    OS_ILLEGAL  = 4096

+};

+

+struct OS_redir_entry

+{

+    SIGSELECT   sig;

+    PROCESS     pid;

+};

+#endif

+

+#ifdef _OS_LINUX

+typedef struct {

+    int quot;   /* quotient  */

+    int rem;    /* remainder */

+} div_t;

+#endif

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/ 

+SINT32 zOss_GetLastError(VOID);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_PUB_H */

+

+

diff --git a/cp/ps/plat/inc/oss/oss_sup.h b/cp/ps/plat/inc/oss/oss_sup.h
new file mode 100755
index 0000000..686c318
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_sup.h
@@ -0,0 +1,971 @@
+/**

+ * @file oss_sup.h

+ * @brief ossÄ£¿é¸½¼Ó¹¦ÄÜ

+ *

+ * Copyright (C) 2017 Sanechips Technology Co., Ltd.

+ * 

+ * 

+ */

+

+#ifndef _OSS_SUP_H

+#define _OSS_SUP_H

+

+/*******************************************************************************

+ *                           Include header files                              *

+ ******************************************************************************/

+#include "ramdump.h"

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+

+/*******************************************************************************

+ *                             Macro definitions                               *

+ ******************************************************************************/

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/* ÉèÖûò»ñȡʼþÊôÐÔ */

+#define ZOSS_EVENTS_OR              0x00

+#define ZOSS_EVENTS_AND             0x01

+#define ZOSS_EVENTS_OR_CLEAR        0x02

+#define ZOSS_EVENTS_AND_CLEAR       0x03

+

+/* ÉèÖûص÷º¯ÊýÀàÐÍ */

+#define ZOSS_SETHOOKFLAG_MONI       0x01         /* ÏûÏ¢¼à¿Ø                 */

+#define ZOSS_SETHOOKFLAG_TRACK      0x02         /* ÏßÐÔ¸ú×Ù                 */

+#define ZOSS_SETHOOKFLAG_INTER      0x03         /* ÏûÏ¢½Ø»ñ                 */

+#define ZOSS_SETHOOK_SEND           0x01         /* zOss_SendMsgÏûÏ¢À©Õ¹     */

+#define ZOSS_SETHOOK_SEND_DATA      0x02         /* zOss_SendMsgÏûÏ¢À©Õ¹     */

+#define ZOSS_SETHOOK_GET_ALL_ID     0x03         /* zOss_GetAllTaskIDÀ©Õ¹    */

+#define ZOSS_SETHOOK_GET_ID         0x04         /* zOss_GetTaskIDÀ©Õ¹       */

+#define ZOSS_SETHOOK_GET_NAME       0x05         /* zOss_GetTaskNameÀ©Õ¹     */

+

+/* ÈÎÎñÏûϢ״̬ */

+#define ZOSS_MSGSENDTYPE_MSG        0x01         /* ·¢ËÍÏûÏ¢                 */

+#define ZOSS_MSGSENDTYPE_DATA       0x02         /* ·¢ËÍÊý¾Ý                 */

+#define ZOSS_MSGSENDTYPE_INTER      0x03         /* ÔÚÖжÏÖз¢ËÍ             */

+#define ZOSS_MSGSENDTYPE_TIMER      0x04         /* ¶¨Ê±Æ÷ÏûÏ¢               */

+

+/* ÈÎÎñ״̬»ú */

+#define ZOSS_STATUS_INIT            0x01         /* ³õʼ̬                   */

+#define ZOSS_STATUS_WORK            0x02         /* ¹¤×÷̬                   */

+#define ZOSS_STATUS_IDLE            0x03         /* ¿ÕÏÐ̬                   */

+#define ZOSS_STATUS_USERBASE        0x04         /* Óû§×´Ì¬×Ô¶¨Òå           */

+

+/* ÈÎÎñÔËÐÐ״̬ */

+#define ZOSS_STATE_STOPPED          0x01         /* ÈÎÎñÔÝÍ£                 */

+#define ZOSS_STATE_IDLE             0x02         /* ÈÎÎñ¿ÕÏÐ                 */

+#define ZOSS_STATE_READY            0x03         /* ÈÎÎñ¾ÍÐ÷                 */

+#define ZOSS_STATE_RUN              0x04         /* ÈÎÎñÔËÐÐ                 */

+

+/* ÏûÏ¢²¶»ñ·½Ïò */

+#define ZOSS_MSGDIRE_IN             0x01         /* ÊäÈëÏûÏ¢²¶»ñ             */

+#define ZOSS_MSGDIRE_OUT            0x02         /* Êä³öÏûÏ¢²¶»ñ             */

+#define ZOSS_MSGDIRE_INOUT          0x03         /* Ë«Ïò²¶»ñ                 */

+

+/* ÏûÏ¢·¢ËÍÓÅÏȼ¶ */

+#define ZOSS_QUEUE_MSG_PRI_NORMAL   0x00         /* normal priority message£¬¼´·Åµ½ÏûÏ¢¶ÓÁÐβ */

+#define ZOSS_QUEUE_MSG_PRI_URGENT   0x01         /* urgent priority message£¬¼´·Åµ½ÏûÏ¢¶ÓÁÐÊ× */

+

+/* ÅäÖòÎÊý×î´ó³¤¶È */

+#define MAX_EVENTNAME_LEN           63          /* ʼþ×éÃû³Æ×î´ó³¤¶È       */

+#define MAX_QUEUENAME_LEN           63          /* ×î´óÏûÏ¢¶ÓÁÐÃû³¤¶È       */ 

+#define ZOSS_MAX_TASKNAME_LEN       63          /* ÈÎÎñÃû³¤¶È               */

+#define SHELL_CMD_LENGTH            31          /* shellÃüÁîµÄ×î´ó³¤¶È      */

+#define SHELL_CMD_PARAM_NUM         12          /* shellÃüÁî²ÎÊýµÄ×î´ó¸öÊý  */

+#define SHELL_CMD_PARAM_LENGTH      23          /* shellÃüÁî²ÎÊýµÄ×î´ó³¤¶È  */

+

+/* ´òÓ¡ */

+#define zOss_Printf                 zTools_Printf

+#define PRINT_LEVEL_ALLWAYS         0x00        /* ±¾¼¶±ð×ÜÊÇ´òÓ¡                   */

+#define PRINT_LEVEL_DEBUG           0x01        /* µ÷ÊÔ¼¶±ð                         */

+#define PRINT_LEVEL_NORMAL          0x02        /* ÆÕͨ¼¶±ð                         */

+#define PRINT_LEVEL_SEVERE          0x03        /* ÑÏÖØ¼¶±ð                         */

+#define PRINT_LEVEL_ABNORMAL        0x04        /* Òì³£¼¶±ð                         */

+#define PRINT_LEVEL_RAM             0x05        /* ´òÓ¡µ½ÄÚ´æ,½öÔÚ´òÓ¡´úÀíÖÐʹÓà    */

+#define PRINT_LEVEL_FORBID          0xff        /* ²»´òÓ¡                           */

+

+/* NV ECC*/

+#define ZOSS_NV_ECC_LOG_NR          (6)

+#define ZOSS_NV_ECC_WORK            (1)

+#define ZOSS_NV_ECC_BACKUP          (2)

+#define ZOSS_NV_ECC_BOTH            (3)

+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS

+

+/*******************************************************************************

+ *                             Type definitions                                *

+ ******************************************************************************/

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/* Ë«ÏòÁ´±íÄ£¿é */

+typedef struct tag_NODE        

+{

+    struct tag_NODE *next;      

+    struct tag_NODE *previous;  

+}T_ZOss_Node;

+

+typedef struct              

+{

+    SINT32      count;             

+    T_ZOss_Node *HEAD;

+    T_ZOss_Node *TAIL;

+}T_ZOss_List;

+

+/* »·Ðλº³åÄ£¿é */

+typedef struct     

+{

+    SINT32  pToBuf;     /* offset from start of buffer where to write next  */

+    SINT32  pFromBuf;   /* offset from start of buffer where to read next   */

+    SINT32  bufSize;    /* size of ring in bytes                            */

+    CHAR    *buf;       /* pointer to start of buffer                       */

+}T_ZOss_Ring, *T_ZOss_RingId;

+

+/* ¶¨Ê±Æ÷¹ÜÀíÄ£¿é 20130415ÒÆÖÁosa.h*/

+

+/* ITCÄ£¿é 20130523 ɾ³ý*/

+

+/* ramdump ¹Ò½Óº¯ÊýÀàÐÍ */

+typedef VOID (*T_zOss_RamdumpHookFunc)(VOID); 

+

+/* ÏûÏ¢¹ÜÀíÄ£¿é */

+typedef struct

+{

+    T_ZOss_Node     node;

+    ZOSS_TASK_ID    t_task_id;      /* Ä¿±êÈÎÎñID   */

+    ZOSS_TASK_ID    s_task_id;      /* Ô´ÈÎÎñID     */

+    UINT32          msgID;          /* ÏûÏ¢ID       */

+    UINT16          msgLen;         /* ÏûÏ¢Ì峤¶È   */

+    UINT8           send_state;     /* ÏûÏ¢·¢ËÍ״̬ */

+}T_ZOss_TaskMsgHead;                /* ÏûϢͷ       */

+

+typedef struct

+{

+    VOID    *msgbuf;

+    UINT16  msgLenEX;

+}T_ZOss_TaskMsg;        /* ÏûÏ¢Ìå */

+

+typedef UINT32 (*TASK_SEND_HOOK)(T_ZOss_TaskMsgHead *buf, UINT8 dire);

+

+/* ÈÎÎñ¹ÜÀíÄ£¿é */                    

+typedef VOID (*FUNC_TASKENTRY)(UINT8 state, UINT32 msg_id, UINT8 *buf, UINT16 msg_len, UINT8 *private_data);

+

+typedef struct struTCB

+{

+    T_ZOss_Node     node;                                   /* Ë«ÏòÁ´±í½áµã                             */

+    UINT32          type;                                   /* Çø·ÖÊÇ·ñSDLÈÎÎñ                          */

+    UINT32          count;                                  /* ÈÎÎñÖ´ÐеĴÎÊý                           */

+    CHAR            task_name[ZOSS_MAX_TASKNAME_LEN + 1];   /* ÈÎÎñÃû,³¤¶È×î´ó63                        */

+    FUNC_TASKENTRY  taskEntry;                              /* ÈÎÎñÈë¿Ú                                 */

+    TASK_SEND_HOOK  HookEntry[3];                           /* »Øµ÷º¯Êý                                 */

+    ZOSS_TASK_ID    task_id;                                /* ÈÎÎñID                                   */

+    ZOSS_TASK_ID    sender_task_id;                         /* ÏûÏ¢Ô´ÈÎÎñID                             */

+    ZOSS_THREAD_ID  thread_id;                              /* ËùÔÚÏß³ÌID                               */

+    T_ZOss_List     msg_queue;                              /* ÈÎÎñÏûÏ¢¶ÓÁÐÁ´±í                         */

+    UINT32          stack_size;                             /* ¶ÑÕ»´óС                                 */

+    UINT32          priority;                               /* ÈÎÎñÓÅÏȼ¶(0-31)                         */

+    UINT32          private_data_len;                       /* ˽ÓÐÊý¾Ý³¤¶È                             */

+    UINT32          time;                                   /* ÈÎÎñ´´½¨Ê±¼ä                             */

+    UINT32          stack_used;                             /* ÒÑÓöÑÕ»´óС                             */

+    UINT32          task_time;                              /* ÈÎÎñ¿ªÊ¼Ê±¼ä                             */

+    UINT32          msg_id;                                 /* µ±Ç°ÈÎÎñÏûÏ¢ID                           */

+    UINT8           dire[4];                                /* ÏûÏ¢²¶»ñ·½Ïò                             */

+    UINT8           thread_no;                              /* Ï̺߳Š                                  */

+    UINT8           run_status;                             /* ÔËÐÐ×´¿ö                                 */

+    UINT8           state;                                  /* ÈÎÎñ״̬                                 */

+    UINT8           *taskData;                              /* ÈÎÎñÊý¾ÝÇøÖ¸Õë                           */

+    struct struTCB  *next;

+    UINT32          cputime;                                /* ÈÎÎñÔËÐÐcpuʱ¼ä                          */

+    FLOAT           cpupercent;                             /* ÈÎÎñcpuÕ¼ÓÃÂÊ                            */

+    UINT32          runtime;                                /* ÈÎÎñÔËÐÐʱ¼ä                             */

+    UINT32          malloc_size;                            /* ÈÎÎñËùÓÃmalloc´óС                       */

+    UINT32          ub_size;                                /* ÈÎÎñËùÓÃÄÚ´æ³Ø´óС                       */

+    UINT8           reserved[4];                            /* ±£Áô룬µÚÒ»¸ö×Ö½ÚΪϵͳ¾²Ì¬ÈÎÎñ±ê־λ   */

+}T_ZOss_TCB;                      /* ÈÎÎñ¿ØÖÆ¿é */

+

+typedef struct 

+{

+    UINT8           is_use;

+    CHAR            task_name[ZOSS_MAX_TASKNAME_LEN + 1];

+    FUNC_TASKENTRY  task_entry;

+    UINT32          priority;

+    UINT32          stack_size;

+    UINT32          private_data_len;

+    UINT8           process_no;

+    UINT8           ack_flag;

+#ifdef _USE_HAL_HRDTST

+    BOOL            hardTestFlag;

+#endif

+}T_ZOss_TaskTabItem;    /* ÈÎÎñµÇ¼Ç±í */

+

+/* SDLÈÎÎñ */

+typedef struct 

+{

+    T_ZOss_Node     node;           /* ±£Áô             */

+    UINT32          type;           /* Çø·ÖÊÇ·ñSDLÈÎÎñ  */

+    SINT32          index;          /* Ë÷Òý             */

+    UINT32          self_id;

+    ZOSS_THREAD_ID  thread_id;      /* ËùÔÚÏß³ÌID       */

+    VOID            *self;

+    TASK_SEND_HOOK  HookEntry[3];   /* »Øµ÷º¯Êý         */

+    UINT8           dire[4];        /* ÏûÏ¢²¶»ñ·½Ïò     */

+}T_ZOss_SDLTCB;                     /* SDLÈÎÎñ¿ØÖÆ¿é    */    

+

+typedef struct signalcode_desc 

+{

+    UINT32  selfid;

+    CHAR    task_name[ZOSS_MAX_TASKNAME_LEN + 1];

+} T_ZOss_SignalCode_Desc;

+

+typedef struct 

+{

+    UINT32          selfid;

+    ZOSS_TASK_ID    task_id;

+}tasksdl_desc;

+/* shellÃüÁî */

+typedef struct 

+{

+    CHAR    cmd[SHELL_CMD_LENGTH + 1];                              /* ÃüÁî×Ö·û´®³¤¶È       */

+    CHAR    para[SHELL_CMD_PARAM_NUM][SHELL_CMD_PARAM_LENGTH + 1];  /* ²ÎÊý                 */

+    UINT32  paraCount;                                              /* ²ÎÊý¸öÊý             */

+}T_Shell_CommandMessage;                                            /* sehllÃüÁîÏûÏ¢½á¹¹Ìå  */

+

+typedef VOID (*Shell_Func)(T_Shell_CommandMessage *CmdMsg);         /* shellÃüÁîʵÏÖº¯ÊýÖ¸Õë */

+

+/* ¶¯Ì¬ÅäÖÃÀàÐͶ¨Òå */

+typedef struct 

+{

+    UINT8 (*pPrioMap)[32];

+}T_OSA_PARAM;

+

+typedef struct 

+{

+    UINT32          ub_pool_num;    /* ÄÚ´æ³Ø¸öÊý, ×î´ó²»Äܳ¬¹ý255  */

+    T_ZOss_UBPOOL   *UBPool;        /* ÄÚ´æ³ØÅäÖñíÖ¸Õë             */

+}T_MEM_PARAM;                       /* ÄÚ´æÄ£¿é                     */

+

+typedef struct 

+{

+    UINT32  max_task_num;           /* ×î´óÈÎÎñÊý                   */

+    UINT32  max_schthread_num;      /* µ÷¶ÈÏß³ÌÊý£¬×î¶à10           */

+    UINT32  max_msg_queue_len;      /* ÈÎÎñÏûÏ¢¶ÓÁг¤¶È             */

+    UINT32  deadloop_time;          /* ËÀÑ­»·ÅжÏʱ¼ä, µ¥Î»s        */

+}T_TASK_PARAM;                      /* ÈÎÎñÄ£¿é                     */

+

+typedef struct 

+{

+    UINT32  SchPrio;                /* ¶¨Ê±Æ÷µ÷¶ÈÏß³ÌÓÅÏȼ¶0-9                                              */

+    UINT32  CallBackStack;          /* ¶¨Ê±Æ÷»Øµ÷º¯ÊýÏ̶߳ÑÕ»                                               */

+    UINT32  CallBackPrio;           /* ¶¨Ê±Æ÷»Øµ÷º¯ÊýÏß³ÌÓÅÏȼ¶£¬±ØÐëµÍÓÚµ÷¶ÈÏß³ÌÓÅÏȼ¶£¬Ò»°ãΪSchPrio+1    */

+    UINT32  MinTimeLen;             /* ¶¨Ê±Æ÷×îСµÄ³¬Ê±Ê±¼ä,µ¥Î»ºÁÃë                                        */

+    UINT32  MaxTimeNum;             /* ×î´ó¶¨Ê±Æ÷¸öÊý                                                       */

+}T_TIMER_PARAM;                     /* ¶¨Ê±Æ÷Ä£¿é                                                           */

+

+typedef struct 

+{

+    UINT32  DeadLoopCheckTime;      /* ËÀÑ­»·¼ì²éʱ¼ä                   */

+    UINT32  UpdateCPUTime;          /* Ë¢ÐÂCPUʹÓÃÂÊʱ¼ä                */

+    UINT32  DeamonStartTime;        /* ϵͳ³õʼ»¯ºóExcepÈÎÎñÆô¶¯µÄʱ¼ä  */

+}T_EXCEP_PARAM;                     /* Ò쳣ģ¿é                         */

+

+typedef struct 

+{

+    T_ZOss_TaskTabItem  *pSysm_TaskItemTab;

+    UINT32              task_num;

+}T_SYSM_PARAM;  /* sysmÄ£¿é */

+

+typedef struct 

+{

+    UINT32  *pNvAddrCfg;

+    UINT32  addrCfgNum;

+    VOID    *pRevNvCfg;

+    UINT32  revNvCfgNum;

+    UINT32  NV_Work_Area_Base_Addr;       /* NV¹¤×÷Çø»ùµØÖ·       */

+    UINT32  NV_Start_Backup_Base_Addr;    /* ±¸·Ý¿éµÄÆðʼµØÖ·     */

+    UINT32  NV_Backup_Area_Base_Addr;     /* NV±¸·ÝÇø»ùµØÖ·       */    

+    UINT32  NV_Backup_Area_Size;          /* NV±¸·ÝÇø´óС         */

+    UINT32  NV_Factory_Area_Base_Addr;    /* NV³ö³§Çø»ùµØÖ·       */

+    UINT32  NV_Factory_Area_Size;         /* NV³ö³§Çø´óС         */

+    UINT32  NV_Work_Area_Symbol_Addr;     /* ¹¤×÷ÇøÐ´±ê־λµØÖ·   */

+    UINT32  NV_Backup_Area_Symbol_Addr;   /* ±¸·ÝÇøÐ´±ê־λµØÖ·   */

+    UINT32  NV_Factory_Area_Symbol_Addr;  /* ³ö³§Çø±ê־λµØÖ·     */

+    UINT32  NV_Reset_Factory_Symbol_Addr; /* »Ö¸´³ö³§ÉèÖñêÖ¾µØÖ· */

+    UINT32  NV_Ecc_log_Addr;              /* Ecc Log¹¤×÷ÇøµØÖ·    */

+    UINT32  NV_Block_Size;                /* ¿é´óС               */

+}T_NVRAM_PARAM;                           /* NVRAMÇøÓòµØÖ·ÐÅÏ¢    */

+

+typedef struct

+{

+    UINT8  count;

+    UINT8  index;

+    UINT8  type[ZOSS_NV_ECC_LOG_NR];

+    UINT32 tick[ZOSS_NV_ECC_LOG_NR];

+    UINT32 addr[ZOSS_NV_ECC_LOG_NR];

+}T_ZOss_NvEccLog;

+

+typedef struct

+{

+    UINT32  Work_Area_Base_Addr;       /* vSIM¹¤×÷Çø»ùµØÖ·   */

+    UINT32  Backup_Area_Base_Addr;     /* vSIM±¸·ÝÇø»ùµØÖ·   */    

+    UINT32  Factory_Area_Base_Addr;    /* vSIM³ö³§Çø»ùµØÖ·   */

+    UINT32  Area_Size;                 /* vSIMµ¥¸öÇø´óС     */

+    UINT32  Work_Area_Symbol_Addr;     /* ¹¤×÷ÇøÐ´±ê־λµØÖ· */

+    UINT32  Backup_Area_Symbol_Addr;   /* ±¸·ÝÇøÐ´±ê־λµØÖ· */

+    UINT32  Factory_Area_Symbol_Addr;  /* ³ö³§Çø±ê־λµØÖ·   */

+}T_vSIM_PARAM;

+

+typedef struct 

+{

+    CHAR    WinDisk[4];    /* windowsÅÌ·û      */

+    CHAR    LinuxPath[20]; /* ÀàlinuxÉ豸Ãû    */

+    CHAR    Format[20];    /* ÎļþϵͳÀàÐÍ     */

+    CHAR    Device[20];    /* É豸Ãû           */

+    CHAR    Params[100];   /* Ïà¹Ø²ÎÊý         */

+    CHAR    Manager[40];   /* ¹ÜÀíÏß³ÌÃû       */

+}T_OSA_DISKMAP;

+

+typedef struct 

+{

+    T_OSA_DISKMAP   *diskMap;

+    UINT32          diskNum;

+}T_DISK_PARAM;

+

+typedef VOID (*ramdump_Hook)(VOID);

+

+typedef struct

+{

+    ramdump_Hook ramdump_Process_PreHook;

+    ramdump_Hook ramdump_Process_AftHook;

+}T_zOss_RamdumpOpt;

+

+

+typedef VOID (*ramdump_IoInit)(VOID);

+typedef VOID (*ramdump_IoReadData)(UINT8 *buffer, UINT32 size);

+typedef VOID (*ramdump_IoWriteData)(UINT8 *buffer, UINT32 size);

+typedef VOID (*ramdump_IoFinish)(VOID);

+

+typedef struct

+{

+    ramdump_IoInit      init;

+    ramdump_IoReadData  read;

+    ramdump_IoWriteData write;

+    ramdump_IoFinish    finish;

+} T_zOss_RamdumpIoOpt;

+

+typedef struct

+{

+    UINT32  baseForServer;

+    UINT32  baseForSelf;

+    UINT32  baseForCopy;

+    UINT32  size;

+} T_zOss_RamdumpRegion;

+

+typedef struct 

+{

+    T_OSA_PARAM     OsaCfg;     /* osaÅäÖÃ              */

+    T_DISK_PARAM    DiskMap;    /* ´ÅÅÌÓ³ÉäÅäÖà         */

+    T_MEM_PARAM     MemCfg;     /* ÄÚ´æÅäÖà             */

+    T_TASK_PARAM    TaskCfg;    /* ÈÎÎñÅäÖà             */

+    T_TIMER_PARAM   TimerCfg;   /* ¶¨Ê±Æ÷ÅäÖà           */

+    T_EXCEP_PARAM   ExcepCfg;   /* Òì³£ÅäÖà             */

+    T_SYSM_PARAM    SysmCfg;    /* sysmtÅäÖÃ            */

+    T_NVRAM_PARAM   NvramCfg;   /* NvÅäÖÃ               */

+    T_vSIM_PARAM    vSIMCfg;    /* vSimÅäÖÃ             */

+#ifdef _USE_PSM

+#ifdef _USE_PSM_NEW_FRAMEWORK

+    T_zPsm_Param    PsmCfg;     /* PsmÅäÖÃ              */

+#else

+    T_PSM_PARAM     PsmCfg;     /* PsmÅäÖÃ              */

+#endif

+#endif

+}T_OSS_PARAM;                   /* Õû¸öOSS¶¯Ì¬ÅäÖÃÀàÐÍ  */

+

+typedef enum 

+{

+    SYS_RESET_TO_NORMAL,

+    SYS_RESET_TO_CHARGER,

+    SYS_RESET_TO_ALRAM,

+    SYS_RESET_TO_EXCEPTRESET,

+    SYS_MAX_RESET_TYPE,

+} T_ZOssSys_RESET_TYPE;

+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS

+

+/*******************************************************************************

+ *                       Global variable declarations                          *

+ ******************************************************************************/

+

+

+/*******************************************************************************

+ *                       Global function declarations                          *

+ ******************************************************************************/

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/* OSAÄ£¿é³õʼ»¯ */

+UINT32 OSA_Init(VOID);

+

+/* ϵͳ¹ÜÀíÄ£¿é */

+UINT32 zOss_Init(VOID);

+UINT32 zOss_TaskInit(VOID);

+UINT32 zOss_Start(VOID);

+VOID zOss_TaskStartOK(VOID);

+UINT32 zOss_SysPowerdown(VOID);

+VOID zOss_SysSoftReset(T_ZOssSys_RESET_TYPE type);

+T_OSS_PARAM *zOss_GetOssCfg(VOID);

+

+/* ÈÎÎñ¹ÜÀíÄ£¿é */

+UINT32 zOss_Task_HookSet(UINT8 type, VOID *HookFunc);

+ZOSS_TASK_ID zOss_CreateTask(const CHAR *task_name, FUNC_TASKENTRY task_entry, UINT32 stack_size, UINT32 priority, UINT32 private_data_len, UINT8 pno);

+UINT32 zOss_DeleteTask(ZOSS_TASK_ID task_id);

+UINT32 zOss_GetTaskInfo(ZOSS_TASK_ID task_id, T_ZOss_TCB *task_info);

+CHAR *zOss_GetTaskName(ZOSS_TASK_ID task_id);

+UINT32 zOss_GetAllTaskID(ZOSS_TASK_ID *task_id_arr);

+ZOSS_TASK_ID zOss_GetTaskID(const CHAR *task_name);

+ZOSS_TASK_ID zOss_GetSelfTaskID(VOID);

+UINT32 zOss_SetState(UINT8 next_state);

+UINT32 zOss_RegTaskSendHook(ZOSS_TASK_ID task_id, UINT8 hooktype, UINT8 dire, TASK_SEND_HOOK intercept_Entry);

+UINT32 zOss_TaskSend(UINT32 msg_id, const VOID *msg_buf, UINT16 msg_len, ZOSS_TASK_ID task_id);

+UINT32 zOss_TaskSendData(UINT32 msg_id, VOID *buf, UINT16 msg_len, ZOSS_TASK_ID task_id);

+ZOSS_TASK_ID zOss_Sender(VOID);

+

+/* ramdump */

+#ifdef _USE_MULTI_CORE_RAMDUMP

+VOID zOss_RamdumpSetOperation(T_zOss_RamdumpOpt *funcObjPtr);

+VOID zOss_RamdumpConfigureMem(T_zOss_RamdumpRegion *regionInfo);

+#else

+VOID zOss_RamdumpConfigureMem(UINT32 base, UINT32 size, UINT32 map_base, UINT32 copy_base);

+VOID zOss_RamdumpHookInstall(T_zOss_RamdumpHookFunc hook);

+#endif

+VOID zOss_RamdumpSetIoOpt(T_zOss_RamdumpIoOpt hook);

+

+/* NV²Ù×÷½Ó¿Ú */

+UINT32 zOss_NvItemWrite(UINT32 NvItemID, UINT8 *NvItemData, UINT32 NvItemLen);

+UINT32 zOss_NvItemRead(UINT32 NvItemID, UINT8 *NvItemData, UINT32 NvItemLen);

+UINT32 zOss_ResetNVFactory(VOID);

+UINT32 zOss_NvramFlush(VOID);

+VOID zOss_NvSetErrorAddr(UINT32 addr);

+BOOL zOss_NvInResume(VOID);

+VOID zOss_NvCheck(VOID);

+VOID zOss_NvWriteFactory(VOID);

+VOID zOss_NvScanBackUpArea(VOID);

+UINT32 zOss_NvGetEccLogInfo(T_ZOss_NvEccLog *logInfo);

+UINT32 zOss_ChangeNvroAttr(int writable);

+UINT32 Nvram_Flush(VOID);

+UINT32 Nvram_Finish(VOID);

+

+/* VSIM²Ù×÷½Ó¿Ú */

+UINT32 zOss_vSIMInit(VOID);

+UINT32 zOss_vSIMDataRead(UINT32 addr, VOID *data, UINT32 len);

+UINT32 zOss_vSIMDataWrite(UINT32 addr, VOID *data, UINT32 len);

+UINT32 zOss_vSIMFacWrite(VOID *data, UINT32 len);

+UINT32 zOss_vSIMRecovery(VOID);

+

+/* ´òÓ¡ */

+UINT32 zTools_Printf(UINT32 nModNo, UINT8 nPrintLevel, const VOID *pFormat, ...);

+VOID zOss_RamLog(CHAR *rambuf, UINT32 restrict);

+VOID zOss_RamPrintf(VOID);

+

+/* ά²â */

+UINT32 zOss_DebugInfoRecord(UINT32 id, const VOID *pFormat, ...);

+

+/* shellÄ£¿é */

+UINT32 zOss_AddShellCmd(const CHAR *cmd_name, const Shell_Func func, const CHAR *description);

+

+/* ¿´ÃŹ· */

+VOID zOss_WatchDogEnable(BOOL enable);

+

+/* CRCУÑé */

+UINT8 Comm_CrcCalc(const UINT8 *buf, UINT8 len);

+SINT32 Comm_CrcCheck(UINT8 *buf, UINT8 len, UINT8 crc);

+

+/* µãµÆÄ£¿é */

+VOID zOss_SetTransDataFlag(VOID);

+BOOL zOss_GetTransDataFlag(VOID);

+

+/* ʼþ×é */

+ZOSS_EVENT_ID zOss_CreateEvent(const CHAR *name);

+UINT32 zOss_GetEvent(ZOSS_EVENT_ID eventId, UINT32 events, UINT32 getOptions, UINT32 *pEventsReceived, UINT32 timeout);

+UINT32 zOss_SetEvent(ZOSS_EVENT_ID eventId, UINT32 events, UINT32 setOptions);

+UINT32 zOss_DeleteEvent(ZOSS_EVENT_ID eventId);

+UINT32 zOss_QueryEvent(ZOSS_EVENT_ID eventId);

+BOOL   zOss_WaitingEvent(ZOSS_EVENT_ID eventId);

+

+/* »·Ðλº³å */ 

+BOOL zOss_RingIsEmpty(T_ZOss_RingId ring_id); 

+BOOL zOss_RingIsFull(T_ZOss_RingId ring_id);

+T_ZOss_RingId zOss_RingCreate(SINT32 nbytes); 

+SINT32 zOss_RingBufGet(T_ZOss_RingId ring_id, CHAR *buffer, SINT32 maxbytes); 

+SINT32 zOss_RingBufPut(T_ZOss_RingId ring_id, CHAR *buffer, SINT32 nbytes);

+SINT32 zOss_RingFreeBytes(T_ZOss_RingId ring_id);

+SINT32 zOss_RingNBytes(T_ZOss_RingId ring_id);

+VOID zOss_RingDelete(T_ZOss_RingId ring_id);

+VOID zOss_RingFlush(T_ZOss_RingId ring_id);

+VOID zOss_RingMoveAhead(T_ZOss_RingId ring_id, SINT32 n);

+VOID zOss_RingPutAhead(T_ZOss_RingId ring_id, CHAR byte, SINT32 offset);

+

+/* ÏûÏ¢¶ÓÁÐ */

+ZOSS_QUEUE_ID zOss_QueueCreate(const CHAR *queue_name, UINT32 maxMsgs, UINT32 maxMsgLen);

+UINT32 zOss_QueueSend(ZOSS_QUEUE_ID queue_id, VOID *msg_ptr, UINT32 size, UINT32 timeout, UINT32 priority);

+UINT32 zOss_QueueRecv(ZOSS_QUEUE_ID queue_id, VOID *buffer, UINT32 maxsize, UINT32 timeout);

+UINT32 zOss_QueueFreeCount(ZOSS_QUEUE_ID queue_id);

+UINT32 zOss_QueueDelete(ZOSS_QUEUE_ID queue_id);

+

+/* ¹ÜµÀ */

+UINT32 zOss_PipeDevCreate(const CHAR *name, SINT32 nBytes);

+UINT32 zOss_PipeDevDelete(const CHAR *name, BOOL force);

+

+/* Cahce½Ó¿Ú */

+VOID zOss_CacheCleanRange(UINT32 base, UINT32 size);

+VOID zOss_CacheInvalidateRange(UINT32 base, UINT32 size);

+VOID zOss_CacheCleanRangeFast(UINT32 base, UINT32 size);

+VOID zOss_CacheInvalidateRangeFast(UINT32 base, UINT32 size);

+VOID zOss_IoRemapPages(VOID *base, UINT32 size);

+

+/* svÉèÖûñÈ¡½Ó¿Ú */

+UINT8 zOss_GetSvConfig(VOID);

+VOID zOss_SetSvConfig(UINT8 sv);

+

+/* ¶¨Ê±Æ÷¹ÜÀíÄ£¿é */

+#ifdef _USE_PSM

+VOID zOss_SetTimer_PsmFlag(ZOSS_TIMER_ID time_id, BOOL Flag);

+UINT32 zOss_GetPs_SleepTimer(VOID);

+#endif

+

+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS

+

+/**

+ * @brief ÉèÖ÷ÇÖÜÆÚÐÔÈÎÎñ¶¨Ê±Æ÷

+ * @param time_len  Èë²Î£¬Ê±³¤£¬µ¥Î»£ºms

+ * @param msg_id    Èë²Î£¬¶¨Ê±µ½ºó,·¢Ë͸øÉèÖö¨Ê±Æ÷ÈÎÎñµÄÏûÏ¢id

+ * @param arg       Èë²Î£¬¸½¼Ó²ÎÊý,¶¨´«µÝ¸øÈÎÎñÈë¿Úº¯ÊýµÄbufÐβδËʱmsg_lenֵΪ4(sizeof(UINT32/arg))

+ * @return ³É¹¦:ÏàÓ¦µÄ¶¨Ê±Æ÷±êʶ; ʧ°Ü:ZOSS_INVALID_TIMER_ID

+ * @retval ZOSS_TIMER_IDÀàÐ͵ıêʶ    ³É¹¦

+ * @retval ZOSS_INVALID_TIMER_ID      ʧ°Ü

+ * @note  ÉèÖÃʱ¿ÌΪ²Î¿¼µã,¾­¹ýÖ¸¶¨Ê±¼äºó, ÏòÉèÖö¨Ê±Æ÷µÄÈÎÎñ·¢ËÍÖ¸¶¨ÏûÏ¢²¢×Ô¶¯ÊͷŶ¨Ê±Æ÷ËùÕ¼×ÊÔ´

+ * @warning  ±ØÐèÔÚÈÎÎñÄÚµ÷ÓÃ

+ */

+ZOSS_TIMER_ID zOss_SetRelativeTimer(UINT32 time_len, UINT32 msg_id, UINT32 arg);

+

+/**

+ * @brief ÉèÖ÷ÇÖÜÆÚÐÔÈÎÎñ¶¨Ê±Æ÷ÏòÄ¿±êÈÎÎñ·¢ËÍÏûÏ¢

+ * @param time_len       Èë²Î£¬Ê±³¤£¬µ¥Î»£ºms

+ * @param msg_id         Èë²Î£¬¶¨Ê±µ½ºó,·¢Ë͸øÉèÖö¨Ê±Æ÷ÈÎÎñµÄÏûÏ¢id

+ * @param arg            Èë²Î£¬¸½¼Ó²ÎÊý,¶¨´«µÝ¸øÈÎÎñÈë¿Úº¯ÊýµÄbufÐβδËʱmsg_lenֵΪ4(sizeof(UINT32/arg))

+ * @param desk_task_id   Èë²Î£¬Ö¸¶¨Ä¿±êÈÎÎñ£¬Èç¹ûÄ¿±êÈÎÎñΪ¿Õʱ£¬½«·¢ËÍÉèÖö¨Ê±Æ÷µÄÈÎÎñ

+ * @return ³É¹¦:ÏàÓ¦µÄ¶¨Ê±Æ÷±êʶ; ʧ°Ü:ZOSS_INVALID_TIMER_ID

+ * @retval ZOSS_TIMER_IDÀàÐ͵ıêʶ    ³É¹¦

+ * @retval ZOSS_INVALID_TIMER_ID      ʧ°Ü

+ * @note 

+ * @warning 

+ */

+ZOSS_TIMER_ID zOss_SetRelativeTimerByTaskId(UINT32 time_len, UINT32 msg_id, UINT32 arg, ZOSS_TASK_ID desk_task_id);

+

+/**

+ * @brief ÉèÖÃÖÜÆÚÐÔÈÎÎñ¶¨Ê±Æ÷

+ * @param time_len  Èë²Î£¬Ê±³¤£¬µ¥Î»£ºms

+ * @param msg_id    Èë²Î£¬¶¨Ê±µ½ºó,·¢Ë͸øÉèÖö¨Ê±Æ÷ÈÎÎñµÄÏûÏ¢id

+ * @param arg       Èë²Î£¬¸½¼Ó²ÎÊý,¶¨´«µÝ¸øÈÎÎñÈë¿Úº¯ÊýµÄbufÐβδËʱmsg_lenֵΪ4(sizeof(UINT32/arg))

+ * @return ³É¹¦:ÏàÓ¦µÄ¶¨Ê±Æ÷±êʶ; ʧ°Ü:ZOSS_INVALID_TIMER_ID

+ * @retval ZOSS_TIMER_IDÀàÐ͵ıêʶ    ³É¹¦

+ * @retval ZOSS_INVALID_TIMER_ID      ʧ°Ü

+ * @note  ÉèÖÃʱ¿ÌΪ²Î¿¼µã,¾­¹ýÖ¸¶¨Ê±¼äºó, ÏòÉèÖö¨Ê±Æ÷µÄÈÎÎñ·¢ËÍÖ¸¶¨ÏûÏ¢²¢×Ô¶¯ÊͷŶ¨Ê±Æ÷ËùÕ¼×ÊÔ´

+ * @warning ±ØÐèÔÚÈÎÎñÄÚµ÷ÓÃ

+ */

+ZOSS_TIMER_ID zOss_SetLoopTimer(UINT32 time_len, UINT32 msg_id, UINT32 arg);

+

+/**

+ * @brief ÉèÖÃÖÜÆÚÐÔÈÎÎñ¶¨Ê±Æ÷ÏòÄ¿±êÈÎÎñ·¢ËÍÏûÏ¢

+ * @param time_len       Èë²Î£¬Ê±³¤£¬µ¥Î»£ºms

+ * @param msg_id         Èë²Î£¬¶¨Ê±µ½ºó,·¢Ë͸øÉèÖö¨Ê±Æ÷ÈÎÎñµÄÏûÏ¢id

+ * @param arg            Èë²Î£¬¸½¼Ó²ÎÊý,¶¨´«µÝ¸øÈÎÎñÈë¿Úº¯ÊýµÄbufÐβδËʱmsg_lenֵΪ4(sizeof(UINT32/arg))

+ * @param desk_task_id   Èë²Î£¬Ö¸¶¨Ä¿±êÈÎÎñ£¬Èç¹ûÄ¿±êÈÎÎñΪ¿Õʱ£¬½«·¢ËÍÉèÖö¨Ê±Æ÷µÄÈÎÎñ

+ * @return ³É¹¦:ÏàÓ¦µÄ¶¨Ê±Æ÷±êʶ; ʧ°Ü:ZOSS_INVALID_TIMER_ID

+ * @retval ZOSS_TIMER_IDÀàÐ͵ıêʶ    ³É¹¦

+ * @retval ZOSS_INVALID_TIMER_ID      ʧ°Ü

+ * @note  

+ * @warning 

+ */

+ZOSS_TIMER_ID zOss_SetLoopTimerByTaskId(UINT32 time_len, UINT32 msg_id, UINT32 arg, ZOSS_TASK_ID desk_task_id);

+

+/**

+ * @brief ´´½¨¶¨Ê±Æ÷º¯Êý

+ * @param tm_name        Èë²Î£¬¶¨Ê±Æ÷Ãû³Æ

+ * @param tm_callback    Èë²Î£¬¶¨Ê±µ½ºóÐèÒªµ÷ÓõĻص÷º¯Êý

+ * @param tm_param       Èë²Î£¬»Øµ÷º¯ÊýµÄÈë²Î

+ * @param bPeriod        Èë²Î£¬TRUE£ºÖÜÆÚÐÔ¶¨Ê±Æ÷£»FALSE£º·ÇÖÜÆÚÐÔ¶¨Ê±Æ÷

+ * @return ³É¹¦:ÏàÓ¦µÄ¶¨Ê±Æ÷±êʶ; ʧ°Ü:ZOSS_INVALID_TIMER_ID

+ * @retval ZOSS_TIMER_IDÀàÐ͵ıêʶ    ³É¹¦

+ * @retval ZOSS_INVALID_TIMER_ID      ʧ°Ü

+ * @note  ´´½¨ºÃÖ®ºó¿ÉÒÔµ÷ÓÃzOss_StartTimer()Æô¶¯¶¨Ê±Æ÷

+ * @warning 

+ */

+ZOSS_TIMER_ID zOss_CreateTimer(const CHAR *tm_name, ZOSS_TIMER_FUN tm_callback, SINT32 tm_param, BOOL bPeriod);

+

+/**

+ * @brief Æô¶¯¶¨Ê±Æ÷º¯Êý,Æô¶¯Ê±¿ÌΪ²Î¿¼µã,¾­¹ýÖ¸¶¨Ê±¼äºó,µ÷Óûص÷º¯Êý

+ * @param timer_id        Èë²Î£¬¶¨Ê±Æ÷id

+ * @param time_len        Èë²Î£¬¶¨Ê±Æ÷ʱ³¤£¬µ¥Î»£ºms

+ * @param tm_callback     Èë²Î£¬¶¨Ê±µ½ºóÒªµ÷ÓõĻص÷º¯Êý

+ * @param tm_param        Èë²Î£¬»Øµ÷º¯ÊýµÄÈë²Î

+ * @return ³É¹¦:ZOSS_SUCCESS;ʧ°ÜZOSS_ERROR

+ * @retval ZOSS_SUCCESS    ³É¹¦

+ * @retval ZOSS_ERROR      ʧ°Ü

+ * @note

+ * @warning  Èç¹û»Øµ÷º¯ÊýÖ´ÐÐʱ¼ä´óÓÚ¶¨Ê±Æ÷ʱ³¤,¿ÉÄÜ»áÔì³É´íÎó»ò¶¨Ê±Æ÷²»±»ÕýÈ·µ÷¶È

+ */

+UINT32 zOss_StartTimer(ZOSS_TIMER_ID timer_id, UINT32 time_len, ZOSS_TIMER_FUN tm_callback, SINT32 tm_param);

+

+/**

+ * @brief Í£Ö¹¶¨Ê±Æ÷¼ÆÊ±º¯Êý

+ * @param timer_id        Èë²Î£¬¶¨Ê±Æ÷id

+ * @return ³É¹¦:ZOSS_SUCCESS;ʧ°ÜZOSS_ERROR

+ * @retval ZOSS_SUCCESS    ³É¹¦

+ * @retval ZOSS_ERROR      ʧ°Ü

+ * @note 

+ * @warning 

+ */

+UINT32 zOss_StopTimer(ZOSS_TIMER_ID timer_id);

+

+/**

+ * @brief ÔÝÍ£Ö¸¶¨¶¨Ê±Æ÷µÄ¼ÆÊ±

+ * @param timer_id        Èë²Î£¬¶¨Ê±Æ÷id

+ * @return ³É¹¦:ZOSS_SUCCESS;ʧ°ÜZOSS_ERROR

+ * @retval ZOSS_SUCCESS    ³É¹¦

+ * @retval ZOSS_ERROR      ʧ°Ü

+ * @note  ÔÝÍ£µÄͬʱ¼Ç¼ÏÂÊ£ÓàµÄÏà¶Ôʱ¼ä£¬µ÷ÓÃzOss_ResumeTime()º¯Êýºó¼ÌÐø¼ÆÊ±£»

+                Èç¹û¶¨Ê±Æ÷ÕýÔÚ±»µ÷¶È,ÔòÖ´ÐÐÍ굱ǰµ÷¶ÈºóÔÝÍ£¼ÆÊ±¡£

+ * @warning 

+ */

+UINT32 zOss_PauseTimer(ZOSS_TIMER_ID timer_id);

+

+/**

+ * @brief ʹÔÝÍ£µÄ¶¨Ê±Æ÷¼ÌÐø¼ÆÊ±

+ * @param timer_id        Èë²Î£¬¶¨Ê±Æ÷id

+ * @return ³É¹¦:ZOSS_SUCCESS;ʧ°ÜZOSS_ERROR

+ * @retval ZOSS_SUCCESS    ³É¹¦

+ * @retval ZOSS_ERROR      ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_ResumeTimer(ZOSS_TIMER_ID timer_id);

+

+/**

+ * @brief ɾ³ýÖ¸¶¨µÄ¶¨Ê±Æ÷

+ * @param timer_id        Èë²Î£¬¶¨Ê±Æ÷id

+ * @return ³É¹¦:ZOSS_SUCCESS;ʧ°ÜZOSS_ERROR

+ * @retval ZOSS_SUCCESS    ³É¹¦

+ * @retval ZOSS_ERROR      ʧ°Ü

+ * @note  

+ * @warning 

+ */

+UINT32 zOss_KillTimer(ZOSS_TIMER_ID timer_id);

+

+/*******************************************************************************

+ *                      Inline function implementations                        *

+ ******************************************************************************/

+#ifndef DOXYGEN_SHOULD_SKIP_THIS

+/* Ë«ÏòÁ´±í */

+#if defined (_OS_TOS) || defined (_OS_LINUX)

+/**************************************************************************

+* º¯ÊýÃû³Æ:  zOss_ListInit

+* ¹¦ÄÜÃèÊö:  ³õʼ»¯Ë«ÏòÁ´±í

+* ²ÎÊý˵Ã÷£º

+             (IN)

+                pList:Á´±íÖ¸Õë

+             (OUT)

+* ·µ »Ø Öµ:

+**************************************************************************/

+static inline VOID zOss_ListInit(T_ZOss_List *pList)

+{

+    zOss_AssertExN(pList != NULL);

+

+    pList->HEAD  = NULL;

+    pList->TAIL  = NULL;

+    pList->count = 0;

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ:  zOss_ListCount

+* ¹¦ÄÜÃèÊö:  »ñÈ¡Á´±íÏÂ×ܹ²µÄ½ÚµãÊý

+* ²ÎÊý˵Ã÷£º

+             (IN)

+                pList:Á´±íÖ¸Õë

+             (OUT)

+* ·µ »Ø Öµ:  ½Úµã¸öÊý

+**************************************************************************/

+static inline SINT32 zOss_ListCount(T_ZOss_List *pList)

+{

+    return (pList->count);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListDelete

+* ¹¦ÄÜÃèÊö: ÒÆ³ýÁ´±íÖÐÖ¸¶¨µÄ½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pList:Á´±íÖ¸Õë

+                pNode:´ýɾ³ý½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ:

+**************************************************************************/

+static inline VOID zOss_ListDelete(T_ZOss_List *pList, T_ZOss_Node *pNode)

+{

+    if (pNode->previous != NULL)

+    {

+        pNode->previous->next = pNode->next;

+    }

+    else

+    {

+        pList->HEAD = pNode->next;

+    }

+

+    if (pNode->next != NULL)

+    {

+        pNode->next->previous = pNode->previous;

+    }

+    else

+    {

+        pList->TAIL = pNode->previous;

+    }

+

+    /* update node count */

+    pList->count--;

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListFirst

+* ¹¦ÄÜÃèÊö: »ñÈ¡Á´±íµÄÊ×½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pList:Á´±íÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ: ½ÚµãÖ¸Õë(µ±Á´±íÖÐûÓнڵãʱ£¬·µ»Ø¿Õ)

+**************************************************************************/

+static inline T_ZOss_Node* zOss_ListFirst(T_ZOss_List *pList)

+{

+    return (pList->HEAD);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListInsert

+* ¹¦ÄÜÃèÊö: ÏòÁ´±íÖ¸¶¨µÄ½Úµãºó²åÈë½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pList:Á´±íÖ¸Õë

+                pPrev:²åÈëµã½ÚµãÖ¸Õ룬µ±pPrevΪ¿Õʱ£¬±íʾ²åÈëµ½Á´±íÊ×λÖÃ

+                pNode:´ý²åÈëµÄ½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ:

+**************************************************************************/

+static inline VOID zOss_ListInsert (T_ZOss_List *pList, T_ZOss_Node *pPrev, T_ZOss_Node *pNode)

+{

+    T_ZOss_Node *pNext = NULL;

+

+    if (pPrev != NULL)

+    {

+        pNext = pPrev->next;    /* make prev node point fwd to new */

+        pPrev->next = pNode;

+    }

+    else

+    {

+     	pNext = pList->HEAD;    /* new node is to be first in list */

+    	pList->HEAD = pNode;

+    }

+

+    if (pNext != NULL)

+    {    	

+       pNext->previous = pNode; /* make next node point back to new */

+    }

+    else

+    {

+        pList->TAIL = pNode;    /* new node is to be last in list */

+    }

+

+    /* set pointers in new node, and update node count */

+    pNode->next     = pNext;

+    pNode->previous = pPrev;

+

+    pList->count++;

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListAdd

+* ¹¦ÄÜÃèÊö: ÏòÁ´±íβÌí¼Ó½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pList:Á´±íÖ¸Õë

+                pNode:´ýÌí¼Ó½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ:

+**************************************************************************/

+static inline VOID zOss_ListAdd (T_ZOss_List *pList, T_ZOss_Node *pNode)

+{

+    zOss_ListInsert(pList, pList->TAIL, pNode);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListLast

+* ¹¦ÄÜÃèÊö: »ñȡָ¶¨½ÚµãµÄºóÒ»½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pNode:Ö¸¶¨½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ: ½ÚµãÖ¸Õë(µ±Á´±íÖÐûÓнڵãʱ£¬·µ»Ø¿Õ)

+**************************************************************************/

+static inline T_ZOss_Node* zOss_ListLast(T_ZOss_List *pList)

+{

+    return (pList->TAIL);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListNext

+* ¹¦ÄÜÃèÊö: »ñȡָ¶¨½ÚµãµÄǰһ½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pNode:½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ: ½ÚµãÖ¸Õë(µ±´«Èë½ÚµãÊÇÁ´±í×îºóÒ»¸ö½Úµãʱ£¬·µ»Ø¿Õ)

+**************************************************************************/

+static inline T_ZOss_Node* zOss_ListNext(T_ZOss_Node *pNode)

+{

+    return (pNode->next);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListPrevious

+* ¹¦ÄÜÃèÊö: »ñȡָ¶¨½ÚµãµÄǰһ½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pNode:Ö¸¶¨½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ: ½ÚµãÖ¸Õë(µ±´«Èë½ÚµãÊÇÁ´±íµÚÒ»¸ö½Úµãʱ£¬·µ»Ø¿Õ)

+**************************************************************************/

+static inline T_ZOss_Node *zOss_ListPrevious(T_ZOss_Node *pNode)

+{

+    return (pNode->previous);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListNStep

+* ¹¦ÄÜÃèÊö: »ñÈ¡ÓëÖ¸¶¨½Úµã¼ä¸ônStepµÄ½Úµã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pNode:½ÚµãÖ¸Õë

+                nStep:¼ä¸ôÊý. ÕýÊý:²éÕÒnext½Úµã£¬¸ºÊý²éÕÒprevious½Úµã

+            (OUT)

+* ·µ »Ø Öµ: ½ÚµãÖ¸Õë(µ±ÔÚ¼ä¸ônStepÄÚµ½´ïÁ´±íβʱ£¬·µ»Ø¿Õ)

+**************************************************************************/

+static inline T_ZOss_Node *zOss_ListNStep(T_ZOss_Node *pNode, SINT32 nStep)

+{

+    int i       = 0;

+    

+    if (nStep > 0)

+    {

+        for (i = nStep; i > 0; i--)

+        {

+            pNode = pNode->next;

+            

+            if (pNode == NULL)

+            {

+                break;

+            }

+        }

+    }

+    else

+    {

+        for (i = nStep; i < 0; i++)

+        {

+            pNode = pNode->previous;

+            

+            if (pNode == NULL)

+            {

+                break;

+            }

+        }

+    }

+    return (pNode);

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListFind

+* ¹¦ÄÜÃèÊö: ²éÕÒÁ´±íÖеĽڵã

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pList:Á´±íÖ¸Õë

+                pNode:´ý²éÕÒ½ÚµãÖ¸Õë

+            (OUT)

+* ·µ »Ø Öµ: Á´±íÖÐÓÐÖ¸¶¨½Úµã:½ÚµãÔÚÁ´±íÖеÄË÷Òý(´Ó1¿ªÊ¼)£¬

+                        Á´±íÖÐÎÞÖ¸¶¨½Úµã:-1

+**************************************************************************/

+static inline SINT32 zOss_ListFind (T_ZOss_List *pList, T_ZOss_Node *pNode)

+{

+    T_ZOss_Node *pNextNode      = NULL;

+    int         iNodePosition   = 1;

+

+    pNextNode = zOss_ListFirst (pList);

+

+    while ((pNextNode != NULL) && (pNextNode != pNode))

+    {

+        iNodePosition++;

+        

+        pNextNode = zOss_ListNext (pNextNode);

+    }

+

+    if (pNextNode != NULL)

+    {

+        return (iNodePosition);

+    }

+    else

+    {

+        return (-1);

+    }

+}

+

+/**************************************************************************

+* º¯ÊýÃû³Æ: zOss_ListConnect

+* ¹¦ÄÜÃèÊö: ½«Á½¸öÁ´±íÁ´½ÓÔÚÒ»Æð

+* ²ÎÊý˵Ã÷£º

+            (IN)

+                pList1: Á´±í1

+                pList2: Á´±í2

+            (OUT)

+* ·µ»ØÖµ:

+* ˵Ã÷£º    ½«pList2Á´½Óµ½pList1β²¿£»pList2µÄÁ´±íÍ·ÄÚÈݲ»»á¸Ä±ä

+**************************************************************************/

+static inline VOID zOss_ListConnect(T_ZOss_List *pList1, T_ZOss_List *pList2)

+{

+    if (pList1->count == 0)

+    {

+        pList1->HEAD    = pList2->HEAD;

+        pList1->TAIL    = pList2->TAIL;

+    }

+    else

+    {

+        if (pList2->count != 0)

+        {

+            pList1->TAIL ->next     = pList2->HEAD;

+            pList2->HEAD->previous  = pList1->TAIL;

+            pList1->TAIL            = pList2->TAIL;

+        }

+    }

+    pList1->count += pList2->count;

+}

+#else

+VOID zOss_ListInit(T_ZOss_List *pList);

+T_ZOss_Node *zOss_ListFirst(T_ZOss_List *pList);

+T_ZOss_Node *zOss_ListLast(T_ZOss_List *pList);

+T_ZOss_Node *zOss_ListNext(T_ZOss_Node *pNode);

+T_ZOss_Node *zOss_ListPrevious(T_ZOss_Node *pNode);

+T_ZOss_Node *zOss_ListNStep(T_ZOss_Node *pNode, SINT32 nStep); 

+SINT32 zOss_ListCount(T_ZOss_List *pList); 

+SINT32 zOss_ListFind(T_ZOss_List *pList, T_ZOss_Node *pNode);

+VOID zOss_ListAdd(T_ZOss_List *pList, T_ZOss_Node *pNode);

+VOID zOss_ListDelete(T_ZOss_List *pList, T_ZOss_Node *pNode);

+VOID zOss_ListInsert(T_ZOss_List *pList, T_ZOss_Node *pPrev, T_ZOss_Node *pNode);

+VOID zOss_ListConnect(T_ZOss_List *pList1, T_ZOss_List *pList2);

+#endif

+

+#endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS

+

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  // #ifndef _OSS_SUP_H

diff --git a/cp/ps/plat/inc/oss/oss_trace.h b/cp/ps/plat/inc/oss/oss_trace.h
new file mode 100644
index 0000000..1ae7b7b
--- /dev/null
+++ b/cp/ps/plat/inc/oss/oss_trace.h
@@ -0,0 +1,90 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_trace.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : ¸ú×Ù¹¦ÄܵÄÍ·Îļþ

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-07-30

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_TRACE_H

+#define _OSS_TRACE_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+    

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+#if defined (_OS_OSE) || defined (_OS_TOS)

+# define OSS_TRACE_FUNC

+# define OSS_TRACE_THREAD

+#endif

+

+#ifndef _OS_WIN

+#if defined OSS_TRACE_FUNC

+# define ZOSS_TRACE_FUNC_START()                                \

+    {                                                           \

+        static VOID *td = NULL; /* Trace Descriptor */          \

+        oss_trace_func_start(&td, __FUNCTION__);

+

+# define ZOSS_TRACE_FUNC_END()                                  \

+        oss_trace_func_end(td);                                 \

+    }

+

+# define ZOSS_TRACE_FUNC_START_ALWAYS()                         \

+    {                                                           \

+        VOID *td = NULL;        /* Trace Descriptor */          \

+        oss_trace_func_start(&td, __FUNCTION__);

+

+# define ZOSS_TRACE_FUNC_END_ALWAYS()                           \

+        oss_trace_func_end(td);                                 \

+    }

+#else

+# define ZOSS_TRACE_FUNC_START()

+# define ZOSS_TRACE_FUNC_END()

+

+# define ZOSS_TRACE_FUNC_START_ALWAYS()

+# define ZOSS_TRACE_FUNC_END_ALWAYS()

+#endif

+#endif

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/

+#ifdef OSS_TRACE_FUNC

+VOID oss_trace_thread_open(VOID);

+VOID oss_trace_thread_close(VOID);

+#endif

+

+VOID zOss_TraceFuncInit(VOID);

+VOID zOss_TraceFuncInfo(CHAR *func_name);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_TRACE_H */

+

diff --git a/cp/ps/plat/inc/oss/ramdump.h b/cp/ps/plat/inc/oss/ramdump.h
new file mode 100644
index 0000000..a83ffda
--- /dev/null
+++ b/cp/ps/plat/inc/oss/ramdump.h
@@ -0,0 +1,77 @@
+/*******************************************************************************
+* °æÈ¨ËùÓÐ (C)2016, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+* 
+* ÎļþÃû³Æ:     ramdump.h
+* Îļþ±êʶ:     ramdump.h
+* ÄÚÈÝÕªÒª:     ramdump¶ÔÍâÌṩͷÎļþ
+* ʹÓ÷½·¨:     #include "ramdump.h"
+* 
+* ÐÞ¸ÄÈÕÆÚ        °æ±¾ºÅ      Ð޸ıê¼Ç        ÐÞ¸ÄÈË          ÐÞ¸ÄÄÚÈÝ
+* ------------------------------------------------------------------------------
+* 2016/3/10      V1.0        Create           ÕÔ¾ü¿ü          ´´½¨
+* 
+*******************************************************************************/
+
+#ifndef _RAMDUMP_H
+#define _RAMDUMP_H
+
+/*******************************************************************************
+*                                   Í·Îļþ                                     *
+*******************************************************************************/
+
+/*******************************************************************************
+*                                Íⲿº¯ÊýÉùÃ÷                                  *
+*******************************************************************************/
+
+/*******************************************************************************
+*                                   ºê¶¨Òå                                     *
+*******************************************************************************/
+
+/*******************************************************************************
+*                                Êý¾ÝÀàÐͶ¨Òå                                  *
+*******************************************************************************/
+typedef int (*ramdump_callback_t)(void);
+
+/* RAMDUMP_FLAG_XXX         */
+enum
+{
+    RAMDUMP_FLAG_NONE           = 0x00, /* default                  */
+    RAMDUMP_FLAG_NEED_COPY      = 0x01, /* Copy destination address */
+    RAMDUMP_FLAG_HAS_EXTERNAL   = 0x02, /* External address         */
+    RAMDUMP_FLAG_HAS_CALLBACK   = 0x04, /* Callback funtion         */
+};
+
+/*******************************************************************************
+*                                È«¾Ö±äÁ¿ÉùÃ÷                                  *
+*******************************************************************************/
+
+/*******************************************************************************
+*                                È«¾Öº¯ÊýÉùÃ÷                                  *
+*******************************************************************************/
+#if defined (CONFIG_RAMDUMP) || defined (_USE_CLIENT_RAMDUMP)
+extern void ramdump_ram_conf_table_add(
+        char *ram_name, 
+        unsigned long ram_phy, 
+        unsigned long ram_size, 
+        unsigned long ram_virt,
+        unsigned long ram_flag,
+        unsigned long ram_extra);
+#else
+static void ramdump_ram_conf_table_add(
+        char *ram_name, 
+        unsigned long ram_phy, 
+        unsigned long ram_size, 
+        unsigned long ram_virt,
+        unsigned long ram_flag,
+        unsigned long ram_extra)
+{
+    ;
+}
+#endif
+
+/*******************************************************************************
+*                                ÄÚÁªº¯ÊýʵÏÖ                                  *
+*******************************************************************************/
+
+#endif  //#ifndef _RAMDUMP_H
+
diff --git a/cp/ps/plat/inc/oss_api.h b/cp/ps/plat/inc/oss_api.h
new file mode 100644
index 0000000..edef4e6
--- /dev/null
+++ b/cp/ps/plat/inc/oss_api.h
@@ -0,0 +1,77 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2012 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : P98C_OSS

+* ÎÄ ¼þ Ãû : oss_api.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : ossÄ£¿é¶ÔÍâÍ·Îļþ

+* ×÷    Õß : chenxingfang

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2012-08-10 

+* ÆäËü˵Ã÷ : oss_pub.h      »ù±¾ÀàÐÍ¡¢Ä£¿éºÅ¡¢´íÎóºÅ¡¢Ê¼þºÅ¶¨Òå

+             oss_posix.h    Óëposix¿âÏà¹ØµÄÀàÐͶ¨Òå

+             oss_clib.h     C¿âÍ·Îļþ

+             oss_compiler.h ±àÒëÆ÷ºêÏà¹ØµÄºê¶¨Òå

+             oss_fs.h       Îļþϵͳ½Ó¿Ú

+             oss_kernel.h   ²Ù×÷ϵͳÄÚºËÏà¹ØµÄ½Ó¿Ú£¬ÈçÏ̡߳¢ÐźÅÁ¿¡¢»¥³âÌå¡¢¶ÏÑÔ¡¢CPUͳ¼Æ

+             oss_trace.h    ¸ú×Ù¹¦ÄܵĽӿÚ

+             oss_irq.h      ÖжϽӿÚ

+             oss_mem.h      UB¡¢heapÄÚ´æ½Ó¿Ú

+             oss_psm.h      Ê¡µç¹¦ÄܵĽӿÚ

+             oss_sup.h      ijЩ¸½¼Ó¹¦ÄÜ£¬Èçʼþ¡¢Á´±í¡¢¶ÓÁС¢»·Ðλº³å¡¢¹ÜµÀ»ù±¾¹¦ÄÜʵÏÖ£¬

+                            ºÍOSSÄ£¿éµÄϵͳ¹ÜÀí½Ó¿Ú

+             oss_monitor.h  TOSϵͳÐÅÏ¢¸ú×ÙÄ£¿éÊý¾Ý½á¹¹¶¨Òå           

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _OSS_API_H

+#define _OSS_API_H

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#include "oss_pub.h"

+#include "oss_posix.h"

+#include "oss_clib.h"

+#include "oss_compiler.h"

+#include "oss_fs.h"

+

+#include "oss_kernel.h"

+#include "oss_trace.h"

+#include "oss_irq.h"

+#include "oss_mem.h"

+#include "oss_psm.h"

+#include "oss_sup.h"

+#include "oss_monitor.h"

+

+#ifdef __cplusplus

+extern "C"

+{

+#endif

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/    

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/ 

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif  /* _OSS_API_H */

+

diff --git a/cp/ps/plat/inc/pub.h b/cp/ps/plat/inc/pub.h
new file mode 100644
index 0000000..1b7174e
--- /dev/null
+++ b/cp/ps/plat/inc/pub.h
@@ -0,0 +1,2 @@
+#include "oss_api.h"

+

diff --git a/cp/ps/plat/inc/pub_errordef.h b/cp/ps/plat/inc/pub_errordef.h
new file mode 100644
index 0000000..1b7174e
--- /dev/null
+++ b/cp/ps/plat/inc/pub_errordef.h
@@ -0,0 +1,2 @@
+#include "oss_api.h"

+

diff --git a/cp/ps/plat/inc/pub_eventdef.h b/cp/ps/plat/inc/pub_eventdef.h
new file mode 100644
index 0000000..1b7174e
--- /dev/null
+++ b/cp/ps/plat/inc/pub_eventdef.h
@@ -0,0 +1,2 @@
+#include "oss_api.h"

+

diff --git a/cp/ps/plat/inc/pub_mdldef.h b/cp/ps/plat/inc/pub_mdldef.h
new file mode 100644
index 0000000..1b7174e
--- /dev/null
+++ b/cp/ps/plat/inc/pub_mdldef.h
@@ -0,0 +1,2 @@
+#include "oss_api.h"

+

diff --git a/cp/ps/plat/inc/pub_typedef.h b/cp/ps/plat/inc/pub_typedef.h
new file mode 100644
index 0000000..1b7174e
--- /dev/null
+++ b/cp/ps/plat/inc/pub_typedef.h
@@ -0,0 +1,2 @@
+#include "oss_api.h"

+