annotate packages/hal/common/current/include/dbg-threads-api.h @ 0:3111d98ba7b3 ecos-v1_1-release

Initial commit of eCos version 1.1
author jlarmour
date Tue, 11 May 1999 11:16:07 +0000
parents
children 443894e2e912
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
1 #if !defined(DBG_THREADS_API_INCLUDED)
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
2 #define DBG_THREADS_API_INCLUDED 1
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
3 /* These are the calls used to extract operating system specific information
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
4 used in supporting thread aware debugging.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
5 The Operating Environment being debugged needs to supply these functions.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
6 */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
7
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
8 /*
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
9 * Copyright (c) 1998 Cygnus Support
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
10 *
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
11 * The authors hereby grant permission to use, copy, modify, distribute,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
12 * and license this software and its documentation for any purpose, provided
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
13 * that existing copyright notices are retained in all copies and that this
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
14 * notice is included verbatim in any distributions. No written agreement,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
15 * license, or royalty fee is required for any of the authorized uses.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
16 * Modifications to this software may be copyrighted by their authors
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
17 * and need not follow the licensing terms described here, provided that
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
18 * the new terms are clearly indicated on the first page of each file where
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
19 * they apply.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
20 */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
21
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
22 #define has_thread_void 0
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
23 #define has_thread_current 1
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
24 #define has_thread_registers 2
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
25 #define has_thread_reg_change 4
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
26 #define has_thread_list 8
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
27 #define has_thread_info 16
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
28
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
29 typedef unsigned char threadref[8] ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
30
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
31 struct dbg_capabilities
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
32 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
33 unsigned long mask1 ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
34 } ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
35
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
36
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
37 /* fill in the list of thread aware capabilities */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
38 extern int dbg_thread_capabilities(struct dbg_capabilities * cbp) ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
39
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
40
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
41 /* Fillin the identifier of the current thread */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
42 /* return 1 if defined, 0 if not defined */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
43 extern int dbg_currthread(threadref * varparm) ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
44
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
45 /* Return the unique ID number of the current thread. */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
46 extern int dbg_currthread_id(void);
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
47
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
48 /* get the first or next member of the list of known threads */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
49 extern int dbg_threadlist(int startflag,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
50 threadref * lastthreadid,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
51 threadref * next_thread
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
52 ) ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
53
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
54 /* return 1 if next_threadid has been filled in with a value */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
55 /* return 0 if there are none or no more */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
56
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
57 /* The O.S can fill in the following information about a thread when queried.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
58 The structure of thise strings is determined by the O.S.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
59 It is display oriented, so figure out what the users need to see.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
60 Nulls are OK but GDB will fill some not so meaningful data.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
61 These pointers may be in the calles private structures, the info will
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
62 get copied immediatly after the call to retreive it.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
63 */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
64 struct cygmon_thread_debug_info
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
65 {
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
66 threadref thread_id ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
67 int context_exists ; /* To the point where examining its state,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
68 registers and stack makes sense to GDB */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
69 char * thread_display ; /* As shown in thread status window, name, state */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
70 char * unique_thread_name ; /* human readable identifier, window label */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
71 char * more_display ; /* more detailed info about thread.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
72 priority, queuedepth, state, stack usage, statistics */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
73 } ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
74
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
75
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
76
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
77
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
78 extern int dbg_threadinfo(
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
79 threadref * threadid,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
80 struct cygmon_thread_debug_info * info) ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
81
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
82 /* Return 1 if threadid is defined and info copied, 0 otherwise */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
83
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
84 /* The O.S should fillin the array of registers using values from the
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
85 saves context. The array MUST be in GDB register save order even if
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
86 the saved context is different or smaller. Do not alter the values of
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
87 registers which are NOT in the O.S. thread context. Their default values
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
88 have already been assigned.
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
89 */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
90
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
91 extern int dbg_getthreadreg(
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
92 threadref * osthreadid,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
93 int regcount, /* count of registers in the array */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
94 void * regval) ; /* fillin this array */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
95
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
96
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
97 /* The O.S. should scan through this list of registers which are in
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
98 GDB order and the O.S. should replace the values of all registers
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
99 which are defined in the saved context of thread or process identified
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
100 by osthreadid. Return 0 if the threadis does not map to a known
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
101 process or other error. Return 1 if the setting is successful. */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
102
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
103 extern int dbg_setthreadreg(
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
104 threadref * osthreadid,
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
105 int regcount , /* number of registers */
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
106 void * regval) ;
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
107
3111d98ba7b3 Initial commit of eCos version 1.1
jlarmour
parents:
diff changeset
108 #endif /* DBG_THREADS_API_INCLUDED */