Fix cleanup of timebase proc entries
PATCH 1/1 Fix cleanup of timebase proc entries
Let's see how this works out: I've started to post my patches also to the bug tracker at gna.org.
This one here fixes the broken cleanup of timerstat proc entries. Not sure if I have caused the whole problem, but at least significant parts of it. :-]
Jan
--- ChangeLog | 5 +++++ include/nucleus/timebase.h | 2 +- ksrc/nucleus/module.c | 20 ++++++-------------- 3 files changed, 12 insertions(+), 15 deletions(-)
ChangeLog +5 -0
@@ -1,3 +1,8 @@ +2007-10-14 Jan Kiszka <[email protected]> + + * include/nucleus/timebase.h, ksrc/nucleus/modules.c: Fix cleanup of + timebase proc entries. + 2007-10-11 Johan Borkhuis <[email protected]> * include/rtdm/rtdm_driver.h: Add private data pointer to rtdm_device
include/nucleus/timebase.h +1 -1
@@ -363,7 +363,7 @@ do { \#define xntbase_umount () \ do { \ - xnpod_declare_tbase_proc(&nktbase); \ + xnpod_discard_tbase_proc(&nktbase); \ removeq(&nktimebaseq, &nktbase.link); \ } while (0)
ksrc/nucleus/module.c +6 -14
@@ -1082,18 +1082,10 @@ void xnpod_delete_proc(void)remove_proc_entry ("latency" , rthal_proc_root);remove_proc_entry ("sched" , rthal_proc_root);#ifdef CONFIG_XENO_OPT_STATS - { -xnholder_t *holder; -xntbase_t *tbase; - -for (holder =getheadq (&nktimebaseq); - holder !=NULL ; holder =nextq (&nktimebaseq, holder)) { - tbase =link2tbase (holder); -remove_proc_entry (tbase->name, tmstat_proc_root); - } -remove_proc_entry ("timerstat" , rthal_proc_root); -remove_proc_entry ("stat" , rthal_proc_root); - } +/* All timebases must have been deregistered now. */ + XENO_ASSERT(NUCLEUS, !getheadq(&nktimebaseq), ;); +remove_proc_entry ("timerstat" , rthal_proc_root); +remove_proc_entry ("stat" , rthal_proc_root);#endif /* CONFIG_XENO_OPT_STATS */ #if defined(CONFIG_SMP ) &&XENO_DEBUG (NUCLEUS )remove_proc_entry ("lock" , rthal_proc_root);
@@ -1242,6 +1234,8 @@ void __exit __xeno_sys_exit(void)xnshadow_cleanup ();#endif /* CONFIG_XENO_OPT_PERVASIVE */ +xntbase_umount (); +#if defined(__KERNEL__) && defined(CONFIG_PROC_FS )xnpod_delete_proc ();#endif /* __KERNEL__ && CONFIG_PROC_FS */
@@ -1260,8 +1254,6 @@ void __exit __xeno_sys_exit(void)#endif /* CONFIG_LTT */ #endif /* __KERNEL__ */ -xntbase_umount (); -if (nkmsgbuf)xnarch_free_host_mem (nkmsgbuf,XNPOD_FATAL_BUFSZ );