[Kos-cvs] kos/modules/debug bt.c, 1.6, 1.7 debug.c, 1.39, 1.40 debug.h, 1.37, 1.38

thomas at kos.enix.org thomas at kos.enix.org
Tue Dec 28 19:44:19 CET 2004


Update of /var/cvs/kos/kos/modules/debug
In directory the-doors:/tmp/cvs-serv10813/modules/debug

Modified Files:
	bt.c debug.c debug.h 
Log Message:
2004-12-28  Thomas Petazzoni  <thomas at crazy.kos.nx>

	* modules/x86/task/task.c: Try to restrict access to exported
	symbol.

	* modules/x86/task/_thread_cpu_context.c: Move to the new PMM
	system.

	* modules/x86/task/Makefile (all): arch_task.ro instead of
	arch-task.ro.

	* modules/x86/mm/_team_mm_context.c: More informations.

	* modules/x86/mm/_mm.h, modules/x86/mm/mm.c, modules/x86/mm/_rmap.c,
	modules/x86/mm/_vmap.c: The new VMAP/RMAP system. We also make
	sure access to all exported function is restricted to the VMM
	module. 

	* modules/x86/mm/Makefile (all): arch_mm.ro instead of
	arch-mm.ro. 

	* modules/x86/lib/Makefile (all): Rename to arch_lib.ro instead of
	arch-lib.ro. 

	* modules/x86/internals.h: More definitions on the address space
	configuration. 

	* modules/vmm/vmm.h (struct address_space): Add a mutex and a
	spinlock to protect address space.

	* modules/vmm/vmm.c: Restrict access to some exported
	functions. More work has to be done in this area.

	* modules/vmm/_vmm_map.c: Part of the new vmap system.

	* modules/vmm/_vmm_as.c: Make the appropriate lock/unlock on the
	address space mutex. It's just a first try. More reflexion has to
	be made.

	* modules/task/task.h: Make sure DOXYGEN doesn't try to analyze
	the #if stuff, because it doesn't like it.

	* modules/task/_task_utils.c (show_all_thread_info): If team is
	NULL, it means that we want to display the threads of all teams.

	* modules/scheduler/synchq.h: Avoid inclusion of task.h.

	* modules/pmm/pmm.c: New PMM system.

	* modules/pmm/_pmm_put_page.c: New PMM system.

	* modules/pmm/_pmm_init.c: New PMM system.

	* modules/pmm/_pmm_get_page.c: New PMM system.

	* modules/pmm/_pmm_get_at_addr.c: New PMM system.

	* modules/pmm/_pmm.h: struct gpfme is now private.

	* modules/pmm/pmm.h: struct gpfme is now private (migrated to
	_pmm.h). 

	* modules/pmm/Makefile (OBJS): New PMM system, with fewer
	functionnalities. 

	* modules/kos/spinlock.h: New type spinlock_flags_t, that should
	be used instead of k_ui32_t for spinlock flags.

	* modules/kmem/_kvmem_utils.c: Migration to the new PMM
	system and various cleanups.

	* modules/kmem/_kvmem_init.c: Migration to the new PMM
	system and various cleanups.

	* modules/kmem/_kslab_cache_grow.c: Migration to the new PMM
	system and various cleanups.

	* modules/kmem/_kslab_cache_free.c: Migration to the new PMM
	system, and various cleanups.

	* modules/kitc/_kmutex.c: DEBUG_PRINT3 calls to show mutex
	lock/unlock/trylock.

	* modules/init/_init_modules.c (init_modules): A message is
	displayed when initializating modules.

	* modules/ide/_ide.c: Various cleanups.

	* modules/fs/fat/_fat.c: Various cleanups.

	* modules/fs/devfs/devfs.c: Various cleanups, including whitespace
	cleanification.

	* modules/debug/debug.h: Add the DEBUG_PRINT1, DEBUG_PRINT2,
	DEBUG_PRINT3 macros. Maybe there's a cleaner way to do it. David ?

	* modules/debug/debug.c (init_module_level0): Init the
	backtracking stuff a little later so that we have debugging
	messages during this initialization.

	* modules/debug/bt.c (_init_backtracing_stuff): bt_next is not
	anymore a valid candidate to determine if fomit-frame-pointer was
	selected or not, because of gcc optimizations. We use bt_init
	instead.

	* modules/Makefile (doc): Add a target that generates the doxygen
	documentation. 

	* loader/mod.h (EXPORT_FUNCTION_RESTRICTED): Change the symbol
	names generated by the macros, so that they include the name of
	the target module (the one allowed to import the exported
	symbol). This is needed in order to export the same symbol to
	multiple modules. Previously, the RESTRICTED system generated
	symbols that were identical for a given symbol exported to
	multiple modules.

	* doc/testingfr.tex: A big update to this documentation. Not
	finished. The english version should also be updated.

	* TODO: Some new things to do.

	* MkVars (CFLAGS): Pass the DEBUG_LEVEL Makefile variable to the C
	files. In each modules/.../Makefile, we can set a
	DEBUG_LEVEL=value that will set the level of verbosity of the
	module. Macros named DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3 have
	been added.
	(MODULES): Change all '-' to '_', because of the new
	EXPORT_FUNCTION_RESTRICTED system. This system creates symbol that
	contains the name of a module (the one allowed to import the
	exported symbol). But the '-' character is not allowed inside C
	identifiers. So, we use '_' instead.

	* CREDITS: Add Fabrice Bellard to the CREDITS, for his Qemu
	emulator.



