bk://linux-sam.bkbits.net/kbuild sam@mars.ravnborg.org|ChangeSet|20041027231008|35943 sam # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/28 12:43:14-07:00 akpm@bix.(none) # Merge bk://linux-sam.bkbits.net/kbuild # into bix.(none):/usr/src/bk-kbuild # # Makefile # 2004/10/28 12:43:10-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/10/28 01:10:08+02:00 sam@mars.ravnborg.org # v850: use generic support ofr asm-consts.h # # Signed-off-by: Sam Ravnborg # # include/asm-v850/Kbuild # 2004/10/28 01:09:50+02:00 sam@mars.ravnborg.org +15 -0 # # include/asm-v850/Kbuild # 2004/10/28 01:09:50+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-v850/Kbuild # # arch/v850/Makefile # 2004/10/28 01:09:50+02:00 sam@mars.ravnborg.org +1 -13 # Move asm-consts.h support to include/asm-v850 # # include/asm-v850/asm-consts.c # 2004/10/28 01:08:18+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/v850/kernel/asm-consts.c -> include/asm-v850/asm-consts.c # # ChangeSet # 2004/10/28 01:06:00+02:00 sam@mars.ravnborg.org # sparc: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-sparc/Kbuild # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-sparc/ptrace.h # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # include/asm-sparc/Kbuild # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-sparc/Kbuild # # arch/sparc/mm/viking.S # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # arch/sparc/mm/tsunami.S # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # arch/sparc/mm/swift.S # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # arch/sparc/mm/hypersparc.S # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # arch/sparc/kernel/sclow.S # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # arch/sparc/kernel/entry.S # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -1 # Rename to kernel wide name offsets.h # # arch/sparc/Makefile # 2004/10/28 01:05:41+02:00 sam@mars.ravnborg.org +1 -10 # Move offsets.h support to include/asm-sparc # # include/asm-sparc/offsets.c # 2004/10/28 01:02:59+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/sparc/kernel/asm-offsets.c -> include/asm-sparc/offsets.c # # ChangeSet # 2004/10/28 00:58:37+02:00 sam@mars.ravnborg.org # x86_64: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-x86_64/Kbuild # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-x86_64/current.h # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # include/asm-x86_64/Kbuild # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-x86_64/Kbuild # # arch/x86_64/lib/putuser.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/lib/getuser.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/lib/copy_user.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/kernel/vsyscall.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/kernel/entry.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/ia32/vsyscall-sysenter.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/ia32/vsyscall-syscall.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/ia32/ia32entry.S # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/x86_64/Makefile # 2004/10/28 00:58:18+02:00 sam@mars.ravnborg.org +0 -10 # Move offsets.h support to include/asm-x86_64 # # include/asm-x86_64/offsets.c # 2004/10/28 00:55:55+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/x86_64/kernel/asm-offsets.c -> include/asm-x86_64/offsets.c # # ChangeSet # 2004/10/28 00:50:50+02:00 sam@mars.ravnborg.org # sh64: use generic support for offsets.h # # Also moved syscalltab.h to include/asm-sh64. # # Signed-off-by: Sam Ravnborg # # include/asm-sh64/Kbuild # 2004/10/28 00:50:31+02:00 sam@mars.ravnborg.org +49 -0 # # include/asm-sh64/Kbuild # 2004/10/28 00:50:31+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-sh64/Kbuild # # arch/sh64/kernel/entry.S # 2004/10/28 00:50:31+02:00 sam@mars.ravnborg.org +1 -1 # Use kernel wide name offsets.h # # arch/sh64/Makefile # 2004/10/28 00:50:30+02:00 sam@mars.ravnborg.org +0 -37 # Move offsets.h and syscalltab.h support to include/asm-sh64 # # include/asm-sh64/offsets.c # 2004/10/28 00:45:23+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/sh64/kernel/asm-offsets.c -> include/asm-sh64/offsets.c # # ChangeSet # 2004/10/28 00:39:47+02:00 sam@mars.ravnborg.org # s390: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-s390/Kbuild # 2004/10/28 00:39:28+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-s390/Kbuild # 2004/10/28 00:39:28+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-s390/Kbuild # # arch/s390/Makefile # 2004/10/28 00:39:28+02:00 sam@mars.ravnborg.org +0 -10 # Move offsets.h support to include/asm-s390 # # include/asm-s390/offsets.c # 2004/10/28 00:38:17+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/s390/kernel/asm-offsets.c -> include/asm-s390/offsets.c # # ChangeSet # 2004/10/28 00:36:35+02:00 sam@mars.ravnborg.org # ppc64: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-ppc64/Kbuild # 2004/10/28 00:36:16+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-ppc64/Kbuild # 2004/10/28 00:36:16+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-ppc64/Kbuild # # arch/ppc64/Makefile # 2004/10/28 00:36:16+02:00 sam@mars.ravnborg.org +0 -10 # Move offsets.h support to include/asm-ppc64 # # include/asm-ppc64/offsets.c # 2004/10/28 00:35:07+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/ppc64/kernel/asm-offsets.c -> include/asm-ppc64/offsets.c # # ChangeSet # 2004/10/28 00:34:31+02:00 sam@mars.ravnborg.org # ppc: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-ppc/Kbuild # 2004/10/28 00:34:12+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-ppc/Kbuild # 2004/10/28 00:34:12+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-ppc/Kbuild # # arch/ppc/Makefile # 2004/10/28 00:34:12+02:00 sam@mars.ravnborg.org +2 -10 # Move offsets.h support to include/asm-ppc # # include/asm-ppc/offsets.c # 2004/10/28 00:32:57+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/ppc/kernel/asm-offsets.c -> include/asm-ppc/offsets.c # # ChangeSet # 2004/10/28 00:31:17+02:00 sam@mars.ravnborg.org # parisc: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-parisc/Kbuild # 2004/10/28 00:30:58+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-parisc/Kbuild # 2004/10/28 00:30:58+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-parisc/Kbuild # # arch/parisc/Makefile # 2004/10/28 00:30:58+02:00 sam@mars.ravnborg.org +1 -9 # Move offsets.h support to include/asm-parisc # # include/asm-parisc/offsets.c # 2004/10/28 00:29:22+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/parisc/kernel/asm-offsets.c -> include/asm-parisc/offsets.c # # ChangeSet # 2004/10/28 00:23:06+02:00 sam@mars.ravnborg.org # mips: move offset.h and reg.h support to include/asm-mips # # Signed-off-by: Sam Ravnborg # # include/asm-mips/Kbuild # 2004/10/28 00:22:48+02:00 sam@mars.ravnborg.org +56 -0 # # include/asm-mips/Kbuild # 2004/10/28 00:22:48+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-mips/Kbuild # # arch/mips/Makefile # 2004/10/28 00:22:48+02:00 sam@mars.ravnborg.org +1 -52 # Move offset.h + reg.h support to include/asm-mips # # include/asm-mips/offset.c # 2004/10/28 00:21:35+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/mips/kernel/offset.c -> include/asm-mips/offset.c # # include/asm-mips/reg.c # 2004/10/28 00:21:08+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/mips/kernel/reg.c -> include/asm-mips/reg.c # # ChangeSet # 2004/10/28 00:12:41+02:00 sam@mars.ravnborg.org # m68knommu: use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-m68knommu/Kbuild # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-m68knommu/Kbuild # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-m68knommu/Kbuild # # arch/m68knommu/platform/68360/entry.S # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm-offsets.h to the kernel wide offsets.h name # # arch/m68knommu/platform/68328/entry.S # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm-offsets.h to the kernel wide offsets.h name # # arch/m68knommu/platform/5307/entry.S # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm-offsets.h to the kernel wide offsets.h name # # arch/m68knommu/kernel/entry.S # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm-offsets.h to the kernel wide offsets.h name # # arch/m68knommu/Makefile # 2004/10/28 00:12:23+02:00 sam@mars.ravnborg.org +0 -10 # Move offsets.h support to include/asm-m68knommu # # include/asm-m68knommu/offsets.c # 2004/10/28 00:10:46+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/m68knommu/kernel/asm-offsets.c -> include/asm-m68knommu/offsets.c # # ChangeSet # 2004/10/28 00:07:08+02:00 sam@mars.ravnborg.org # m68k: Use generic offsets.h support # # Signed-off-by: Sam Ravnborg # # include/asm-m68k/Kbuild # 2004/10/28 00:06:49+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-m68k/Kbuild # 2004/10/28 00:06:49+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-m68k/Kbuild # # arch/m68k/Makefile # 2004/10/28 00:06:49+02:00 sam@mars.ravnborg.org +0 -9 # Move offsets.h support to include/asm-m68k # # include/asm-m68k/offsets.c # 2004/10/28 00:05:12+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/m68k/kernel/asm-offsets.c -> include/asm-m68k/offsets.c # # ChangeSet # 2004/10/28 00:02:01+02:00 sam@mars.ravnborg.org # ia64: Use generic support for offsets.h # # This may cause troubles because kbuild now have full knowledge over dependencies # so the .stamp trick may have to be updated. # # Signed-off-by: Sam Ravnborg # # include/asm-ia64/Kbuild # 2004/10/28 00:01:41+02:00 sam@mars.ravnborg.org +29 -0 # # include/asm-ia64/Kbuild # 2004/10/28 00:01:41+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-ia64/Kbuild # # arch/ia64/Makefile # 2004/10/28 00:01:41+02:00 sam@mars.ravnborg.org +1 -16 # Move offsets.h support to include/asm-ia64 # # include/asm-ia64/offsets.c # 2004/10/27 23:57:23+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/ia64/kernel/asm-offsets.c -> include/asm-ia64/offsets.c # # ChangeSet # 2004/10/27 23:52:08+02:00 sam@mars.ravnborg.org # h8300: USe generic offsets.h support # # Signed-off-by: Sam Ravnborg # # include/asm-h8300/Kbuild # 2004/10/27 23:51:49+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-h8300/Kbuild # 2004/10/27 23:51:49+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-h8300/Kbuild # # arch/h8300/platform/h8s/entry.S # 2004/10/27 23:51:49+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm-offsets.h to kernel wide offsets.h # # arch/h8300/platform/h8300h/entry.S # 2004/10/27 23:51:49+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm-offsets.h to kernel wide offsets.h # # arch/h8300/Makefile # 2004/10/27 23:51:49+02:00 sam@mars.ravnborg.org +0 -8 # Move offsets.h support to include/asm-h8300 # # include/asm-h8300/offsets.c # 2004/10/27 23:50:25+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/h8300/kernel/asm-offsets.c -> include/asm-h8300/offsets.c # # ChangeSet # 2004/10/27 23:46:28+02:00 sam@mars.ravnborg.org # arm26: Use generic support for offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-arm26/Kbuild # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-arm26/Kbuild # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-arm26/Kbuild # # arch/arm26/nwfpe/entry.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/mm/proc-funcs.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/lib/putuser.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/lib/getuser.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/lib/csumpartialcopyuser.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/lib/copy_page.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/kernel/entry.S # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets to the kernel wide offsets.h name # # arch/arm26/Makefile # 2004/10/27 23:46:09+02:00 sam@mars.ravnborg.org +0 -18 # Move offsets.h support to include/asm-arm26 # Also clean up a bit unused stuff # # include/asm-arm26/offsets.c # 2004/10/27 23:42:43+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/arm26/kernel/asm-offsets.c -> include/asm-arm26/offsets.c # # ChangeSet # 2004/10/27 23:35:02+02:00 sam@mars.ravnborg.org # arm: Use new generic offset.h infrastructure # # The symlinking taking place in include/asm-arm had to move also. # Did not have an arm toolchain to test it.. # # Signed-off-by: Sam Ravnborg # # include/asm-arm/Kbuild # 2004/10/27 23:34:44+02:00 sam@mars.ravnborg.org +35 -0 # # include/asm-arm/Kbuild # 2004/10/27 23:34:44+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-arm/Kbuild # # arch/arm/Makefile # 2004/10/27 23:34:44+02:00 sam@mars.ravnborg.org +3 -23 # Move generating of constants.h to include/asm-arm # Same with .arch # # include/asm-arm/offsets.c # 2004/10/27 23:30:02+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/arm/kernel/asm-offsets.c -> include/asm-arm/offsets.c # # ChangeSet # 2004/10/27 23:16:30+02:00 sam@mars.ravnborg.org # alpha: fix include/asm-alpha/Kbuild # # copy'n'paste bug. Get rid of i386. # # Signed-off-by: Sam Ravnborg # # include/asm-alpha/Kbuild # 2004/10/27 23:16:13+02:00 sam@mars.ravnborg.org +2 -2 # Make Kbuild file more generic # # ChangeSet # 2004/10/27 23:10:14+02:00 sam@mars.ravnborg.org # alpha: use generic support to generate offsets.h # # Also did a renaming to the kernel wide name: offsets.h # # Signed-off-by: Sam Ravnborg # # include/asm-alpha/Kbuild # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-alpha/Kbuild # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-alpha/Kbuild # # arch/alpha/lib/dbg_stackkill.S # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h to match rest of kernel # # arch/alpha/lib/dbg_stackcheck.S # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h to match rest of kernel # # arch/alpha/kernel/head.S # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h to match rest of kernel # # arch/alpha/kernel/entry.S # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h to match rest of kernel # # arch/alpha/Makefile # 2004/10/27 23:09:55+02:00 sam@mars.ravnborg.org +0 -10 # Move offsets.h support to include/asm-alpha # # ChangeSet # 2004/10/27 23:07:09+02:00 sam@mars.ravnborg.org # i386: use new generic infrastructure to generate offsets.h # # Also renamed .h file to offsets.h. # This is the most widely used naming. # # Signed-off-by: Sam Ravnborg # # include/asm-i386/Kbuild # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +17 -0 # # include/asm-i386/thread_info.h # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h. So we use the same name all over the kernel # # include/asm-i386/Kbuild # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-i386/Kbuild # # arch/i386/kernel/vsyscall.lds.S # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h. So we use the same name all over the kernel # # arch/i386/kernel/vsyscall-sigreturn.S # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h. So we use the same name all over the kernel # # arch/i386/kernel/head.S # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +1 -1 # Rename asm_offsets.h to offsets.h. So we use the same name all over the kernel # # arch/i386/Makefile # 2004/10/27 23:06:50+02:00 sam@mars.ravnborg.org +0 -9 # Move asm_offsets support to include/asm-i386 # # ChangeSet # 2004/10/27 23:00:44+02:00 sam@mars.ravnborg.org # kbuild: introduce a generic method to generate offsets.h # # The following patch will break most architectures because it introduce a new way to # generate the offsets.h file. The main rationale is to use correct dependencies for # the offsets.h file. Before one could change a .h file with no recompile of # offsets.h resulting in assembler code to use wrong constants - horror. # Follow-up patches will try to unbreak all relevant architectures. # # As an added bonus give a nice print-out when .config is missing. # # Signed-off-by: Sam Ravnborg # # include/asm-generic/Kbuild # 2004/10/27 23:00:26+02:00 sam@mars.ravnborg.org +24 -0 # # include/asm-generic/Kbuild # 2004/10/27 23:00:26+02:00 sam@mars.ravnborg.org +0 -0 # BitKeeper file /home/sam/bk/offset/include/asm-generic/Kbuild # # Makefile # 2004/10/27 23:00:25+02:00 sam@mars.ravnborg.org +5 -21 # New generic method to generate offsets.h file # Move the handling to include/asm-$(ARCH) and make sure # to build the offsets.h file before starting the real kernel build. # # ChangeSet # 2004/10/27 22:50:11+02:00 sam@mars.ravnborg.org # kbuild: Prefer Kbuild as name of the kbuild files # # The kbuild syntax is unique and does only have very few things in common with # usual Makefile syntax. So to avoid confusion make the filename 'Kbuild' be # the preferred name as replacement for 'Makefile'. # No global renaming planned to take place for now, but new stuff expected to use # the new 'Kbuild' filename. # # Signed-off-by: Sam Ravnborg # # scripts/Makefile.clean # 2004/10/27 22:49:53+02:00 sam@mars.ravnborg.org +1 -1 # Kbuild is now the preferred name for a kbuild file # # scripts/Makefile.build # 2004/10/27 22:49:53+02:00 sam@mars.ravnborg.org +1 -1 # Kbuild is now the preferred name for a build file # # Documentation/kbuild/makefiles.txt # 2004/10/27 22:49:53+02:00 sam@mars.ravnborg.org +5 -2 # Document the new preferred Kbuild filename # # include/asm-i386/offsets.c # 2004/10/27 22:28:31+02:00 sam@mars.ravnborg.org +0 -0 # Rename: arch/i386/kernel/asm-offsets.c -> include/asm-i386/offsets.c # diff -Nru a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt --- a/Documentation/kbuild/makefiles.txt 2004-10-28 22:41:09 -07:00 +++ b/Documentation/kbuild/makefiles.txt 2004-10-28 22:41:09 -07:00 @@ -6,7 +6,7 @@ === 1 Overview === 2 Who does what - === 3 The kbuild Makefiles + === 3 The kbuild files --- 3.1 Goal definitions --- 3.2 Built-in object goals - obj-y --- 3.3 Loadable module goals - obj-m @@ -101,11 +101,14 @@ This document is aimed towards normal developers and arch developers. -=== 3 The kbuild Makefiles +=== 3 The kbuild files Most Makefiles within the kernel are kbuild Makefiles that use the kbuild infrastructure. This chapter introduce the syntax used in the kbuild makefiles. +The preferred name for the kbuild files is 'Kbuild' but 'Makefile' will +continue to be supported. All new developmen is expected to use the +Kbuild filename. Section 3.1 "Goal definitions" is a quick intro, further chapters provide more details, with real examples. diff -Nru a/Makefile b/Makefile --- a/Makefile 2004-10-28 22:41:09 -07:00 +++ b/Makefile 2004-10-28 22:41:09 -07:00 @@ -476,6 +476,9 @@ -include .config.cmd include .config +$(if $(wildcard .config),, \ + $(warning *** Use 'make *config' to generate .config.) \ + $(error Try 'make help'!)) # If .config needs to be updated, it will be done via the dependency # that autoconf has on .config. @@ -758,6 +761,7 @@ prepare1: prepare2 outputmakefile prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER + $(Q)$(MAKE) $(build)=$(srctree)/include/asm ifneq ($(KBUILD_MODULES),) $(Q)rm -rf $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR) @@ -904,26 +908,6 @@ endif # CONFIG_MODULES -# Generate asm-offsets.h -# --------------------------------------------------------------------------- - -define filechk_gen-asm-offsets - (set -e; \ - echo "#ifndef __ASM_OFFSETS_H__"; \ - echo "#define __ASM_OFFSETS_H__"; \ - echo "/*"; \ - echo " * DO NOT MODIFY."; \ - echo " *"; \ - echo " * This file was generated by arch/$(ARCH)/Makefile"; \ - echo " *"; \ - echo " */"; \ - echo ""; \ - sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ - echo ""; \ - echo "#endif" ) -endef - - ### # Cleaning is done on three levels. # make clean Delete most generated files @@ -946,7 +930,7 @@ # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_,$(vmlinux-alldirs)) +clean-dirs := $(addprefix _clean_,$(vmlinux-alldirs) include/asm-$(ARCH)) .PHONY: $(clean-dirs) clean archclean $(clean-dirs): diff -Nru a/arch/alpha/Makefile b/arch/alpha/Makefile --- a/arch/alpha/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/alpha/Makefile 2004-10-28 22:41:09 -07:00 @@ -109,18 +109,8 @@ $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ -prepare: include/asm-$(ARCH)/asm_offsets.h - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - archclean: $(Q)$(MAKE) $(clean)=$(boot) - -CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h define archhelp echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)' diff -Nru a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S --- a/arch/alpha/kernel/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/alpha/kernel/entry.S 2004-10-28 22:41:09 -07:00 @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include diff -Nru a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S --- a/arch/alpha/kernel/head.S 2004-10-28 22:41:09 -07:00 +++ b/arch/alpha/kernel/head.S 2004-10-28 22:41:09 -07:00 @@ -9,7 +9,7 @@ #include #include -#include +#include .globl swapper_pg_dir .globl _stext diff -Nru a/arch/alpha/lib/dbg_stackcheck.S b/arch/alpha/lib/dbg_stackcheck.S --- a/arch/alpha/lib/dbg_stackcheck.S 2004-10-28 22:41:09 -07:00 +++ b/arch/alpha/lib/dbg_stackcheck.S 2004-10-28 22:41:09 -07:00 @@ -5,7 +5,7 @@ * Verify that we have not overflowed the stack. Oops if we have. */ -#include +#include .text .set noat diff -Nru a/arch/alpha/lib/dbg_stackkill.S b/arch/alpha/lib/dbg_stackkill.S --- a/arch/alpha/lib/dbg_stackkill.S 2004-10-28 22:41:09 -07:00 +++ b/arch/alpha/lib/dbg_stackkill.S 2004-10-28 22:41:09 -07:00 @@ -6,7 +6,7 @@ * uninitialized local variables in the act. */ -#include +#include .text .set noat diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile --- a/arch/arm/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/arm/Makefile 2004-10-28 22:41:09 -07:00 @@ -108,7 +108,7 @@ ifeq ($(incdir-y),) incdir-y := $(machine-y) endif -INCDIR := arch-$(incdir-y) +export INCDIR := arch-$(incdir-y) ifneq ($(machine-y),) MACHINE := arch/arm/mach-$(machine-y)/ else @@ -141,21 +141,7 @@ boot := arch/arm/boot -# Update machine arch and proc symlinks if something which affects -# them changed. We use .arch to indicate when they were updated -# last, otherwise make uses the target directory mtime. - -include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/MARKER - @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/$(INCDIR)' -ifneq ($(KBUILD_SRC),) - $(Q)mkdir -p include/asm-arm - $(Q)ln -fsn $(srctree)/include/asm-arm/$(INCDIR) include/asm-arm/arch -else - $(Q)ln -fsn $(INCDIR) include/asm-arm/arch -endif - @touch $@ - -prepare: maketools include/asm-arm/.arch +prepare: maketools .PHONY: maketools FORCE maketools: include/asm-arm/constants.h include/linux/version.h FORCE @@ -171,7 +157,7 @@ $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \ - include/asm-arm/arch include/asm-arm/.arch + include/asm-arm/arch # We use MRPROPER_FILES and CLEAN_FILES now archclean: @@ -180,12 +166,6 @@ # My testing targets (bypasses dependencies) bp:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage i zi:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/asm-arm/.arch - -include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) define archhelp echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' diff -Nru a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c --- a/arch/arm/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,80 +0,0 @@ -/* - * Copyright (C) 1995-2003 Russell King - * 2001-2002 Keith Owens - * - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed to extract - * and format the required data. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include -#include -#include -#include - -/* - * Make sure that the compiler and target are compatible. - */ -#if defined(__APCS_26__) -#error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32 -#endif -/* - * GCC 2.95.1, 2.95.2: ignores register clobber list in asm(). - * GCC 3.0, 3.1: general bad code generation. - * GCC 3.2.0: incorrect function argument offset calculation. - * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c - * (http://gcc.gnu.org/PR8896) and incorrect structure - * initialisation in fs/jffs2/erase.c - */ -#if __GNUC__ < 2 || \ - (__GNUC__ == 2 && __GNUC_MINOR__ < 95) || \ - (__GNUC__ == 2 && __GNUC_MINOR__ == 95 && __GNUC_PATCHLEVEL__ != 0 && \ - __GNUC_PATCHLEVEL__ < 3) || \ - (__GNUC__ == 3 && __GNUC_MINOR__ < 3) -#error Your compiler is too buggy; it is known to miscompile kernels. -#error Known good compilers: 2.95.3, 2.95.4, 2.96, 3.3 -#endif - -/* Use marker if you need to separate the values later */ - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); - BLANK(); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); - DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); - DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); - DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); - DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp)); - DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); - DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); - DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); - BLANK(); -#if __LINUX_ARM_ARCH__ >= 6 - DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); - BLANK(); -#endif - DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); - DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags)); - BLANK(); - DEFINE(VM_EXEC, VM_EXEC); - BLANK(); - DEFINE(PAGE_SZ, PAGE_SIZE); - BLANK(); - DEFINE(SYS_ERROR0, 0x9f0000); - BLANK(); - DEFINE(SIZEOF_MACHINE_DESC, sizeof(struct machine_desc)); - return 0; -} diff -Nru a/arch/arm26/Makefile b/arch/arm26/Makefile --- a/arch/arm26/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/Makefile 2004-10-28 22:41:09 -07:00 @@ -36,11 +36,6 @@ DATAADDR := . endif -ifeq ($(incdir-y),) -incdir-y := -endif -INCDIR := - export MACHINE TEXTADDR GZFLAGS CFLAGS_BOOT # If we have a machine-specific directory, then include it in the build. @@ -54,14 +49,6 @@ boot := arch/arm26/boot -prepare: include/asm-$(ARCH)/asm_offsets.h -CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h - - -.PHONY: maketools FORCE -maketools: FORCE - - # Convert bzImage to zImage bzImage: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/zImage @@ -99,11 +86,6 @@ fi; \ ) -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) define archhelp echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' diff -Nru a/arch/arm26/kernel/asm-offsets.c b/arch/arm26/kernel/asm-offsets.c --- a/arch/arm26/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,64 +0,0 @@ -/* - * Copyright (C) 1995-2001 Russell King - * 2001-2002 Keith Owens - * 2003 Ian Molton - * - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed to extract - * and format the required data. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include - -#include -#include - -/* - * Make sure that the compiler and target are compatible. - */ -#if defined(__APCS_32__) && defined(CONFIG_CPU_26) -#error Sorry, your compiler targets APCS-32 but this kernel requires APCS-26 -#endif -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) -#error Sorry, your compiler is known to miscompile kernels. Only use gcc 2.95.3 and later. -#endif -#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 -/* shame we can't detect the .1 or .2 releases */ -#warning GCC 2.95.2 and earlier miscompiles kernels. -#endif - -/* Use marker if you need to separate the values later */ - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - DEFINE(TSK_USED_MATH, offsetof(struct task_struct, used_math)); - DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); - BLANK(); - DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); - DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags)); - BLANK(); - DEFINE(VM_EXEC, VM_EXEC); - BLANK(); - BLANK(); - DEFINE(PAGE_PRESENT, _PAGE_PRESENT); - DEFINE(PAGE_READONLY, _PAGE_READONLY); - DEFINE(PAGE_NOT_USER, _PAGE_NOT_USER); - DEFINE(PAGE_OLD, _PAGE_OLD); - DEFINE(PAGE_CLEAN, _PAGE_CLEAN); - BLANK(); - DEFINE(PAGE_SZ, PAGE_SIZE); - BLANK(); - DEFINE(SYS_ERROR0, 0x9f0000); - return 0; -} diff -Nru a/arch/arm26/kernel/entry.S b/arch/arm26/kernel/entry.S --- a/arch/arm26/kernel/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/kernel/entry.S 2004-10-28 22:41:09 -07:00 @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff -Nru a/arch/arm26/lib/copy_page.S b/arch/arm26/lib/copy_page.S --- a/arch/arm26/lib/copy_page.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/lib/copy_page.S 2004-10-28 22:41:09 -07:00 @@ -11,7 +11,7 @@ */ #include #include -#include +#include .text .align 5 diff -Nru a/arch/arm26/lib/csumpartialcopyuser.S b/arch/arm26/lib/csumpartialcopyuser.S --- a/arch/arm26/lib/csumpartialcopyuser.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/lib/csumpartialcopyuser.S 2004-10-28 22:41:09 -07:00 @@ -11,7 +11,7 @@ #include #include #include -#include +#include .text diff -Nru a/arch/arm26/lib/getuser.S b/arch/arm26/lib/getuser.S --- a/arch/arm26/lib/getuser.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/lib/getuser.S 2004-10-28 22:41:09 -07:00 @@ -26,7 +26,7 @@ * Note that ADDR_LIMIT is either 0 or 0xc0000000. * Note also that it is intended that __get_user_bad is not global. */ -#include +#include #include .global __get_user_1 diff -Nru a/arch/arm26/lib/putuser.S b/arch/arm26/lib/putuser.S --- a/arch/arm26/lib/putuser.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/lib/putuser.S 2004-10-28 22:41:09 -07:00 @@ -26,7 +26,7 @@ * Note that ADDR_LIMIT is either 0 or 0xc0000000 * Note also that it is intended that __put_user_bad is not global. */ -#include +#include #include .global __put_user_1 diff -Nru a/arch/arm26/mm/proc-funcs.S b/arch/arm26/mm/proc-funcs.S --- a/arch/arm26/mm/proc-funcs.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/mm/proc-funcs.S 2004-10-28 22:41:09 -07:00 @@ -14,7 +14,7 @@ */ #include #include -#include +#include #include #include diff -Nru a/arch/arm26/nwfpe/entry.S b/arch/arm26/nwfpe/entry.S --- a/arch/arm26/nwfpe/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/arm26/nwfpe/entry.S 2004-10-28 22:41:09 -07:00 @@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include /* This is the kernel's entry point into the floating point emulator. It is called from the kernel with code similar to this: diff -Nru a/arch/h8300/Makefile b/arch/h8300/Makefile --- a/arch/h8300/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/h8300/Makefile 2004-10-28 22:41:09 -07:00 @@ -62,12 +62,6 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -prepare: include/asm-$(ARCH)/asm-offsets.h - -include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ - include/asm include/linux/version.h - $(call filechk,gen-asm-offsets) - vmlinux.srec vmlinux.bin: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ @@ -75,5 +69,3 @@ echo 'vmlinux.bin - Create raw binary' echo 'vmlinux.srec - Create srec binary' endef - -CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h diff -Nru a/arch/h8300/kernel/asm-offsets.c b/arch/h8300/kernel/asm-offsets.c --- a/arch/h8300/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,65 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - /* offsets into the task struct */ - DEFINE(TASK_STATE, offsetof(struct task_struct, state)); - DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); - DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); - DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked)); - DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); - DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); - DEFINE(TASK_MM, offsetof(struct task_struct, mm)); - DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); - - /* offsets into the irq_cpustat_t struct */ - DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); - - /* offsets into the thread struct */ - DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); - DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); - DEFINE(THREAD_CCR, offsetof(struct thread_struct, ccr)); - - /* offsets into the pt_regs struct */ - DEFINE(LER0, offsetof(struct pt_regs, er0) - sizeof(long)); - DEFINE(LER1, offsetof(struct pt_regs, er1) - sizeof(long)); - DEFINE(LER2, offsetof(struct pt_regs, er2) - sizeof(long)); - DEFINE(LER3, offsetof(struct pt_regs, er3) - sizeof(long)); - DEFINE(LER4, offsetof(struct pt_regs, er4) - sizeof(long)); - DEFINE(LER5, offsetof(struct pt_regs, er5) - sizeof(long)); - DEFINE(LER6, offsetof(struct pt_regs, er6) - sizeof(long)); - DEFINE(LORIG, offsetof(struct pt_regs, orig_er0) - sizeof(long)); - DEFINE(LCCR, offsetof(struct pt_regs, ccr) - sizeof(long)); - DEFINE(LVEC, offsetof(struct pt_regs, vector) - sizeof(long)); -#if defined(__H8300S__) - DEFINE(LEXR, offsetof(struct pt_regs, exr) - sizeof(long)); -#endif - DEFINE(LRET, offsetof(struct pt_regs, pc) - sizeof(long)); - - DEFINE(PT_PTRACED, PT_PTRACED); - DEFINE(PT_DTRACE, PT_DTRACE); - - return 0; -} diff -Nru a/arch/h8300/platform/h8300h/entry.S b/arch/h8300/platform/h8300h/entry.S --- a/arch/h8300/platform/h8300h/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/h8300/platform/h8300h/entry.S 2004-10-28 22:41:09 -07:00 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/h8300/platform/h8s/entry.S b/arch/h8300/platform/h8s/entry.S --- a/arch/h8300/platform/h8s/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/h8300/platform/h8s/entry.S 2004-10-28 22:41:09 -07:00 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile --- a/arch/i386/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/i386/Makefile 2004-10-28 22:41:09 -07:00 @@ -140,15 +140,6 @@ install fdimage fdimage144 fdimage288: vmlinux $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ -prepare: include/asm-$(ARCH)/asm_offsets.h -CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - archclean: $(Q)$(MAKE) $(clean)=arch/i386/boot diff -Nru a/arch/i386/kernel/asm-offsets.c b/arch/i386/kernel/asm-offsets.c --- a/arch/i386/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,66 +0,0 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed - * to extract and format the required data. - */ - -#include -#include -#include -#include -#include "sigframe.h" -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -#define OFFSET(sym, str, mem) \ - DEFINE(sym, offsetof(struct str, mem)); - -void foo(void) -{ - OFFSET(SIGCONTEXT_eax, sigcontext, eax); - OFFSET(SIGCONTEXT_ebx, sigcontext, ebx); - OFFSET(SIGCONTEXT_ecx, sigcontext, ecx); - OFFSET(SIGCONTEXT_edx, sigcontext, edx); - OFFSET(SIGCONTEXT_esi, sigcontext, esi); - OFFSET(SIGCONTEXT_edi, sigcontext, edi); - OFFSET(SIGCONTEXT_ebp, sigcontext, ebp); - OFFSET(SIGCONTEXT_esp, sigcontext, esp); - OFFSET(SIGCONTEXT_eip, sigcontext, eip); - BLANK(); - - OFFSET(CPUINFO_x86, cpuinfo_x86, x86); - OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); - OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); - OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); - OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math); - OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); - OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); - OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); - BLANK(); - - OFFSET(TI_task, thread_info, task); - OFFSET(TI_exec_domain, thread_info, exec_domain); - OFFSET(TI_flags, thread_info, flags); - OFFSET(TI_status, thread_info, status); - OFFSET(TI_cpu, thread_info, cpu); - OFFSET(TI_preempt_count, thread_info, preempt_count); - OFFSET(TI_addr_limit, thread_info, addr_limit); - OFFSET(TI_restart_block, thread_info, restart_block); - BLANK(); - - OFFSET(EXEC_DOMAIN_handler, exec_domain, handler); - OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); - - /* Offset from the sysenter stack to tss.esp0 */ - DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) - - sizeof(struct tss_struct)); - - DEFINE(PAGE_SIZE_asm, PAGE_SIZE); - DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL)); -} diff -Nru a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S --- a/arch/i386/kernel/head.S 2004-10-28 22:41:09 -07:00 +++ b/arch/i386/kernel/head.S 2004-10-28 22:41:09 -07:00 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include /* diff -Nru a/arch/i386/kernel/vsyscall-sigreturn.S b/arch/i386/kernel/vsyscall-sigreturn.S --- a/arch/i386/kernel/vsyscall-sigreturn.S 2004-10-28 22:41:09 -07:00 +++ b/arch/i386/kernel/vsyscall-sigreturn.S 2004-10-28 22:41:09 -07:00 @@ -7,7 +7,7 @@ */ #include -#include +#include /* XXX diff -Nru a/arch/i386/kernel/vsyscall.lds.S b/arch/i386/kernel/vsyscall.lds.S --- a/arch/i386/kernel/vsyscall.lds.S 2004-10-28 22:41:09 -07:00 +++ b/arch/i386/kernel/vsyscall.lds.S 2004-10-28 22:41:09 -07:00 @@ -3,7 +3,7 @@ * object prelinked to its virtual address, and with only one read-only * segment (that fits in one page). This script controls its layout. */ -#include +#include SECTIONS { diff -Nru a/arch/ia64/Makefile b/arch/ia64/Makefile --- a/arch/ia64/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/ia64/Makefile 2004-10-28 22:41:09 -07:00 @@ -82,22 +82,7 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -CLEAN_FILES += include/asm-ia64/.offsets.h.stamp include/asm-ia64/offsets.h vmlinux.gz bootloader - -prepare: include/asm-ia64/offsets.h - -arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER - -include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - -arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp - -include/asm-ia64/.offsets.h.stamp: - mkdir -p include/asm-ia64 - [ -s include/asm-ia64/offsets.h ] \ - || echo "#define IA64_TASK_SIZE 0" > include/asm-ia64/offsets.h - touch $@ +CLEAN_FILES += vmlinux.gz bootloader boot: lib/lib.a vmlinux $(Q)$(MAKE) $(build)=$(boot) $@ diff -Nru a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c --- a/arch/ia64/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,224 +0,0 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed - * to extract and format the required data. - */ - -#include - -#include - -#include -#include -#include -#include -#include - -#include "../kernel/sigframe.h" - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -void foo(void) -{ - DEFINE(IA64_TASK_SIZE, sizeof (struct task_struct)); - DEFINE(IA64_THREAD_INFO_SIZE, sizeof (struct thread_info)); - DEFINE(IA64_PT_REGS_SIZE, sizeof (struct pt_regs)); - DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack)); - DEFINE(IA64_SIGINFO_SIZE, sizeof (struct siginfo)); - DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64)); - DEFINE(SIGFRAME_SIZE, sizeof (struct sigframe)); - DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info)); - - BLANK(); - - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); - - BLANK(); - - DEFINE(IA64_TASK_BLOCKED_OFFSET,offsetof (struct task_struct, blocked)); - DEFINE(IA64_TASK_CLEAR_CHILD_TID_OFFSET,offsetof (struct task_struct, clear_child_tid)); - DEFINE(IA64_TASK_GROUP_LEADER_OFFSET, offsetof (struct task_struct, group_leader)); - DEFINE(IA64_TASK_PENDING_OFFSET,offsetof (struct task_struct, pending)); - DEFINE(IA64_TASK_PID_OFFSET, offsetof (struct task_struct, pid)); - DEFINE(IA64_TASK_REAL_PARENT_OFFSET, offsetof (struct task_struct, real_parent)); - DEFINE(IA64_TASK_SIGHAND_OFFSET,offsetof (struct task_struct, sighand)); - DEFINE(IA64_TASK_SIGNAL_OFFSET,offsetof (struct task_struct, signal)); - DEFINE(IA64_TASK_TGID_OFFSET, offsetof (struct task_struct, tgid)); - DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct task_struct, thread.ksp)); - DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct task_struct, thread.on_ustack)); - - BLANK(); - - DEFINE(IA64_SIGHAND_SIGLOCK_OFFSET,offsetof (struct sighand_struct, siglock)); - - BLANK(); - - DEFINE(IA64_SIGNAL_GROUP_STOP_COUNT_OFFSET,offsetof (struct signal_struct, - group_stop_count)); - DEFINE(IA64_SIGNAL_SHARED_PENDING_OFFSET,offsetof (struct signal_struct, shared_pending)); - - BLANK(); - - DEFINE(IA64_PT_REGS_B6_OFFSET, offsetof (struct pt_regs, b6)); - DEFINE(IA64_PT_REGS_B7_OFFSET, offsetof (struct pt_regs, b7)); - DEFINE(IA64_PT_REGS_AR_CSD_OFFSET, offsetof (struct pt_regs, ar_csd)); - DEFINE(IA64_PT_REGS_AR_SSD_OFFSET, offsetof (struct pt_regs, ar_ssd)); - DEFINE(IA64_PT_REGS_R8_OFFSET, offsetof (struct pt_regs, r8)); - DEFINE(IA64_PT_REGS_R9_OFFSET, offsetof (struct pt_regs, r9)); - DEFINE(IA64_PT_REGS_R10_OFFSET, offsetof (struct pt_regs, r10)); - DEFINE(IA64_PT_REGS_R11_OFFSET, offsetof (struct pt_regs, r11)); - DEFINE(IA64_PT_REGS_CR_IPSR_OFFSET, offsetof (struct pt_regs, cr_ipsr)); - DEFINE(IA64_PT_REGS_CR_IIP_OFFSET, offsetof (struct pt_regs, cr_iip)); - DEFINE(IA64_PT_REGS_CR_IFS_OFFSET, offsetof (struct pt_regs, cr_ifs)); - DEFINE(IA64_PT_REGS_AR_UNAT_OFFSET, offsetof (struct pt_regs, ar_unat)); - DEFINE(IA64_PT_REGS_AR_PFS_OFFSET, offsetof (struct pt_regs, ar_pfs)); - DEFINE(IA64_PT_REGS_AR_RSC_OFFSET, offsetof (struct pt_regs, ar_rsc)); - DEFINE(IA64_PT_REGS_AR_RNAT_OFFSET, offsetof (struct pt_regs, ar_rnat)); - - DEFINE(IA64_PT_REGS_AR_BSPSTORE_OFFSET, offsetof (struct pt_regs, ar_bspstore)); - DEFINE(IA64_PT_REGS_PR_OFFSET, offsetof (struct pt_regs, pr)); - DEFINE(IA64_PT_REGS_B0_OFFSET, offsetof (struct pt_regs, b0)); - DEFINE(IA64_PT_REGS_LOADRS_OFFSET, offsetof (struct pt_regs, loadrs)); - DEFINE(IA64_PT_REGS_R1_OFFSET, offsetof (struct pt_regs, r1)); - DEFINE(IA64_PT_REGS_R12_OFFSET, offsetof (struct pt_regs, r12)); - DEFINE(IA64_PT_REGS_R13_OFFSET, offsetof (struct pt_regs, r13)); - DEFINE(IA64_PT_REGS_AR_FPSR_OFFSET, offsetof (struct pt_regs, ar_fpsr)); - DEFINE(IA64_PT_REGS_R15_OFFSET, offsetof (struct pt_regs, r15)); - DEFINE(IA64_PT_REGS_R14_OFFSET, offsetof (struct pt_regs, r14)); - DEFINE(IA64_PT_REGS_R2_OFFSET, offsetof (struct pt_regs, r2)); - DEFINE(IA64_PT_REGS_R3_OFFSET, offsetof (struct pt_regs, r3)); - DEFINE(IA64_PT_REGS_R16_OFFSET, offsetof (struct pt_regs, r16)); - DEFINE(IA64_PT_REGS_R17_OFFSET, offsetof (struct pt_regs, r17)); - DEFINE(IA64_PT_REGS_R18_OFFSET, offsetof (struct pt_regs, r18)); - DEFINE(IA64_PT_REGS_R19_OFFSET, offsetof (struct pt_regs, r19)); - DEFINE(IA64_PT_REGS_R20_OFFSET, offsetof (struct pt_regs, r20)); - DEFINE(IA64_PT_REGS_R21_OFFSET, offsetof (struct pt_regs, r21)); - DEFINE(IA64_PT_REGS_R22_OFFSET, offsetof (struct pt_regs, r22)); - DEFINE(IA64_PT_REGS_R23_OFFSET, offsetof (struct pt_regs, r23)); - DEFINE(IA64_PT_REGS_R24_OFFSET, offsetof (struct pt_regs, r24)); - DEFINE(IA64_PT_REGS_R25_OFFSET, offsetof (struct pt_regs, r25)); - DEFINE(IA64_PT_REGS_R26_OFFSET, offsetof (struct pt_regs, r26)); - DEFINE(IA64_PT_REGS_R27_OFFSET, offsetof (struct pt_regs, r27)); - DEFINE(IA64_PT_REGS_R28_OFFSET, offsetof (struct pt_regs, r28)); - DEFINE(IA64_PT_REGS_R29_OFFSET, offsetof (struct pt_regs, r29)); - DEFINE(IA64_PT_REGS_R30_OFFSET, offsetof (struct pt_regs, r30)); - DEFINE(IA64_PT_REGS_R31_OFFSET, offsetof (struct pt_regs, r31)); - DEFINE(IA64_PT_REGS_AR_CCV_OFFSET, offsetof (struct pt_regs, ar_ccv)); - DEFINE(IA64_PT_REGS_F6_OFFSET, offsetof (struct pt_regs, f6)); - DEFINE(IA64_PT_REGS_F7_OFFSET, offsetof (struct pt_regs, f7)); - DEFINE(IA64_PT_REGS_F8_OFFSET, offsetof (struct pt_regs, f8)); - DEFINE(IA64_PT_REGS_F9_OFFSET, offsetof (struct pt_regs, f9)); - DEFINE(IA64_PT_REGS_F10_OFFSET, offsetof (struct pt_regs, f10)); - DEFINE(IA64_PT_REGS_F11_OFFSET, offsetof (struct pt_regs, f11)); - - BLANK(); - - DEFINE(IA64_SWITCH_STACK_CALLER_UNAT_OFFSET, offsetof (struct switch_stack, caller_unat)); - DEFINE(IA64_SWITCH_STACK_AR_FPSR_OFFSET, offsetof (struct switch_stack, ar_fpsr)); - DEFINE(IA64_SWITCH_STACK_F2_OFFSET, offsetof (struct switch_stack, f2)); - DEFINE(IA64_SWITCH_STACK_F3_OFFSET, offsetof (struct switch_stack, f3)); - DEFINE(IA64_SWITCH_STACK_F4_OFFSET, offsetof (struct switch_stack, f4)); - DEFINE(IA64_SWITCH_STACK_F5_OFFSET, offsetof (struct switch_stack, f5)); - DEFINE(IA64_SWITCH_STACK_F12_OFFSET, offsetof (struct switch_stack, f12)); - DEFINE(IA64_SWITCH_STACK_F13_OFFSET, offsetof (struct switch_stack, f13)); - DEFINE(IA64_SWITCH_STACK_F14_OFFSET, offsetof (struct switch_stack, f14)); - DEFINE(IA64_SWITCH_STACK_F15_OFFSET, offsetof (struct switch_stack, f15)); - DEFINE(IA64_SWITCH_STACK_F16_OFFSET, offsetof (struct switch_stack, f16)); - DEFINE(IA64_SWITCH_STACK_F17_OFFSET, offsetof (struct switch_stack, f17)); - DEFINE(IA64_SWITCH_STACK_F18_OFFSET, offsetof (struct switch_stack, f18)); - DEFINE(IA64_SWITCH_STACK_F19_OFFSET, offsetof (struct switch_stack, f19)); - DEFINE(IA64_SWITCH_STACK_F20_OFFSET, offsetof (struct switch_stack, f20)); - DEFINE(IA64_SWITCH_STACK_F21_OFFSET, offsetof (struct switch_stack, f21)); - DEFINE(IA64_SWITCH_STACK_F22_OFFSET, offsetof (struct switch_stack, f22)); - DEFINE(IA64_SWITCH_STACK_F23_OFFSET, offsetof (struct switch_stack, f23)); - DEFINE(IA64_SWITCH_STACK_F24_OFFSET, offsetof (struct switch_stack, f24)); - DEFINE(IA64_SWITCH_STACK_F25_OFFSET, offsetof (struct switch_stack, f25)); - DEFINE(IA64_SWITCH_STACK_F26_OFFSET, offsetof (struct switch_stack, f26)); - DEFINE(IA64_SWITCH_STACK_F27_OFFSET, offsetof (struct switch_stack, f27)); - DEFINE(IA64_SWITCH_STACK_F28_OFFSET, offsetof (struct switch_stack, f28)); - DEFINE(IA64_SWITCH_STACK_F29_OFFSET, offsetof (struct switch_stack, f29)); - DEFINE(IA64_SWITCH_STACK_F30_OFFSET, offsetof (struct switch_stack, f30)); - DEFINE(IA64_SWITCH_STACK_F31_OFFSET, offsetof (struct switch_stack, f31)); - DEFINE(IA64_SWITCH_STACK_R4_OFFSET, offsetof (struct switch_stack, r4)); - DEFINE(IA64_SWITCH_STACK_R5_OFFSET, offsetof (struct switch_stack, r5)); - DEFINE(IA64_SWITCH_STACK_R6_OFFSET, offsetof (struct switch_stack, r6)); - DEFINE(IA64_SWITCH_STACK_R7_OFFSET, offsetof (struct switch_stack, r7)); - DEFINE(IA64_SWITCH_STACK_B0_OFFSET, offsetof (struct switch_stack, b0)); - DEFINE(IA64_SWITCH_STACK_B1_OFFSET, offsetof (struct switch_stack, b1)); - DEFINE(IA64_SWITCH_STACK_B2_OFFSET, offsetof (struct switch_stack, b2)); - DEFINE(IA64_SWITCH_STACK_B3_OFFSET, offsetof (struct switch_stack, b3)); - DEFINE(IA64_SWITCH_STACK_B4_OFFSET, offsetof (struct switch_stack, b4)); - DEFINE(IA64_SWITCH_STACK_B5_OFFSET, offsetof (struct switch_stack, b5)); - DEFINE(IA64_SWITCH_STACK_AR_PFS_OFFSET, offsetof (struct switch_stack, ar_pfs)); - DEFINE(IA64_SWITCH_STACK_AR_LC_OFFSET, offsetof (struct switch_stack, ar_lc)); - DEFINE(IA64_SWITCH_STACK_AR_UNAT_OFFSET, offsetof (struct switch_stack, ar_unat)); - DEFINE(IA64_SWITCH_STACK_AR_RNAT_OFFSET, offsetof (struct switch_stack, ar_rnat)); - DEFINE(IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET, offsetof (struct switch_stack, ar_bspstore)); - DEFINE(IA64_SWITCH_STACK_PR_OFFSET, offsetof (struct switch_stack, pr)); - - BLANK(); - - DEFINE(IA64_SIGCONTEXT_IP_OFFSET, offsetof (struct sigcontext, sc_ip)); - DEFINE(IA64_SIGCONTEXT_AR_BSP_OFFSET, offsetof (struct sigcontext, sc_ar_bsp)); - DEFINE(IA64_SIGCONTEXT_AR_FPSR_OFFSET, offsetof (struct sigcontext, sc_ar_fpsr)); - DEFINE(IA64_SIGCONTEXT_AR_RNAT_OFFSET, offsetof (struct sigcontext, sc_ar_rnat)); - DEFINE(IA64_SIGCONTEXT_AR_UNAT_OFFSET, offsetof (struct sigcontext, sc_ar_unat)); - DEFINE(IA64_SIGCONTEXT_B0_OFFSET, offsetof (struct sigcontext, sc_br[0])); - DEFINE(IA64_SIGCONTEXT_CFM_OFFSET, offsetof (struct sigcontext, sc_cfm)); - DEFINE(IA64_SIGCONTEXT_FLAGS_OFFSET, offsetof (struct sigcontext, sc_flags)); - DEFINE(IA64_SIGCONTEXT_FR6_OFFSET, offsetof (struct sigcontext, sc_fr[6])); - DEFINE(IA64_SIGCONTEXT_PR_OFFSET, offsetof (struct sigcontext, sc_pr)); - DEFINE(IA64_SIGCONTEXT_R12_OFFSET, offsetof (struct sigcontext, sc_gr[12])); - DEFINE(IA64_SIGCONTEXT_RBS_BASE_OFFSET,offsetof (struct sigcontext, sc_rbs_base)); - DEFINE(IA64_SIGCONTEXT_LOADRS_OFFSET, offsetof (struct sigcontext, sc_loadrs)); - - BLANK(); - - DEFINE(IA64_SIGPENDING_SIGNAL_OFFSET, offsetof (struct sigpending, signal)); - - BLANK(); - - DEFINE(IA64_SIGFRAME_ARG0_OFFSET, offsetof (struct sigframe, arg0)); - DEFINE(IA64_SIGFRAME_ARG1_OFFSET, offsetof (struct sigframe, arg1)); - DEFINE(IA64_SIGFRAME_ARG2_OFFSET, offsetof (struct sigframe, arg2)); - DEFINE(IA64_SIGFRAME_HANDLER_OFFSET, offsetof (struct sigframe, handler)); - DEFINE(IA64_SIGFRAME_SIGCONTEXT_OFFSET, offsetof (struct sigframe, sc)); - BLANK(); - /* for assembly files which can't include sched.h: */ - DEFINE(IA64_CLONE_VFORK, CLONE_VFORK); - DEFINE(IA64_CLONE_VM, CLONE_VM); - - BLANK(); - DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, offsetof (struct cpuinfo_ia64, nsec_per_cyc)); - DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, offsetof (struct timespec, tv_nsec)); - - - DEFINE(CLONE_SETTLS_BIT, 19); -#if CLONE_SETTLS != (1<<19) -# error "CLONE_SETTLS_BIT incorrect, please fix" -#endif - - BLANK(); - DEFINE(IA64_MCA_TLB_INFO_SIZE, sizeof (struct ia64_mca_tlb_info)); - /* used by head.S */ - DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, offsetof (struct cpuinfo_ia64, nsec_per_cyc)); - - BLANK(); - /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */ - DEFINE(IA64_TIME_INTERPOLATOR_ADDRESS_OFFSET, offsetof (struct time_interpolator, addr)); - DEFINE(IA64_TIME_INTERPOLATOR_SOURCE_OFFSET, offsetof (struct time_interpolator, source)); - DEFINE(IA64_TIME_INTERPOLATOR_SHIFT_OFFSET, offsetof (struct time_interpolator, shift)); - DEFINE(IA64_TIME_INTERPOLATOR_NSEC_OFFSET, offsetof (struct time_interpolator, nsec_per_cyc)); - DEFINE(IA64_TIME_INTERPOLATOR_OFFSET_OFFSET, offsetof (struct time_interpolator, offset)); - DEFINE(IA64_TIME_INTERPOLATOR_LAST_CYCLE_OFFSET, offsetof (struct time_interpolator, last_cycle)); - DEFINE(IA64_TIME_INTERPOLATOR_LAST_COUNTER_OFFSET, offsetof (struct time_interpolator, last_counter)); - DEFINE(IA64_TIME_INTERPOLATOR_JITTER_OFFSET, offsetof (struct time_interpolator, jitter)); - DEFINE(IA64_TIME_SOURCE_CPU, TIME_SOURCE_CPU); - DEFINE(IA64_TIME_SOURCE_MMIO64, TIME_SOURCE_MMIO64); - DEFINE(IA64_TIME_SOURCE_MMIO32, TIME_SOURCE_MMIO32); - DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, offsetof (struct timespec, tv_nsec)); -} diff -Nru a/arch/m68k/Makefile b/arch/m68k/Makefile --- a/arch/m68k/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/m68k/Makefile 2004-10-28 22:41:09 -07:00 @@ -113,14 +113,5 @@ bzip2 -1c vmlinux >vmlinux.bz2 endif -prepare: include/asm-$(ARCH)/offsets.h -CLEAN_FILES += include/asm-$(ARCH)/offsets.h - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - archclean: rm -f vmlinux.gz vmlinux.bz2 diff -Nru a/arch/m68k/kernel/asm-offsets.c b/arch/m68k/kernel/asm-offsets.c --- a/arch/m68k/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,109 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - */ - -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -int main(void) -{ - /* offsets into the task struct */ - DEFINE(TASK_STATE, offsetof(struct task_struct, state)); - DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); - DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); - DEFINE(TASK_WORK, offsetof(struct task_struct, thread.work)); - DEFINE(TASK_NEEDRESCHED, offsetof(struct task_struct, thread.work.need_resched)); - DEFINE(TASK_SYSCALL_TRACE, offsetof(struct task_struct, thread.work.syscall_trace)); - DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending)); - DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume)); - DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); - DEFINE(TASK_MM, offsetof(struct task_struct, mm)); - DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); - - /* offsets into the thread struct */ - DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); - DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); - DEFINE(THREAD_SR, offsetof(struct thread_struct, sr)); - DEFINE(THREAD_FS, offsetof(struct thread_struct, fs)); - DEFINE(THREAD_CRP, offsetof(struct thread_struct, crp)); - DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0)); - DEFINE(THREAD_FPREG, offsetof(struct thread_struct, fp)); - DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); - DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); - - /* offsets into the pt_regs */ - DEFINE(PT_D0, offsetof(struct pt_regs, d0)); - DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); - DEFINE(PT_D1, offsetof(struct pt_regs, d1)); - DEFINE(PT_D2, offsetof(struct pt_regs, d2)); - DEFINE(PT_D3, offsetof(struct pt_regs, d3)); - DEFINE(PT_D4, offsetof(struct pt_regs, d4)); - DEFINE(PT_D5, offsetof(struct pt_regs, d5)); - DEFINE(PT_A0, offsetof(struct pt_regs, a0)); - DEFINE(PT_A1, offsetof(struct pt_regs, a1)); - DEFINE(PT_A2, offsetof(struct pt_regs, a2)); - DEFINE(PT_PC, offsetof(struct pt_regs, pc)); - DEFINE(PT_SR, offsetof(struct pt_regs, sr)); - /* bitfields are a bit difficult */ - DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4); - - /* offsets into the irq_handler struct */ - DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler)); - DEFINE(IRQ_DEVID, offsetof(struct irq_node, dev_id)); - DEFINE(IRQ_NEXT, offsetof(struct irq_node, next)); - - /* offsets into the kernel_stat struct */ - DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs)); - - /* offsets into the irq_cpustat_t struct */ - DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); - - /* offsets into the bi_record struct */ - DEFINE(BIR_TAG, offsetof(struct bi_record, tag)); - DEFINE(BIR_SIZE, offsetof(struct bi_record, size)); - DEFINE(BIR_DATA, offsetof(struct bi_record, data)); - - /* offsets into font_desc (drivers/video/console/font.h) */ - DEFINE(FONT_DESC_IDX, offsetof(struct font_desc, idx)); - DEFINE(FONT_DESC_NAME, offsetof(struct font_desc, name)); - DEFINE(FONT_DESC_WIDTH, offsetof(struct font_desc, width)); - DEFINE(FONT_DESC_HEIGHT, offsetof(struct font_desc, height)); - DEFINE(FONT_DESC_DATA, offsetof(struct font_desc, data)); - DEFINE(FONT_DESC_PREF, offsetof(struct font_desc, pref)); - - /* signal defines */ - DEFINE(SIGSEGV, SIGSEGV); - DEFINE(SEGV_MAPERR, SEGV_MAPERR); - DEFINE(SIGTRAP, SIGTRAP); - DEFINE(TRAP_TRACE, TRAP_TRACE); - - /* offsets into the custom struct */ - DEFINE(CUSTOMBASE, &custom); - DEFINE(C_INTENAR, offsetof(struct CUSTOM, intenar)); - DEFINE(C_INTREQR, offsetof(struct CUSTOM, intreqr)); - DEFINE(C_INTENA, offsetof(struct CUSTOM, intena)); - DEFINE(C_INTREQ, offsetof(struct CUSTOM, intreq)); - DEFINE(C_SERDATR, offsetof(struct CUSTOM, serdatr)); - DEFINE(C_SERDAT, offsetof(struct CUSTOM, serdat)); - DEFINE(C_SERPER, offsetof(struct CUSTOM, serper)); - DEFINE(CIAABASE, &ciaa); - DEFINE(CIABBASE, &ciab); - DEFINE(C_PRA, offsetof(struct CIA, pra)); - DEFINE(ZTWOBASE, zTwoBase); - - return 0; -} diff -Nru a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile --- a/arch/m68knommu/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/m68knommu/Makefile 2004-10-28 22:41:09 -07:00 @@ -88,21 +88,11 @@ head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o -CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \ - arch/$(ARCH)/kernel/asm-offsets.s - core-y += arch/m68knommu/kernel/ \ arch/m68knommu/mm/ \ $(CLASSDIR) \ arch/m68knommu/platform/$(PLATFORM)/ libs-y += arch/m68knommu/lib/ -prepare: include/asm-$(ARCH)/asm-offsets.h - archclean: $(call descend arch/$(ARCH)/boot, subdirclean) - -include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ - include/asm include/linux/version.h \ - include/config/MARKER - $(call filechk,gen-asm-offsets) diff -Nru a/arch/m68knommu/kernel/asm-offsets.c b/arch/m68knommu/kernel/asm-offsets.c --- a/arch/m68knommu/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,89 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - */ - -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - /* offsets into the task struct */ - DEFINE(TASK_STATE, offsetof(struct task_struct, state)); - DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); - DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); - DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked)); - DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); - DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); - DEFINE(TASK_MM, offsetof(struct task_struct, mm)); - DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); - - /* offsets into the kernel_stat struct */ - DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs)); - - /* offsets into the irq_cpustat_t struct */ - DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); - - /* offsets into the thread struct */ - DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); - DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); - DEFINE(THREAD_SR, offsetof(struct thread_struct, sr)); - DEFINE(THREAD_FS, offsetof(struct thread_struct, fs)); - DEFINE(THREAD_CRP, offsetof(struct thread_struct, crp)); - DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0)); - DEFINE(THREAD_FPREG, offsetof(struct thread_struct, fp)); - DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); - DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); - - /* offsets into the pt_regs */ - DEFINE(PT_D0, offsetof(struct pt_regs, d0)); - DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); - DEFINE(PT_D1, offsetof(struct pt_regs, d1)); - DEFINE(PT_D2, offsetof(struct pt_regs, d2)); - DEFINE(PT_D3, offsetof(struct pt_regs, d3)); - DEFINE(PT_D4, offsetof(struct pt_regs, d4)); - DEFINE(PT_D5, offsetof(struct pt_regs, d5)); - DEFINE(PT_A0, offsetof(struct pt_regs, a0)); - DEFINE(PT_A1, offsetof(struct pt_regs, a1)); - DEFINE(PT_A2, offsetof(struct pt_regs, a2)); - DEFINE(PT_PC, offsetof(struct pt_regs, pc)); - DEFINE(PT_SR, offsetof(struct pt_regs, sr)); - /* bitfields are a bit difficult */ - DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4); - -#ifndef CONFIG_COLDFIRE - /* offsets into the irq_handler struct */ - DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler)); - DEFINE(IRQ_DEVID, offsetof(struct irq_node, dev_id)); - DEFINE(IRQ_NEXT, offsetof(struct irq_node, next)); -#endif - - /* offsets into the kernel_stat struct */ - DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs)); - - /* signal defines */ - DEFINE(SIGSEGV, SIGSEGV); - DEFINE(SEGV_MAPERR, SEGV_MAPERR); - DEFINE(SIGTRAP, SIGTRAP); - DEFINE(TRAP_TRACE, TRAP_TRACE); - - DEFINE(PT_PTRACED, PT_PTRACED); - DEFINE(PT_DTRACE, PT_DTRACE); - - return 0; -} diff -Nru a/arch/m68knommu/kernel/entry.S b/arch/m68knommu/kernel/entry.S --- a/arch/m68knommu/kernel/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/m68knommu/kernel/entry.S 2004-10-28 22:41:09 -07:00 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include .text diff -Nru a/arch/m68knommu/platform/5307/entry.S b/arch/m68knommu/platform/5307/entry.S --- a/arch/m68knommu/platform/5307/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/m68knommu/platform/5307/entry.S 2004-10-28 22:41:09 -07:00 @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include .data diff -Nru a/arch/m68knommu/platform/68328/entry.S b/arch/m68knommu/platform/68328/entry.S --- a/arch/m68knommu/platform/68328/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/m68knommu/platform/68328/entry.S 2004-10-28 22:41:09 -07:00 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include .text diff -Nru a/arch/m68knommu/platform/68360/entry.S b/arch/m68knommu/platform/68360/entry.S --- a/arch/m68knommu/platform/68360/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/m68knommu/platform/68360/entry.S 2004-10-28 22:41:09 -07:00 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include .text diff -Nru a/arch/mips/Makefile b/arch/mips/Makefile --- a/arch/mips/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/mips/Makefile 2004-10-28 22:41:09 -07:00 @@ -710,57 +710,6 @@ @$(MAKE) $(clean)=arch/mips/baget @$(MAKE) $(clean)=arch/mips/lasat -# Generate -#include -#include -#include -#include -#include - -#include -#include - -#define text(t) __asm__("\n@@@" t) -#define _offset(type, member) (&(((type *)NULL)->member)) -#define offset(string, ptr, member) \ - __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member))) -#define constant(string, member) \ - __asm__("\n@@@" string "%x0" : : "ri" (member)) -#define size(string, size) \ - __asm__("\n@@@" string "%0" : : "i" (sizeof(size))) -#define linefeed text("") - -void output_ptreg_defines(void) -{ - text("/* MIPS pt_regs offsets. */"); - offset("#define PT_R0 ", struct pt_regs, regs[0]); - offset("#define PT_R1 ", struct pt_regs, regs[1]); - offset("#define PT_R2 ", struct pt_regs, regs[2]); - offset("#define PT_R3 ", struct pt_regs, regs[3]); - offset("#define PT_R4 ", struct pt_regs, regs[4]); - offset("#define PT_R5 ", struct pt_regs, regs[5]); - offset("#define PT_R6 ", struct pt_regs, regs[6]); - offset("#define PT_R7 ", struct pt_regs, regs[7]); - offset("#define PT_R8 ", struct pt_regs, regs[8]); - offset("#define PT_R9 ", struct pt_regs, regs[9]); - offset("#define PT_R10 ", struct pt_regs, regs[10]); - offset("#define PT_R11 ", struct pt_regs, regs[11]); - offset("#define PT_R12 ", struct pt_regs, regs[12]); - offset("#define PT_R13 ", struct pt_regs, regs[13]); - offset("#define PT_R14 ", struct pt_regs, regs[14]); - offset("#define PT_R15 ", struct pt_regs, regs[15]); - offset("#define PT_R16 ", struct pt_regs, regs[16]); - offset("#define PT_R17 ", struct pt_regs, regs[17]); - offset("#define PT_R18 ", struct pt_regs, regs[18]); - offset("#define PT_R19 ", struct pt_regs, regs[19]); - offset("#define PT_R20 ", struct pt_regs, regs[20]); - offset("#define PT_R21 ", struct pt_regs, regs[21]); - offset("#define PT_R22 ", struct pt_regs, regs[22]); - offset("#define PT_R23 ", struct pt_regs, regs[23]); - offset("#define PT_R24 ", struct pt_regs, regs[24]); - offset("#define PT_R25 ", struct pt_regs, regs[25]); - offset("#define PT_R26 ", struct pt_regs, regs[26]); - offset("#define PT_R27 ", struct pt_regs, regs[27]); - offset("#define PT_R28 ", struct pt_regs, regs[28]); - offset("#define PT_R29 ", struct pt_regs, regs[29]); - offset("#define PT_R30 ", struct pt_regs, regs[30]); - offset("#define PT_R31 ", struct pt_regs, regs[31]); - offset("#define PT_LO ", struct pt_regs, lo); - offset("#define PT_HI ", struct pt_regs, hi); - offset("#define PT_EPC ", struct pt_regs, cp0_epc); - offset("#define PT_BVADDR ", struct pt_regs, cp0_badvaddr); - offset("#define PT_STATUS ", struct pt_regs, cp0_status); - offset("#define PT_CAUSE ", struct pt_regs, cp0_cause); - size("#define PT_SIZE ", struct pt_regs); - linefeed; -} - -void output_task_defines(void) -{ - text("/* MIPS task_struct offsets. */"); - offset("#define TASK_STATE ", struct task_struct, state); - offset("#define TASK_THREAD_INFO ", struct task_struct, thread_info); - offset("#define TASK_FLAGS ", struct task_struct, flags); - offset("#define TASK_MM ", struct task_struct, mm); - offset("#define TASK_PID ", struct task_struct, pid); - size( "#define TASK_STRUCT_SIZE ", struct task_struct); - linefeed; -} - -void output_thread_info_defines(void) -{ - text("/* MIPS thread_info offsets. */"); - offset("#define TI_TASK ", struct thread_info, task); - offset("#define TI_EXEC_DOMAIN ", struct thread_info, exec_domain); - offset("#define TI_FLAGS ", struct thread_info, flags); - offset("#define TI_CPU ", struct thread_info, cpu); - offset("#define TI_PRE_COUNT ", struct thread_info, preempt_count); - offset("#define TI_ADDR_LIMIT ", struct thread_info, addr_limit); - offset("#define TI_RESTART_BLOCK ", struct thread_info, restart_block); - constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER); - constant("#define _THREAD_SIZE ", THREAD_SIZE); - constant("#define _THREAD_MASK ", THREAD_MASK); - linefeed; -} - -void output_thread_defines(void) -{ - text("/* MIPS specific thread_struct offsets. */"); - offset("#define THREAD_REG16 ", struct task_struct, thread.reg16); - offset("#define THREAD_REG17 ", struct task_struct, thread.reg17); - offset("#define THREAD_REG18 ", struct task_struct, thread.reg18); - offset("#define THREAD_REG19 ", struct task_struct, thread.reg19); - offset("#define THREAD_REG20 ", struct task_struct, thread.reg20); - offset("#define THREAD_REG21 ", struct task_struct, thread.reg21); - offset("#define THREAD_REG22 ", struct task_struct, thread.reg22); - offset("#define THREAD_REG23 ", struct task_struct, thread.reg23); - offset("#define THREAD_REG29 ", struct task_struct, thread.reg29); - offset("#define THREAD_REG30 ", struct task_struct, thread.reg30); - offset("#define THREAD_REG31 ", struct task_struct, thread.reg31); - offset("#define THREAD_STATUS ", struct task_struct, - thread.cp0_status); - offset("#define THREAD_FPU ", struct task_struct, thread.fpu); - - offset("#define THREAD_BVADDR ", struct task_struct, \ - thread.cp0_badvaddr); - offset("#define THREAD_BUADDR ", struct task_struct, \ - thread.cp0_baduaddr); - offset("#define THREAD_ECODE ", struct task_struct, \ - thread.error_code); - offset("#define THREAD_TRAPNO ", struct task_struct, thread.trap_no); - offset("#define THREAD_MFLAGS ", struct task_struct, thread.mflags); - offset("#define THREAD_TRAMP ", struct task_struct, \ - thread.irix_trampoline); - offset("#define THREAD_OLDCTX ", struct task_struct, \ - thread.irix_oldctx); - linefeed; -} - -void output_thread_fpu_defines(void) -{ - offset("#define THREAD_FPR0 ", - struct task_struct, thread.fpu.hard.fpr[0]); - offset("#define THREAD_FPR1 ", - struct task_struct, thread.fpu.hard.fpr[1]); - offset("#define THREAD_FPR2 ", - struct task_struct, thread.fpu.hard.fpr[2]); - offset("#define THREAD_FPR3 ", - struct task_struct, thread.fpu.hard.fpr[3]); - offset("#define THREAD_FPR4 ", - struct task_struct, thread.fpu.hard.fpr[4]); - offset("#define THREAD_FPR5 ", - struct task_struct, thread.fpu.hard.fpr[5]); - offset("#define THREAD_FPR6 ", - struct task_struct, thread.fpu.hard.fpr[6]); - offset("#define THREAD_FPR7 ", - struct task_struct, thread.fpu.hard.fpr[7]); - offset("#define THREAD_FPR8 ", - struct task_struct, thread.fpu.hard.fpr[8]); - offset("#define THREAD_FPR9 ", - struct task_struct, thread.fpu.hard.fpr[9]); - offset("#define THREAD_FPR10 ", - struct task_struct, thread.fpu.hard.fpr[10]); - offset("#define THREAD_FPR11 ", - struct task_struct, thread.fpu.hard.fpr[11]); - offset("#define THREAD_FPR12 ", - struct task_struct, thread.fpu.hard.fpr[12]); - offset("#define THREAD_FPR13 ", - struct task_struct, thread.fpu.hard.fpr[13]); - offset("#define THREAD_FPR14 ", - struct task_struct, thread.fpu.hard.fpr[14]); - offset("#define THREAD_FPR15 ", - struct task_struct, thread.fpu.hard.fpr[15]); - offset("#define THREAD_FPR16 ", - struct task_struct, thread.fpu.hard.fpr[16]); - offset("#define THREAD_FPR17 ", - struct task_struct, thread.fpu.hard.fpr[17]); - offset("#define THREAD_FPR18 ", - struct task_struct, thread.fpu.hard.fpr[18]); - offset("#define THREAD_FPR19 ", - struct task_struct, thread.fpu.hard.fpr[19]); - offset("#define THREAD_FPR20 ", - struct task_struct, thread.fpu.hard.fpr[20]); - offset("#define THREAD_FPR21 ", - struct task_struct, thread.fpu.hard.fpr[21]); - offset("#define THREAD_FPR22 ", - struct task_struct, thread.fpu.hard.fpr[22]); - offset("#define THREAD_FPR23 ", - struct task_struct, thread.fpu.hard.fpr[23]); - offset("#define THREAD_FPR24 ", - struct task_struct, thread.fpu.hard.fpr[24]); - offset("#define THREAD_FPR25 ", - struct task_struct, thread.fpu.hard.fpr[25]); - offset("#define THREAD_FPR26 ", - struct task_struct, thread.fpu.hard.fpr[26]); - offset("#define THREAD_FPR27 ", - struct task_struct, thread.fpu.hard.fpr[27]); - offset("#define THREAD_FPR28 ", - struct task_struct, thread.fpu.hard.fpr[28]); - offset("#define THREAD_FPR29 ", - struct task_struct, thread.fpu.hard.fpr[29]); - offset("#define THREAD_FPR30 ", - struct task_struct, thread.fpu.hard.fpr[30]); - offset("#define THREAD_FPR31 ", - struct task_struct, thread.fpu.hard.fpr[31]); - - offset("#define THREAD_FCR31 ", - struct task_struct, thread.fpu.hard.fcr31); - linefeed; -} - -void output_mm_defines(void) -{ - text("/* Size of struct page */"); - size("#define STRUCT_PAGE_SIZE ", struct page); - linefeed; - text("/* Linux mm_struct offsets. */"); - offset("#define MM_USERS ", struct mm_struct, mm_users); - offset("#define MM_PGD ", struct mm_struct, pgd); - offset("#define MM_CONTEXT ", struct mm_struct, context); - linefeed; - constant("#define _PAGE_SIZE ", PAGE_SIZE); - constant("#define _PAGE_SHIFT ", PAGE_SHIFT); - linefeed; - constant("#define _PGD_T_SIZE ", sizeof(pgd_t)); - constant("#define _PMD_T_SIZE ", sizeof(pmd_t)); - constant("#define _PTE_T_SIZE ", sizeof(pte_t)); - linefeed; - constant("#define _PGD_T_LOG2 ", PGD_T_LOG2); - constant("#define _PMD_T_LOG2 ", PMD_T_LOG2); - constant("#define _PTE_T_LOG2 ", PTE_T_LOG2); - linefeed; - constant("#define _PMD_SHIFT ", PMD_SHIFT); - constant("#define _PGDIR_SHIFT ", PGDIR_SHIFT); - linefeed; - constant("#define _PGD_ORDER ", PGD_ORDER); - constant("#define _PMD_ORDER ", PMD_ORDER); - constant("#define _PTE_ORDER ", PTE_ORDER); - linefeed; - constant("#define _PTRS_PER_PGD ", PTRS_PER_PGD); - constant("#define _PTRS_PER_PMD ", PTRS_PER_PMD); - constant("#define _PTRS_PER_PTE ", PTRS_PER_PTE); - linefeed; -} - -void output_sc_defines(void) -{ - text("/* Linux sigcontext offsets. */"); - offset("#define SC_REGS ", struct sigcontext, sc_regs); - offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); - offset("#define SC_MDHI ", struct sigcontext, sc_mdhi); - offset("#define SC_MDLO ", struct sigcontext, sc_mdlo); - offset("#define SC_PC ", struct sigcontext, sc_pc); - offset("#define SC_STATUS ", struct sigcontext, sc_status); - offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); - offset("#define SC_FPC_EIR ", struct sigcontext, sc_fpc_eir); - offset("#define SC_CAUSE ", struct sigcontext, sc_cause); - offset("#define SC_BADVADDR ", struct sigcontext, sc_badvaddr); - linefeed; -} - -#ifdef CONFIG_MIPS32_COMPAT -void output_sc32_defines(void) -{ - text("/* Linux 32-bit sigcontext offsets. */"); - offset("#define SC32_FPREGS ", struct sigcontext32, sc_fpregs); - offset("#define SC32_FPC_CSR ", struct sigcontext32, sc_fpc_csr); - offset("#define SC32_FPC_EIR ", struct sigcontext32, sc_fpc_eir); - linefeed; -} -#endif - -void output_signal_defined(void) -{ - text("/* Linux signal numbers. */"); - constant("#define _SIGHUP ", SIGHUP); - constant("#define _SIGINT ", SIGINT); - constant("#define _SIGQUIT ", SIGQUIT); - constant("#define _SIGILL ", SIGILL); - constant("#define _SIGTRAP ", SIGTRAP); - constant("#define _SIGIOT ", SIGIOT); - constant("#define _SIGABRT ", SIGABRT); - constant("#define _SIGEMT ", SIGEMT); - constant("#define _SIGFPE ", SIGFPE); - constant("#define _SIGKILL ", SIGKILL); - constant("#define _SIGBUS ", SIGBUS); - constant("#define _SIGSEGV ", SIGSEGV); - constant("#define _SIGSYS ", SIGSYS); - constant("#define _SIGPIPE ", SIGPIPE); - constant("#define _SIGALRM ", SIGALRM); - constant("#define _SIGTERM ", SIGTERM); - constant("#define _SIGUSR1 ", SIGUSR1); - constant("#define _SIGUSR2 ", SIGUSR2); - constant("#define _SIGCHLD ", SIGCHLD); - constant("#define _SIGPWR ", SIGPWR); - constant("#define _SIGWINCH ", SIGWINCH); - constant("#define _SIGURG ", SIGURG); - constant("#define _SIGIO ", SIGIO); - constant("#define _SIGSTOP ", SIGSTOP); - constant("#define _SIGTSTP ", SIGTSTP); - constant("#define _SIGCONT ", SIGCONT); - constant("#define _SIGTTIN ", SIGTTIN); - constant("#define _SIGTTOU ", SIGTTOU); - constant("#define _SIGVTALRM ", SIGVTALRM); - constant("#define _SIGPROF ", SIGPROF); - constant("#define _SIGXCPU ", SIGXCPU); - constant("#define _SIGXFSZ ", SIGXFSZ); - linefeed; -} - -void output_irq_cpustat_t_defines(void) -{ - text("/* Linux irq_cpustat_t offsets. */"); - offset("#define IC_SOFTIRQ_PENDING ", irq_cpustat_t, __softirq_pending); - size("#define IC_IRQ_CPUSTAT_T ", irq_cpustat_t); - linefeed; -} diff -Nru a/arch/mips/kernel/reg.c b/arch/mips/kernel/reg.c --- a/arch/mips/kernel/reg.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,69 +0,0 @@ -/* - * offset.c: Calculate pt_regs and task_struct indices. - * - * Copyright (C) 1996 David S. Miller - * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle - */ -#include -#include -#include -#include - -#include -#include - -#define text(t) __asm__("\n@@@" t) -#define _offset(type, member) ((unsigned long) &(((type *)NULL)->member)) -#define index(string, ptr, member) \ - __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)/sizeof(long))) -#define size(string, size) \ - __asm__("\n@@@" string "%0" : : "i" (sizeof(size))) -#define linefeed text("") - -void output_ptreg_defines(void) -{ - text("/* MIPS pt_regs indices. */"); - index("#define EF_R0 ", struct pt_regs, regs[0]); - index("#define EF_R1 ", struct pt_regs, regs[1]); - index("#define EF_R2 ", struct pt_regs, regs[2]); - index("#define EF_R3 ", struct pt_regs, regs[3]); - index("#define EF_R4 ", struct pt_regs, regs[4]); - index("#define EF_R5 ", struct pt_regs, regs[5]); - index("#define EF_R6 ", struct pt_regs, regs[6]); - index("#define EF_R7 ", struct pt_regs, regs[7]); - index("#define EF_R8 ", struct pt_regs, regs[8]); - index("#define EF_R9 ", struct pt_regs, regs[9]); - index("#define EF_R10 ", struct pt_regs, regs[10]); - index("#define EF_R11 ", struct pt_regs, regs[11]); - index("#define EF_R12 ", struct pt_regs, regs[12]); - index("#define EF_R13 ", struct pt_regs, regs[13]); - index("#define EF_R14 ", struct pt_regs, regs[14]); - index("#define EF_R15 ", struct pt_regs, regs[15]); - index("#define EF_R16 ", struct pt_regs, regs[16]); - index("#define EF_R17 ", struct pt_regs, regs[17]); - index("#define EF_R18 ", struct pt_regs, regs[18]); - index("#define EF_R19 ", struct pt_regs, regs[19]); - index("#define EF_R20 ", struct pt_regs, regs[20]); - index("#define EF_R21 ", struct pt_regs, regs[21]); - index("#define EF_R22 ", struct pt_regs, regs[22]); - index("#define EF_R23 ", struct pt_regs, regs[23]); - index("#define EF_R24 ", struct pt_regs, regs[24]); - index("#define EF_R25 ", struct pt_regs, regs[25]); - index("#define EF_R26 ", struct pt_regs, regs[26]); - index("#define EF_R27 ", struct pt_regs, regs[27]); - index("#define EF_R28 ", struct pt_regs, regs[28]); - index("#define EF_R29 ", struct pt_regs, regs[29]); - index("#define EF_R30 ", struct pt_regs, regs[30]); - index("#define EF_R31 ", struct pt_regs, regs[31]); - linefeed; - index("#define EF_LO ", struct pt_regs, lo); - index("#define EF_HI ", struct pt_regs, hi); - linefeed; - index("#define EF_EPC ", struct pt_regs, cp0_epc); - index("#define EF_BVADDR ", struct pt_regs, cp0_badvaddr); - index("#define EF_STATUS ", struct pt_regs, cp0_status); - index("#define EF_CAUSE ", struct pt_regs, cp0_cause); - linefeed; - size("#define EF_SIZE ", struct pt_regs); - linefeed; -} diff -Nru a/arch/parisc/Makefile b/arch/parisc/Makefile --- a/arch/parisc/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/parisc/Makefile 2004-10-28 22:41:09 -07:00 @@ -86,15 +86,7 @@ # Shorthands for known targets not supported by parisc, use palo as default Image zImage bzImage: palo -prepare: include/asm-parisc/offsets.h - -arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - -CLEAN_FILES += lifimage include/asm-parisc/offsets.h +CLEAN_FILES += lifimage MRPROPER_FILES += palo.conf define archhelp diff -Nru a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c --- a/arch/parisc/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,295 +0,0 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed to extract - * and format the required data. - * - * Copyright (C) 2000-2001 John Marvin - * Copyright (C) 2000 David Huggins-Daines - * Copyright (C) 2000 Sam Creasey - * Copyright (C) 2000 Grant Grundler - * Copyright (C) 2001 Paul Bame - * Copyright (C) 2001 Richard Hirst - * Copyright (C) 2002 Randolph Chung - * Copyright (C) 2003 James Bottomley - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -#ifdef __LP64__ -#define FRAME_SIZE 128 -#else -#define FRAME_SIZE 64 -#endif - -#define align(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y))) - -int main(void) -{ - DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); - DEFINE(TASK_STATE, offsetof(struct task_struct, state)); - DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); - DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending)); - DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); - DEFINE(TASK_MM, offsetof(struct task_struct, mm)); - DEFINE(TASK_PERSONALITY, offsetof(struct task_struct, personality)); - DEFINE(TASK_PID, offsetof(struct task_struct, pid)); - BLANK(); - DEFINE(TASK_REGS, offsetof(struct task_struct, thread.regs)); - DEFINE(TASK_PT_PSW, offsetof(struct task_struct, thread.regs.gr[ 0])); - DEFINE(TASK_PT_GR1, offsetof(struct task_struct, thread.regs.gr[ 1])); - DEFINE(TASK_PT_GR2, offsetof(struct task_struct, thread.regs.gr[ 2])); - DEFINE(TASK_PT_GR3, offsetof(struct task_struct, thread.regs.gr[ 3])); - DEFINE(TASK_PT_GR4, offsetof(struct task_struct, thread.regs.gr[ 4])); - DEFINE(TASK_PT_GR5, offsetof(struct task_struct, thread.regs.gr[ 5])); - DEFINE(TASK_PT_GR6, offsetof(struct task_struct, thread.regs.gr[ 6])); - DEFINE(TASK_PT_GR7, offsetof(struct task_struct, thread.regs.gr[ 7])); - DEFINE(TASK_PT_GR8, offsetof(struct task_struct, thread.regs.gr[ 8])); - DEFINE(TASK_PT_GR9, offsetof(struct task_struct, thread.regs.gr[ 9])); - DEFINE(TASK_PT_GR10, offsetof(struct task_struct, thread.regs.gr[10])); - DEFINE(TASK_PT_GR11, offsetof(struct task_struct, thread.regs.gr[11])); - DEFINE(TASK_PT_GR12, offsetof(struct task_struct, thread.regs.gr[12])); - DEFINE(TASK_PT_GR13, offsetof(struct task_struct, thread.regs.gr[13])); - DEFINE(TASK_PT_GR14, offsetof(struct task_struct, thread.regs.gr[14])); - DEFINE(TASK_PT_GR15, offsetof(struct task_struct, thread.regs.gr[15])); - DEFINE(TASK_PT_GR16, offsetof(struct task_struct, thread.regs.gr[16])); - DEFINE(TASK_PT_GR17, offsetof(struct task_struct, thread.regs.gr[17])); - DEFINE(TASK_PT_GR18, offsetof(struct task_struct, thread.regs.gr[18])); - DEFINE(TASK_PT_GR19, offsetof(struct task_struct, thread.regs.gr[19])); - DEFINE(TASK_PT_GR20, offsetof(struct task_struct, thread.regs.gr[20])); - DEFINE(TASK_PT_GR21, offsetof(struct task_struct, thread.regs.gr[21])); - DEFINE(TASK_PT_GR22, offsetof(struct task_struct, thread.regs.gr[22])); - DEFINE(TASK_PT_GR23, offsetof(struct task_struct, thread.regs.gr[23])); - DEFINE(TASK_PT_GR24, offsetof(struct task_struct, thread.regs.gr[24])); - DEFINE(TASK_PT_GR25, offsetof(struct task_struct, thread.regs.gr[25])); - DEFINE(TASK_PT_GR26, offsetof(struct task_struct, thread.regs.gr[26])); - DEFINE(TASK_PT_GR27, offsetof(struct task_struct, thread.regs.gr[27])); - DEFINE(TASK_PT_GR28, offsetof(struct task_struct, thread.regs.gr[28])); - DEFINE(TASK_PT_GR29, offsetof(struct task_struct, thread.regs.gr[29])); - DEFINE(TASK_PT_GR30, offsetof(struct task_struct, thread.regs.gr[30])); - DEFINE(TASK_PT_GR31, offsetof(struct task_struct, thread.regs.gr[31])); - DEFINE(TASK_PT_FR0, offsetof(struct task_struct, thread.regs.fr[ 0])); - DEFINE(TASK_PT_FR1, offsetof(struct task_struct, thread.regs.fr[ 1])); - DEFINE(TASK_PT_FR2, offsetof(struct task_struct, thread.regs.fr[ 2])); - DEFINE(TASK_PT_FR3, offsetof(struct task_struct, thread.regs.fr[ 3])); - DEFINE(TASK_PT_FR4, offsetof(struct task_struct, thread.regs.fr[ 4])); - DEFINE(TASK_PT_FR5, offsetof(struct task_struct, thread.regs.fr[ 5])); - DEFINE(TASK_PT_FR6, offsetof(struct task_struct, thread.regs.fr[ 6])); - DEFINE(TASK_PT_FR7, offsetof(struct task_struct, thread.regs.fr[ 7])); - DEFINE(TASK_PT_FR8, offsetof(struct task_struct, thread.regs.fr[ 8])); - DEFINE(TASK_PT_FR9, offsetof(struct task_struct, thread.regs.fr[ 9])); - DEFINE(TASK_PT_FR10, offsetof(struct task_struct, thread.regs.fr[10])); - DEFINE(TASK_PT_FR11, offsetof(struct task_struct, thread.regs.fr[11])); - DEFINE(TASK_PT_FR12, offsetof(struct task_struct, thread.regs.fr[12])); - DEFINE(TASK_PT_FR13, offsetof(struct task_struct, thread.regs.fr[13])); - DEFINE(TASK_PT_FR14, offsetof(struct task_struct, thread.regs.fr[14])); - DEFINE(TASK_PT_FR15, offsetof(struct task_struct, thread.regs.fr[15])); - DEFINE(TASK_PT_FR16, offsetof(struct task_struct, thread.regs.fr[16])); - DEFINE(TASK_PT_FR17, offsetof(struct task_struct, thread.regs.fr[17])); - DEFINE(TASK_PT_FR18, offsetof(struct task_struct, thread.regs.fr[18])); - DEFINE(TASK_PT_FR19, offsetof(struct task_struct, thread.regs.fr[19])); - DEFINE(TASK_PT_FR20, offsetof(struct task_struct, thread.regs.fr[20])); - DEFINE(TASK_PT_FR21, offsetof(struct task_struct, thread.regs.fr[21])); - DEFINE(TASK_PT_FR22, offsetof(struct task_struct, thread.regs.fr[22])); - DEFINE(TASK_PT_FR23, offsetof(struct task_struct, thread.regs.fr[23])); - DEFINE(TASK_PT_FR24, offsetof(struct task_struct, thread.regs.fr[24])); - DEFINE(TASK_PT_FR25, offsetof(struct task_struct, thread.regs.fr[25])); - DEFINE(TASK_PT_FR26, offsetof(struct task_struct, thread.regs.fr[26])); - DEFINE(TASK_PT_FR27, offsetof(struct task_struct, thread.regs.fr[27])); - DEFINE(TASK_PT_FR28, offsetof(struct task_struct, thread.regs.fr[28])); - DEFINE(TASK_PT_FR29, offsetof(struct task_struct, thread.regs.fr[29])); - DEFINE(TASK_PT_FR30, offsetof(struct task_struct, thread.regs.fr[30])); - DEFINE(TASK_PT_FR31, offsetof(struct task_struct, thread.regs.fr[31])); - DEFINE(TASK_PT_SR0, offsetof(struct task_struct, thread.regs.sr[ 0])); - DEFINE(TASK_PT_SR1, offsetof(struct task_struct, thread.regs.sr[ 1])); - DEFINE(TASK_PT_SR2, offsetof(struct task_struct, thread.regs.sr[ 2])); - DEFINE(TASK_PT_SR3, offsetof(struct task_struct, thread.regs.sr[ 3])); - DEFINE(TASK_PT_SR4, offsetof(struct task_struct, thread.regs.sr[ 4])); - DEFINE(TASK_PT_SR5, offsetof(struct task_struct, thread.regs.sr[ 5])); - DEFINE(TASK_PT_SR6, offsetof(struct task_struct, thread.regs.sr[ 6])); - DEFINE(TASK_PT_SR7, offsetof(struct task_struct, thread.regs.sr[ 7])); - DEFINE(TASK_PT_IASQ0, offsetof(struct task_struct, thread.regs.iasq[0])); - DEFINE(TASK_PT_IASQ1, offsetof(struct task_struct, thread.regs.iasq[1])); - DEFINE(TASK_PT_IAOQ0, offsetof(struct task_struct, thread.regs.iaoq[0])); - DEFINE(TASK_PT_IAOQ1, offsetof(struct task_struct, thread.regs.iaoq[1])); - DEFINE(TASK_PT_CR27, offsetof(struct task_struct, thread.regs.cr27)); - DEFINE(TASK_PT_ORIG_R28, offsetof(struct task_struct, thread.regs.orig_r28)); - DEFINE(TASK_PT_KSP, offsetof(struct task_struct, thread.regs.ksp)); - DEFINE(TASK_PT_KPC, offsetof(struct task_struct, thread.regs.kpc)); - DEFINE(TASK_PT_SAR, offsetof(struct task_struct, thread.regs.sar)); - DEFINE(TASK_PT_IIR, offsetof(struct task_struct, thread.regs.iir)); - DEFINE(TASK_PT_ISR, offsetof(struct task_struct, thread.regs.isr)); - DEFINE(TASK_PT_IOR, offsetof(struct task_struct, thread.regs.ior)); - BLANK(); - DEFINE(TASK_SZ, sizeof(struct task_struct)); - DEFINE(TASK_SZ_ALGN, align(sizeof(struct task_struct), 64)); - BLANK(); - DEFINE(PT_PSW, offsetof(struct pt_regs, gr[ 0])); - DEFINE(PT_GR1, offsetof(struct pt_regs, gr[ 1])); - DEFINE(PT_GR2, offsetof(struct pt_regs, gr[ 2])); - DEFINE(PT_GR3, offsetof(struct pt_regs, gr[ 3])); - DEFINE(PT_GR4, offsetof(struct pt_regs, gr[ 4])); - DEFINE(PT_GR5, offsetof(struct pt_regs, gr[ 5])); - DEFINE(PT_GR6, offsetof(struct pt_regs, gr[ 6])); - DEFINE(PT_GR7, offsetof(struct pt_regs, gr[ 7])); - DEFINE(PT_GR8, offsetof(struct pt_regs, gr[ 8])); - DEFINE(PT_GR9, offsetof(struct pt_regs, gr[ 9])); - DEFINE(PT_GR10, offsetof(struct pt_regs, gr[10])); - DEFINE(PT_GR11, offsetof(struct pt_regs, gr[11])); - DEFINE(PT_GR12, offsetof(struct pt_regs, gr[12])); - DEFINE(PT_GR13, offsetof(struct pt_regs, gr[13])); - DEFINE(PT_GR14, offsetof(struct pt_regs, gr[14])); - DEFINE(PT_GR15, offsetof(struct pt_regs, gr[15])); - DEFINE(PT_GR16, offsetof(struct pt_regs, gr[16])); - DEFINE(PT_GR17, offsetof(struct pt_regs, gr[17])); - DEFINE(PT_GR18, offsetof(struct pt_regs, gr[18])); - DEFINE(PT_GR19, offsetof(struct pt_regs, gr[19])); - DEFINE(PT_GR20, offsetof(struct pt_regs, gr[20])); - DEFINE(PT_GR21, offsetof(struct pt_regs, gr[21])); - DEFINE(PT_GR22, offsetof(struct pt_regs, gr[22])); - DEFINE(PT_GR23, offsetof(struct pt_regs, gr[23])); - DEFINE(PT_GR24, offsetof(struct pt_regs, gr[24])); - DEFINE(PT_GR25, offsetof(struct pt_regs, gr[25])); - DEFINE(PT_GR26, offsetof(struct pt_regs, gr[26])); - DEFINE(PT_GR27, offsetof(struct pt_regs, gr[27])); - DEFINE(PT_GR28, offsetof(struct pt_regs, gr[28])); - DEFINE(PT_GR29, offsetof(struct pt_regs, gr[29])); - DEFINE(PT_GR30, offsetof(struct pt_regs, gr[30])); - DEFINE(PT_GR31, offsetof(struct pt_regs, gr[31])); - DEFINE(PT_FR0, offsetof(struct pt_regs, fr[ 0])); - DEFINE(PT_FR1, offsetof(struct pt_regs, fr[ 1])); - DEFINE(PT_FR2, offsetof(struct pt_regs, fr[ 2])); - DEFINE(PT_FR3, offsetof(struct pt_regs, fr[ 3])); - DEFINE(PT_FR4, offsetof(struct pt_regs, fr[ 4])); - DEFINE(PT_FR5, offsetof(struct pt_regs, fr[ 5])); - DEFINE(PT_FR6, offsetof(struct pt_regs, fr[ 6])); - DEFINE(PT_FR7, offsetof(struct pt_regs, fr[ 7])); - DEFINE(PT_FR8, offsetof(struct pt_regs, fr[ 8])); - DEFINE(PT_FR9, offsetof(struct pt_regs, fr[ 9])); - DEFINE(PT_FR10, offsetof(struct pt_regs, fr[10])); - DEFINE(PT_FR11, offsetof(struct pt_regs, fr[11])); - DEFINE(PT_FR12, offsetof(struct pt_regs, fr[12])); - DEFINE(PT_FR13, offsetof(struct pt_regs, fr[13])); - DEFINE(PT_FR14, offsetof(struct pt_regs, fr[14])); - DEFINE(PT_FR15, offsetof(struct pt_regs, fr[15])); - DEFINE(PT_FR16, offsetof(struct pt_regs, fr[16])); - DEFINE(PT_FR17, offsetof(struct pt_regs, fr[17])); - DEFINE(PT_FR18, offsetof(struct pt_regs, fr[18])); - DEFINE(PT_FR19, offsetof(struct pt_regs, fr[19])); - DEFINE(PT_FR20, offsetof(struct pt_regs, fr[20])); - DEFINE(PT_FR21, offsetof(struct pt_regs, fr[21])); - DEFINE(PT_FR22, offsetof(struct pt_regs, fr[22])); - DEFINE(PT_FR23, offsetof(struct pt_regs, fr[23])); - DEFINE(PT_FR24, offsetof(struct pt_regs, fr[24])); - DEFINE(PT_FR25, offsetof(struct pt_regs, fr[25])); - DEFINE(PT_FR26, offsetof(struct pt_regs, fr[26])); - DEFINE(PT_FR27, offsetof(struct pt_regs, fr[27])); - DEFINE(PT_FR28, offsetof(struct pt_regs, fr[28])); - DEFINE(PT_FR29, offsetof(struct pt_regs, fr[29])); - DEFINE(PT_FR30, offsetof(struct pt_regs, fr[30])); - DEFINE(PT_FR31, offsetof(struct pt_regs, fr[31])); - DEFINE(PT_SR0, offsetof(struct pt_regs, sr[ 0])); - DEFINE(PT_SR1, offsetof(struct pt_regs, sr[ 1])); - DEFINE(PT_SR2, offsetof(struct pt_regs, sr[ 2])); - DEFINE(PT_SR3, offsetof(struct pt_regs, sr[ 3])); - DEFINE(PT_SR4, offsetof(struct pt_regs, sr[ 4])); - DEFINE(PT_SR5, offsetof(struct pt_regs, sr[ 5])); - DEFINE(PT_SR6, offsetof(struct pt_regs, sr[ 6])); - DEFINE(PT_SR7, offsetof(struct pt_regs, sr[ 7])); - DEFINE(PT_IASQ0, offsetof(struct pt_regs, iasq[0])); - DEFINE(PT_IASQ1, offsetof(struct pt_regs, iasq[1])); - DEFINE(PT_IAOQ0, offsetof(struct pt_regs, iaoq[0])); - DEFINE(PT_IAOQ1, offsetof(struct pt_regs, iaoq[1])); - DEFINE(PT_CR27, offsetof(struct pt_regs, cr27)); - DEFINE(PT_ORIG_R28, offsetof(struct pt_regs, orig_r28)); - DEFINE(PT_KSP, offsetof(struct pt_regs, ksp)); - DEFINE(PT_KPC, offsetof(struct pt_regs, kpc)); - DEFINE(PT_SAR, offsetof(struct pt_regs, sar)); - DEFINE(PT_IIR, offsetof(struct pt_regs, iir)); - DEFINE(PT_ISR, offsetof(struct pt_regs, isr)); - DEFINE(PT_IOR, offsetof(struct pt_regs, ior)); - DEFINE(PT_SIZE, sizeof(struct pt_regs)); - DEFINE(PT_SZ_ALGN, align(sizeof(struct pt_regs), 64)); - BLANK(); - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); - DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit)); - DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); - DEFINE(THREAD_SZ, sizeof(struct thread_info)); - DEFINE(THREAD_SZ_ALGN, align(sizeof(struct thread_info), 64)); - BLANK(); - DEFINE(IRQSTAT_SIRQ_PEND, offsetof(irq_cpustat_t, __softirq_pending)); - DEFINE(IRQSTAT_SZ, sizeof(irq_cpustat_t)); - BLANK(); - DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base)); - DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride)); - DEFINE(ICACHE_COUNT, offsetof(struct pdc_cache_info, ic_count)); - DEFINE(ICACHE_LOOP, offsetof(struct pdc_cache_info, ic_loop)); - DEFINE(DCACHE_BASE, offsetof(struct pdc_cache_info, dc_base)); - DEFINE(DCACHE_STRIDE, offsetof(struct pdc_cache_info, dc_stride)); - DEFINE(DCACHE_COUNT, offsetof(struct pdc_cache_info, dc_count)); - DEFINE(DCACHE_LOOP, offsetof(struct pdc_cache_info, dc_loop)); - DEFINE(ITLB_SID_BASE, offsetof(struct pdc_cache_info, it_sp_base)); - DEFINE(ITLB_SID_STRIDE, offsetof(struct pdc_cache_info, it_sp_stride)); - DEFINE(ITLB_SID_COUNT, offsetof(struct pdc_cache_info, it_sp_count)); - DEFINE(ITLB_OFF_BASE, offsetof(struct pdc_cache_info, it_off_base)); - DEFINE(ITLB_OFF_STRIDE, offsetof(struct pdc_cache_info, it_off_stride)); - DEFINE(ITLB_OFF_COUNT, offsetof(struct pdc_cache_info, it_off_count)); - DEFINE(ITLB_LOOP, offsetof(struct pdc_cache_info, it_loop)); - DEFINE(DTLB_SID_BASE, offsetof(struct pdc_cache_info, dt_sp_base)); - DEFINE(DTLB_SID_STRIDE, offsetof(struct pdc_cache_info, dt_sp_stride)); - DEFINE(DTLB_SID_COUNT, offsetof(struct pdc_cache_info, dt_sp_count)); - DEFINE(DTLB_OFF_BASE, offsetof(struct pdc_cache_info, dt_off_base)); - DEFINE(DTLB_OFF_STRIDE, offsetof(struct pdc_cache_info, dt_off_stride)); - DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count)); - DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop)); - BLANK(); - DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT); - DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT); - BLANK(); - DEFINE(ASM_PMD_SHIFT, PMD_SHIFT); - DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT); - DEFINE(ASM_BITS_PER_PGD, BITS_PER_PGD); - DEFINE(ASM_BITS_PER_PMD, BITS_PER_PMD); - DEFINE(ASM_BITS_PER_PTE, BITS_PER_PTE); - DEFINE(ASM_PGD_PMD_OFFSET, -(PAGE_SIZE << PGD_ORDER)); - DEFINE(ASM_PMD_ENTRY, ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT)); - DEFINE(ASM_PGD_ENTRY, PAGE_OFFSET >> PGDIR_SHIFT); - DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE); - DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE); - DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); - DEFINE(ASM_PT_INITIAL, PT_INITIAL); - DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); - BLANK(); - return 0; -} diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile --- a/arch/ppc/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/ppc/Makefile 2004-10-28 22:41:09 -07:00 @@ -96,13 +96,7 @@ archclean: $(Q)$(MAKE) $(clean)=arch/ppc/boot -prepare: include/asm-$(ARCH)/offsets.h checkbin - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) +prepare: checkbin # Use the file '.tmp_gas_check' for binutils tests, as gas won't output # to stdout and these checks are run even on install targets. @@ -130,7 +124,5 @@ endif @true -CLEAN_FILES += include/asm-$(ARCH)/offsets.h \ - arch/$(ARCH)/kernel/asm-offsets.s \ - $(TOUT) +CLEAN_FILES += $(TOUT) diff -Nru a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c --- a/arch/ppc/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,141 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int -main(void) -{ - DEFINE(THREAD, offsetof(struct task_struct, thread)); - DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info)); - DEFINE(MM, offsetof(struct task_struct, mm)); - DEFINE(PTRACE, offsetof(struct task_struct, ptrace)); - DEFINE(KSP, offsetof(struct thread_struct, ksp)); - DEFINE(PGDIR, offsetof(struct thread_struct, pgdir)); - DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall)); - DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); - DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); - DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); - DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); -#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) - DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0)); - DEFINE(PT_PTRACED, PT_PTRACED); -#endif -#ifdef CONFIG_ALTIVEC - DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); - DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); - DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); - DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); -#endif /* CONFIG_ALTIVEC */ -#ifdef CONFIG_SPE - DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0])); - DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc)); - DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr)); - DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe)); -#endif /* CONFIG_SPE */ - /* Interrupt register frame */ - DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); - DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); - /* in fact we only use gpr0 - gpr9 and gpr20 - gpr23 */ - DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0])); - DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1])); - DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2])); - DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3])); - DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4])); - DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5])); - DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6])); - DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7])); - DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8])); - DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9])); - DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10])); - DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); - DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); - DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); - DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14])); - DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15])); - DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16])); - DEFINE(GPR17, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[17])); - DEFINE(GPR18, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[18])); - DEFINE(GPR19, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[19])); - DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20])); - DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21])); - DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22])); - DEFINE(GPR23, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[23])); - DEFINE(GPR24, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[24])); - DEFINE(GPR25, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[25])); - DEFINE(GPR26, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[26])); - DEFINE(GPR27, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[27])); - DEFINE(GPR28, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[28])); - DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29])); - DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30])); - DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31])); - /* Note: these symbols include _ because they overlap with special - * register names - */ - DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip)); - DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr)); - DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr)); - DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link)); - DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr)); - DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq)); - DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer)); - DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); - DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); - /* The PowerPC 400-class & Book-E processors have neither the DAR nor the DSISR - * SPRs. Hence, we overload them to hold the similar DEAR and ESR SPRs - * for such processors. For critical interrupts we use them to - * hold SRR0 and SRR1. - */ - DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); - DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); - DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); - DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); - DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); - DEFINE(CLONE_VM, CLONE_VM); - DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); - DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); - - /* About the CPU features table */ - DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); - DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask)); - DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value)); - DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); - DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); - - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); - DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); - - DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); - return 0; -} diff -Nru a/arch/ppc64/Makefile b/arch/ppc64/Makefile --- a/arch/ppc64/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/ppc64/Makefile 2004-10-28 22:41:09 -07:00 @@ -72,19 +72,9 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -prepare: include/asm-ppc64/offsets.h - -arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - define archhelp echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' echo ' zImage.initrd- Compressed kernel image with initrd attached,' echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz' echo ' (arch/$(ARCH)/boot/zImage.initrd)' endef - -CLEAN_FILES += include/asm-ppc64/offsets.h diff -Nru a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c --- a/arch/ppc64/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,172 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - /* thread struct on stack */ - DEFINE(THREAD_SHIFT, THREAD_SHIFT); - DEFINE(THREAD_SIZE, THREAD_SIZE); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); - DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror)); - - /* task_struct->thread */ - DEFINE(THREAD, offsetof(struct task_struct, thread)); - DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); - DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); - DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); - DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); - DEFINE(KSP, offsetof(struct thread_struct, ksp)); - DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid)); - -#ifdef CONFIG_ALTIVEC - DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); - DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); - DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); - DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); -#endif /* CONFIG_ALTIVEC */ - DEFINE(MM, offsetof(struct task_struct, mm)); - - /* naca */ - DEFINE(PACA, offsetof(struct naca_struct, paca)); - DEFINE(DCACHEL1LINESIZE, offsetof(struct systemcfg, dCacheL1LineSize)); - DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct naca_struct, dCacheL1LogLineSize)); - DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct naca_struct, dCacheL1LinesPerPage)); - DEFINE(ICACHEL1LINESIZE, offsetof(struct systemcfg, iCacheL1LineSize)); - DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize)); - DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage)); - DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); - - /* paca */ - DEFINE(PACA_SIZE, sizeof(struct paca_struct)); - DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); - DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start)); - DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack)); - DEFINE(PACACURRENT, offsetof(struct paca_struct, __current)); - DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr)); - DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real)); - DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr)); - DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr)); - DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1)); - DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc)); - DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled)); - DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache)); - DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr)); - DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); -#ifdef CONFIG_HUGETLB_PAGE - DEFINE(PACAHTLBSEGS, offsetof(struct paca_struct, context.htlb_segs)); -#endif /* CONFIG_HUGETLB_PAGE */ - DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr)); - DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); - DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); - DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); - DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi)); - DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); - DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca)); - DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0)); - DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1)); - DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xIntDword.xAnyInt)); - DEFINE(LPPACADECRINT, offsetof(struct ItLpPaca, xIntDword.xFields.xDecrInt)); - - /* RTAS */ - DEFINE(RTASBASE, offsetof(struct rtas_t, base)); - DEFINE(RTASENTRY, offsetof(struct rtas_t, entry)); - - /* Interrupt register frame */ - DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); - - DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); - - /* 288 = # of volatile regs, int & fp, for leaf routines */ - /* which do not stack a frame. See the PPC64 ABI. */ - DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288); - /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */ - DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); - DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); - DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0])); - DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1])); - DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2])); - DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3])); - DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4])); - DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5])); - DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6])); - DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7])); - DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8])); - DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9])); - DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10])); - DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); - DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); - DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); - /* - * Note: these symbols include _ because they overlap with special - * register names - */ - DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip)); - DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr)); - DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr)); - DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link)); - DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr)); - DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer)); - DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); - DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); - DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); - DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); - DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); - DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe)); - - /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */ - DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)); - DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8); - - DEFINE(CLONE_VM, CLONE_VM); - DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); - - /* About the CPU features table */ - DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); - DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask)); - DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value)); - DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); - DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); - - return 0; -} diff -Nru a/arch/s390/Makefile b/arch/s390/Makefile --- a/arch/s390/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/s390/Makefile 2004-10-28 22:41:09 -07:00 @@ -88,16 +88,6 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -prepare: include/asm-$(ARCH)/offsets.h - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - -CLEAN_FILES += include/asm-$(ARCH)/offsets.h - # Don't use tabs in echo arguments define archhelp echo '* image - Kernel image for IPL ($(boot)/image)' diff -Nru a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c --- a/arch/s390/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,49 +0,0 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed to extract - * and format the required data. - */ - -#include -#include - -/* Use marker if you need to separate the values later */ - -#define DEFINE(sym, val, marker) \ - asm volatile("\n->" #sym " %0 " #val " " #marker : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - DEFINE(__THREAD_info, offsetof(struct task_struct, thread_info),); - DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp),); - DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info),); - DEFINE(__THREAD_mm_segment, - offsetof(struct task_struct, thread.mm_segment),); - BLANK(); - DEFINE(__TASK_pid, offsetof(struct task_struct, pid),); - BLANK(); - DEFINE(__PER_atmid, offsetof(per_struct, lowcore.words.perc_atmid),); - DEFINE(__PER_address, offsetof(per_struct, lowcore.words.address),); - DEFINE(__PER_access_id, offsetof(per_struct, lowcore.words.access_id),); - BLANK(); - DEFINE(__TI_task, offsetof(struct thread_info, task),); - DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain),); - DEFINE(__TI_flags, offsetof(struct thread_info, flags),); - DEFINE(__TI_cpu, offsetof(struct thread_info, cpu),); - DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count),); - BLANK(); - DEFINE(__PT_ARGS, offsetof(struct pt_regs, args),); - DEFINE(__PT_PSW, offsetof(struct pt_regs, psw),); - DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs),); - DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2),); - DEFINE(__PT_ILC, offsetof(struct pt_regs, ilc),); - DEFINE(__PT_TRAP, offsetof(struct pt_regs, trap),); - DEFINE(__PT_SIZE, sizeof(struct pt_regs),); - BLANK(); - DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain),); - DEFINE(__SF_GPRS, offsetof(struct stack_frame, gprs),); - DEFINE(__SF_EMPTY, offsetof(struct stack_frame, empty1),); - return 0; -} diff -Nru a/arch/sh64/Makefile b/arch/sh64/Makefile --- a/arch/sh64/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/sh64/Makefile 2004-10-28 22:41:09 -07:00 @@ -69,43 +69,6 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -prepare: include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h - -include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ - include/asm include/linux/version.h - $(call filechk,gen-asm-offsets) - -define filechk_gen-syscalltab - (set -e; \ - echo "/*"; \ - echo " * DO NOT MODIFY."; \ - echo " *"; \ - echo " * This file was generated by arch/$(ARCH)/Makefile"; \ - echo " * Any changes will be reverted at build time."; \ - echo " */"; \ - echo ""; \ - echo "#ifndef __SYSCALLTAB_H"; \ - echo "#define __SYSCALLTAB_H"; \ - echo ""; \ - echo "#include "; \ - echo ""; \ - echo "struct syscall_info {"; \ - echo " const char *name;"; \ - echo "} syscall_info_table[] = {"; \ - sed -e '/^.*\.long /!d;s//\t{ "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ - s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ - echo "};"; \ - echo ""; \ - echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)"; \ - echo ""; \ - echo "#endif /* __SYSCALLTAB_H */" ) -endef - -arch/$(ARCH)/lib/syscalltab.h: arch/sh64/kernel/syscalls.S - $(call filechk,gen-syscalltab) - -CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h - define archhelp @echo ' zImage - Compressed kernel image (arch/sh64/boot/zImage)' endef diff -Nru a/arch/sh64/kernel/asm-offsets.c b/arch/sh64/kernel/asm-offsets.c --- a/arch/sh64/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,33 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - */ - -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ - /* offsets into the thread_info struct */ - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); - DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); - DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block)); - - return 0; -} diff -Nru a/arch/sh64/kernel/entry.S b/arch/sh64/kernel/entry.S --- a/arch/sh64/kernel/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sh64/kernel/entry.S 2004-10-28 22:41:09 -07:00 @@ -19,7 +19,7 @@ #include #include #include -#include +#include /* * SR fields. diff -Nru a/arch/sparc/Makefile b/arch/sparc/Makefile --- a/arch/sparc/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/Makefile 2004-10-28 22:41:09 -07:00 @@ -59,17 +59,8 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -prepare: include/asm-$(ARCH)/asm_offsets.h -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - -CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ - arch/$(ARCH)/kernel/asm-offsets.s \ - arch/$(ARCH)/boot/System.map +CLEAN_FILES += arch/$(ARCH)/boot/System.map # Don't use tabs in echo arguments. define archhelp diff -Nru a/arch/sparc/kernel/asm-offsets.c b/arch/sparc/kernel/asm-offsets.c --- a/arch/sparc/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,45 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - * - * On sparc, thread_info data is static and TI_XXX offsets are computed by hand. - */ - -#include -#include -// #include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int foo(void) -{ - DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread)); - BLANK(); - /* XXX This is the stuff for sclow.S, kill it. */ - DEFINE(AOFF_task_pid, offsetof(struct task_struct, pid)); - DEFINE(AOFF_task_uid, offsetof(struct task_struct, uid)); - DEFINE(AOFF_task_gid, offsetof(struct task_struct, gid)); - DEFINE(AOFF_task_euid, offsetof(struct task_struct, euid)); - DEFINE(AOFF_task_egid, offsetof(struct task_struct, egid)); - /* DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info)); */ - DEFINE(ASIZ_task_uid, sizeof(current->uid)); - DEFINE(ASIZ_task_gid, sizeof(current->gid)); - DEFINE(ASIZ_task_euid, sizeof(current->euid)); - DEFINE(ASIZ_task_egid, sizeof(current->egid)); - BLANK(); - DEFINE(AOFF_thread_fork_kpsr, - offsetof(struct thread_struct, fork_kpsr)); - BLANK(); - DEFINE(AOFF_mm_context, offsetof(struct mm_struct, context)); - - /* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */ - return 0; -} diff -Nru a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S --- a/arch/sparc/kernel/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/kernel/entry.S 2004-10-28 22:41:09 -07:00 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/sparc/kernel/sclow.S b/arch/sparc/kernel/sclow.S --- a/arch/sparc/kernel/sclow.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/kernel/sclow.S 2004-10-28 22:41:09 -07:00 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff -Nru a/arch/sparc/mm/hypersparc.S b/arch/sparc/mm/hypersparc.S --- a/arch/sparc/mm/hypersparc.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/mm/hypersparc.S 2004-10-28 22:41:09 -07:00 @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff -Nru a/arch/sparc/mm/swift.S b/arch/sparc/mm/swift.S --- a/arch/sparc/mm/swift.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/mm/swift.S 2004-10-28 22:41:09 -07:00 @@ -9,7 +9,7 @@ #include #include #include -#include +#include .text .align 4 diff -Nru a/arch/sparc/mm/tsunami.S b/arch/sparc/mm/tsunami.S --- a/arch/sparc/mm/tsunami.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/mm/tsunami.S 2004-10-28 22:41:09 -07:00 @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff -Nru a/arch/sparc/mm/viking.S b/arch/sparc/mm/viking.S --- a/arch/sparc/mm/viking.S 2004-10-28 22:41:09 -07:00 +++ b/arch/sparc/mm/viking.S 2004-10-28 22:41:09 -07:00 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/v850/Makefile b/arch/v850/Makefile --- a/arch/v850/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/v850/Makefile 2004-10-28 22:41:09 -07:00 @@ -48,16 +48,4 @@ $(OBJCOPY) $(OBJCOPY_FLAGS_BLOB) --rename-section .data=.root,alloc,load,readonly,data,contents $< root_fs_image.o endif - -prepare: include/asm-$(ARCH)/asm-consts.h - -# Generate constants from C code for use by asm files -arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s - $(call filechk,gen-asm-offsets) - -CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \ - arch/$(ARCH)/kernel/asm-consts.s \ - root_fs_image.o +CLEAN_FILES += root_fs_image.o diff -Nru a/arch/v850/kernel/asm-consts.c b/arch/v850/kernel/asm-consts.c --- a/arch/v850/kernel/asm-consts.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,61 +0,0 @@ -/* - * This program is used to generate definitions needed by - * assembly language modules. - * - * We use the technique used in the OSF Mach kernel code: - * generate asm statements containing #defines, - * compile this file to assembler, and then extract the - * #defines from the assembly-language output. - */ - -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main (void) -{ - /* offsets into the task struct */ - DEFINE (TASK_STATE, offsetof (struct task_struct, state)); - DEFINE (TASK_FLAGS, offsetof (struct task_struct, flags)); - DEFINE (TASK_PTRACE, offsetof (struct task_struct, ptrace)); - DEFINE (TASK_BLOCKED, offsetof (struct task_struct, blocked)); - DEFINE (TASK_THREAD, offsetof (struct task_struct, thread)); - DEFINE (TASK_THREAD_INFO, offsetof (struct task_struct, thread_info)); - DEFINE (TASK_MM, offsetof (struct task_struct, mm)); - DEFINE (TASK_ACTIVE_MM, offsetof (struct task_struct, active_mm)); - DEFINE (TASK_PID, offsetof (struct task_struct, pid)); - - /* offsets into the kernel_stat struct */ - DEFINE (STAT_IRQ, offsetof (struct kernel_stat, irqs)); - - - /* signal defines */ - DEFINE (SIGSEGV, SIGSEGV); - DEFINE (SEGV_MAPERR, SEGV_MAPERR); - DEFINE (SIGTRAP, SIGTRAP); - DEFINE (SIGCHLD, SIGCHLD); - DEFINE (SIGILL, SIGILL); - DEFINE (TRAP_TRACE, TRAP_TRACE); - - /* ptrace flag bits */ - DEFINE (PT_PTRACED, PT_PTRACED); - DEFINE (PT_DTRACE, PT_DTRACE); - - /* error values */ - DEFINE (ENOSYS, ENOSYS); - - /* clone flag bits */ - DEFINE (CLONE_VFORK, CLONE_VFORK); - DEFINE (CLONE_VM, CLONE_VM); - - return 0; -} diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile --- a/arch/x86_64/Makefile 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/Makefile 2004-10-28 22:41:09 -07:00 @@ -94,16 +94,6 @@ archclean: $(Q)$(MAKE) $(clean)=$(boot) -prepare: include/asm-$(ARCH)/offset.h - -arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/config/MARKER - -include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s - $(call filechk,gen-asm-offsets) - -CLEAN_FILES += include/asm-$(ARCH)/offset.h - define archhelp echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' echo ' install - Install kernel using' diff -Nru a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S --- a/arch/x86_64/ia32/ia32entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/ia32/ia32entry.S 2004-10-28 22:41:09 -07:00 @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff -Nru a/arch/x86_64/ia32/vsyscall-syscall.S b/arch/x86_64/ia32/vsyscall-syscall.S --- a/arch/x86_64/ia32/vsyscall-syscall.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/ia32/vsyscall-syscall.S 2004-10-28 22:41:09 -07:00 @@ -3,7 +3,7 @@ */ #include -#include +#include #include .text diff -Nru a/arch/x86_64/ia32/vsyscall-sysenter.S b/arch/x86_64/ia32/vsyscall-sysenter.S --- a/arch/x86_64/ia32/vsyscall-sysenter.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/ia32/vsyscall-sysenter.S 2004-10-28 22:41:09 -07:00 @@ -3,7 +3,7 @@ */ #include -#include +#include .text .section .text.vsyscall,"ax" diff -Nru a/arch/x86_64/kernel/asm-offsets.c b/arch/x86_64/kernel/asm-offsets.c --- a/arch/x86_64/kernel/asm-offsets.c 2004-10-28 22:41:09 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,66 +0,0 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed to extract - * and format the required data. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -int main(void) -{ -#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry)) - ENTRY(state); - ENTRY(flags); - ENTRY(thread); - ENTRY(pid); - BLANK(); -#undef ENTRY -#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry)) - ENTRY(flags); - ENTRY(addr_limit); - ENTRY(preempt_count); - BLANK(); -#undef ENTRY -#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry)) - ENTRY(kernelstack); - ENTRY(oldrsp); - ENTRY(pcurrent); - ENTRY(irqrsp); - ENTRY(irqcount); - ENTRY(cpunumber); - ENTRY(irqstackptr); - BLANK(); -#undef ENTRY -#ifdef CONFIG_IA32_EMULATION -#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry)) - ENTRY(eax); - ENTRY(ebx); - ENTRY(ecx); - ENTRY(edx); - ENTRY(esi); - ENTRY(edi); - ENTRY(ebp); - ENTRY(esp); - ENTRY(eip); - BLANK(); -#undef ENTRY - DEFINE(IA32_RT_SIGFRAME_sigcontext, - offsetof (struct rt_sigframe32, uc.uc_mcontext)); - BLANK(); -#endif - - return 0; -} diff -Nru a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S --- a/arch/x86_64/kernel/entry.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/kernel/entry.S 2004-10-28 22:41:09 -07:00 @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/x86_64/kernel/vsyscall.S b/arch/x86_64/kernel/vsyscall.S --- a/arch/x86_64/kernel/vsyscall.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/kernel/vsyscall.S 2004-10-28 22:41:09 -07:00 @@ -3,7 +3,7 @@ */ #include -#include +#include .text .globl __kernel_vsyscall diff -Nru a/arch/x86_64/lib/copy_user.S b/arch/x86_64/lib/copy_user.S --- a/arch/x86_64/lib/copy_user.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/lib/copy_user.S 2004-10-28 22:41:09 -07:00 @@ -7,7 +7,7 @@ #define FIX_ALIGNMENT 1 #include - #include + #include #include #include diff -Nru a/arch/x86_64/lib/getuser.S b/arch/x86_64/lib/getuser.S --- a/arch/x86_64/lib/getuser.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/lib/getuser.S 2004-10-28 22:41:09 -07:00 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include .text diff -Nru a/arch/x86_64/lib/putuser.S b/arch/x86_64/lib/putuser.S --- a/arch/x86_64/lib/putuser.S 2004-10-28 22:41:09 -07:00 +++ b/arch/x86_64/lib/putuser.S 2004-10-28 22:41:09 -07:00 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include .text diff -Nru a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-alpha/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-arm/Kbuild b/include/asm-arm/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,35 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + +always := constants.h include/asm-arm/.arch + +# Update machine arch and proc symlinks if something which affects +# them changed. We use .arch to indicate when they were updated +# last, otherwise make uses the target directory mtime. + +include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/MARKER + @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/$(INCDIR)' +ifneq ($(KBUILD_SRC),) + $(Q)mkdir -p include/asm-arm + $(Q)ln -fsn $(srctree)/include/asm-arm/$(INCDIR) include/asm-arm/arch +else + $(Q)ln -fsn $(INCDIR) include/asm-arm/arch +endif + @touch $@ + + +# generate offsets.h file +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +# explicit dependency +$(obj)/offsets.s: include/asm-arm/.arch + +$(obj)/constants.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-arm/offsets.c b/include/asm-arm/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,80 @@ +/* + * Copyright (C) 1995-2003 Russell King + * 2001-2002 Keith Owens + * + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed to extract + * and format the required data. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include + +/* + * Make sure that the compiler and target are compatible. + */ +#if defined(__APCS_26__) +#error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32 +#endif +/* + * GCC 2.95.1, 2.95.2: ignores register clobber list in asm(). + * GCC 3.0, 3.1: general bad code generation. + * GCC 3.2.0: incorrect function argument offset calculation. + * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c + * (http://gcc.gnu.org/PR8896) and incorrect structure + * initialisation in fs/jffs2/erase.c + */ +#if __GNUC__ < 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ < 95) || \ + (__GNUC__ == 2 && __GNUC_MINOR__ == 95 && __GNUC_PATCHLEVEL__ != 0 && \ + __GNUC_PATCHLEVEL__ < 3) || \ + (__GNUC__ == 3 && __GNUC_MINOR__ < 3) +#error Your compiler is too buggy; it is known to miscompile kernels. +#error Known good compilers: 2.95.3, 2.95.4, 2.96, 3.3 +#endif + +/* Use marker if you need to separate the values later */ + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); + BLANK(); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); + DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); + DEFINE(TI_TASK, offsetof(struct thread_info, task)); + DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); + DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); + DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp)); + DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); + DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); + DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); + BLANK(); +#if __LINUX_ARM_ARCH__ >= 6 + DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); + BLANK(); +#endif + DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); + DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags)); + BLANK(); + DEFINE(VM_EXEC, VM_EXEC); + BLANK(); + DEFINE(PAGE_SZ, PAGE_SIZE); + BLANK(); + DEFINE(SYS_ERROR0, 0x9f0000); + BLANK(); + DEFINE(SIZEOF_MACHINE_DESC, sizeof(struct machine_desc)); + return 0; +} diff -Nru a/include/asm-arm26/Kbuild b/include/asm-arm26/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm26/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-arm26/offsets.c b/include/asm-arm26/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm26/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,64 @@ +/* + * Copyright (C) 1995-2001 Russell King + * 2001-2002 Keith Owens + * 2003 Ian Molton + * + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed to extract + * and format the required data. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include + +#include +#include + +/* + * Make sure that the compiler and target are compatible. + */ +#if defined(__APCS_32__) && defined(CONFIG_CPU_26) +#error Sorry, your compiler targets APCS-32 but this kernel requires APCS-26 +#endif +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) +#error Sorry, your compiler is known to miscompile kernels. Only use gcc 2.95.3 and later. +#endif +#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 +/* shame we can't detect the .1 or .2 releases */ +#warning GCC 2.95.2 and earlier miscompiles kernels. +#endif + +/* Use marker if you need to separate the values later */ + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + DEFINE(TSK_USED_MATH, offsetof(struct task_struct, used_math)); + DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); + BLANK(); + DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); + DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags)); + BLANK(); + DEFINE(VM_EXEC, VM_EXEC); + BLANK(); + BLANK(); + DEFINE(PAGE_PRESENT, _PAGE_PRESENT); + DEFINE(PAGE_READONLY, _PAGE_READONLY); + DEFINE(PAGE_NOT_USER, _PAGE_NOT_USER); + DEFINE(PAGE_OLD, _PAGE_OLD); + DEFINE(PAGE_CLEAN, _PAGE_CLEAN); + BLANK(); + DEFINE(PAGE_SZ, PAGE_SIZE); + BLANK(); + DEFINE(SYS_ERROR0, 0x9f0000); + return 0; +} diff -Nru a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-generic/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,24 @@ +# kbuild file for asm-generic contains generic support +# for usage in asm-$(ARCH) +# This file is included from include/asm-$(ARCH)/Kbuild + + +# Generate asm-offsets.h +# --------------------------------------------------------------------------- + +define filechk_gen-asm-offsets + (set -e; \ + echo "#ifndef __ASM_OFFSETS_H__"; \ + echo "#define __ASM_OFFSETS_H__"; \ + echo "/*"; \ + echo " * DO NOT MODIFY."; \ + echo " *"; \ + echo " * This file was generated by arch/$(ARCH)/Makefile"; \ + echo " *"; \ + echo " */"; \ + echo ""; \ + sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ + echo ""; \ + echo "#endif" ) +endef + diff -Nru a/include/asm-h8300/Kbuild b/include/asm-h8300/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-h8300/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-h8300/offsets.c b/include/asm-h8300/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-h8300/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,65 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + /* offsets into the task struct */ + DEFINE(TASK_STATE, offsetof(struct task_struct, state)); + DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); + DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); + DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked)); + DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); + DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); + DEFINE(TASK_MM, offsetof(struct task_struct, mm)); + DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); + + /* offsets into the irq_cpustat_t struct */ + DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); + + /* offsets into the thread struct */ + DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); + DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); + DEFINE(THREAD_CCR, offsetof(struct thread_struct, ccr)); + + /* offsets into the pt_regs struct */ + DEFINE(LER0, offsetof(struct pt_regs, er0) - sizeof(long)); + DEFINE(LER1, offsetof(struct pt_regs, er1) - sizeof(long)); + DEFINE(LER2, offsetof(struct pt_regs, er2) - sizeof(long)); + DEFINE(LER3, offsetof(struct pt_regs, er3) - sizeof(long)); + DEFINE(LER4, offsetof(struct pt_regs, er4) - sizeof(long)); + DEFINE(LER5, offsetof(struct pt_regs, er5) - sizeof(long)); + DEFINE(LER6, offsetof(struct pt_regs, er6) - sizeof(long)); + DEFINE(LORIG, offsetof(struct pt_regs, orig_er0) - sizeof(long)); + DEFINE(LCCR, offsetof(struct pt_regs, ccr) - sizeof(long)); + DEFINE(LVEC, offsetof(struct pt_regs, vector) - sizeof(long)); +#if defined(__H8300S__) + DEFINE(LEXR, offsetof(struct pt_regs, exr) - sizeof(long)); +#endif + DEFINE(LRET, offsetof(struct pt_regs, pc) - sizeof(long)); + + DEFINE(PT_PTRACED, PT_PTRACED); + DEFINE(PT_DTRACE, PT_DTRACE); + + return 0; +} diff -Nru a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-i386/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for i386 +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/i386/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-i386/offsets.c b/include/asm-i386/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-i386/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,66 @@ +/* + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed + * to extract and format the required data. + */ + +#include +#include +#include +#include +#include "sigframe.h" +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +#define OFFSET(sym, str, mem) \ + DEFINE(sym, offsetof(struct str, mem)); + +void foo(void) +{ + OFFSET(SIGCONTEXT_eax, sigcontext, eax); + OFFSET(SIGCONTEXT_ebx, sigcontext, ebx); + OFFSET(SIGCONTEXT_ecx, sigcontext, ecx); + OFFSET(SIGCONTEXT_edx, sigcontext, edx); + OFFSET(SIGCONTEXT_esi, sigcontext, esi); + OFFSET(SIGCONTEXT_edi, sigcontext, edi); + OFFSET(SIGCONTEXT_ebp, sigcontext, ebp); + OFFSET(SIGCONTEXT_esp, sigcontext, esp); + OFFSET(SIGCONTEXT_eip, sigcontext, eip); + BLANK(); + + OFFSET(CPUINFO_x86, cpuinfo_x86, x86); + OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); + OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); + OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); + OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math); + OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); + OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); + OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); + BLANK(); + + OFFSET(TI_task, thread_info, task); + OFFSET(TI_exec_domain, thread_info, exec_domain); + OFFSET(TI_flags, thread_info, flags); + OFFSET(TI_status, thread_info, status); + OFFSET(TI_cpu, thread_info, cpu); + OFFSET(TI_preempt_count, thread_info, preempt_count); + OFFSET(TI_addr_limit, thread_info, addr_limit); + OFFSET(TI_restart_block, thread_info, restart_block); + BLANK(); + + OFFSET(EXEC_DOMAIN_handler, exec_domain, handler); + OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); + + /* Offset from the sysenter stack to tss.esp0 */ + DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) - + sizeof(struct tss_struct)); + + DEFINE(PAGE_SIZE_asm, PAGE_SIZE); + DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL)); +} diff -Nru a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h --- a/include/asm-i386/thread_info.h 2004-10-28 22:41:09 -07:00 +++ b/include/asm-i386/thread_info.h 2004-10-28 22:41:09 -07:00 @@ -47,7 +47,7 @@ #else /* !__ASSEMBLY__ */ -#include +#include #endif diff -Nru a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-ia64/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,29 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +always := offsets.h + +# offsets.h is needed to build offsets.h - so we fake one +$(obj)/.offsets.h.stamp: + mkdir -p include/asm-ia64 + [ -s include/asm-ia64/offsets.h ] \ + || echo "#define IA64_TASK_SIZE 0" > $(obj)/offsets.h + touch $@ + + +# generate offsets.h file +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +# explicit dependency +$(obj)/offsets.s: $(obj)/.offsets.h.stamp + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-ia64/offsets.c b/include/asm-ia64/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-ia64/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,224 @@ +/* + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed + * to extract and format the required data. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +#include "../kernel/sigframe.h" + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +void foo(void) +{ + DEFINE(IA64_TASK_SIZE, sizeof (struct task_struct)); + DEFINE(IA64_THREAD_INFO_SIZE, sizeof (struct thread_info)); + DEFINE(IA64_PT_REGS_SIZE, sizeof (struct pt_regs)); + DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack)); + DEFINE(IA64_SIGINFO_SIZE, sizeof (struct siginfo)); + DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64)); + DEFINE(SIGFRAME_SIZE, sizeof (struct sigframe)); + DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info)); + + BLANK(); + + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); + + BLANK(); + + DEFINE(IA64_TASK_BLOCKED_OFFSET,offsetof (struct task_struct, blocked)); + DEFINE(IA64_TASK_CLEAR_CHILD_TID_OFFSET,offsetof (struct task_struct, clear_child_tid)); + DEFINE(IA64_TASK_GROUP_LEADER_OFFSET, offsetof (struct task_struct, group_leader)); + DEFINE(IA64_TASK_PENDING_OFFSET,offsetof (struct task_struct, pending)); + DEFINE(IA64_TASK_PID_OFFSET, offsetof (struct task_struct, pid)); + DEFINE(IA64_TASK_REAL_PARENT_OFFSET, offsetof (struct task_struct, real_parent)); + DEFINE(IA64_TASK_SIGHAND_OFFSET,offsetof (struct task_struct, sighand)); + DEFINE(IA64_TASK_SIGNAL_OFFSET,offsetof (struct task_struct, signal)); + DEFINE(IA64_TASK_TGID_OFFSET, offsetof (struct task_struct, tgid)); + DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct task_struct, thread.ksp)); + DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct task_struct, thread.on_ustack)); + + BLANK(); + + DEFINE(IA64_SIGHAND_SIGLOCK_OFFSET,offsetof (struct sighand_struct, siglock)); + + BLANK(); + + DEFINE(IA64_SIGNAL_GROUP_STOP_COUNT_OFFSET,offsetof (struct signal_struct, + group_stop_count)); + DEFINE(IA64_SIGNAL_SHARED_PENDING_OFFSET,offsetof (struct signal_struct, shared_pending)); + + BLANK(); + + DEFINE(IA64_PT_REGS_B6_OFFSET, offsetof (struct pt_regs, b6)); + DEFINE(IA64_PT_REGS_B7_OFFSET, offsetof (struct pt_regs, b7)); + DEFINE(IA64_PT_REGS_AR_CSD_OFFSET, offsetof (struct pt_regs, ar_csd)); + DEFINE(IA64_PT_REGS_AR_SSD_OFFSET, offsetof (struct pt_regs, ar_ssd)); + DEFINE(IA64_PT_REGS_R8_OFFSET, offsetof (struct pt_regs, r8)); + DEFINE(IA64_PT_REGS_R9_OFFSET, offsetof (struct pt_regs, r9)); + DEFINE(IA64_PT_REGS_R10_OFFSET, offsetof (struct pt_regs, r10)); + DEFINE(IA64_PT_REGS_R11_OFFSET, offsetof (struct pt_regs, r11)); + DEFINE(IA64_PT_REGS_CR_IPSR_OFFSET, offsetof (struct pt_regs, cr_ipsr)); + DEFINE(IA64_PT_REGS_CR_IIP_OFFSET, offsetof (struct pt_regs, cr_iip)); + DEFINE(IA64_PT_REGS_CR_IFS_OFFSET, offsetof (struct pt_regs, cr_ifs)); + DEFINE(IA64_PT_REGS_AR_UNAT_OFFSET, offsetof (struct pt_regs, ar_unat)); + DEFINE(IA64_PT_REGS_AR_PFS_OFFSET, offsetof (struct pt_regs, ar_pfs)); + DEFINE(IA64_PT_REGS_AR_RSC_OFFSET, offsetof (struct pt_regs, ar_rsc)); + DEFINE(IA64_PT_REGS_AR_RNAT_OFFSET, offsetof (struct pt_regs, ar_rnat)); + + DEFINE(IA64_PT_REGS_AR_BSPSTORE_OFFSET, offsetof (struct pt_regs, ar_bspstore)); + DEFINE(IA64_PT_REGS_PR_OFFSET, offsetof (struct pt_regs, pr)); + DEFINE(IA64_PT_REGS_B0_OFFSET, offsetof (struct pt_regs, b0)); + DEFINE(IA64_PT_REGS_LOADRS_OFFSET, offsetof (struct pt_regs, loadrs)); + DEFINE(IA64_PT_REGS_R1_OFFSET, offsetof (struct pt_regs, r1)); + DEFINE(IA64_PT_REGS_R12_OFFSET, offsetof (struct pt_regs, r12)); + DEFINE(IA64_PT_REGS_R13_OFFSET, offsetof (struct pt_regs, r13)); + DEFINE(IA64_PT_REGS_AR_FPSR_OFFSET, offsetof (struct pt_regs, ar_fpsr)); + DEFINE(IA64_PT_REGS_R15_OFFSET, offsetof (struct pt_regs, r15)); + DEFINE(IA64_PT_REGS_R14_OFFSET, offsetof (struct pt_regs, r14)); + DEFINE(IA64_PT_REGS_R2_OFFSET, offsetof (struct pt_regs, r2)); + DEFINE(IA64_PT_REGS_R3_OFFSET, offsetof (struct pt_regs, r3)); + DEFINE(IA64_PT_REGS_R16_OFFSET, offsetof (struct pt_regs, r16)); + DEFINE(IA64_PT_REGS_R17_OFFSET, offsetof (struct pt_regs, r17)); + DEFINE(IA64_PT_REGS_R18_OFFSET, offsetof (struct pt_regs, r18)); + DEFINE(IA64_PT_REGS_R19_OFFSET, offsetof (struct pt_regs, r19)); + DEFINE(IA64_PT_REGS_R20_OFFSET, offsetof (struct pt_regs, r20)); + DEFINE(IA64_PT_REGS_R21_OFFSET, offsetof (struct pt_regs, r21)); + DEFINE(IA64_PT_REGS_R22_OFFSET, offsetof (struct pt_regs, r22)); + DEFINE(IA64_PT_REGS_R23_OFFSET, offsetof (struct pt_regs, r23)); + DEFINE(IA64_PT_REGS_R24_OFFSET, offsetof (struct pt_regs, r24)); + DEFINE(IA64_PT_REGS_R25_OFFSET, offsetof (struct pt_regs, r25)); + DEFINE(IA64_PT_REGS_R26_OFFSET, offsetof (struct pt_regs, r26)); + DEFINE(IA64_PT_REGS_R27_OFFSET, offsetof (struct pt_regs, r27)); + DEFINE(IA64_PT_REGS_R28_OFFSET, offsetof (struct pt_regs, r28)); + DEFINE(IA64_PT_REGS_R29_OFFSET, offsetof (struct pt_regs, r29)); + DEFINE(IA64_PT_REGS_R30_OFFSET, offsetof (struct pt_regs, r30)); + DEFINE(IA64_PT_REGS_R31_OFFSET, offsetof (struct pt_regs, r31)); + DEFINE(IA64_PT_REGS_AR_CCV_OFFSET, offsetof (struct pt_regs, ar_ccv)); + DEFINE(IA64_PT_REGS_F6_OFFSET, offsetof (struct pt_regs, f6)); + DEFINE(IA64_PT_REGS_F7_OFFSET, offsetof (struct pt_regs, f7)); + DEFINE(IA64_PT_REGS_F8_OFFSET, offsetof (struct pt_regs, f8)); + DEFINE(IA64_PT_REGS_F9_OFFSET, offsetof (struct pt_regs, f9)); + DEFINE(IA64_PT_REGS_F10_OFFSET, offsetof (struct pt_regs, f10)); + DEFINE(IA64_PT_REGS_F11_OFFSET, offsetof (struct pt_regs, f11)); + + BLANK(); + + DEFINE(IA64_SWITCH_STACK_CALLER_UNAT_OFFSET, offsetof (struct switch_stack, caller_unat)); + DEFINE(IA64_SWITCH_STACK_AR_FPSR_OFFSET, offsetof (struct switch_stack, ar_fpsr)); + DEFINE(IA64_SWITCH_STACK_F2_OFFSET, offsetof (struct switch_stack, f2)); + DEFINE(IA64_SWITCH_STACK_F3_OFFSET, offsetof (struct switch_stack, f3)); + DEFINE(IA64_SWITCH_STACK_F4_OFFSET, offsetof (struct switch_stack, f4)); + DEFINE(IA64_SWITCH_STACK_F5_OFFSET, offsetof (struct switch_stack, f5)); + DEFINE(IA64_SWITCH_STACK_F12_OFFSET, offsetof (struct switch_stack, f12)); + DEFINE(IA64_SWITCH_STACK_F13_OFFSET, offsetof (struct switch_stack, f13)); + DEFINE(IA64_SWITCH_STACK_F14_OFFSET, offsetof (struct switch_stack, f14)); + DEFINE(IA64_SWITCH_STACK_F15_OFFSET, offsetof (struct switch_stack, f15)); + DEFINE(IA64_SWITCH_STACK_F16_OFFSET, offsetof (struct switch_stack, f16)); + DEFINE(IA64_SWITCH_STACK_F17_OFFSET, offsetof (struct switch_stack, f17)); + DEFINE(IA64_SWITCH_STACK_F18_OFFSET, offsetof (struct switch_stack, f18)); + DEFINE(IA64_SWITCH_STACK_F19_OFFSET, offsetof (struct switch_stack, f19)); + DEFINE(IA64_SWITCH_STACK_F20_OFFSET, offsetof (struct switch_stack, f20)); + DEFINE(IA64_SWITCH_STACK_F21_OFFSET, offsetof (struct switch_stack, f21)); + DEFINE(IA64_SWITCH_STACK_F22_OFFSET, offsetof (struct switch_stack, f22)); + DEFINE(IA64_SWITCH_STACK_F23_OFFSET, offsetof (struct switch_stack, f23)); + DEFINE(IA64_SWITCH_STACK_F24_OFFSET, offsetof (struct switch_stack, f24)); + DEFINE(IA64_SWITCH_STACK_F25_OFFSET, offsetof (struct switch_stack, f25)); + DEFINE(IA64_SWITCH_STACK_F26_OFFSET, offsetof (struct switch_stack, f26)); + DEFINE(IA64_SWITCH_STACK_F27_OFFSET, offsetof (struct switch_stack, f27)); + DEFINE(IA64_SWITCH_STACK_F28_OFFSET, offsetof (struct switch_stack, f28)); + DEFINE(IA64_SWITCH_STACK_F29_OFFSET, offsetof (struct switch_stack, f29)); + DEFINE(IA64_SWITCH_STACK_F30_OFFSET, offsetof (struct switch_stack, f30)); + DEFINE(IA64_SWITCH_STACK_F31_OFFSET, offsetof (struct switch_stack, f31)); + DEFINE(IA64_SWITCH_STACK_R4_OFFSET, offsetof (struct switch_stack, r4)); + DEFINE(IA64_SWITCH_STACK_R5_OFFSET, offsetof (struct switch_stack, r5)); + DEFINE(IA64_SWITCH_STACK_R6_OFFSET, offsetof (struct switch_stack, r6)); + DEFINE(IA64_SWITCH_STACK_R7_OFFSET, offsetof (struct switch_stack, r7)); + DEFINE(IA64_SWITCH_STACK_B0_OFFSET, offsetof (struct switch_stack, b0)); + DEFINE(IA64_SWITCH_STACK_B1_OFFSET, offsetof (struct switch_stack, b1)); + DEFINE(IA64_SWITCH_STACK_B2_OFFSET, offsetof (struct switch_stack, b2)); + DEFINE(IA64_SWITCH_STACK_B3_OFFSET, offsetof (struct switch_stack, b3)); + DEFINE(IA64_SWITCH_STACK_B4_OFFSET, offsetof (struct switch_stack, b4)); + DEFINE(IA64_SWITCH_STACK_B5_OFFSET, offsetof (struct switch_stack, b5)); + DEFINE(IA64_SWITCH_STACK_AR_PFS_OFFSET, offsetof (struct switch_stack, ar_pfs)); + DEFINE(IA64_SWITCH_STACK_AR_LC_OFFSET, offsetof (struct switch_stack, ar_lc)); + DEFINE(IA64_SWITCH_STACK_AR_UNAT_OFFSET, offsetof (struct switch_stack, ar_unat)); + DEFINE(IA64_SWITCH_STACK_AR_RNAT_OFFSET, offsetof (struct switch_stack, ar_rnat)); + DEFINE(IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET, offsetof (struct switch_stack, ar_bspstore)); + DEFINE(IA64_SWITCH_STACK_PR_OFFSET, offsetof (struct switch_stack, pr)); + + BLANK(); + + DEFINE(IA64_SIGCONTEXT_IP_OFFSET, offsetof (struct sigcontext, sc_ip)); + DEFINE(IA64_SIGCONTEXT_AR_BSP_OFFSET, offsetof (struct sigcontext, sc_ar_bsp)); + DEFINE(IA64_SIGCONTEXT_AR_FPSR_OFFSET, offsetof (struct sigcontext, sc_ar_fpsr)); + DEFINE(IA64_SIGCONTEXT_AR_RNAT_OFFSET, offsetof (struct sigcontext, sc_ar_rnat)); + DEFINE(IA64_SIGCONTEXT_AR_UNAT_OFFSET, offsetof (struct sigcontext, sc_ar_unat)); + DEFINE(IA64_SIGCONTEXT_B0_OFFSET, offsetof (struct sigcontext, sc_br[0])); + DEFINE(IA64_SIGCONTEXT_CFM_OFFSET, offsetof (struct sigcontext, sc_cfm)); + DEFINE(IA64_SIGCONTEXT_FLAGS_OFFSET, offsetof (struct sigcontext, sc_flags)); + DEFINE(IA64_SIGCONTEXT_FR6_OFFSET, offsetof (struct sigcontext, sc_fr[6])); + DEFINE(IA64_SIGCONTEXT_PR_OFFSET, offsetof (struct sigcontext, sc_pr)); + DEFINE(IA64_SIGCONTEXT_R12_OFFSET, offsetof (struct sigcontext, sc_gr[12])); + DEFINE(IA64_SIGCONTEXT_RBS_BASE_OFFSET,offsetof (struct sigcontext, sc_rbs_base)); + DEFINE(IA64_SIGCONTEXT_LOADRS_OFFSET, offsetof (struct sigcontext, sc_loadrs)); + + BLANK(); + + DEFINE(IA64_SIGPENDING_SIGNAL_OFFSET, offsetof (struct sigpending, signal)); + + BLANK(); + + DEFINE(IA64_SIGFRAME_ARG0_OFFSET, offsetof (struct sigframe, arg0)); + DEFINE(IA64_SIGFRAME_ARG1_OFFSET, offsetof (struct sigframe, arg1)); + DEFINE(IA64_SIGFRAME_ARG2_OFFSET, offsetof (struct sigframe, arg2)); + DEFINE(IA64_SIGFRAME_HANDLER_OFFSET, offsetof (struct sigframe, handler)); + DEFINE(IA64_SIGFRAME_SIGCONTEXT_OFFSET, offsetof (struct sigframe, sc)); + BLANK(); + /* for assembly files which can't include sched.h: */ + DEFINE(IA64_CLONE_VFORK, CLONE_VFORK); + DEFINE(IA64_CLONE_VM, CLONE_VM); + + BLANK(); + DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, offsetof (struct cpuinfo_ia64, nsec_per_cyc)); + DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, offsetof (struct timespec, tv_nsec)); + + + DEFINE(CLONE_SETTLS_BIT, 19); +#if CLONE_SETTLS != (1<<19) +# error "CLONE_SETTLS_BIT incorrect, please fix" +#endif + + BLANK(); + DEFINE(IA64_MCA_TLB_INFO_SIZE, sizeof (struct ia64_mca_tlb_info)); + /* used by head.S */ + DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, offsetof (struct cpuinfo_ia64, nsec_per_cyc)); + + BLANK(); + /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */ + DEFINE(IA64_TIME_INTERPOLATOR_ADDRESS_OFFSET, offsetof (struct time_interpolator, addr)); + DEFINE(IA64_TIME_INTERPOLATOR_SOURCE_OFFSET, offsetof (struct time_interpolator, source)); + DEFINE(IA64_TIME_INTERPOLATOR_SHIFT_OFFSET, offsetof (struct time_interpolator, shift)); + DEFINE(IA64_TIME_INTERPOLATOR_NSEC_OFFSET, offsetof (struct time_interpolator, nsec_per_cyc)); + DEFINE(IA64_TIME_INTERPOLATOR_OFFSET_OFFSET, offsetof (struct time_interpolator, offset)); + DEFINE(IA64_TIME_INTERPOLATOR_LAST_CYCLE_OFFSET, offsetof (struct time_interpolator, last_cycle)); + DEFINE(IA64_TIME_INTERPOLATOR_LAST_COUNTER_OFFSET, offsetof (struct time_interpolator, last_counter)); + DEFINE(IA64_TIME_INTERPOLATOR_JITTER_OFFSET, offsetof (struct time_interpolator, jitter)); + DEFINE(IA64_TIME_SOURCE_CPU, TIME_SOURCE_CPU); + DEFINE(IA64_TIME_SOURCE_MMIO64, TIME_SOURCE_MMIO64); + DEFINE(IA64_TIME_SOURCE_MMIO32, TIME_SOURCE_MMIO32); + DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, offsetof (struct timespec, tv_nsec)); +} diff -Nru a/include/asm-m68k/Kbuild b/include/asm-m68k/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-m68k/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-m68k/offsets.c b/include/asm-m68k/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-m68k/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,109 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +int main(void) +{ + /* offsets into the task struct */ + DEFINE(TASK_STATE, offsetof(struct task_struct, state)); + DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); + DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); + DEFINE(TASK_WORK, offsetof(struct task_struct, thread.work)); + DEFINE(TASK_NEEDRESCHED, offsetof(struct task_struct, thread.work.need_resched)); + DEFINE(TASK_SYSCALL_TRACE, offsetof(struct task_struct, thread.work.syscall_trace)); + DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending)); + DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume)); + DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); + DEFINE(TASK_MM, offsetof(struct task_struct, mm)); + DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); + + /* offsets into the thread struct */ + DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); + DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); + DEFINE(THREAD_SR, offsetof(struct thread_struct, sr)); + DEFINE(THREAD_FS, offsetof(struct thread_struct, fs)); + DEFINE(THREAD_CRP, offsetof(struct thread_struct, crp)); + DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0)); + DEFINE(THREAD_FPREG, offsetof(struct thread_struct, fp)); + DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); + DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); + + /* offsets into the pt_regs */ + DEFINE(PT_D0, offsetof(struct pt_regs, d0)); + DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); + DEFINE(PT_D1, offsetof(struct pt_regs, d1)); + DEFINE(PT_D2, offsetof(struct pt_regs, d2)); + DEFINE(PT_D3, offsetof(struct pt_regs, d3)); + DEFINE(PT_D4, offsetof(struct pt_regs, d4)); + DEFINE(PT_D5, offsetof(struct pt_regs, d5)); + DEFINE(PT_A0, offsetof(struct pt_regs, a0)); + DEFINE(PT_A1, offsetof(struct pt_regs, a1)); + DEFINE(PT_A2, offsetof(struct pt_regs, a2)); + DEFINE(PT_PC, offsetof(struct pt_regs, pc)); + DEFINE(PT_SR, offsetof(struct pt_regs, sr)); + /* bitfields are a bit difficult */ + DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4); + + /* offsets into the irq_handler struct */ + DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler)); + DEFINE(IRQ_DEVID, offsetof(struct irq_node, dev_id)); + DEFINE(IRQ_NEXT, offsetof(struct irq_node, next)); + + /* offsets into the kernel_stat struct */ + DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs)); + + /* offsets into the irq_cpustat_t struct */ + DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); + + /* offsets into the bi_record struct */ + DEFINE(BIR_TAG, offsetof(struct bi_record, tag)); + DEFINE(BIR_SIZE, offsetof(struct bi_record, size)); + DEFINE(BIR_DATA, offsetof(struct bi_record, data)); + + /* offsets into font_desc (drivers/video/console/font.h) */ + DEFINE(FONT_DESC_IDX, offsetof(struct font_desc, idx)); + DEFINE(FONT_DESC_NAME, offsetof(struct font_desc, name)); + DEFINE(FONT_DESC_WIDTH, offsetof(struct font_desc, width)); + DEFINE(FONT_DESC_HEIGHT, offsetof(struct font_desc, height)); + DEFINE(FONT_DESC_DATA, offsetof(struct font_desc, data)); + DEFINE(FONT_DESC_PREF, offsetof(struct font_desc, pref)); + + /* signal defines */ + DEFINE(SIGSEGV, SIGSEGV); + DEFINE(SEGV_MAPERR, SEGV_MAPERR); + DEFINE(SIGTRAP, SIGTRAP); + DEFINE(TRAP_TRACE, TRAP_TRACE); + + /* offsets into the custom struct */ + DEFINE(CUSTOMBASE, &custom); + DEFINE(C_INTENAR, offsetof(struct CUSTOM, intenar)); + DEFINE(C_INTREQR, offsetof(struct CUSTOM, intreqr)); + DEFINE(C_INTENA, offsetof(struct CUSTOM, intena)); + DEFINE(C_INTREQ, offsetof(struct CUSTOM, intreq)); + DEFINE(C_SERDATR, offsetof(struct CUSTOM, serdatr)); + DEFINE(C_SERDAT, offsetof(struct CUSTOM, serdat)); + DEFINE(C_SERPER, offsetof(struct CUSTOM, serper)); + DEFINE(CIAABASE, &ciaa); + DEFINE(CIABBASE, &ciab); + DEFINE(C_PRA, offsetof(struct CIA, pra)); + DEFINE(ZTWOBASE, zTwoBase); + + return 0; +} diff -Nru a/include/asm-m68knommu/Kbuild b/include/asm-m68knommu/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-m68knommu/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offset.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-m68knommu/offsets.c b/include/asm-m68knommu/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-m68knommu/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,89 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + /* offsets into the task struct */ + DEFINE(TASK_STATE, offsetof(struct task_struct, state)); + DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); + DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); + DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked)); + DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); + DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); + DEFINE(TASK_MM, offsetof(struct task_struct, mm)); + DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); + + /* offsets into the kernel_stat struct */ + DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs)); + + /* offsets into the irq_cpustat_t struct */ + DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); + + /* offsets into the thread struct */ + DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); + DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); + DEFINE(THREAD_SR, offsetof(struct thread_struct, sr)); + DEFINE(THREAD_FS, offsetof(struct thread_struct, fs)); + DEFINE(THREAD_CRP, offsetof(struct thread_struct, crp)); + DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0)); + DEFINE(THREAD_FPREG, offsetof(struct thread_struct, fp)); + DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); + DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); + + /* offsets into the pt_regs */ + DEFINE(PT_D0, offsetof(struct pt_regs, d0)); + DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); + DEFINE(PT_D1, offsetof(struct pt_regs, d1)); + DEFINE(PT_D2, offsetof(struct pt_regs, d2)); + DEFINE(PT_D3, offsetof(struct pt_regs, d3)); + DEFINE(PT_D4, offsetof(struct pt_regs, d4)); + DEFINE(PT_D5, offsetof(struct pt_regs, d5)); + DEFINE(PT_A0, offsetof(struct pt_regs, a0)); + DEFINE(PT_A1, offsetof(struct pt_regs, a1)); + DEFINE(PT_A2, offsetof(struct pt_regs, a2)); + DEFINE(PT_PC, offsetof(struct pt_regs, pc)); + DEFINE(PT_SR, offsetof(struct pt_regs, sr)); + /* bitfields are a bit difficult */ + DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4); + +#ifndef CONFIG_COLDFIRE + /* offsets into the irq_handler struct */ + DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler)); + DEFINE(IRQ_DEVID, offsetof(struct irq_node, dev_id)); + DEFINE(IRQ_NEXT, offsetof(struct irq_node, next)); +#endif + + /* offsets into the kernel_stat struct */ + DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs)); + + /* signal defines */ + DEFINE(SIGSEGV, SIGSEGV); + DEFINE(SEGV_MAPERR, SEGV_MAPERR); + DEFINE(SIGTRAP, SIGTRAP); + DEFINE(TRAP_TRACE, TRAP_TRACE); + + DEFINE(PT_PTRACED, PT_PTRACED); + DEFINE(PT_DTRACE, PT_DTRACE); + + return 0; +} diff -Nru a/include/asm-mips/Kbuild b/include/asm-mips/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-mips/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,56 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h +# 2) Generate include/asm/reg.h + + +# generate offsets.h file +always := offset.h reg.h +targets := offset.s reg.s + + +# Generate +#include +#include +#include +#include +#include + +#include +#include + +#define text(t) __asm__("\n@@@" t) +#define _offset(type, member) (&(((type *)NULL)->member)) +#define offset(string, ptr, member) \ + __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member))) +#define constant(string, member) \ + __asm__("\n@@@" string "%x0" : : "ri" (member)) +#define size(string, size) \ + __asm__("\n@@@" string "%0" : : "i" (sizeof(size))) +#define linefeed text("") + +void output_ptreg_defines(void) +{ + text("/* MIPS pt_regs offsets. */"); + offset("#define PT_R0 ", struct pt_regs, regs[0]); + offset("#define PT_R1 ", struct pt_regs, regs[1]); + offset("#define PT_R2 ", struct pt_regs, regs[2]); + offset("#define PT_R3 ", struct pt_regs, regs[3]); + offset("#define PT_R4 ", struct pt_regs, regs[4]); + offset("#define PT_R5 ", struct pt_regs, regs[5]); + offset("#define PT_R6 ", struct pt_regs, regs[6]); + offset("#define PT_R7 ", struct pt_regs, regs[7]); + offset("#define PT_R8 ", struct pt_regs, regs[8]); + offset("#define PT_R9 ", struct pt_regs, regs[9]); + offset("#define PT_R10 ", struct pt_regs, regs[10]); + offset("#define PT_R11 ", struct pt_regs, regs[11]); + offset("#define PT_R12 ", struct pt_regs, regs[12]); + offset("#define PT_R13 ", struct pt_regs, regs[13]); + offset("#define PT_R14 ", struct pt_regs, regs[14]); + offset("#define PT_R15 ", struct pt_regs, regs[15]); + offset("#define PT_R16 ", struct pt_regs, regs[16]); + offset("#define PT_R17 ", struct pt_regs, regs[17]); + offset("#define PT_R18 ", struct pt_regs, regs[18]); + offset("#define PT_R19 ", struct pt_regs, regs[19]); + offset("#define PT_R20 ", struct pt_regs, regs[20]); + offset("#define PT_R21 ", struct pt_regs, regs[21]); + offset("#define PT_R22 ", struct pt_regs, regs[22]); + offset("#define PT_R23 ", struct pt_regs, regs[23]); + offset("#define PT_R24 ", struct pt_regs, regs[24]); + offset("#define PT_R25 ", struct pt_regs, regs[25]); + offset("#define PT_R26 ", struct pt_regs, regs[26]); + offset("#define PT_R27 ", struct pt_regs, regs[27]); + offset("#define PT_R28 ", struct pt_regs, regs[28]); + offset("#define PT_R29 ", struct pt_regs, regs[29]); + offset("#define PT_R30 ", struct pt_regs, regs[30]); + offset("#define PT_R31 ", struct pt_regs, regs[31]); + offset("#define PT_LO ", struct pt_regs, lo); + offset("#define PT_HI ", struct pt_regs, hi); + offset("#define PT_EPC ", struct pt_regs, cp0_epc); + offset("#define PT_BVADDR ", struct pt_regs, cp0_badvaddr); + offset("#define PT_STATUS ", struct pt_regs, cp0_status); + offset("#define PT_CAUSE ", struct pt_regs, cp0_cause); + size("#define PT_SIZE ", struct pt_regs); + linefeed; +} + +void output_task_defines(void) +{ + text("/* MIPS task_struct offsets. */"); + offset("#define TASK_STATE ", struct task_struct, state); + offset("#define TASK_THREAD_INFO ", struct task_struct, thread_info); + offset("#define TASK_FLAGS ", struct task_struct, flags); + offset("#define TASK_MM ", struct task_struct, mm); + offset("#define TASK_PID ", struct task_struct, pid); + size( "#define TASK_STRUCT_SIZE ", struct task_struct); + linefeed; +} + +void output_thread_info_defines(void) +{ + text("/* MIPS thread_info offsets. */"); + offset("#define TI_TASK ", struct thread_info, task); + offset("#define TI_EXEC_DOMAIN ", struct thread_info, exec_domain); + offset("#define TI_FLAGS ", struct thread_info, flags); + offset("#define TI_CPU ", struct thread_info, cpu); + offset("#define TI_PRE_COUNT ", struct thread_info, preempt_count); + offset("#define TI_ADDR_LIMIT ", struct thread_info, addr_limit); + offset("#define TI_RESTART_BLOCK ", struct thread_info, restart_block); + constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER); + constant("#define _THREAD_SIZE ", THREAD_SIZE); + constant("#define _THREAD_MASK ", THREAD_MASK); + linefeed; +} + +void output_thread_defines(void) +{ + text("/* MIPS specific thread_struct offsets. */"); + offset("#define THREAD_REG16 ", struct task_struct, thread.reg16); + offset("#define THREAD_REG17 ", struct task_struct, thread.reg17); + offset("#define THREAD_REG18 ", struct task_struct, thread.reg18); + offset("#define THREAD_REG19 ", struct task_struct, thread.reg19); + offset("#define THREAD_REG20 ", struct task_struct, thread.reg20); + offset("#define THREAD_REG21 ", struct task_struct, thread.reg21); + offset("#define THREAD_REG22 ", struct task_struct, thread.reg22); + offset("#define THREAD_REG23 ", struct task_struct, thread.reg23); + offset("#define THREAD_REG29 ", struct task_struct, thread.reg29); + offset("#define THREAD_REG30 ", struct task_struct, thread.reg30); + offset("#define THREAD_REG31 ", struct task_struct, thread.reg31); + offset("#define THREAD_STATUS ", struct task_struct, + thread.cp0_status); + offset("#define THREAD_FPU ", struct task_struct, thread.fpu); + + offset("#define THREAD_BVADDR ", struct task_struct, \ + thread.cp0_badvaddr); + offset("#define THREAD_BUADDR ", struct task_struct, \ + thread.cp0_baduaddr); + offset("#define THREAD_ECODE ", struct task_struct, \ + thread.error_code); + offset("#define THREAD_TRAPNO ", struct task_struct, thread.trap_no); + offset("#define THREAD_MFLAGS ", struct task_struct, thread.mflags); + offset("#define THREAD_TRAMP ", struct task_struct, \ + thread.irix_trampoline); + offset("#define THREAD_OLDCTX ", struct task_struct, \ + thread.irix_oldctx); + linefeed; +} + +void output_thread_fpu_defines(void) +{ + offset("#define THREAD_FPR0 ", + struct task_struct, thread.fpu.hard.fpr[0]); + offset("#define THREAD_FPR1 ", + struct task_struct, thread.fpu.hard.fpr[1]); + offset("#define THREAD_FPR2 ", + struct task_struct, thread.fpu.hard.fpr[2]); + offset("#define THREAD_FPR3 ", + struct task_struct, thread.fpu.hard.fpr[3]); + offset("#define THREAD_FPR4 ", + struct task_struct, thread.fpu.hard.fpr[4]); + offset("#define THREAD_FPR5 ", + struct task_struct, thread.fpu.hard.fpr[5]); + offset("#define THREAD_FPR6 ", + struct task_struct, thread.fpu.hard.fpr[6]); + offset("#define THREAD_FPR7 ", + struct task_struct, thread.fpu.hard.fpr[7]); + offset("#define THREAD_FPR8 ", + struct task_struct, thread.fpu.hard.fpr[8]); + offset("#define THREAD_FPR9 ", + struct task_struct, thread.fpu.hard.fpr[9]); + offset("#define THREAD_FPR10 ", + struct task_struct, thread.fpu.hard.fpr[10]); + offset("#define THREAD_FPR11 ", + struct task_struct, thread.fpu.hard.fpr[11]); + offset("#define THREAD_FPR12 ", + struct task_struct, thread.fpu.hard.fpr[12]); + offset("#define THREAD_FPR13 ", + struct task_struct, thread.fpu.hard.fpr[13]); + offset("#define THREAD_FPR14 ", + struct task_struct, thread.fpu.hard.fpr[14]); + offset("#define THREAD_FPR15 ", + struct task_struct, thread.fpu.hard.fpr[15]); + offset("#define THREAD_FPR16 ", + struct task_struct, thread.fpu.hard.fpr[16]); + offset("#define THREAD_FPR17 ", + struct task_struct, thread.fpu.hard.fpr[17]); + offset("#define THREAD_FPR18 ", + struct task_struct, thread.fpu.hard.fpr[18]); + offset("#define THREAD_FPR19 ", + struct task_struct, thread.fpu.hard.fpr[19]); + offset("#define THREAD_FPR20 ", + struct task_struct, thread.fpu.hard.fpr[20]); + offset("#define THREAD_FPR21 ", + struct task_struct, thread.fpu.hard.fpr[21]); + offset("#define THREAD_FPR22 ", + struct task_struct, thread.fpu.hard.fpr[22]); + offset("#define THREAD_FPR23 ", + struct task_struct, thread.fpu.hard.fpr[23]); + offset("#define THREAD_FPR24 ", + struct task_struct, thread.fpu.hard.fpr[24]); + offset("#define THREAD_FPR25 ", + struct task_struct, thread.fpu.hard.fpr[25]); + offset("#define THREAD_FPR26 ", + struct task_struct, thread.fpu.hard.fpr[26]); + offset("#define THREAD_FPR27 ", + struct task_struct, thread.fpu.hard.fpr[27]); + offset("#define THREAD_FPR28 ", + struct task_struct, thread.fpu.hard.fpr[28]); + offset("#define THREAD_FPR29 ", + struct task_struct, thread.fpu.hard.fpr[29]); + offset("#define THREAD_FPR30 ", + struct task_struct, thread.fpu.hard.fpr[30]); + offset("#define THREAD_FPR31 ", + struct task_struct, thread.fpu.hard.fpr[31]); + + offset("#define THREAD_FCR31 ", + struct task_struct, thread.fpu.hard.fcr31); + linefeed; +} + +void output_mm_defines(void) +{ + text("/* Size of struct page */"); + size("#define STRUCT_PAGE_SIZE ", struct page); + linefeed; + text("/* Linux mm_struct offsets. */"); + offset("#define MM_USERS ", struct mm_struct, mm_users); + offset("#define MM_PGD ", struct mm_struct, pgd); + offset("#define MM_CONTEXT ", struct mm_struct, context); + linefeed; + constant("#define _PAGE_SIZE ", PAGE_SIZE); + constant("#define _PAGE_SHIFT ", PAGE_SHIFT); + linefeed; + constant("#define _PGD_T_SIZE ", sizeof(pgd_t)); + constant("#define _PMD_T_SIZE ", sizeof(pmd_t)); + constant("#define _PTE_T_SIZE ", sizeof(pte_t)); + linefeed; + constant("#define _PGD_T_LOG2 ", PGD_T_LOG2); + constant("#define _PMD_T_LOG2 ", PMD_T_LOG2); + constant("#define _PTE_T_LOG2 ", PTE_T_LOG2); + linefeed; + constant("#define _PMD_SHIFT ", PMD_SHIFT); + constant("#define _PGDIR_SHIFT ", PGDIR_SHIFT); + linefeed; + constant("#define _PGD_ORDER ", PGD_ORDER); + constant("#define _PMD_ORDER ", PMD_ORDER); + constant("#define _PTE_ORDER ", PTE_ORDER); + linefeed; + constant("#define _PTRS_PER_PGD ", PTRS_PER_PGD); + constant("#define _PTRS_PER_PMD ", PTRS_PER_PMD); + constant("#define _PTRS_PER_PTE ", PTRS_PER_PTE); + linefeed; +} + +void output_sc_defines(void) +{ + text("/* Linux sigcontext offsets. */"); + offset("#define SC_REGS ", struct sigcontext, sc_regs); + offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); + offset("#define SC_MDHI ", struct sigcontext, sc_mdhi); + offset("#define SC_MDLO ", struct sigcontext, sc_mdlo); + offset("#define SC_PC ", struct sigcontext, sc_pc); + offset("#define SC_STATUS ", struct sigcontext, sc_status); + offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); + offset("#define SC_FPC_EIR ", struct sigcontext, sc_fpc_eir); + offset("#define SC_CAUSE ", struct sigcontext, sc_cause); + offset("#define SC_BADVADDR ", struct sigcontext, sc_badvaddr); + linefeed; +} + +#ifdef CONFIG_MIPS32_COMPAT +void output_sc32_defines(void) +{ + text("/* Linux 32-bit sigcontext offsets. */"); + offset("#define SC32_FPREGS ", struct sigcontext32, sc_fpregs); + offset("#define SC32_FPC_CSR ", struct sigcontext32, sc_fpc_csr); + offset("#define SC32_FPC_EIR ", struct sigcontext32, sc_fpc_eir); + linefeed; +} +#endif + +void output_signal_defined(void) +{ + text("/* Linux signal numbers. */"); + constant("#define _SIGHUP ", SIGHUP); + constant("#define _SIGINT ", SIGINT); + constant("#define _SIGQUIT ", SIGQUIT); + constant("#define _SIGILL ", SIGILL); + constant("#define _SIGTRAP ", SIGTRAP); + constant("#define _SIGIOT ", SIGIOT); + constant("#define _SIGABRT ", SIGABRT); + constant("#define _SIGEMT ", SIGEMT); + constant("#define _SIGFPE ", SIGFPE); + constant("#define _SIGKILL ", SIGKILL); + constant("#define _SIGBUS ", SIGBUS); + constant("#define _SIGSEGV ", SIGSEGV); + constant("#define _SIGSYS ", SIGSYS); + constant("#define _SIGPIPE ", SIGPIPE); + constant("#define _SIGALRM ", SIGALRM); + constant("#define _SIGTERM ", SIGTERM); + constant("#define _SIGUSR1 ", SIGUSR1); + constant("#define _SIGUSR2 ", SIGUSR2); + constant("#define _SIGCHLD ", SIGCHLD); + constant("#define _SIGPWR ", SIGPWR); + constant("#define _SIGWINCH ", SIGWINCH); + constant("#define _SIGURG ", SIGURG); + constant("#define _SIGIO ", SIGIO); + constant("#define _SIGSTOP ", SIGSTOP); + constant("#define _SIGTSTP ", SIGTSTP); + constant("#define _SIGCONT ", SIGCONT); + constant("#define _SIGTTIN ", SIGTTIN); + constant("#define _SIGTTOU ", SIGTTOU); + constant("#define _SIGVTALRM ", SIGVTALRM); + constant("#define _SIGPROF ", SIGPROF); + constant("#define _SIGXCPU ", SIGXCPU); + constant("#define _SIGXFSZ ", SIGXFSZ); + linefeed; +} + +void output_irq_cpustat_t_defines(void) +{ + text("/* Linux irq_cpustat_t offsets. */"); + offset("#define IC_SOFTIRQ_PENDING ", irq_cpustat_t, __softirq_pending); + size("#define IC_IRQ_CPUSTAT_T ", irq_cpustat_t); + linefeed; +} diff -Nru a/include/asm-mips/reg.c b/include/asm-mips/reg.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-mips/reg.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,69 @@ +/* + * offset.c: Calculate pt_regs and task_struct indices. + * + * Copyright (C) 1996 David S. Miller + * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle + */ +#include +#include +#include +#include + +#include +#include + +#define text(t) __asm__("\n@@@" t) +#define _offset(type, member) ((unsigned long) &(((type *)NULL)->member)) +#define index(string, ptr, member) \ + __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)/sizeof(long))) +#define size(string, size) \ + __asm__("\n@@@" string "%0" : : "i" (sizeof(size))) +#define linefeed text("") + +void output_ptreg_defines(void) +{ + text("/* MIPS pt_regs indices. */"); + index("#define EF_R0 ", struct pt_regs, regs[0]); + index("#define EF_R1 ", struct pt_regs, regs[1]); + index("#define EF_R2 ", struct pt_regs, regs[2]); + index("#define EF_R3 ", struct pt_regs, regs[3]); + index("#define EF_R4 ", struct pt_regs, regs[4]); + index("#define EF_R5 ", struct pt_regs, regs[5]); + index("#define EF_R6 ", struct pt_regs, regs[6]); + index("#define EF_R7 ", struct pt_regs, regs[7]); + index("#define EF_R8 ", struct pt_regs, regs[8]); + index("#define EF_R9 ", struct pt_regs, regs[9]); + index("#define EF_R10 ", struct pt_regs, regs[10]); + index("#define EF_R11 ", struct pt_regs, regs[11]); + index("#define EF_R12 ", struct pt_regs, regs[12]); + index("#define EF_R13 ", struct pt_regs, regs[13]); + index("#define EF_R14 ", struct pt_regs, regs[14]); + index("#define EF_R15 ", struct pt_regs, regs[15]); + index("#define EF_R16 ", struct pt_regs, regs[16]); + index("#define EF_R17 ", struct pt_regs, regs[17]); + index("#define EF_R18 ", struct pt_regs, regs[18]); + index("#define EF_R19 ", struct pt_regs, regs[19]); + index("#define EF_R20 ", struct pt_regs, regs[20]); + index("#define EF_R21 ", struct pt_regs, regs[21]); + index("#define EF_R22 ", struct pt_regs, regs[22]); + index("#define EF_R23 ", struct pt_regs, regs[23]); + index("#define EF_R24 ", struct pt_regs, regs[24]); + index("#define EF_R25 ", struct pt_regs, regs[25]); + index("#define EF_R26 ", struct pt_regs, regs[26]); + index("#define EF_R27 ", struct pt_regs, regs[27]); + index("#define EF_R28 ", struct pt_regs, regs[28]); + index("#define EF_R29 ", struct pt_regs, regs[29]); + index("#define EF_R30 ", struct pt_regs, regs[30]); + index("#define EF_R31 ", struct pt_regs, regs[31]); + linefeed; + index("#define EF_LO ", struct pt_regs, lo); + index("#define EF_HI ", struct pt_regs, hi); + linefeed; + index("#define EF_EPC ", struct pt_regs, cp0_epc); + index("#define EF_BVADDR ", struct pt_regs, cp0_badvaddr); + index("#define EF_STATUS ", struct pt_regs, cp0_status); + index("#define EF_CAUSE ", struct pt_regs, cp0_cause); + linefeed; + size("#define EF_SIZE ", struct pt_regs); + linefeed; +} diff -Nru a/include/asm-parisc/Kbuild b/include/asm-parisc/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-parisc/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-parisc/offsets.c b/include/asm-parisc/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-parisc/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,295 @@ +/* + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed to extract + * and format the required data. + * + * Copyright (C) 2000-2001 John Marvin + * Copyright (C) 2000 David Huggins-Daines + * Copyright (C) 2000 Sam Creasey + * Copyright (C) 2000 Grant Grundler + * Copyright (C) 2001 Paul Bame + * Copyright (C) 2001 Richard Hirst + * Copyright (C) 2002 Randolph Chung + * Copyright (C) 2003 James Bottomley + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +#ifdef __LP64__ +#define FRAME_SIZE 128 +#else +#define FRAME_SIZE 64 +#endif + +#define align(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y))) + +int main(void) +{ + DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info)); + DEFINE(TASK_STATE, offsetof(struct task_struct, state)); + DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); + DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending)); + DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); + DEFINE(TASK_MM, offsetof(struct task_struct, mm)); + DEFINE(TASK_PERSONALITY, offsetof(struct task_struct, personality)); + DEFINE(TASK_PID, offsetof(struct task_struct, pid)); + BLANK(); + DEFINE(TASK_REGS, offsetof(struct task_struct, thread.regs)); + DEFINE(TASK_PT_PSW, offsetof(struct task_struct, thread.regs.gr[ 0])); + DEFINE(TASK_PT_GR1, offsetof(struct task_struct, thread.regs.gr[ 1])); + DEFINE(TASK_PT_GR2, offsetof(struct task_struct, thread.regs.gr[ 2])); + DEFINE(TASK_PT_GR3, offsetof(struct task_struct, thread.regs.gr[ 3])); + DEFINE(TASK_PT_GR4, offsetof(struct task_struct, thread.regs.gr[ 4])); + DEFINE(TASK_PT_GR5, offsetof(struct task_struct, thread.regs.gr[ 5])); + DEFINE(TASK_PT_GR6, offsetof(struct task_struct, thread.regs.gr[ 6])); + DEFINE(TASK_PT_GR7, offsetof(struct task_struct, thread.regs.gr[ 7])); + DEFINE(TASK_PT_GR8, offsetof(struct task_struct, thread.regs.gr[ 8])); + DEFINE(TASK_PT_GR9, offsetof(struct task_struct, thread.regs.gr[ 9])); + DEFINE(TASK_PT_GR10, offsetof(struct task_struct, thread.regs.gr[10])); + DEFINE(TASK_PT_GR11, offsetof(struct task_struct, thread.regs.gr[11])); + DEFINE(TASK_PT_GR12, offsetof(struct task_struct, thread.regs.gr[12])); + DEFINE(TASK_PT_GR13, offsetof(struct task_struct, thread.regs.gr[13])); + DEFINE(TASK_PT_GR14, offsetof(struct task_struct, thread.regs.gr[14])); + DEFINE(TASK_PT_GR15, offsetof(struct task_struct, thread.regs.gr[15])); + DEFINE(TASK_PT_GR16, offsetof(struct task_struct, thread.regs.gr[16])); + DEFINE(TASK_PT_GR17, offsetof(struct task_struct, thread.regs.gr[17])); + DEFINE(TASK_PT_GR18, offsetof(struct task_struct, thread.regs.gr[18])); + DEFINE(TASK_PT_GR19, offsetof(struct task_struct, thread.regs.gr[19])); + DEFINE(TASK_PT_GR20, offsetof(struct task_struct, thread.regs.gr[20])); + DEFINE(TASK_PT_GR21, offsetof(struct task_struct, thread.regs.gr[21])); + DEFINE(TASK_PT_GR22, offsetof(struct task_struct, thread.regs.gr[22])); + DEFINE(TASK_PT_GR23, offsetof(struct task_struct, thread.regs.gr[23])); + DEFINE(TASK_PT_GR24, offsetof(struct task_struct, thread.regs.gr[24])); + DEFINE(TASK_PT_GR25, offsetof(struct task_struct, thread.regs.gr[25])); + DEFINE(TASK_PT_GR26, offsetof(struct task_struct, thread.regs.gr[26])); + DEFINE(TASK_PT_GR27, offsetof(struct task_struct, thread.regs.gr[27])); + DEFINE(TASK_PT_GR28, offsetof(struct task_struct, thread.regs.gr[28])); + DEFINE(TASK_PT_GR29, offsetof(struct task_struct, thread.regs.gr[29])); + DEFINE(TASK_PT_GR30, offsetof(struct task_struct, thread.regs.gr[30])); + DEFINE(TASK_PT_GR31, offsetof(struct task_struct, thread.regs.gr[31])); + DEFINE(TASK_PT_FR0, offsetof(struct task_struct, thread.regs.fr[ 0])); + DEFINE(TASK_PT_FR1, offsetof(struct task_struct, thread.regs.fr[ 1])); + DEFINE(TASK_PT_FR2, offsetof(struct task_struct, thread.regs.fr[ 2])); + DEFINE(TASK_PT_FR3, offsetof(struct task_struct, thread.regs.fr[ 3])); + DEFINE(TASK_PT_FR4, offsetof(struct task_struct, thread.regs.fr[ 4])); + DEFINE(TASK_PT_FR5, offsetof(struct task_struct, thread.regs.fr[ 5])); + DEFINE(TASK_PT_FR6, offsetof(struct task_struct, thread.regs.fr[ 6])); + DEFINE(TASK_PT_FR7, offsetof(struct task_struct, thread.regs.fr[ 7])); + DEFINE(TASK_PT_FR8, offsetof(struct task_struct, thread.regs.fr[ 8])); + DEFINE(TASK_PT_FR9, offsetof(struct task_struct, thread.regs.fr[ 9])); + DEFINE(TASK_PT_FR10, offsetof(struct task_struct, thread.regs.fr[10])); + DEFINE(TASK_PT_FR11, offsetof(struct task_struct, thread.regs.fr[11])); + DEFINE(TASK_PT_FR12, offsetof(struct task_struct, thread.regs.fr[12])); + DEFINE(TASK_PT_FR13, offsetof(struct task_struct, thread.regs.fr[13])); + DEFINE(TASK_PT_FR14, offsetof(struct task_struct, thread.regs.fr[14])); + DEFINE(TASK_PT_FR15, offsetof(struct task_struct, thread.regs.fr[15])); + DEFINE(TASK_PT_FR16, offsetof(struct task_struct, thread.regs.fr[16])); + DEFINE(TASK_PT_FR17, offsetof(struct task_struct, thread.regs.fr[17])); + DEFINE(TASK_PT_FR18, offsetof(struct task_struct, thread.regs.fr[18])); + DEFINE(TASK_PT_FR19, offsetof(struct task_struct, thread.regs.fr[19])); + DEFINE(TASK_PT_FR20, offsetof(struct task_struct, thread.regs.fr[20])); + DEFINE(TASK_PT_FR21, offsetof(struct task_struct, thread.regs.fr[21])); + DEFINE(TASK_PT_FR22, offsetof(struct task_struct, thread.regs.fr[22])); + DEFINE(TASK_PT_FR23, offsetof(struct task_struct, thread.regs.fr[23])); + DEFINE(TASK_PT_FR24, offsetof(struct task_struct, thread.regs.fr[24])); + DEFINE(TASK_PT_FR25, offsetof(struct task_struct, thread.regs.fr[25])); + DEFINE(TASK_PT_FR26, offsetof(struct task_struct, thread.regs.fr[26])); + DEFINE(TASK_PT_FR27, offsetof(struct task_struct, thread.regs.fr[27])); + DEFINE(TASK_PT_FR28, offsetof(struct task_struct, thread.regs.fr[28])); + DEFINE(TASK_PT_FR29, offsetof(struct task_struct, thread.regs.fr[29])); + DEFINE(TASK_PT_FR30, offsetof(struct task_struct, thread.regs.fr[30])); + DEFINE(TASK_PT_FR31, offsetof(struct task_struct, thread.regs.fr[31])); + DEFINE(TASK_PT_SR0, offsetof(struct task_struct, thread.regs.sr[ 0])); + DEFINE(TASK_PT_SR1, offsetof(struct task_struct, thread.regs.sr[ 1])); + DEFINE(TASK_PT_SR2, offsetof(struct task_struct, thread.regs.sr[ 2])); + DEFINE(TASK_PT_SR3, offsetof(struct task_struct, thread.regs.sr[ 3])); + DEFINE(TASK_PT_SR4, offsetof(struct task_struct, thread.regs.sr[ 4])); + DEFINE(TASK_PT_SR5, offsetof(struct task_struct, thread.regs.sr[ 5])); + DEFINE(TASK_PT_SR6, offsetof(struct task_struct, thread.regs.sr[ 6])); + DEFINE(TASK_PT_SR7, offsetof(struct task_struct, thread.regs.sr[ 7])); + DEFINE(TASK_PT_IASQ0, offsetof(struct task_struct, thread.regs.iasq[0])); + DEFINE(TASK_PT_IASQ1, offsetof(struct task_struct, thread.regs.iasq[1])); + DEFINE(TASK_PT_IAOQ0, offsetof(struct task_struct, thread.regs.iaoq[0])); + DEFINE(TASK_PT_IAOQ1, offsetof(struct task_struct, thread.regs.iaoq[1])); + DEFINE(TASK_PT_CR27, offsetof(struct task_struct, thread.regs.cr27)); + DEFINE(TASK_PT_ORIG_R28, offsetof(struct task_struct, thread.regs.orig_r28)); + DEFINE(TASK_PT_KSP, offsetof(struct task_struct, thread.regs.ksp)); + DEFINE(TASK_PT_KPC, offsetof(struct task_struct, thread.regs.kpc)); + DEFINE(TASK_PT_SAR, offsetof(struct task_struct, thread.regs.sar)); + DEFINE(TASK_PT_IIR, offsetof(struct task_struct, thread.regs.iir)); + DEFINE(TASK_PT_ISR, offsetof(struct task_struct, thread.regs.isr)); + DEFINE(TASK_PT_IOR, offsetof(struct task_struct, thread.regs.ior)); + BLANK(); + DEFINE(TASK_SZ, sizeof(struct task_struct)); + DEFINE(TASK_SZ_ALGN, align(sizeof(struct task_struct), 64)); + BLANK(); + DEFINE(PT_PSW, offsetof(struct pt_regs, gr[ 0])); + DEFINE(PT_GR1, offsetof(struct pt_regs, gr[ 1])); + DEFINE(PT_GR2, offsetof(struct pt_regs, gr[ 2])); + DEFINE(PT_GR3, offsetof(struct pt_regs, gr[ 3])); + DEFINE(PT_GR4, offsetof(struct pt_regs, gr[ 4])); + DEFINE(PT_GR5, offsetof(struct pt_regs, gr[ 5])); + DEFINE(PT_GR6, offsetof(struct pt_regs, gr[ 6])); + DEFINE(PT_GR7, offsetof(struct pt_regs, gr[ 7])); + DEFINE(PT_GR8, offsetof(struct pt_regs, gr[ 8])); + DEFINE(PT_GR9, offsetof(struct pt_regs, gr[ 9])); + DEFINE(PT_GR10, offsetof(struct pt_regs, gr[10])); + DEFINE(PT_GR11, offsetof(struct pt_regs, gr[11])); + DEFINE(PT_GR12, offsetof(struct pt_regs, gr[12])); + DEFINE(PT_GR13, offsetof(struct pt_regs, gr[13])); + DEFINE(PT_GR14, offsetof(struct pt_regs, gr[14])); + DEFINE(PT_GR15, offsetof(struct pt_regs, gr[15])); + DEFINE(PT_GR16, offsetof(struct pt_regs, gr[16])); + DEFINE(PT_GR17, offsetof(struct pt_regs, gr[17])); + DEFINE(PT_GR18, offsetof(struct pt_regs, gr[18])); + DEFINE(PT_GR19, offsetof(struct pt_regs, gr[19])); + DEFINE(PT_GR20, offsetof(struct pt_regs, gr[20])); + DEFINE(PT_GR21, offsetof(struct pt_regs, gr[21])); + DEFINE(PT_GR22, offsetof(struct pt_regs, gr[22])); + DEFINE(PT_GR23, offsetof(struct pt_regs, gr[23])); + DEFINE(PT_GR24, offsetof(struct pt_regs, gr[24])); + DEFINE(PT_GR25, offsetof(struct pt_regs, gr[25])); + DEFINE(PT_GR26, offsetof(struct pt_regs, gr[26])); + DEFINE(PT_GR27, offsetof(struct pt_regs, gr[27])); + DEFINE(PT_GR28, offsetof(struct pt_regs, gr[28])); + DEFINE(PT_GR29, offsetof(struct pt_regs, gr[29])); + DEFINE(PT_GR30, offsetof(struct pt_regs, gr[30])); + DEFINE(PT_GR31, offsetof(struct pt_regs, gr[31])); + DEFINE(PT_FR0, offsetof(struct pt_regs, fr[ 0])); + DEFINE(PT_FR1, offsetof(struct pt_regs, fr[ 1])); + DEFINE(PT_FR2, offsetof(struct pt_regs, fr[ 2])); + DEFINE(PT_FR3, offsetof(struct pt_regs, fr[ 3])); + DEFINE(PT_FR4, offsetof(struct pt_regs, fr[ 4])); + DEFINE(PT_FR5, offsetof(struct pt_regs, fr[ 5])); + DEFINE(PT_FR6, offsetof(struct pt_regs, fr[ 6])); + DEFINE(PT_FR7, offsetof(struct pt_regs, fr[ 7])); + DEFINE(PT_FR8, offsetof(struct pt_regs, fr[ 8])); + DEFINE(PT_FR9, offsetof(struct pt_regs, fr[ 9])); + DEFINE(PT_FR10, offsetof(struct pt_regs, fr[10])); + DEFINE(PT_FR11, offsetof(struct pt_regs, fr[11])); + DEFINE(PT_FR12, offsetof(struct pt_regs, fr[12])); + DEFINE(PT_FR13, offsetof(struct pt_regs, fr[13])); + DEFINE(PT_FR14, offsetof(struct pt_regs, fr[14])); + DEFINE(PT_FR15, offsetof(struct pt_regs, fr[15])); + DEFINE(PT_FR16, offsetof(struct pt_regs, fr[16])); + DEFINE(PT_FR17, offsetof(struct pt_regs, fr[17])); + DEFINE(PT_FR18, offsetof(struct pt_regs, fr[18])); + DEFINE(PT_FR19, offsetof(struct pt_regs, fr[19])); + DEFINE(PT_FR20, offsetof(struct pt_regs, fr[20])); + DEFINE(PT_FR21, offsetof(struct pt_regs, fr[21])); + DEFINE(PT_FR22, offsetof(struct pt_regs, fr[22])); + DEFINE(PT_FR23, offsetof(struct pt_regs, fr[23])); + DEFINE(PT_FR24, offsetof(struct pt_regs, fr[24])); + DEFINE(PT_FR25, offsetof(struct pt_regs, fr[25])); + DEFINE(PT_FR26, offsetof(struct pt_regs, fr[26])); + DEFINE(PT_FR27, offsetof(struct pt_regs, fr[27])); + DEFINE(PT_FR28, offsetof(struct pt_regs, fr[28])); + DEFINE(PT_FR29, offsetof(struct pt_regs, fr[29])); + DEFINE(PT_FR30, offsetof(struct pt_regs, fr[30])); + DEFINE(PT_FR31, offsetof(struct pt_regs, fr[31])); + DEFINE(PT_SR0, offsetof(struct pt_regs, sr[ 0])); + DEFINE(PT_SR1, offsetof(struct pt_regs, sr[ 1])); + DEFINE(PT_SR2, offsetof(struct pt_regs, sr[ 2])); + DEFINE(PT_SR3, offsetof(struct pt_regs, sr[ 3])); + DEFINE(PT_SR4, offsetof(struct pt_regs, sr[ 4])); + DEFINE(PT_SR5, offsetof(struct pt_regs, sr[ 5])); + DEFINE(PT_SR6, offsetof(struct pt_regs, sr[ 6])); + DEFINE(PT_SR7, offsetof(struct pt_regs, sr[ 7])); + DEFINE(PT_IASQ0, offsetof(struct pt_regs, iasq[0])); + DEFINE(PT_IASQ1, offsetof(struct pt_regs, iasq[1])); + DEFINE(PT_IAOQ0, offsetof(struct pt_regs, iaoq[0])); + DEFINE(PT_IAOQ1, offsetof(struct pt_regs, iaoq[1])); + DEFINE(PT_CR27, offsetof(struct pt_regs, cr27)); + DEFINE(PT_ORIG_R28, offsetof(struct pt_regs, orig_r28)); + DEFINE(PT_KSP, offsetof(struct pt_regs, ksp)); + DEFINE(PT_KPC, offsetof(struct pt_regs, kpc)); + DEFINE(PT_SAR, offsetof(struct pt_regs, sar)); + DEFINE(PT_IIR, offsetof(struct pt_regs, iir)); + DEFINE(PT_ISR, offsetof(struct pt_regs, isr)); + DEFINE(PT_IOR, offsetof(struct pt_regs, ior)); + DEFINE(PT_SIZE, sizeof(struct pt_regs)); + DEFINE(PT_SZ_ALGN, align(sizeof(struct pt_regs), 64)); + BLANK(); + DEFINE(TI_TASK, offsetof(struct thread_info, task)); + DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit)); + DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); + DEFINE(THREAD_SZ, sizeof(struct thread_info)); + DEFINE(THREAD_SZ_ALGN, align(sizeof(struct thread_info), 64)); + BLANK(); + DEFINE(IRQSTAT_SIRQ_PEND, offsetof(irq_cpustat_t, __softirq_pending)); + DEFINE(IRQSTAT_SZ, sizeof(irq_cpustat_t)); + BLANK(); + DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base)); + DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride)); + DEFINE(ICACHE_COUNT, offsetof(struct pdc_cache_info, ic_count)); + DEFINE(ICACHE_LOOP, offsetof(struct pdc_cache_info, ic_loop)); + DEFINE(DCACHE_BASE, offsetof(struct pdc_cache_info, dc_base)); + DEFINE(DCACHE_STRIDE, offsetof(struct pdc_cache_info, dc_stride)); + DEFINE(DCACHE_COUNT, offsetof(struct pdc_cache_info, dc_count)); + DEFINE(DCACHE_LOOP, offsetof(struct pdc_cache_info, dc_loop)); + DEFINE(ITLB_SID_BASE, offsetof(struct pdc_cache_info, it_sp_base)); + DEFINE(ITLB_SID_STRIDE, offsetof(struct pdc_cache_info, it_sp_stride)); + DEFINE(ITLB_SID_COUNT, offsetof(struct pdc_cache_info, it_sp_count)); + DEFINE(ITLB_OFF_BASE, offsetof(struct pdc_cache_info, it_off_base)); + DEFINE(ITLB_OFF_STRIDE, offsetof(struct pdc_cache_info, it_off_stride)); + DEFINE(ITLB_OFF_COUNT, offsetof(struct pdc_cache_info, it_off_count)); + DEFINE(ITLB_LOOP, offsetof(struct pdc_cache_info, it_loop)); + DEFINE(DTLB_SID_BASE, offsetof(struct pdc_cache_info, dt_sp_base)); + DEFINE(DTLB_SID_STRIDE, offsetof(struct pdc_cache_info, dt_sp_stride)); + DEFINE(DTLB_SID_COUNT, offsetof(struct pdc_cache_info, dt_sp_count)); + DEFINE(DTLB_OFF_BASE, offsetof(struct pdc_cache_info, dt_off_base)); + DEFINE(DTLB_OFF_STRIDE, offsetof(struct pdc_cache_info, dt_off_stride)); + DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count)); + DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop)); + BLANK(); + DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT); + DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT); + BLANK(); + DEFINE(ASM_PMD_SHIFT, PMD_SHIFT); + DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT); + DEFINE(ASM_BITS_PER_PGD, BITS_PER_PGD); + DEFINE(ASM_BITS_PER_PMD, BITS_PER_PMD); + DEFINE(ASM_BITS_PER_PTE, BITS_PER_PTE); + DEFINE(ASM_PGD_PMD_OFFSET, -(PAGE_SIZE << PGD_ORDER)); + DEFINE(ASM_PMD_ENTRY, ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT)); + DEFINE(ASM_PGD_ENTRY, PAGE_OFFSET >> PGDIR_SHIFT); + DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE); + DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE); + DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); + DEFINE(ASM_PT_INITIAL, PT_INITIAL); + DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); + BLANK(); + return 0; +} diff -Nru a/include/asm-ppc/Kbuild b/include/asm-ppc/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-ppc/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-ppc/offsets.c b/include/asm-ppc/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-ppc/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,141 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int +main(void) +{ + DEFINE(THREAD, offsetof(struct task_struct, thread)); + DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info)); + DEFINE(MM, offsetof(struct task_struct, mm)); + DEFINE(PTRACE, offsetof(struct task_struct, ptrace)); + DEFINE(KSP, offsetof(struct thread_struct, ksp)); + DEFINE(PGDIR, offsetof(struct thread_struct, pgdir)); + DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall)); + DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); + DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); + DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); + DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) + DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0)); + DEFINE(PT_PTRACED, PT_PTRACED); +#endif +#ifdef CONFIG_ALTIVEC + DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); + DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); + DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); + DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); +#endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0])); + DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc)); + DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr)); + DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe)); +#endif /* CONFIG_SPE */ + /* Interrupt register frame */ + DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); + DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); + /* in fact we only use gpr0 - gpr9 and gpr20 - gpr23 */ + DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0])); + DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1])); + DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2])); + DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3])); + DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4])); + DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5])); + DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6])); + DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7])); + DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8])); + DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9])); + DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10])); + DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); + DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); + DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); + DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14])); + DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15])); + DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16])); + DEFINE(GPR17, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[17])); + DEFINE(GPR18, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[18])); + DEFINE(GPR19, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[19])); + DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20])); + DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21])); + DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22])); + DEFINE(GPR23, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[23])); + DEFINE(GPR24, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[24])); + DEFINE(GPR25, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[25])); + DEFINE(GPR26, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[26])); + DEFINE(GPR27, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[27])); + DEFINE(GPR28, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[28])); + DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29])); + DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30])); + DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31])); + /* Note: these symbols include _ because they overlap with special + * register names + */ + DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip)); + DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr)); + DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr)); + DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link)); + DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr)); + DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq)); + DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer)); + DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); + DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); + /* The PowerPC 400-class & Book-E processors have neither the DAR nor the DSISR + * SPRs. Hence, we overload them to hold the similar DEAR and ESR SPRs + * for such processors. For critical interrupts we use them to + * hold SRR0 and SRR1. + */ + DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); + DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); + DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); + DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); + DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); + DEFINE(CLONE_VM, CLONE_VM); + DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); + DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); + + /* About the CPU features table */ + DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); + DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask)); + DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value)); + DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); + DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); + + DEFINE(TI_TASK, offsetof(struct thread_info, task)); + DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); + + DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); + return 0; +} diff -Nru a/include/asm-ppc64/Kbuild b/include/asm-ppc64/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-ppc64/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-ppc64/offsets.c b/include/asm-ppc64/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-ppc64/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,172 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + /* thread struct on stack */ + DEFINE(THREAD_SHIFT, THREAD_SHIFT); + DEFINE(THREAD_SIZE, THREAD_SIZE); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); + DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror)); + + /* task_struct->thread */ + DEFINE(THREAD, offsetof(struct task_struct, thread)); + DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); + DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); + DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); + DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); + DEFINE(KSP, offsetof(struct thread_struct, ksp)); + DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid)); + +#ifdef CONFIG_ALTIVEC + DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); + DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); + DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); + DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); +#endif /* CONFIG_ALTIVEC */ + DEFINE(MM, offsetof(struct task_struct, mm)); + + /* naca */ + DEFINE(PACA, offsetof(struct naca_struct, paca)); + DEFINE(DCACHEL1LINESIZE, offsetof(struct systemcfg, dCacheL1LineSize)); + DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct naca_struct, dCacheL1LogLineSize)); + DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct naca_struct, dCacheL1LinesPerPage)); + DEFINE(ICACHEL1LINESIZE, offsetof(struct systemcfg, iCacheL1LineSize)); + DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize)); + DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage)); + DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); + + /* paca */ + DEFINE(PACA_SIZE, sizeof(struct paca_struct)); + DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); + DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start)); + DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack)); + DEFINE(PACACURRENT, offsetof(struct paca_struct, __current)); + DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr)); + DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real)); + DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr)); + DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr)); + DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1)); + DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc)); + DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled)); + DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache)); + DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr)); + DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); +#ifdef CONFIG_HUGETLB_PAGE + DEFINE(PACAHTLBSEGS, offsetof(struct paca_struct, context.htlb_segs)); +#endif /* CONFIG_HUGETLB_PAGE */ + DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr)); + DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); + DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); + DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); + DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi)); + DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); + DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca)); + DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0)); + DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1)); + DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xIntDword.xAnyInt)); + DEFINE(LPPACADECRINT, offsetof(struct ItLpPaca, xIntDword.xFields.xDecrInt)); + + /* RTAS */ + DEFINE(RTASBASE, offsetof(struct rtas_t, base)); + DEFINE(RTASENTRY, offsetof(struct rtas_t, entry)); + + /* Interrupt register frame */ + DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); + + DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); + + /* 288 = # of volatile regs, int & fp, for leaf routines */ + /* which do not stack a frame. See the PPC64 ABI. */ + DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288); + /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */ + DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); + DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); + DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0])); + DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1])); + DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2])); + DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3])); + DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4])); + DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5])); + DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6])); + DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7])); + DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8])); + DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9])); + DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10])); + DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); + DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); + DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); + /* + * Note: these symbols include _ because they overlap with special + * register names + */ + DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip)); + DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr)); + DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr)); + DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link)); + DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr)); + DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer)); + DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); + DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); + DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); + DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); + DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); + DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe)); + + /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */ + DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)); + DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8); + + DEFINE(CLONE_VM, CLONE_VM); + DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); + + /* About the CPU features table */ + DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); + DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask)); + DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value)); + DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); + DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); + + return 0; +} diff -Nru a/include/asm-s390/Kbuild b/include/asm-s390/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-s390/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-s390/offsets.c b/include/asm-s390/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-s390/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,49 @@ +/* + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed to extract + * and format the required data. + */ + +#include +#include + +/* Use marker if you need to separate the values later */ + +#define DEFINE(sym, val, marker) \ + asm volatile("\n->" #sym " %0 " #val " " #marker : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + DEFINE(__THREAD_info, offsetof(struct task_struct, thread_info),); + DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp),); + DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info),); + DEFINE(__THREAD_mm_segment, + offsetof(struct task_struct, thread.mm_segment),); + BLANK(); + DEFINE(__TASK_pid, offsetof(struct task_struct, pid),); + BLANK(); + DEFINE(__PER_atmid, offsetof(per_struct, lowcore.words.perc_atmid),); + DEFINE(__PER_address, offsetof(per_struct, lowcore.words.address),); + DEFINE(__PER_access_id, offsetof(per_struct, lowcore.words.access_id),); + BLANK(); + DEFINE(__TI_task, offsetof(struct thread_info, task),); + DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain),); + DEFINE(__TI_flags, offsetof(struct thread_info, flags),); + DEFINE(__TI_cpu, offsetof(struct thread_info, cpu),); + DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count),); + BLANK(); + DEFINE(__PT_ARGS, offsetof(struct pt_regs, args),); + DEFINE(__PT_PSW, offsetof(struct pt_regs, psw),); + DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs),); + DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2),); + DEFINE(__PT_ILC, offsetof(struct pt_regs, ilc),); + DEFINE(__PT_TRAP, offsetof(struct pt_regs, trap),); + DEFINE(__PT_SIZE, sizeof(struct pt_regs),); + BLANK(); + DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain),); + DEFINE(__SF_GPRS, offsetof(struct stack_frame, gprs),); + DEFINE(__SF_EMPTY, offsetof(struct stack_frame, empty1),); + return 0; +} diff -Nru a/include/asm-sh64/Kbuild b/include/asm-sh64/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-sh64/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,49 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h +# 2) Generate include/asm/syscalltab.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h syscalltab.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) + +# Generate syscalltab.h +define filechk_gen-syscalltab + (set -e; \ + echo "/*"; \ + echo " * DO NOT MODIFY."; \ + echo " *"; \ + echo " * This file was generated by include/asm-$(ARCH)/Kbuild"; \ + echo " * Any changes will be reverted at build time."; \ + echo " */"; \ + echo ""; \ + echo "#ifndef __SYSCALLTAB_H"; \ + echo "#define __SYSCALLTAB_H"; \ + echo ""; \ + echo "#include "; \ + echo ""; \ + echo "struct syscall_info {"; \ + echo " const char *name;"; \ + echo "} syscall_info_table[] = {"; \ + sed -e '/^.*\.long /!d;s//\t{ "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ + s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ + echo "};"; \ + echo ""; \ + echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)"; \ + echo ""; \ + echo "#endif /* __SYSCALLTAB_H */" ) +endef + +$(obj)/syscalltab.h: $(srctree)/arch/$(ARCH)/kernel/syscalls.S + $(call filechk,gen-syscalltab) + diff -Nru a/include/asm-sh64/offsets.c b/include/asm-sh64/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-sh64/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,33 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + */ + +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + /* offsets into the thread_info struct */ + DEFINE(TI_TASK, offsetof(struct thread_info, task)); + DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); + DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block)); + + return 0; +} diff -Nru a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-sparc/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-sparc/offsets.c b/include/asm-sparc/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-sparc/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,45 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + * + * On sparc, thread_info data is static and TI_XXX offsets are computed by hand. + */ + +#include +#include +// #include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int foo(void) +{ + DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread)); + BLANK(); + /* XXX This is the stuff for sclow.S, kill it. */ + DEFINE(AOFF_task_pid, offsetof(struct task_struct, pid)); + DEFINE(AOFF_task_uid, offsetof(struct task_struct, uid)); + DEFINE(AOFF_task_gid, offsetof(struct task_struct, gid)); + DEFINE(AOFF_task_euid, offsetof(struct task_struct, euid)); + DEFINE(AOFF_task_egid, offsetof(struct task_struct, egid)); + /* DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info)); */ + DEFINE(ASIZ_task_uid, sizeof(current->uid)); + DEFINE(ASIZ_task_gid, sizeof(current->gid)); + DEFINE(ASIZ_task_euid, sizeof(current->euid)); + DEFINE(ASIZ_task_egid, sizeof(current->egid)); + BLANK(); + DEFINE(AOFF_thread_fork_kpsr, + offsetof(struct thread_struct, fork_kpsr)); + BLANK(); + DEFINE(AOFF_mm_context, offsetof(struct mm_struct, context)); + + /* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */ + return 0; +} diff -Nru a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h --- a/include/asm-sparc/ptrace.h 2004-10-28 22:41:09 -07:00 +++ b/include/asm-sparc/ptrace.h 2004-10-28 22:41:09 -07:00 @@ -77,7 +77,7 @@ * It may be OK for glibc headers, but it's utterly pointless for C code. * The assembly code using those offsets has to include it explicitly. */ -/* #include */ +/* #include */ /* These are for pt_regs. */ #define PT_PSR 0x0 diff -Nru a/include/asm-v850/Kbuild b/include/asm-v850/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-v850/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,15 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/asm-consts.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := asm-consts.h +targets := asm-consts.s + +$(obj)/asm-consts.h: $(obj)/asm-consts.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-v850/asm-consts.c b/include/asm-v850/asm-consts.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-v850/asm-consts.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,61 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main (void) +{ + /* offsets into the task struct */ + DEFINE (TASK_STATE, offsetof (struct task_struct, state)); + DEFINE (TASK_FLAGS, offsetof (struct task_struct, flags)); + DEFINE (TASK_PTRACE, offsetof (struct task_struct, ptrace)); + DEFINE (TASK_BLOCKED, offsetof (struct task_struct, blocked)); + DEFINE (TASK_THREAD, offsetof (struct task_struct, thread)); + DEFINE (TASK_THREAD_INFO, offsetof (struct task_struct, thread_info)); + DEFINE (TASK_MM, offsetof (struct task_struct, mm)); + DEFINE (TASK_ACTIVE_MM, offsetof (struct task_struct, active_mm)); + DEFINE (TASK_PID, offsetof (struct task_struct, pid)); + + /* offsets into the kernel_stat struct */ + DEFINE (STAT_IRQ, offsetof (struct kernel_stat, irqs)); + + + /* signal defines */ + DEFINE (SIGSEGV, SIGSEGV); + DEFINE (SEGV_MAPERR, SEGV_MAPERR); + DEFINE (SIGTRAP, SIGTRAP); + DEFINE (SIGCHLD, SIGCHLD); + DEFINE (SIGILL, SIGILL); + DEFINE (TRAP_TRACE, TRAP_TRACE); + + /* ptrace flag bits */ + DEFINE (PT_PTRACED, PT_PTRACED); + DEFINE (PT_DTRACE, PT_DTRACE); + + /* error values */ + DEFINE (ENOSYS, ENOSYS); + + /* clone flag bits */ + DEFINE (CLONE_VFORK, CLONE_VFORK); + DEFINE (CLONE_VM, CLONE_VM); + + return 0; +} diff -Nru a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-x86_64/Kbuild 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,17 @@ +# Generate header files required for $(ARCH) +# Pull in generic stuff from include/asm-generic +# Used to: +# 1) Generate include/asm/offsets.h + +# pull in generic parts +include $(srctree)/include/asm-generic/Kbuild + + +# generate offsets.h file +always := offsets.h +targets := offsets.s + +CFLAGS_offsets.o := -I arch/$(ARCH)/kernel + +$(obj)/offsets.h: $(obj)/offsets.s FORCE + $(call filechk,gen-asm-offsets, < $<) diff -Nru a/include/asm-x86_64/current.h b/include/asm-x86_64/current.h --- a/include/asm-x86_64/current.h 2004-10-28 22:41:09 -07:00 +++ b/include/asm-x86_64/current.h 2004-10-28 22:41:09 -07:00 @@ -17,7 +17,7 @@ #else #ifndef ASM_OFFSET_H -#include +#include #endif #define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg diff -Nru a/include/asm-x86_64/offsets.c b/include/asm-x86_64/offsets.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-x86_64/offsets.c 2004-10-28 22:41:09 -07:00 @@ -0,0 +1,66 @@ +/* + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed to extract + * and format the required data. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ +#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry)) + ENTRY(state); + ENTRY(flags); + ENTRY(thread); + ENTRY(pid); + BLANK(); +#undef ENTRY +#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry)) + ENTRY(flags); + ENTRY(addr_limit); + ENTRY(preempt_count); + BLANK(); +#undef ENTRY +#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry)) + ENTRY(kernelstack); + ENTRY(oldrsp); + ENTRY(pcurrent); + ENTRY(irqrsp); + ENTRY(irqcount); + ENTRY(cpunumber); + ENTRY(irqstackptr); + BLANK(); +#undef ENTRY +#ifdef CONFIG_IA32_EMULATION +#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry)) + ENTRY(eax); + ENTRY(ebx); + ENTRY(ecx); + ENTRY(edx); + ENTRY(esi); + ENTRY(edi); + ENTRY(ebp); + ENTRY(esp); + ENTRY(eip); + BLANK(); +#undef ENTRY + DEFINE(IA32_RT_SIGFRAME_sigcontext, + offsetof (struct rt_sigframe32, uc.uc_mcontext)); + BLANK(); +#endif + + return 0; +} diff -Nru a/scripts/Makefile.build b/scripts/Makefile.build --- a/scripts/Makefile.build 2004-10-28 22:41:09 -07:00 +++ b/scripts/Makefile.build 2004-10-28 22:41:09 -07:00 @@ -10,7 +10,7 @@ # Read .config if it exist, otherwise ignore -include .config -include $(obj)/Makefile +include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile) include scripts/Makefile.lib diff -Nru a/scripts/Makefile.clean b/scripts/Makefile.clean --- a/scripts/Makefile.clean 2004-10-28 22:41:09 -07:00 +++ b/scripts/Makefile.clean 2004-10-28 22:41:09 -07:00 @@ -7,7 +7,7 @@ .PHONY: __clean __clean: -include $(obj)/Makefile +include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile) # Figure out what we need to build from the various variables # ==========================================================================