The core NLKD adjustments to pre-existing code. Signed-Off-By: Jan Beulich Index: 2.6.14-nlkd/include/asm-generic/bug.h =================================================================== --- 2.6.14-nlkd.orig/include/asm-generic/bug.h 2005-11-09 10:40:16.000000000 +0100 +++ 2.6.14-nlkd/include/asm-generic/bug.h 2005-11-04 16:19:34.000000000 +0100 @@ -5,6 +5,44 @@ #include #ifdef CONFIG_BUG + +# ifdef CONFIG_NLKD + +# ifndef _LINUX_NLKD_H +# define _LINUX_NLKD_H +# include +# undef _LINUX_NLKD_H +# endif + +# ifdef HAVE_ARCH_BUG +# undef BUG +# else +# define HAVE_ARCH_BUG +# endif +# define BUG() nlkdAssert("BUG", __FILE__, __PRETTY_FUNCTION__, __LINE__) + +# ifdef HAVE_ARCH_BUG_ON +# undef BUG_ON +# else +# define HAVE_ARCH_BUG_ON +# endif +# define BUG_ON(condition) (unlikely(condition) \ + ? nlkdAssert("!(" #condition ")", __FILE__, __PRETTY_FUNCTION__, __LINE__) \ + : (void)0) + +# ifdef HAVE_ARCH_WARN_ON +# undef WARN_ON +# else +# define HAVE_ARCH_WARN_ON +# endif +# define WARN_ON(condition) (unlikely(condition) \ + ? printk("Badness in %s at %s:%d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__), \ + dump_stack(), \ + nlkdDebugEvent(DEBUG_EVENT_MESSAGE, #condition) \ + : (void)0) + +# endif /* CONFIG_NLKD */ + #ifndef HAVE_ARCH_BUG #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ Index: 2.6.14-nlkd/include/linux/sched.h =================================================================== --- 2.6.14-nlkd.orig/include/linux/sched.h 2005-11-04 16:19:34.000000000 +0100 +++ 2.6.14-nlkd/include/linux/sched.h 2005-11-04 16:19:34.000000000 +0100 @@ -298,6 +298,10 @@ struct mm_struct { /* Architecture-specific MM context */ mm_context_t context; +#ifdef CONFIG_NLKD + struct cdeBPStruct_s *bpList; +#endif + /* Token based thrashing protection. */ unsigned long swap_token_time; char recent_pagein; @@ -681,6 +685,10 @@ struct task_struct { struct mm_struct *mm, *active_mm; +#ifdef CONFIG_NLKD + struct cdeBPStruct_s *bpList; +#endif + /* task state */ struct linux_binfmt *binfmt; long exit_state; @@ -689,6 +697,9 @@ struct task_struct { /* ??? */ unsigned long personality; unsigned did_exec:1; +#ifdef CONFIG_NLKD + unsigned kstep:1; /* kernel-debugger single stepping this task */ +#endif pid_t pid; pid_t tgid; /* Index: 2.6.14-nlkd/init/Kconfig =================================================================== --- 2.6.14-nlkd.orig/init/Kconfig 2005-11-07 10:51:19.000000000 +0100 +++ 2.6.14-nlkd/init/Kconfig 2005-11-07 10:51:19.000000000 +0100 @@ -275,7 +275,7 @@ config KALLSYMS config KALLSYMS_TRADITIONAL bool "Traditional kallsyms symbol table format" depends on KALLSYMS - default !MODULES + default !MODULES && !NLKD help Say N here if you want the kernel symbol table to be consistent with that loadable modules use (i.e. the ELF symbol table extracted from Index: 2.6.14-nlkd/init/main.c =================================================================== --- 2.6.14-nlkd.orig/init/main.c 2005-11-07 10:53:53.000000000 +0100 +++ 2.6.14-nlkd/init/main.c 2005-11-07 10:53:53.000000000 +0100 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -482,6 +483,7 @@ asmlinkage void __init start_kernel(void sort_main_extable(); trap_init(); kallsyms_early_init(); + nlkd_init(); rcu_init(); init_IRQ(); pidhash_init(); @@ -709,6 +711,7 @@ static int init(void * unused) * we're essentially up and running. Get rid of the * initmem segments and start the user-mode stuff.. */ + nlkd_init_done(); kallsyms_init_done(); free_initmem(); unlock_kernel(); Index: 2.6.14-nlkd/kernel/exit.c =================================================================== --- 2.6.14-nlkd.orig/kernel/exit.c 2005-11-09 10:40:16.000000000 +0100 +++ 2.6.14-nlkd/kernel/exit.c 2005-11-04 16:19:34.000000000 +0100 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -794,6 +795,7 @@ fastcall NORET_TYPE void do_exit(long co struct task_struct *tsk = current; int group_dead; + bp_list_clear(tsk); profile_task_exit(tsk); WARN_ON(atomic_read(&tsk->fs_excl)); Index: 2.6.14-nlkd/kernel/fork.c =================================================================== --- 2.6.14-nlkd.orig/kernel/fork.c 2005-11-04 16:19:34.000000000 +0100 +++ 2.6.14-nlkd/kernel/fork.c 2005-11-04 16:19:34.000000000 +0100 @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -337,6 +338,9 @@ static struct mm_struct * mm_init(struct if (likely(!mm_alloc_pgd(mm))) { mm->def_flags = 0; +#if defined(CONFIG_CDE) || defined(CONFIG_CDE_MODULE) + mm->bpList = NULL; +#endif return mm; } free_mm(mm); @@ -377,6 +381,7 @@ void fastcall __mmdrop(struct mm_struct void mmput(struct mm_struct *mm) { if (atomic_dec_and_test(&mm->mm_users)) { + bp_list_clear(mm); exit_aio(mm); exit_mmap(mm); if (!list_empty(&mm->mmlist)) { Index: 2.6.14-nlkd/kernel/power/swsusp.c =================================================================== --- 2.6.14-nlkd.orig/kernel/power/swsusp.c 2005-11-09 10:40:16.000000000 +0100 +++ 2.6.14-nlkd/kernel/power/swsusp.c 2005-11-04 16:19:34.000000000 +0100 @@ -67,6 +67,7 @@ #include #include #include +#include #include #include @@ -1044,6 +1045,7 @@ int swsusp_suspend(void) /* Restore control flow magically appears here */ restore_processor_state(); BUG_ON (nr_copy_pages_check != nr_copy_pages); + bp_load(); restore_highmem(); device_power_up(); local_irq_enable(); @@ -1064,6 +1066,7 @@ int swsusp_resume(void) */ BUG_ON(!error); restore_processor_state(); + bp_load(); restore_highmem(); touch_softlockup_watchdog(); device_power_up(); Index: 2.6.14-nlkd/kernel/sched.c =================================================================== --- 2.6.14-nlkd.orig/kernel/sched.c 2005-11-09 10:40:16.000000000 +0100 +++ 2.6.14-nlkd/kernel/sched.c 2005-11-04 16:19:34.000000000 +0100 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -1568,12 +1569,17 @@ task_t * context_switch(runqueue_t *rq, struct mm_struct *mm = next->mm; struct mm_struct *oldmm = prev->active_mm; + bp_list_disable(1, prev); + if (unlikely(!mm)) { next->active_mm = oldmm; atomic_inc(&oldmm->mm_count); enter_lazy_tlb(oldmm, next); - } else + } else { + bp_list_disable(oldmm && oldmm != mm, oldmm); switch_mm(oldmm, mm, next); + bp_list_enable(oldmm != mm, mm); + } if (unlikely(!prev->mm)) { prev->active_mm = NULL; @@ -1584,6 +1590,8 @@ task_t * context_switch(runqueue_t *rq, /* Here we just switch the register state and the stack. */ switch_to(prev, next, prev); + bp_list_enable(1, current); + return prev; }