versadac  1
versadac - Scalable Recorder Firmware
osstack.h
1 /*---------------------------------------------------------------------------*/
2 /* Copyright (C) 2006 Woodhead Software & Electonics. All rights reserved. */
3 /*---------------------------------------------------------------------------*/
4 /* This program is protected by international copyright. */
5 /* */
6 /* The use of this software including but not limited to its Source Code */
7 /* is subject to restrictions as agreed in the license agreement between */
8 /* you and Woodhead. */
9 /* Copying or distribution is not allowed unless expressly permitted */
10 /* according to your license agreement with Woodhead. */
11 /*---------------------------------------------------------------------------*/
12 /* */
13 /* Project : STACK PROFINET Controller */
14 /* Component : OS Interface */
15 /* $Workfile:: osstack.h $*/
16 /* $Revision:: 2 $*/
17 /* $Date:: 9/22/09 6:01p $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* Abstraction layer between Stack file and operating system layer */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 
26 
27 #ifdef _DEBUG_OS_ALLOC
28 
29 #ifndef LINK_H
30 #include "link.h"
31 #endif
32 
33 #ifndef _PLATFORM_H
34 #include "platform.h"
35 #endif
36 
37 
38 #ifndef __POOL_H__
39 #include "pool.h"
40 #endif
41 
42 #ifndef __STK_THD_H__
43 #include "stk_thd.h"
44 #endif
45 
46 #ifndef __STK_MTX_H__
47 #include "stk_mtx.h"
48 #endif
49 
50 #ifndef __SCHEDULE_H
51 #include "schedule.h"
52 #endif
53 
54 #include "system.h"
55 
56 
57 #ifndef _MESSAGE_H
58 #include "message.h"
59 #endif
60 typedef struct st_Alloc_elt
61 {
62  ST_LINK stLink;
63  APP_LPVOID lpPtrMem; /*ptr mem*/
64  char szFileName[32]; /*file name*/
65  APP_DWORD dwLineNumber;
66  APP_DWORD dwSize;
67 }ST_ALLOC_ELT, * PST_ALLOC_ELT , APP_FAR * LPST_ALLOC_ELT;
68 
69 #define ALLOC_TAKE_MUTEX StackEnterX(OS_MUTEX_USER1)
70 #define ALLOC_GIVE_MUTEX StackExitX(OS_MUTEX_USER1)
71 
72 typedef struct _st_alloc_debug_elt
73 {
74  ST_DESC_CBF stDescCbf;
75  ST_ALLOC_ELT stFspmElt[_DEBUG_MAX_ALLOC_];
76  APP_DWORD dwIndex;
77 }st_alloc_debug_elt;
78 
79 APP_WORD FreeAllocList (APP_VOID);
80 extern st_alloc_debug_elt _alloc_debug_elt;
81 #define OsAlloc(a,b,c) _OsAllocDebug(a,b,c,__FILE__,__LINE__)
82 #define OsFree(a) _OsFreeDebug(a,__FILE__,__LINE__)
83 
84 #else
85 #define OsAlloc(a,b,c) _OsAlloc(a,b,c)
86 #define OsFree(a) _OsFree(a)
87 #endif
88 
89 
90 APP_VOID APP_FAR list_node_destroy (APP_LPVOID pData);
91 APP_VOID StackEnterX(APP_DWORD dwSyncId);
92 APP_VOID StackExitX(APP_DWORD dwSyncId);
93 
94 
95 #define OS_ENTER() StackEnterX(OS_MUTEX_MSG)
96 #define OS_EXIT() StackExitX(OS_MUTEX_MSG)
Definition: link.h:35
Definition: schedule.h:96