Hi Alan
I found one way to break the circularity. The association of type and struct
definitions with interlocking inline functions caused the problem. This
extracts task_struct from linux/sched.h to its own header,
linux/task_struct.h. There are a few modifications elsewhere to support
this. I'm not sure all the changes were necessary, but they are working as I
write:
$ uname -a
Linux mercury 2.4.1 #3 SMP Sat Feb 10 08:28:39 EST 2001 i686 unknown
$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 1
model name : AMD-K7(tm) Processor
stepping: 2
cpu MHz : 704.949
cache size : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat mmx
syscall mmxext 3dnowext 3dnow
bogomips: 1405.74
I don't have access to a real SMP Athlon box, so I'd appreciate test reports
on the real thing. I expect some polishing will be needed.
Cheers,
Tom
--
The Daemons lurk and are dumb. -- Emerson
diff -uNr linux-2.4.1-pristine/include/asm-i386/string.h
linux/include/asm-i386/string.h
--- linux-2.4.1-pristine/include/asm-i386/string.h Tue Feb 6 03:55:24 2001
+++ linux/include/asm-i386/string.h Sat Feb 10 08:28:32 2001
@@ -289,10 +289,9 @@
/* All this just for in_interrupt() ... */
-#include
-#include
+#include
+#include
#include
-#include
#include
#include
diff -uNr linux-2.4.1-pristine/include/linux/capability.h
linux/include/linux/capability.h
--- linux-2.4.1-pristine/include/linux/capability.h Thu Feb 8 23:55:24 2001
+++ linux/include/linux/capability.hSat Feb 10 07:41:19 2001
@@ -14,7 +14,9 @@
#define _LINUX_CAPABILITY_H
#include
+/* Try removing -- we'll see if there are parasitic users
#include
+*/
/* User-level do most of the mapping between kernel and user
capabilities based on the version tag given by the kernel. The
diff -uNr linux-2.4.1-pristine/include/linux/mm_struct.h
linux/include/linux/mm_struct.h
--- linux-2.4.1-pristine/include/linux/mm_struct.h Wed Dec 31 19:00:00 1969
+++ linux/include/linux/mm_struct.h Sat Feb 10 08:02:15 2001
@@ -0,0 +1,47 @@
+#ifndef _LINUX_MM_STRUCT_H
+#define _LINUX_MM_STRUCT_H
+/*
+ * linux/struct_mm.h
+ * Extracted from linux/sched.h: 02/09/2001 Tom Leete
+ *
+ */
+
+#ifdef __KERNEL__
+
+#include
+#include
+#include
+#include
+
+
+#ifndef _LINUX_MM_H
+struct vm_area_struct;
+#endif
+
+struct mm_struct {
+ struct vm_area_struct * mmap; /* list of VMAs */
+ struct vm_area_struct * mmap_avl; /* tree of VMAs */
+ struct vm_area_struct * mmap_cache; /* last find_vma result */
+ pgd_t * pgd;
+ atomic_t mm_users; /* How many users with user space? */
+ atomic_t mm_count; /* How many references to "struct
+mm_struct" (users count as 1) */
+ int map_count; /* number of VMAs */
+ struct semaphore mmap_sem;
+ spinlock_t page_table_lock;
+
+ struct list_head mmlist;/* List of all active mm's */
+
+ unsigned long start_code, end_code, start_data, end_data;
+ unsigned long start_brk, brk, start_stack;
+ unsigned long arg_start, arg_end, env_start, env_end;
+ unsigned long rss, total_vm, locked_vm;
+ unsigned long def_flags;
+ unsigned long cpu_vm_mask;
+ unsigned long swap_address;
+
+ /* Architecture-specific MM context */
+ mm_context_t context;
+};
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_MM_STRUCT_H */
diff -uNr linux-2.4.1-pristine/include/linux/sched.h linux/include/linux/sched.h
--- linux-2.4.1-pristine/include/linux/sched.h Thu Feb 8 23:55:24 2001
+++ linux/include/linux/sched.h Sat Feb 10 08:28:32 2001
@@ -11,6 +11,7 @@
#include
#include
#include
+#include
#include
#include
@@ -200,30 +201,7 @@
/* Number of map areas at which the AVL tree is activated. This is arbitrary. */
#define AVL_MIN_MAP_COUNT 32
-struct mm_struct {
- struct vm_area_struct * mmap; /* list of VMAs */
- struct vm_area_struct * mmap_avl; /* tree of VMAs */
- struct vm_area_struct * mmap_cache; /* last find_vma result */
- pgd_t * pgd;
- atomic_t mm_users; /* How many users with user space? */
- atomic_t mm_count; /* How many references to "struct
mm_struct" (users count as 1) */
- int map_count; /* number of VMAs */
- struct semaphore mmap_sem;
- spinlock_t page_table_lock;
-
- struct list_head mmlist;/* List of all active mm's */
-
- unsigned long start_code, end_code, start_data, end_data;
- unsigned long start_brk, brk, start_stack;
- unsi