comparison packages/hal/sparclite/sleb/current/src/hal_diag.c @ 4:1d7f19c9e4d1 ecos-sw-1999-05-11

Merge from eCos master repository on 1999-05-11-21:11:10-BST
author jlarmour
date Tue, 11 May 1999 14:07:25 +0000
parents 443894e2e912
children c38311975d4f
comparison
equal deleted inserted replaced
3:69e820d8bae1 4:1d7f19c9e4d1
173 void *__ictrl_table; 173 void *__ictrl_table;
174 void *__exc_table; 174 void *__exc_table;
175 void *__dbg_vector; 175 void *__dbg_vector;
176 void *__kill_vector; 176 void *__kill_vector;
177 struct bsp_comm_procs *__console_procs; 177 struct bsp_comm_procs *__console_procs;
178 struct bsp_comm_procs *__debug_procs;
179 void *__flush_dcache;
180 void *__flush_icache;
181 void *__cpu_data;
182 void *__board_data;
183 void *__sysinfo;
184 int (*__set_debug_comm)(int __comm_id);
185 void *__set_console_comm;
178 } bsp_shared_t; 186 } bsp_shared_t;
179 187
188
189 static int
190 hal_bsp_set_debug_comm(int arg)
191 {
192 bsp_shared_t *shared;
193
194 shared = (bsp_shared_t *)
195 (CYGMON_VECTOR_TABLE[ BSP_NOTVEC_BSP_COMM_PROCS ]);
196
197 if (0 != shared->__set_debug_comm) {
198 return (*(shared->__set_debug_comm))(arg);
199 }
200 return 0;
201 }
180 202
181 static int 203 static int
182 hal_bsp_console_write(const char *p, int len) 204 hal_bsp_console_write(const char *p, int len)
183 { 205 {
184 bsp_shared_t *shared; 206 bsp_shared_t *shared;
189 211
190 com = shared->__console_procs; 212 com = shared->__console_procs;
191 213
192 if (0 != com) { 214 if (0 != com) {
193 com->__write(com->ch_data, p, len); 215 com->__write(com->ch_data, p, len);
216
217 #if 1
218 // FIXME: This is a workaround for PR 19926; CygMon does not
219 // expect to be sharing the line with a serial driver (which
220 // can be excused :) and so doesn't acknowledge the interrupt.
221 // In normal circumstances CygMon would handle the resulting
222 // interrupt and do the right thing. However, when using the
223 // serial driver it is handling the interrupts and gets
224 // mightily confused by these spurious interrupts.
225 //
226 // As a workaround, ask CygMon which communication port is
227 // using for console output. If this is the serial port
228 // (comm 0), acknowledge the interrupt.
229 if ( 0 == hal_bsp_set_debug_comm( -1 ) )
230 HAL_INTERRUPT_ACKNOWLEDGE( CYGNUM_HAL_VECTOR_INTERRUPT_10 );
231 #endif
232
194 return 1; 233 return 1;
195 } 234 }
196 return 0; 235 return 0;
197 } 236 }
198 237
236 275
237 pos = 0; 276 pos = 0;
238 277
239 // And re-enable interrupts 278 // And re-enable interrupts
240 HAL_RESTORE_INTERRUPTS(old); 279 HAL_RESTORE_INTERRUPTS(old);
241 280
242 } 281 }
243 } 282 }
244 283
245 #endif // CYG_KERNEL_DIAG_GDB_SERIAL_DIRECT not defined; use CygMon 284 #endif // CYG_KERNEL_DIAG_GDB_SERIAL_DIRECT not defined; use CygMon
246 285