blob: 5e7bb7dcdd60001b80a80554f814c988035bbb24 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2016
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35/*************************************************************
36*
37* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.
38*
39* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
40*
41* Copyright (c) 1999-2010 VIA Telecom, Inc. All rights reserved.
42*
43*************************************************************/
44/****************************************************************************
45 *
46 * Module: bitbash.h
47 *
48 * Purpose: Header File for the IS-136 Bitfield Functions.
49 *
50 ****************************************************************************
51 *
52 * PVCS Header Information
53 *
54 * $Workfile$
55 * $Revision: 1.2 $
56 * $Modtime$
57 * $Author: fpeng $
58 *
59 * $Log: bitbash.h $
60 *
61 * 06 29 2017 sue.zhong
62 * [MOLY00259241] [6293][C2K]Replace with KAL data type
63 * ::KAL type - folder inc
64 * Revision 1.2 2004/03/25 12:09:17 fpeng
65 * Updated from 6.0 CP 2.5.0
66 * Revision 1.1 2003/05/12 15:38:28 fpeng
67 * Initial revision
68 * Revision 1.2 2002/06/06 13:10:35 chinh
69 * Changed and Added Copyright
70 * Revision 1.1 2001/01/17 10:58:03 plabarbe
71 * Initial revision
72 * Revision 1.1 2000/10/24 14:11:02 fpeng
73 * Initial revision
74 * Revision 1.2 2000/03/01 18:05:39Z rsattari
75 * Isotel release 2.3 updates.
76 * Revision 1.1 1999/11/30 23:11:42Z cdma
77 * Initial revision
78 * Revision 1.18 1999/08/25 20:02:39 dstecker
79 * Merges from patches
80 * Revision 1.14.1.2.1.4 1999/08/23 21:42:43 dstecker
81 * ISOTEL R2.10
82 * Revision 1.3 1998/03/30 23:26:03 mhayduk
83 * Release 0.03.
84 *
85 * Revision 1.1 1997/11/06 17:49:24 mhayduk
86 * Initial revision
87 *
88 *
89 ****************************************************************************
90 ****************************************************************************/
91
92
93#ifndef _BITBASH_H_
94
95 #define _BITBASH_H_
96
97#include "sysdefs.h"
98
99
100#ifdef SYS_DEBUG_FAULT_FILE_INFO
101#define getByte( Data, StartBit, NumBits )\
102 __getByte( __MODULE__, __LINE__ , Data, StartBit, NumBits )
103#define getWord( Data, StartBit, NumBits)\
104 __getWord( __MODULE__, __LINE__, Data, StartBit, NumBits)
105#define getDword( Data, StartBit, NumBits)\
106 __getDword( __MODULE__, __LINE__, Data, StartBit, NumBits)
107#define putByte( Data, StartBit, NumBits, Value)\
108 __putByte( __MODULE__, __LINE__, Data, StartBit, NumBits, Value)
109#define putWord( Data, StartBit, NumBits, Value)\
110 __putWord( __MODULE__, __LINE__, Data, StartBit, NumBits, Value)
111#define putDword( Data, StartBit, NumBits, Value)\
112 __putDword( __MODULE__, __LINE__, Data, StartBit, NumBits, Value)
113
114 kal_uint8 __getByte( const char *moduleName, unsigned lineNumber, kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits );
115 kal_uint16 __getWord( const char *moduleName, unsigned lineNumber, kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits );
116 kal_uint32 __getDword( const char *moduleName, unsigned lineNumber, kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits );
117
118 void __putByte( const char *moduleName, unsigned lineNumber, kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits, kal_uint8 Value );
119 void __putWord( const char *moduleName, unsigned lineNumber, kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits, kal_uint16 Value );
120 void __putDword( const char *moduleName, unsigned lineNumber, kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits, kal_uint32 Value );
121
122#else
123 kal_uint8 getByte( kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits );
124 kal_uint16 getWord( kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits );
125 kal_uint32 getDword( kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits );
126
127 void putByte( kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits, kal_uint8 Value );
128 void putWord( kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits, kal_uint16 Value );
129 void putDword( kal_uint8 *Data, kal_uint16 StartBit, kal_uint8 NumBits, kal_uint32 Value );
130
131#endif
132
133
134#endif /* _BITBASH_H_ */
135
136