Index: bt.c
===================================================================
RCS file: /var/cvs/kos/kos/modules/debug/bt.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- bt.c	21 May 2002 08:51:56 -0000	1.6
+++ bt.c	28 Dec 2004 18:44:17 -0000	1.7
@@ -13,7 +13,7 @@
 
 __init_text int _init_backtracing_stuff(void)
 {
-  char *first_opcode = (char*)bt_next;
+  char *first_opcode = (char*)bt_init;
 
   if (*first_opcode != 0x55) /* pushl %ebp */ {
     fomit_frame_pointer = _SET;

Index: debug.h
===================================================================
RCS file: /var/cvs/kos/kos/modules/debug/debug.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- debug.h	19 Aug 2003 00:13:30 -0000	1.37
+++ debug.h	28 Dec 2004 18:44:17 -0000	1.38
@@ -56,7 +56,7 @@
 
 #define _B_RED      "\033[31m"
 #define _B_GREEN    "\033[32m"
-#define _B_KKDOI    "\033[33m" 
+#define _B_KKDOI    "\033[33m"
 #define _B_BLUE     "\033[34m"
 #define _B_VIOLET   "\033[35m"
 #define _B_CYAN     "\033[36m"
@@ -74,14 +74,33 @@
 #define DEBUG_CONSOLE 2
 #define DEBUG_BOCHS   3
 
+/* Remove this */
 #define DEBUG_PRINT __dbg_printk
 
+#if (DEBUG_LEVEL == 0)
+#define DEBUG_PRINT1(fmt, args...)
+#define DEBUG_PRINT2(fmt, args...)
+#define DEBUG_PRINT3(fmt, args...)
+#elif (DEBUG_LEVEL == 1)
+#define DEBUG_PRINT1 __dbg_printk
+#define DEBUG_PRINT2(fmt, args...)
+#define DEBUG_PRINT3(fmt, args...)
+#elif (DEBUG_LEVEL == 2)
+#define DEBUG_PRINT1 __dbg_printk
+#define DEBUG_PRINT2 __dbg_printk
+#define DEBUG_PRINT3(fmt, args...)
+#else
+#define DEBUG_PRINT1 __dbg_printk
+#define DEBUG_PRINT2 __dbg_printk
+#define DEBUG_PRINT3 __dbg_printk
+#endif
+
 /*
  * DEBUG_PRINT with file/function/line indication.
  */
 #define DEBUG_PRINT_VERBOSE(fmt, args...) ({ \
-  DEBUG_PRINT("[%s@%s:%d] ", __PRETTY_FUNCTION__, __FILE__, __LINE__); \
-  DEBUG_PRINT(fmt, ## args); \
+  DEBUG_PRINT1("[%s@%s:%d] ", __PRETTY_FUNCTION__, __FILE__, __LINE__); \
+  DEBUG_PRINT1(fmt, ## args); \
 })
 
 

Index: debug.c
===================================================================
RCS file: /var/cvs/kos/kos/modules/debug/debug.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- debug.c	20 Aug 2003 21:32:30 -0000	1.39
+++ debug.c	28 Dec 2004 18:44:17 -0000	1.40
@@ -335,9 +335,6 @@
   if(_init_debug() < 0)
     return -1;
 
-  if (_init_backtracing_stuff())
-    return -1;
-
 #ifdef DEBUG_BOCHS_OUTPUT
   __dbg_enable_output(DEBUG_BOCHS);
 #endif
@@ -353,6 +350,9 @@
   __dbg_enable_output(DEBUG_SERIAL1);
 #endif
 
+  if (_init_backtracing_stuff())
+    return -1;
+
   return 0;
 }
 



More information about the Kos-cvs mailing list