comparison packages/hal/sh/cq7708/current/src/plf_misc.c @ 94:4642a6d35749 ecos-sw-2000-06-02

Merge from eCos master repository on 2000-06-02-07:47:04-BST
author jlarmour
date Fri, 02 Jun 2000 17:35:00 +0000
parents
children 5a0cc6c243a9
comparison
equal deleted inserted replaced
93:8c2901fd1dc1 94:4642a6d35749
1 //==========================================================================
2 //
3 // plf_misc.c
4 //
5 // HAL platform miscellaneous functions
6 //
7 //==========================================================================
8 //####COPYRIGHTBEGIN####
9 //
10 // -------------------------------------------
11 // The contents of this file are subject to the Red Hat eCos Public License
12 // Version 1.1 (the "License"); you may not use this file except in
13 // compliance with the License. You may obtain a copy of the License at
14 // http://www.redhat.com/
15 //
16 // Software distributed under the License is distributed on an "AS IS"
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
18 // License for the specific language governing rights and limitations under
19 // the License.
20 //
21 // The Original Code is eCos - Embedded Configurable Operating System,
22 // released September 30, 1998.
23 //
24 // The Initial Developer of the Original Code is Red Hat.
25 // Portions created by Red Hat are
26 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
27 // All Rights Reserved.
28 // -------------------------------------------
29 //
30 //####COPYRIGHTEND####
31 //==========================================================================
32 //#####DESCRIPTIONBEGIN####
33 //
34 // Author(s): jskov
35 // Contributors: jskov,nickg, jlarmour
36 // Date: 1999-10-13
37 // Purpose: HAL miscellaneous functions
38 // Description: This file contains miscellaneous functions provided by the
39 // HAL.
40 //
41 //####DESCRIPTIONEND####
42 //
43 //==========================================================================
44
45 #include <pkgconf/hal.h>
46
47 #include <cyg/infra/cyg_type.h> // Base types
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
59 //--------------------------------------------------------------------------
60 // Functions to support the detection and execution of a user provoked
61 // program break. These are usually called from interrupt routines.
62
63 cyg_bool
64 cyg_hal_is_break(char *buf, int size)
65 {
66 while( size )
67 if( buf[--size] == 0x03 ) return true;
68
69 return false;
70 }
71
72 void
73 cyg_hal_user_break( CYG_ADDRWORD *regs )
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 }