diff options
| author | Guillem Jover <guillem@debian.org> | 2006-02-02 04:16:44 +0000 |
|---|---|---|
| committer | Guillem Jover <guillem@debian.org> | 2006-02-02 04:16:44 +0000 |
| commit | e09f73b045d4b8b3b5d33fd179e88493e2d1b0f7 (patch) | |
| tree | 7549fc1af274cf5336178d0d8e9350c3cd23d756 /debian | |
| parent | 27e0cc4c26b1f1ce8712e62985243ba180c7b6f6 (diff) | |
* Make the Linux glude code use GNU Mach's AST software interrupts instead
of hooking into SPL code.
- debian/patches/60_glue_linux_soft_ints.patch: New file.
Thanks to Gianluca Guida <glguida@gmail.com>.
Diffstat (limited to 'debian')
| -rw-r--r-- | debian/changelog | 4 | ||||
| -rw-r--r-- | debian/patches/60_glue_linux_soft_ints.patch | 185 |
2 files changed, 189 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 6cec45c..f0579e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,10 @@ gnumach (1:20060201-1) UNRELEASED; urgency=low * Do not allow PCI IRQ's higher than 16. - debian/patches/patches/24_pci_irq_fix.patch: New file. Thanks to Gianluca Guida <glguida@gmail.com>. + * Make the Linux glude code use GNU Mach's AST software interrupts instead + of hooking into SPL code. + - debian/patches/60_glue_linux_soft_ints.patch: New file. + Thanks to Gianluca Guida <glguida@gmail.com>. -- Guillem Jover <guillem@debian.org> Wed, 1 Feb 2006 23:21:59 +0200 diff --git a/debian/patches/60_glue_linux_soft_ints.patch b/debian/patches/60_glue_linux_soft_ints.patch new file mode 100644 index 0000000..5395250 --- /dev/null +++ b/debian/patches/60_glue_linux_soft_ints.patch @@ -0,0 +1,185 @@ +#DPATCHLEVEL=1 + +Current GNU Mach provides Linux's "software interrupts" (bottom +halves) by calling 'linux_soft_intr' during spl switches and Linux's +schedule() call. +However, Mach has support for software interrupts or similar, +obscurely called 'ASTs' (see kern/ast.c). + +This patch make the glue use Mach AST's and remove the invasive (IMHO) +SPL's hacks and let schedule() just block the thread, not making it +deal with software interrupts. + + +2006-02-01 Gianluca Guida <glguida@gmail.com> + + * i386/i386/spl.S (spl0) [LINUX_DEV]: Removed linux glue dependant + code for calling linux_soft_intr. + (splx_cli) [LINUX_DEV]: Likewise. + + * kern/ast.h (AST_LINUX20): New macro. + * kern/ast.c (ast_taken): Call linux_ast() on AST_LINUX20 reason. + + * linux/dev/kernel/sched.c (handle_soft_intr): Function removed. + (schedule): Do not call handle_soft_intr() anymore. + * linux/dev/kenrel/softirq.c (linux_soft_intr): Changed name into ... + (linux_ast): ... this. + * linux/src/include/linux/interrupt.h: Include <kern/ast.h>. + (mark_bh): Call ast_on() with reason AST_LINUX20. + + +diff -ru gnumach-vanilla/i386/i386/spl.S gnumach-lessglueisbetter/i386/i386/spl.S +--- gnumach-vanilla/i386/i386/spl.S 1997-02-25 22:27:11.000000000 +0100 ++++ gnumach-lessglueisbetter/i386/i386/spl.S 2006-01-28 04:12:00.000000000 +0100 +@@ -55,18 +55,6 @@ + movl EXT(curr_ipl),%eax /* save current ipl */ + pushl %eax + cli /* disable interrupts */ +-#ifdef LINUX_DEV +- movl EXT(bh_active),%eax +- /* get pending mask */ +- andl EXT(bh_mask),%eax /* any pending unmasked interrupts? */ +- jz 1f /* no, skip */ +- call EXT(spl1) /* block further interrupts */ +- incl EXT(intr_count) /* set interrupt flag */ +- call EXT(linux_soft_intr) /* go handle interrupt */ +- decl EXT(intr_count) /* decrement interrupt flag */ +- cli /* disable interrupts */ +-1: +-#endif + cmpl $0,softclkpending /* softclock pending? */ + je 1f /* no, skip */ + movl $0,softclkpending /* clear flag */ +@@ -146,18 +134,6 @@ + cli /* disable interrupts */ + testl %edx,%edx /* spl0? */ + jnz 2f /* no, skip */ +-#ifdef LINUX_DEV +- movl EXT(bh_active),%eax +- /* get pending mask */ +- andl EXT(bh_mask),%eax /* any pending unmasked interrupts? */ +- jz 1f /* no, skip */ +- call EXT(spl1) /* block further interrupts */ +- incl EXT(intr_count) /* set interrupt flag */ +- call EXT(linux_soft_intr) /* go handle interrupt */ +- decl EXT(intr_count) /* decrement interrupt flag */ +- cli /* disable interrupts */ +-1: +-#endif + cmpl $0,softclkpending /* softclock pending? */ + je 1f /* no, skip */ + movl $0,softclkpending /* clear flag */ + +diff -ru gnumach-vanilla/kern/ast.c gnumach-lessglueisbetter/kern/ast.c +--- gnumach-vanilla/kern/ast.c 2001-04-05 08:39:20.000000000 +0200 ++++ gnumach-lessglueisbetter/kern/ast.c 2006-01-27 17:02:19.000000000 +0100 +@@ -54,7 +54,7 @@ + #include <mach/policy.h> + #endif /* MACH_FIXPRI */ + +- ++extern void linux_ast(); + volatile ast_t need_ast[NCPUS]; + + void +@@ -90,6 +90,9 @@ + if (reasons & AST_NETWORK) + net_ast(); + ++ if (reasons & AST_LINUX20) ++ linux_ast(); ++ + #if NORMA_IPC + if (reasons & AST_NETIPC) + netipc_ast(); +diff -ru gnumach-vanilla/kern/ast.h gnumach-lessglueisbetter/kern/ast.h +--- gnumach-vanilla/kern/ast.h 2001-04-05 08:39:20.000000000 +0200 ++++ gnumach-lessglueisbetter/kern/ast.h 2006-01-27 17:01:53.000000000 +0100 +@@ -56,6 +56,7 @@ + #define AST_BLOCK 0x4 + #define AST_NETWORK 0x8 + #define AST_NETIPC 0x10 ++#define AST_LINUX20 0x20 + + #define AST_SCHEDULING (AST_HALT|AST_TERMINATE|AST_BLOCK) + +diff -ru gnumach-vanilla/linux/dev/kernel/sched.c gnumach-lessglueisbetter/linux/dev/kernel/sched.c +--- gnumach-vanilla/linux/dev/kernel/sched.c 1999-04-26 07:49:38.000000000 +0200 ++++ gnumach-lessglueisbetter/linux/dev/kernel/sched.c 2006-01-27 18:29:28.000000000 +0100 +@@ -51,7 +51,6 @@ + extern void free_contig_mem (vm_page_t); + extern spl_t splhigh (void); + extern spl_t splx (spl_t); +-extern void linux_soft_intr (void); + extern int issig (void); + extern int printf (const char *, ...); + extern int linux_auto_config; +@@ -64,17 +63,6 @@ + + static struct wait_queue **auto_config_queue; + +-static inline void +-handle_soft_intr (void) +-{ +- if (bh_active & bh_mask) +- { +- intr_count = 1; +- linux_soft_intr (); +- intr_count = 0; +- } +-} +- + static void + tqueue_bh (void) + { +@@ -318,7 +318,6 @@ + printk ("Aiee: scheduling in interrupt %p\n", + __builtin_return_address (0)); + +- handle_soft_intr (); + run_task_queue (&tq_scheduler); + + if (!linux_auto_config) +@@ -635,8 +622,4 @@ + mark_bh (TIMER_BH); + if (tq_timer) + mark_bh (TQUEUE_BH); +-#if 0 +- if (linux_timer_print) +- printf ("linux_timer_intr: pic_mask[0] %x\n", pic_mask[0]); +-#endif + } + +diff -ru gnumach-vanilla/linux/dev/kernel/softirq.c gnumach-lessglueisbetter/linux/dev/kernel/softirq.c +--- gnumach-vanilla/linux/dev/kernel/softirq.c 1999-04-26 07:49:38.000000000 +0200 ++++ gnumach-lessglueisbetter/linux/dev/kernel/softirq.c 2006-01-27 15:58:33.000000000 +0100 +@@ -19,7 +19,7 @@ + void (*bh_base[32]) (void); + + void +-linux_soft_intr (void) ++linux_ast (void) + { + unsigned long active; + unsigned long mask, left; + +diff -ru gnumach-vanilla/linux/src/include/linux/interrupt.h gnumach-lessglueisbetter/linux/src/include/linux/interrupt.h +--- gnumach-vanilla/linux/src/include/linux/interrupt.h 1999-04-26 07:56:35.000000000 +0200 ++++ gnumach-lessglueisbetter/linux/src/include/linux/interrupt.h 2006-01-27 17:08:54.000000000 +0100 +@@ -2,6 +2,7 @@ + #ifndef _LINUX_INTERRUPT_H + #define _LINUX_INTERRUPT_H + ++#include <kern/ast.h> + #include <linux/kernel.h> + #include <asm/bitops.h> + +@@ -53,6 +54,7 @@ + extern inline void mark_bh(int nr) + { + set_bit(nr, &bh_active); ++ ast_on (cpu_number(), AST_LINUX20); + } + + /* + |
