OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [cygmon/] [v2_0/] [misc/] [bsp/] [dbg-threads-api.h] - Blame information for rev 361

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#ifndef __BSP_DBG_THREADS_API_H__
2
#define __BSP_DBG_THREADS_API_H__
3
//==========================================================================
4
//
5
//      dbg-threads-api.h
6
//
7
//      <DESCRIPTION>
8
//
9
//==========================================================================
10
//####ECOSGPLCOPYRIGHTBEGIN####
11
// -------------------------------------------
12
// This file is part of eCos, the Embedded Configurable Operating System.
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under
16
// the terms of the GNU General Public License as published by the Free
17
// Software Foundation; either version 2 or (at your option) any later version.
18
//
19
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
// for more details.
23
//
24
// You should have received a copy of the GNU General Public License along
25
// with eCos; if not, write to the Free Software Foundation, Inc.,
26
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
//
28
// As a special exception, if other files instantiate templates or use macros
29
// or inline functions from this file, or you compile this file and link it
30
// with other works to produce a work based on this file, this file does not
31
// by itself cause the resulting work to be covered by the GNU General Public
32
// License. However the source code for this file must still be made available
33
// in accordance with section (3) of the GNU General Public License.
34
//
35
// This exception does not invalidate any other reasons why a work based on
36
// this file might be covered by the GNU General Public License.
37
//
38
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
// at http://sources.redhat.com/ecos/ecos-license/
40
// -------------------------------------------
41
//####ECOSGPLCOPYRIGHTEND####
42
//==========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):    
46
// Contributors: gthomas
47
// Date:         1999-10-20
48
// Purpose:      
49
// Description:  These are the calls used to extract operating system
50
//               specific information used in supporting thread aware
51
//               debugging.
52
//               The Operating Environment being debugged needs to supply
53
//               these functions.
54
//
55
//####DESCRIPTIONEND####
56
//
57
//=========================================================================
58
 
59
 
60
#define has_thread_void       0 
61
#define has_thread_current    1
62
#define has_thread_registers  2
63
#define has_thread_reg_change 4
64
#define has_thread_list       8
65
#define has_thread_info       16
66
 
67
typedef unsigned char threadref[8] ;
68
 
69
struct dbg_capabilities
70
{
71
    unsigned long mask1;
72
};
73
 
74
/* fill in the list of thread aware capabilities */
75
extern int dbg_thread_capabilities(struct dbg_capabilities *cbp);
76
 
77
 
78
/* Fill in the identifier of the current thread */
79
/* return 1 if defined, 0 if not defined */
80
extern int dbg_currthread(threadref *varparm);
81
 
82
/* get the first or next member of the list of known threads */
83
extern int dbg_threadlist(int startflag,
84
                          threadref *lastthreadid,
85
                          threadref *next_thread);
86
 
87
/* return 1 if next_threadid has been filled in with a value */
88
/* return 0 if there are none or no more */
89
 
90
/* The O.S can fill in the following information about a thread when queried.
91
   The structure of thise strings is determined by the O.S.
92
   It is display oriented, so figure out what the users need to see.
93
   Nulls are OK but GDB will fill some not so meaningful data.
94
   These pointers may be in the calles private structures, the info will
95
   get copied immediatly after the call to retreive it.
96
   */
97
struct cygmon_thread_debug_info
98
{
99
  threadref thread_id ;
100
  int context_exists ; /* To the point where examining its state,
101
                         registers and stack makes sense to GDB */
102
  char * thread_display ; /* As shown in thread status window, name, state */
103
  char * unique_thread_name ; /* human readable identifier, window label */
104
  char * more_display ;   /* more detailed info about thread.
105
                          priority, queuedepth, state, stack usage, statistics */
106
} ;
107
 
108
 
109
 
110
 
111
extern int dbg_threadinfo(threadref *threadid,
112
                          struct cygmon_thread_debug_info *info);
113
 
114
/* Return 1 if threadid is defined and info copied, 0 otherwise */
115
 
116
/* The O.S should fillin the array of registers using values from the
117
saves context. The array MUST be in GDB register save order even if
118
the saved context is different or smaller. Do not alter the values of
119
registers which are NOT in the O.S. thread context. Their default values
120
have already been assigned.
121
*/
122
 
123
extern int dbg_getthreadreg(threadref *osthreadid,
124
                            int regcount, /* count of registers in the array */
125
                            void * regval); /* fillin this array */
126
 
127
 
128
/* The O.S. should scan through this list of registers which are in
129
GDB order and the O.S. should replace the values of all registers
130
which are defined in the saved context of thread or process identified
131
by osthreadid. Return 0 if the threadis does not map to a known
132
process or other error. Return 1 if the setting is successful.  */
133
 
134
extern int dbg_setthreadreg(threadref *osthreadid,
135
                            int regcount, /* number of registers */
136
                            void *regval) ;
137
 
138
 
139
extern int dbg_scheduler(threadref *thread_id, int lock, int mode);
140
 
141
/* --- EXCEPTION -
142
   The O.S. does not provide this function , it calls this to specify the
143
   location of the dbg_syscall vector
144
   */
145
extern void patch_dbg_syscalls(void * vector);
146
 
147
#endif /* DBG_THREADS_API_INCLUDED */
148
#endif // __BSP_DBG_THREADS_API_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.