diff packages/cygmon/current/misc/bsp/dbg-threads-api.h @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children e0c0827131d1
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/packages/cygmon/current/misc/bsp/dbg-threads-api.h
@@ -0,0 +1,139 @@
+#ifndef __BSP_DBG_THREADS_API_H__
+#define __BSP_DBG_THREADS_API_H__
+//==========================================================================
+//
+//      dbg-threads-api.h
+//
+//      <DESCRIPTION>
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    
+// Contributors: gthomas
+// Date:         1999-10-20
+// Purpose:      
+// Description:  These are the calls used to extract operating system
+//               specific information used in supporting thread aware
+//               debugging.
+//               The Operating Environment being debugged needs to supply
+//               these functions.
+//
+//####DESCRIPTIONEND####
+//
+//=========================================================================
+
+
+#define has_thread_void       0 
+#define has_thread_current    1
+#define has_thread_registers  2
+#define has_thread_reg_change 4
+#define has_thread_list       8
+#define has_thread_info       16
+
+typedef unsigned char threadref[8] ;
+
+struct dbg_capabilities
+{
+    unsigned long mask1;
+};
+
+/* fill in the list of thread aware capabilities */
+extern int dbg_thread_capabilities(struct dbg_capabilities *cbp);
+
+
+/* Fill in the identifier of the current thread */
+/* return 1 if defined, 0 if not defined */
+extern int dbg_currthread(threadref *varparm);
+
+/* get the first or next member of the list of known threads */
+extern int dbg_threadlist(int startflag,
+			  threadref *lastthreadid,
+			  threadref *next_thread);
+
+/* return 1 if next_threadid has been filled in with a value */
+/* return 0 if there are none or no more */
+
+/* The O.S can fill in the following information about a thread when queried.
+   The structure of thise strings is determined by the O.S.
+   It is display oriented, so figure out what the users need to see.
+   Nulls are OK but GDB will fill some not so meaningful data.
+   These pointers may be in the calles private structures, the info will
+   get copied immediatly after the call to retreive it.
+   */
+struct cygmon_thread_debug_info
+{
+  threadref thread_id ;
+  int context_exists ; /* To the point where examining its state,
+			 registers and stack makes sense to GDB */
+  char * thread_display ; /* As shown in thread status window, name, state */
+  char * unique_thread_name ; /* human readable identifier, window label */
+  char * more_display ;   /* more detailed info about thread.
+			  priority, queuedepth, state, stack usage, statistics */
+} ;
+
+
+
+
+extern int dbg_threadinfo(threadref *threadid,
+			  struct cygmon_thread_debug_info *info);
+
+/* Return 1 if threadid is defined and info copied, 0 otherwise */
+
+/* The O.S should fillin the array of registers using values from the
+saves context. The array MUST be in GDB register save order even if
+the saved context is different or smaller. Do not alter the values of
+registers which are NOT in the O.S. thread context. Their default values
+have already been assigned.
+*/
+
+extern int dbg_getthreadreg(threadref *osthreadid, 
+			    int regcount, /* count of registers in the array */
+			    void * regval); /* fillin this array */
+
+
+/* The O.S. should scan through this list of registers which are in
+GDB order and the O.S. should replace the values of all registers
+which are defined in the saved context of thread or process identified
+by osthreadid. Return 0 if the threadis does not map to a known
+process or other error. Return 1 if the setting is successful.  */
+
+extern int dbg_setthreadreg(threadref *osthreadid, 
+			    int regcount, /* number of registers */
+			    void *regval) ;
+
+
+extern int dbg_scheduler(threadref *thread_id, int lock, int mode);
+
+/* --- EXCEPTION -
+   The O.S. does not provide this function , it calls this to specify the
+   location of the dbg_syscall vector
+   */
+extern void patch_dbg_syscalls(void * vector);
+
+#endif /* DBG_THREADS_API_INCLUDED */
+#endif // __BSP_DBG_THREADS_API_H__