注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

liuyue18301的个人主页

追逐梦想 光辉岁月

 
 
 

日志

 
 

GT  

2009-11-12 20:01:38|  分类: v4l2 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

* gt.h

4

 *

5

 * DSP-BIOS Bridge driver support functions for TI OMAP processors.

6

 *

7

 * Copyright (C) 2008 Texas Instruments, Inc.

8

 *

9

 * This package is free software; you can redistribute it and/or modify

10

 * it under the terms of the GNU General Public License version 2 as

11

 * published by the Free Software Foundation.

12

 *

13

 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR

14

 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED

15

 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

16

 */

17

18

19

/*

20

 *  ======== gt.h ========

21

 *  Purpose:

22

 *      There are two definitions that affect which portions of trace

23

 *      are acutally compiled into the client: GT_TRACE and GT_ASSERT. If

24

 *      GT_TRACE is set to 0 then all trace statements (except for assertions)

25

 *      will be compiled out of the client. If GT_ASSERT is set to 0 then

26

 *      assertions will be compiled out of the client. GT_ASSERT can not be

27

 *      set to 0 unless GT_TRACE is also set to 0 (i.e. GT_TRACE == 1 implies

28

 *      GT_ASSERT == 1).

29

 *

30

 *! Revision History

31

 *! ================

32

 *! 02-Feb-2000 rr:     Renamed this file to gtce.h. GT CLASS and trace

33

 *!                     definitions are WinCE Specific.

34

 *! 03-Jan-1997 ge      Replaced "GT_" prefix to GT_Config structure members

35

 *!                     to eliminate preprocessor confusion with other macros.

36

 */

37

#include <linux/types.h>

38

#ifndef GT_

39

#define GT_

40

41

#ifndef GT_TRACE

42

#define GT_TRACE 0      /* 0 = "trace compiled out"; 1 = "trace active" */

43

#endif

44

45

/* #include <syslink/host_os.h> */

46

47

typedef s32(*Fxn)();    /* generic function type */

48

49

50

#if !defined(GT_ASSERT) || GT_TRACE

51

#define GT_ASSERT 1

52

#endif

53

54

struct GT_Config {

55

        Fxn PRINTFXN;

56

        Fxn PIDFXN;

57

        Fxn TIDFXN;

58

        Fxn ERRORFXN;

59

};

60

61

extern struct GT_Config *GT;

62

63

struct gt_mask {

64

        char *modName;

65

        u8 *flags;

66

} ;

67

68

/*

69

 *  New GT Class defenitions.

70

 *

71

 *  The following are the explanations and how it could be used in the code

72

 *

73

 *  -   GT_ENTER        On Entry to Functions

74

 *

75

 *  -   GT_1CLASS       Display level of debugging status- Object/Automatic

76

 *                      variables

77

 *  -   GT_2CLASS       ---- do ----

78

 *

79

 *  -   GT_3CLASS        ---- do ---- + It can be used(recommended) for debug

80

 *                      status in the ISR, IST

81

 *  -   GT_4CLASS       ---- do ----

82

 *

83

 *  -   GT_5CLASS       Display entry for module init/exit functions

84

 *

85

 *  -   GT_6CLASS       Warn whenever SERVICES function fails

86

 *

87

 *  -   GT_7CLASS       Warn failure of Critical failures

88

 *

89

 */

90

91

#define GT_ENTER        ((u8)0x01)

92

#define GT_1CLASS       ((u8)0x02)

93

#define GT_2CLASS       ((u8)0x04)

94

#define GT_3CLASS       ((u8)0x08)

95

#define GT_4CLASS       ((u8)0x10)

96

#define GT_5CLASS       ((u8)0x20)

97

#define GT_6CLASS       ((u8)0x40)

98

#define GT_7CLASS       ((u8)0x80)

99

#define GT_LEAVE        ((u8)0x02)

100

101

#ifdef _LINT_

102

103

/* LINTLIBRARY */

104

105

/*

106

 *  ======== GT_assert ========

107

 */

108

/* ARGSUSED */

109

void GT_assert(struct gt_mask mask, s32 expr)

110

{

111

}

112

113

/*

114

 *  ======== GT_config ========

115

 */

116

/* ARGSUSED */

117

void GT_config(struct GT_Config config)

118

{

119

}

120

121

/*

122

 *  ======== GT_create ========

123

 */

124

/* ARGSUSED */

125

void GT_create(struct gt_mask *mask, char *modName)

126

{

127

}

128

129

/*

130

 *  ======== GT_curline ========

131

 *  Purpose:

132

 *      Returns the current source code line number. Is useful for performing

133

 *      branch testing using trace.  For example,

134

 *

135

 *      gt_1trace(curTrace, GT_1CLASS,

136

 *        "in module XX_mod, executing line %u\n", GT_curline());

137

 */

138

/* ARGSUSED */

139

u16 GT_curline(void)

140

{

141

        return (u16)NULL;

142

}

143

144

/*

145

 *  ======== GT_exit ========

146

 */

147

/* ARGSUSED */

148

void GT_exit(void)

149

{

150

}

151

152

/*

153

 *  ======== GT_init ========

154

 */

155

/* ARGSUSED */

156

void GT_init(void)

157

{

158

}

159

160

/*

161

 *  ======== GT_query ========

162

 */

163

/* ARGSUSED */

164

bool GT_query(struct gt_mask mask, u8 class)

165

{

166

        return false;

167

}

168

169

