49 static int* latest_subscription = subscription_table; |
49 static int* latest_subscription = subscription_table; |
50 static int* subscription_cursor = subscription_table; |
50 static int* subscription_cursor = subscription_table; |
51 |
51 |
52 struct_plcvar variable_table[%(variables_pointer_type_table_count)d]; |
52 struct_plcvar variable_table[%(variables_pointer_type_table_count)d]; |
53 |
53 |
54 void __init_debug() |
54 void __init_debug(void) |
55 { |
55 { |
56 %(variables_pointer_type_table_initializer)s |
56 %(variables_pointer_type_table_initializer)s |
57 buffer_state = BUFFER_FREE; |
57 buffer_state = BUFFER_FREE; |
58 } |
58 } |
59 |
59 |
60 void __cleanup_debug() |
60 void __cleanup_debug(void) |
61 { |
61 { |
62 } |
62 } |
63 |
63 |
64 void __retrieve_debug() |
64 void __retrieve_debug(void) |
65 { |
65 { |
66 } |
66 } |
67 |
67 |
68 extern int TryEnterDebugSection(void); |
68 extern int TryEnterDebugSection(void); |
69 extern void LeaveDebugSection(void); |
69 extern void LeaveDebugSection(void); |
70 extern long AtomicCompareExchange(long*, long, long); |
70 extern long AtomicCompareExchange(long*, long, long); |
71 extern void InitiateDebugTransfer(void); |
71 extern void InitiateDebugTransfer(void); |
72 |
72 |
73 extern unsigned long __tick; |
73 extern unsigned long __tick; |
74 void __publish_debug() |
74 void __publish_debug(void) |
75 { |
75 { |
76 /* Check there is no running debugger re-configuration */ |
76 /* Check there is no running debugger re-configuration */ |
77 if(TryEnterDebugSection()){ |
77 if(TryEnterDebugSection()){ |
78 /* Lock buffer */ |
78 /* Lock buffer */ |
79 long latest_state = AtomicCompareExchange( |
79 long latest_state = AtomicCompareExchange( |