[Linux-hls-cvs] hls/patches gensched2-2.4.25.patch,NONE,1.1 tsc-2.4.25.patch,NONE,1.1
Status: Pre-Alpha
Brought to you by:
lucabe
|
From: Luca A. <lu...@us...> - 2004-07-18 10:40:50
|
Update of /cvsroot/linux-hls/hls/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26246 Added Files: gensched2-2.4.25.patch tsc-2.4.25.patch Log Message: - Split the gensched patch in 2 parts - Modify the setsched & gensched hook to get a task struct instead of a pid as an input --- NEW FILE: gensched2-2.4.25.patch --- diff -ur ../linux-2.4.25/Makefile linux-2.4.25/Makefile --- ../linux-2.4.25/Makefile 2004-03-07 09:07:35.000000000 +0100 +++ linux-2.4.25/Makefile 2004-06-20 15:58:40.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 25 -EXTRAVERSION = + EXTRAVERSION = -gensched KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -ur ../linux-2.4.25/arch/i386/config.in linux-2.4.25/arch/i386/config.in --- ../linux-2.4.25/arch/i386/config.in 2004-03-07 09:08:19.000000000 +0100 +++ linux-2.4.25/arch/i386/config.in 2004-06-20 15:58:40.000000000 +0200 @@ -261,6 +261,8 @@ if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then define_bool CONFIG_HAVE_DEC_LOCK y fi +#Added by Luca +bool 'Generic Scheduler' CONFIG_GENERIC_SCHEDULER endmenu mainmenu_option next_comment diff -ur ../linux-2.4.25/arch/ppc/config.in linux-2.4.25/arch/ppc/config.in --- ../linux-2.4.25/arch/ppc/config.in 2004-03-07 09:08:24.000000000 +0100 +++ linux-2.4.25/arch/ppc/config.in 2004-06-20 15:59:35.000000000 +0200 @@ -265,6 +265,9 @@ if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then define_bool CONFIG_EMBEDDEDBOOT y fi + +#Added by Luca +bool 'Generic Scheduler' CONFIG_GENERIC_SCHEDULER endmenu mainmenu_option next_comment diff -ur ../linux-2.4.25/include/linux/sched.h linux-2.4.25/include/linux/sched.h --- ../linux-2.4.25/include/linux/sched.h 2004-03-07 09:07:41.000000000 +0100 +++ linux-2.4.25/include/linux/sched.h 2004-06-20 18:03:49.000000000 +0200 @@ -415,6 +415,9 @@ /* journalling filesystem info */ void *journal_info; +#ifdef CONFIG_GENERIC_SCHEDULER + void *private_data; +#endif /* CONFIG_GENERIC_SCHEDULER */ }; /* @@ -469,6 +472,12 @@ * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ +#ifdef CONFIG_GENERIC_SCHEDULER +#define DATA_INIT private_data: NULL, +#else +#define DATA_INIT +#endif /* CONFIG_GENERIC_SCHEDULER */ + #define INIT_TASK(tsk) \ { \ state: 0, \ @@ -510,6 +519,7 @@ blocked: {{0}}, \ alloc_lock: SPIN_LOCK_UNLOCKED, \ journal_info: NULL, \ + DATA_INIT \ } @@ -806,6 +816,15 @@ extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); +#ifdef CONFIG_GENERIC_SCHEDULER +extern void (*block_hook)(struct task_struct *tsk); +extern void (*unblock_hook)(struct task_struct *tsk); +extern void (*fork_hook)(struct task_struct *tsk); +extern void (*cleanup_hook)(struct task_struct *tsk); +extern int (*setsched_hook)(struct task_struct *p, int policy, struct sched_param *param); +extern int (*getsched_hook)(struct task_struct *p, struct sched_param *param); +#endif /* CONFIG_GENERIC_SCHEDULER */ + #define __wait_event(wq, condition) \ do { \ wait_queue_t __wait; \ @@ -897,6 +916,11 @@ p->sleep_time = jiffies; list_del(&p->run_list); p->run_list.next = NULL; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((block_hook != NULL) && (p->private_data != NULL)) { + block_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } static inline int task_on_runqueue(struct task_struct *p) diff -ur ../linux-2.4.25/kernel/exit.c linux-2.4.25/kernel/exit.c --- ../linux-2.4.25/kernel/exit.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/exit.c 2004-06-20 15:58:40.000000000 +0200 @@ -21,6 +21,10 @@ #include <asm/pgtable.h> #include <asm/mmu_context.h> +#ifdef CONFIG_GENERIC_SCHEDULER +void (*cleanup_hook)(struct task_struct *tsk); +#endif /* CONFIG_GENERIC_SCHEDULER */ + extern void sem_exit (void); extern struct task_struct *child_reaper; @@ -443,6 +447,14 @@ lock_kernel(); sem_exit(); + +#ifdef CONFIG_GENERIC_SCHEDULER + /* Is this the correct place for this hook? */ + if (cleanup_hook != NULL) { + cleanup_hook(tsk); + } +#endif + __exit_files(tsk); __exit_fs(tsk); exit_namespace(tsk); diff -ur ../linux-2.4.25/kernel/fork.c linux-2.4.25/kernel/fork.c --- ../linux-2.4.25/kernel/fork.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/fork.c 2004-06-20 15:58:40.000000000 +0200 @@ -29,6 +29,10 @@ #include <asm/mmu_context.h> #include <asm/processor.h> +#ifdef CONFIG_GENERIC_SCHEDULER +void (*fork_hook)(struct task_struct *tsk); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* The idle threads do not count.. */ int nr_threads; int nr_running; @@ -779,6 +783,13 @@ if (!current->counter) current->need_resched = 1; +#ifdef CONFIG_GENERIC_SCHEDULER + p->private_data = NULL; + if (fork_hook != NULL) { + fork_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* * Ok, add it to the run-queues and make it * visible to the rest of the system. diff -ur ../linux-2.4.25/kernel/ksyms.c linux-2.4.25/kernel/ksyms.c --- ../linux-2.4.25/kernel/ksyms.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/ksyms.c 2004-06-20 15:58:40.000000000 +0200 @@ -619,6 +619,17 @@ /* debug */ EXPORT_SYMBOL(dump_stack); +#ifdef CONFIG_GENERIC_SCHEDULER +extern struct task_struct * init_tasks[NR_CPUS]; +EXPORT_SYMBOL_GPL(init_tasks); +EXPORT_SYMBOL_GPL(block_hook); +EXPORT_SYMBOL_GPL(unblock_hook); +EXPORT_SYMBOL_GPL(fork_hook); +EXPORT_SYMBOL_GPL(cleanup_hook); +EXPORT_SYMBOL_GPL(setsched_hook); +EXPORT_SYMBOL_GPL(getsched_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* To match ksyms with System.map */ extern const char _end[]; EXPORT_SYMBOL(_end); diff -ur ../linux-2.4.25/kernel/sched.c linux-2.4.25/kernel/sched.c --- ../linux-2.4.25/kernel/sched.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/sched.c 2004-06-20 18:02:35.000000000 +0200 @@ -33,6 +33,13 @@ #include <asm/uaccess.h> #include <asm/mmu_context.h> +#ifdef CONFIG_GENERIC_SCHEDULER +void (*block_hook)(struct task_struct *tsk); +void (*unblock_hook)(struct task_struct *tsk); +int (*setsched_hook)(struct task_struct *p, int policy, struct sched_param *param); +int (*getsched_hook)(struct task_struct *p, struct sched_param *param); +#endif /* CONFIG_GENERIC_SCHEDULER */ + extern void timer_bh(void); extern void tqueue_bh(void); extern void immediate_bh(void); @@ -330,6 +337,11 @@ { list_add_tail(&p->run_list, &runqueue_head); nr_running++; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((unblock_hook != NULL) && (p->private_data != NULL)) { + unblock_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } static inline void move_last_runqueue(struct task_struct * p) @@ -961,6 +973,16 @@ if (!p) goto out_unlock; +#ifdef CONFIG_GENERIC_SCHEDULER + if (setsched_hook != NULL) { + int res; + + res = setsched_hook(p, -1, param); + if (res <= 0) { + return res; + } + } +#endif if (policy < 0) policy = p->policy; else { @@ -1048,6 +1070,16 @@ retval = -ESRCH; if (!p) goto out_unlock; +#ifdef CONFIG_GENERIC_SCHEDULER + if (getsched_hook != NULL) { + int res; + + res = getsched_hook(p, param); + if (res <= 0) { + return res; + } + } +#endif lp.sched_priority = p->rt_priority; read_unlock(&tasklist_lock); --- NEW FILE: tsc-2.4.25.patch --- diff -ur linux-2.4.25/arch/i386/kernel/i386_ksyms.c linux-2.4.25-gensched/arch/i386/kernel/i386_ksyms.c --- linux-2.4.25/arch/i386/kernel/i386_ksyms.c 2004-02-18 14:36:30.000000000 +0100 +++ linux-2.4.25-gensched/arch/i386/kernel/i386_ksyms.c 2004-02-29 22:41:05.000000000 +0100 @@ -187,3 +187,10 @@ EXPORT_SYMBOL(eddnr); EXPORT_SYMBOL(edd_disk80_sig); #endif + +#ifdef CONFIG_GENERIC_SCHEDULER +extern unsigned long fast_gettimeoffset_quotient; +extern unsigned long cpu_khz; +EXPORT_SYMBOL_GPL(cpu_khz); +EXPORT_SYMBOL_GPL(fast_gettimeoffset_quotient); +#endif /* CONFIG_GENERIC_SCHEDULER */ diff -ur linux-2.4.25/arch/ppc/kernel/time.c linux-2.4.25-gensched/arch/ppc/kernel/time.c --- linux-2.4.25/arch/ppc/kernel/time.c 2003-08-25 13:44:40.000000000 +0200 +++ linux-2.4.25-gensched/arch/ppc/kernel/time.c 2004-02-29 22:35:36.000000000 +0100 @@ -90,6 +90,10 @@ EXPORT_SYMBOL(rtc_lock); +#ifdef CONFIG_GENERIC_SCHEDULER +EXPORT_SYMBOL_GPL(tb_to_us); +#endif + /* Timer interrupt helper function */ static inline int tb_delta(unsigned *jiffy_stamp) { int delta; |