/*

170

 *  ======== GT_set ========

171

 *  sets trace mask according to settings

172

 */

173

174

/* ARGSUSED */

175

void GT_set(char *settings)

176

{

177

}

178

179

/*

180

 *  ======== GT_setprintf ========

181

 *  sets printf function

182

 */

183

184

/* ARGSUSED */

185

void GT_setprintf(Fxn fxn)

186

{

187

}

188

189

/* ARGSUSED */

190

void gt_0trace(struct gt_mask mask, u8 class, char *format)

191

{

192

}

193

194

/* ARGSUSED */

195

void gt_1trace(struct gt_mask mask, u8 class, char *format, ...)

196

{

197

}

198

199

/* ARGSUSED */

200

void gt_2trace(struct gt_mask mask, u8 class, char *format, ...)

201

{

202

}

203

204

/* ARGSUSED */

205

void gt_3trace(struct gt_mask mask, u8 class, char *format, ...)

206

{

207

}

208

209

/* ARGSUSED */

210

void gt_4trace(struct gt_mask mask, u8 class, char *format, ...)

211

{

212

}

213

214

/* ARGSUSED */

215

void gt_5trace(struct gt_mask mask, u8 class, char *format, ...)

216

{

217

}

218

219

/* ARGSUSED */

220

void GT_6trace(struct gt_mask mask, u8 class, char *format, ...)

221

{

222

}

223

224

#else

225

226

#define GT_BOUND        26      /* 26 letters in alphabet */

227

228

extern void _GT_create(struct gt_mask *mask, char *modName);

229

230

#define GT_exit()

231

232

extern void GT_init(void);

233

extern void _GT_set(char *str);

234

extern s32 _GT_trace(struct gt_mask *mask, char *format, ...);

235

236

#if GT_ASSERT == 0

237

238

#define GT_assert(mask, expr)

239

#define GT_config(config)

240

#define GT_configInit(config)

241

#define GT_seterror(fxn)

242

243

#else

244

245

extern struct GT_Config _GT_params;

246

247

#define GT_assert(mask, expr) \

248

        (!(expr) ? \

249

                printk(KERN_ALERT "assertion violation: %s, line %d\n", \

250

                                __FILE__, __LINE__), NULL : NULL)

251

252

#define GT_config(config)               (_GT_params = *(config))

253

#define GT_configInit(config)           (*(config) = _GT_params)

254

#define GT_seterror(fxn)                (_GT_params.ERRORFXN = (Fxn)(fxn))

255

256

#endif

257

258

#if GT_TRACE == 0

259

260

#define GT_curline()                    ((u16)__LINE__)

261

#define GT_create(mask, modName)

262

#define GT_exit()

263

#define GT_init()

264

#define GT_set(settings)

265

#define GT_setprintf(fxn)

266

267

#define GT_query(mask, class)           false

268

269

#define gt_0trace(mask, class, format)

270

#define gt_1trace(mask, class, format, arg1)

271

#define gt_2trace(mask, class, format, arg1, arg2)

272

#define gt_3trace(mask, class, format, arg1, arg2, arg3)

273

#define gt_4trace(mask, class, format, arg1, arg2, arg3, arg4)

274

#define gt_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5)

275

#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6)

276

277

#else                           /* GT_TRACE == 1 */

278

279

#define GT_create(mask, modName)        _GT_create((mask), (modName))

280

#define GT_curline()                    ((u16)__LINE__)

281

#define GT_set(settings)                _GT_set(settings)

282

#define GT_setprintf(fxn)               (_GT_params.PRINTFXN = (Fxn)(fxn))

283

284

#define GT_query(mask, class) ((*(mask).flags & (class)))

285

286

#define gt_0trace(mask, class, format) \

287

        ((*(mask).flags & (class)) ? \

288

        _GT_trace(&(mask), (format)) : 0)

289

290

#define gt_1trace(mask, class, format, arg1) \

291

        ((*(mask).flags & (class)) ? \

292

        _GT_trace(&(mask), (format), (arg1)) : 0)

293

294

#define gt_2trace(mask, class, format, arg1, arg2) \

295

        ((*(mask).flags & (class)) ? \

296

        _GT_trace(&(mask), (format), (arg1), (arg2)) : 0)

297

298

#define gt_3trace(mask, class, format, arg1, arg2, arg3) \

299

        ((*(mask).flags & (class)) ? \

300

        _GT_trace(&(mask), (format), (arg1), (arg2), (arg3)) : 0)

301

302

#define gt_4trace(mask, class, format, arg1, arg2, arg3, arg4) \

303

        ((*(mask).flags & (class)) ? \

304

        _GT_trace(&(mask), (format), (arg1), (arg2), (arg3), (arg4)) : 0)

305

306

#define gt_5trace(mask, class, format, arg1, arg2, arg3, arg4, arg5) \

307

        ((*(mask).flags & (class)) ? \

308

        _GT_trace(&(mask), (format), (arg1), (arg2), (arg3), (arg4), (arg5)) \

309

         : 0)

310

311

#define GT_6trace(mask, class, format, arg1, arg2, arg3, arg4, arg5, arg6) \

312

        ((*(mask).flags & (class)) ? \

313

        _GT_trace(&(mask), (format), (arg1), (arg2), (arg3), (arg4), (arg5), \

314

        (arg6)) : 0)

315

316

#endif                          /* GT_TRACE */

317

318

#endif                          /* _LINT_ */

319

320

#endif                          /* GTCE_ */

  评论这张
 
阅读(344)| 评论(1)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018