comparison packages/hal/sh/cq7708/current/src/plf_misc.c @ 105:5a0cc6c243a9 ecos-sw-2000-06-30

Merge from eCos master repository on 2000-06-30-08:18:49-BST
author jlarmour
date Fri, 30 Jun 2000 16:27:35 +0000
parents 4642a6d35749
children e0c0827131d1
comparison
equal deleted inserted replaced
104:ad66e26a9e7c 105:5a0cc6c243a9
42 // 42 //
43 //========================================================================== 43 //==========================================================================
44 44
45 #include <pkgconf/hal.h> 45 #include <pkgconf/hal.h>
46 46
47 #include <cyg/infra/cyg_type.h> // Base types 47 #include <cyg/hal/hal_if.h> // interfacing API
48
49 #include <cyg/hal/hal_arch.h> // architectural definitions
50
51 #include <cyg/hal/hal_intr.h> // Interrupt handling
52
53 #include <cyg/hal/hal_cache.h> // Cache handling
54
55 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
56 #include <cyg/hal/hal_stub.h> // stub functionality
57 #endif
58 48
59 //-------------------------------------------------------------------------- 49 //--------------------------------------------------------------------------
60 // Functions to support the detection and execution of a user provoked 50 void
61 // program break. These are usually called from interrupt routines. 51 hal_platform_init(void)
62
63 cyg_bool
64 cyg_hal_is_break(char *buf, int size)
65 { 52 {
66 while( size ) 53 hal_if_init();
67 if( buf[--size] == 0x03 ) return true;
68
69 return false;
70 } 54 }
71 55
72 void 56 //--------------------------------------------------------------------------
73 cyg_hal_user_break( CYG_ADDRWORD *regs ) 57 // eof plf_misc.c
74 {
75 #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
76 HAL_SavedRegisters *__sreg = (HAL_SavedRegisters *)regs;
77 target_register_t __pc;
78
79 if (__sreg)
80 __pc = (target_register_t) __sreg->pc;
81 else
82 __pc = (target_register_t) &&safe_breakpoint;
83
84 // Note: This would be better for the else case but doesn't work
85 // at the moment. CR: 101357
86 // __pc = (target_register_t) __builtin_return_address(0);
87
88 cyg_hal_gdb_interrupt (__pc);
89
90 safe_breakpoint:
91 #elif defined(CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs)
92
93 // Note: Need to communicate to the ROM stub instead
94 HAL_BREAKPOINT(breakinst);
95
96 #else
97
98 HAL_BREAKPOINT(breakinst);
99
100 #endif
101
102 }