aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/bug.h3
-rw-r--r--include/asm-alpha/errno.h4
-rw-r--r--include/asm-alpha/siginfo.h2
-rw-r--r--include/asm-alpha/signal.h25
-rw-r--r--include/asm-arm/arch-cl7500/vmalloc.h11
-rw-r--r--include/asm-arm/arch-clps711x/vmalloc.h11
-rw-r--r--include/asm-arm/arch-ebsa110/vmalloc.h11
-rw-r--r--include/asm-arm/arch-ebsa285/vmalloc.h11
-rw-r--r--include/asm-arm/arch-epxa10db/vmalloc.h11
-rw-r--r--include/asm-arm/arch-h720x/vmalloc.h11
-rw-r--r--include/asm-arm/arch-imx/imxfb.h35
-rw-r--r--include/asm-arm/arch-imx/vmalloc.h12
-rw-r--r--include/asm-arm/arch-integrator/cm.h6
-rw-r--r--include/asm-arm/arch-integrator/platform.h108
-rw-r--r--include/asm-arm/arch-integrator/vmalloc.h11
-rw-r--r--include/asm-arm/arch-iop3xx/vmalloc.h3
-rw-r--r--include/asm-arm/arch-ixp2000/platform.h1
-rw-r--r--include/asm-arm/arch-ixp2000/vmalloc.h3
-rw-r--r--include/asm-arm/arch-ixp4xx/vmalloc.h12
-rw-r--r--include/asm-arm/arch-l7200/vmalloc.h11
-rw-r--r--include/asm-arm/arch-lh7a40x/vmalloc.h11
-rw-r--r--include/asm-arm/arch-omap/vmalloc.h12
-rw-r--r--include/asm-arm/arch-pxa/vmalloc.h11
-rw-r--r--include/asm-arm/arch-rpc/vmalloc.h11
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iis.h10
-rw-r--r--include/asm-arm/arch-s3c2410/regs-mem.h8
-rw-r--r--include/asm-arm/arch-s3c2410/regs-spi.h2
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h6
-rw-r--r--include/asm-arm/arch-s3c2410/vmalloc.h12
-rw-r--r--include/asm-arm/arch-sa1100/vmalloc.h11
-rw-r--r--include/asm-arm/arch-shark/vmalloc.h11
-rw-r--r--include/asm-arm/arch-versatile/vmalloc.h12
-rw-r--r--include/asm-arm/bug.h3
-rw-r--r--include/asm-arm/hardware/amba_clcd.h31
-rw-r--r--include/asm-arm/hardware/clock.h7
-rw-r--r--include/asm-arm/io.h28
-rw-r--r--include/asm-arm/pgtable.h17
-rw-r--r--include/asm-arm/processor.h7
-rw-r--r--include/asm-arm/rtc.h4
-rw-r--r--include/asm-arm/signal.h26
-rw-r--r--include/asm-arm/string.h17
-rw-r--r--include/asm-arm/thread_info.h6
-rw-r--r--include/asm-arm/unistd.h3
-rw-r--r--include/asm-arm26/bug.h3
-rw-r--r--include/asm-arm26/signal.h22
-rw-r--r--include/asm-cris/page.h4
-rw-r--r--include/asm-cris/signal.h25
-rw-r--r--include/asm-frv/bug.h2
-rw-r--r--include/asm-frv/pgtable.h4
-rw-r--r--include/asm-frv/signal.h25
-rw-r--r--include/asm-generic/bug.h22
-rw-r--r--include/asm-generic/errno.h4
-rw-r--r--include/asm-generic/resource.h7
-rw-r--r--include/asm-generic/sections.h2
-rw-r--r--include/asm-generic/siginfo.h13
-rw-r--r--include/asm-generic/signal.h21
-rw-r--r--include/asm-generic/unaligned.h83
-rw-r--r--include/asm-h8300/signal.h24
-rw-r--r--include/asm-i386/apic.h1
-rw-r--r--include/asm-i386/bug.h5
-rw-r--r--include/asm-i386/checksum.h2
-rw-r--r--include/asm-i386/cpufeature.h4
-rw-r--r--include/asm-i386/e820.h2
-rw-r--r--include/asm-i386/floppy.h2
-rw-r--r--include/asm-i386/hpet.h1
-rw-r--r--include/asm-i386/module.h4
-rw-r--r--include/asm-i386/pgtable.h4
-rw-r--r--include/asm-i386/setup.h2
-rw-r--r--include/asm-i386/signal.h29
-rw-r--r--include/asm-i386/string.h89
-rw-r--r--include/asm-i386/system.h6
-rw-r--r--include/asm-ia64/bitops.h21
-rw-r--r--include/asm-ia64/bug.h5
-rw-r--r--include/asm-ia64/gcc_intrin.h10
-rw-r--r--include/asm-ia64/hw_irq.h1
-rw-r--r--include/asm-ia64/pal.h68
-rw-r--r--include/asm-ia64/perfmon.h12
-rw-r--r--include/asm-ia64/pgalloc.h148
-rw-r--r--include/asm-ia64/processor.h10
-rw-r--r--include/asm-ia64/sal.h50
-rw-r--r--include/asm-ia64/siginfo.h4
-rw-r--r--include/asm-ia64/signal.h21
-rw-r--r--include/asm-ia64/smp.h5
-rw-r--r--include/asm-ia64/sn/addrs.h14
-rw-r--r--include/asm-ia64/sn/arch.h17
-rw-r--r--include/asm-ia64/sn/bte.h53
-rw-r--r--include/asm-ia64/sn/fetchop.h85
-rw-r--r--include/asm-ia64/sn/geo.h45
-rw-r--r--include/asm-ia64/sn/l1.h3
-rw-r--r--include/asm-ia64/sn/nodepda.h19
-rw-r--r--include/asm-ia64/sn/pcibus_provider_defs.h52
-rw-r--r--include/asm-ia64/sn/pcidev.h58
-rw-r--r--include/asm-ia64/sn/pda.h12
-rw-r--r--include/asm-ia64/sn/shub_mmr.h61
-rw-r--r--include/asm-ia64/sn/shubio.h3116
-rw-r--r--include/asm-ia64/sn/sn_cpuid.h25
-rw-r--r--include/asm-ia64/sn/sn_fru.h44
-rw-r--r--include/asm-ia64/sn/sn_sal.h111
-rw-r--r--include/asm-ia64/sn/sndrv.h47
-rw-r--r--include/asm-ia64/sn/tioca.h596
-rw-r--r--include/asm-ia64/sn/tioca_provider.h206
-rw-r--r--include/asm-ia64/sn/tiocx.h71
-rw-r--r--include/asm-ia64/sn/types.h3
-rw-r--r--include/asm-ia64/sn/xp.h436
-rw-r--r--include/asm-m32r/signal.h29
-rw-r--r--include/asm-m68k/bug.h3
-rw-r--r--include/asm-m68k/signal.h28
-rw-r--r--include/asm-m68knommu/MC68328.h2
-rw-r--r--include/asm-m68knommu/MC68EZ328.h2
-rw-r--r--include/asm-m68knommu/MC68VZ328.h2
-rw-r--r--include/asm-m68knommu/signal.h24
-rw-r--r--include/asm-mips/bug.h4
-rw-r--r--include/asm-mips/errno.h4
-rw-r--r--include/asm-mips/siginfo.h2
-rw-r--r--include/asm-mips/signal.h24
-rw-r--r--include/asm-parisc/bug.h2
-rw-r--r--include/asm-parisc/errno.h4
-rw-r--r--include/asm-parisc/floppy.h2
-rw-r--r--include/asm-parisc/signal.h11
-rw-r--r--include/asm-parisc/uaccess.h2
-rw-r--r--include/asm-ppc/bug.h3
-rw-r--r--include/asm-ppc/hydra.h2
-rw-r--r--include/asm-ppc/pci-bridge.h4
-rw-r--r--include/asm-ppc/pmac_feature.h3
-rw-r--r--include/asm-ppc/reg_booke.h1
-rw-r--r--include/asm-ppc/sigcontext.h2
-rw-r--r--include/asm-ppc/signal.h28
-rw-r--r--include/asm-ppc64/a.out.h2
-rw-r--r--include/asm-ppc64/bug.h7
-rw-r--r--include/asm-ppc64/elf.h8
-rw-r--r--include/asm-ppc64/imalloc.h24
-rw-r--r--include/asm-ppc64/mmu.h193
-rw-r--r--include/asm-ppc64/mmu_context.h82
-rw-r--r--include/asm-ppc64/page.h30
-rw-r--r--include/asm-ppc64/pgalloc.h2
-rw-r--r--include/asm-ppc64/pgtable.h156
-rw-r--r--include/asm-ppc64/signal.h33
-rw-r--r--include/asm-ppc64/spinlock.h8
-rw-r--r--include/asm-ppc64/xics.h3
-rw-r--r--include/asm-s390/bug.h3
-rw-r--r--include/asm-s390/cmb.h2
-rw-r--r--include/asm-s390/debug.h2
-rw-r--r--include/asm-s390/page.h2
-rw-r--r--include/asm-s390/processor.h2
-rw-r--r--include/asm-s390/ptrace.h16
-rw-r--r--include/asm-s390/siginfo.h6
-rw-r--r--include/asm-s390/signal.h25
-rw-r--r--include/asm-sh/bug.h3
-rw-r--r--include/asm-sh/checksum.h2
-rw-r--r--include/asm-sh/floppy.h2
-rw-r--r--include/asm-sh/signal.h25
-rw-r--r--include/asm-sh64/bug.h4
-rw-r--r--include/asm-sh64/checksum.h2
-rw-r--r--include/asm-sh64/signal.h25
-rw-r--r--include/asm-sparc/bug.h3
-rw-r--r--include/asm-sparc/errno.h4
-rw-r--r--include/asm-sparc/floppy.h2
-rw-r--r--include/asm-sparc/mxcc.h4
-rw-r--r--include/asm-sparc/signal.h19
-rw-r--r--include/asm-sparc/uaccess.h2
-rw-r--r--include/asm-sparc64/bug.h3
-rw-r--r--include/asm-sparc64/errno.h4
-rw-r--r--include/asm-sparc64/mostek.h6
-rw-r--r--include/asm-sparc64/parport.h6
-rw-r--r--include/asm-sparc64/pgalloc.h9
-rw-r--r--include/asm-sparc64/pgtable.h5
-rw-r--r--include/asm-sparc64/siginfo.h2
-rw-r--r--include/asm-sparc64/signal.h24
-rw-r--r--include/asm-sparc64/spinlock.h4
-rw-r--r--include/asm-um/arch-signal-i386.h24
-rw-r--r--include/asm-um/archparam-i386.h137
-rw-r--r--include/asm-um/archparam-ppc.h20
-rw-r--r--include/asm-um/archparam-x86_64.h36
-rw-r--r--include/asm-um/common.lds.S9
-rw-r--r--include/asm-um/delay.h2
-rw-r--r--include/asm-um/elf-i386.h169
-rw-r--r--include/asm-um/elf-ppc.h54
-rw-r--r--include/asm-um/elf-x86_64.h73
-rw-r--r--include/asm-um/elf.h37
-rw-r--r--include/asm-um/fixmap.h1
-rw-r--r--include/asm-um/ipc.h7
-rw-r--r--include/asm-um/linkage.h7
-rw-r--r--include/asm-um/page.h5
-rw-r--r--include/asm-um/pgtable-3level.h4
-rw-r--r--include/asm-um/pgtable.h2
-rw-r--r--include/asm-um/processor-generic.h15
-rw-r--r--include/asm-um/processor-i386.h7
-rw-r--r--include/asm-um/processor-x86_64.h12
-rw-r--r--include/asm-um/ptrace-i386.h2
-rw-r--r--include/asm-um/ptrace-x86_64.h2
-rw-r--r--include/asm-um/setup.h3
-rw-r--r--include/asm-um/thread_info.h4
-rw-r--r--include/asm-v850/bug.h3
-rw-r--r--include/asm-v850/signal.h27
-rw-r--r--include/asm-x86_64/apic.h1
-rw-r--r--include/asm-x86_64/bootsetup.h3
-rw-r--r--include/asm-x86_64/bug.h4
-rw-r--r--include/asm-x86_64/cpufeature.h14
-rw-r--r--include/asm-x86_64/e820.h2
-rw-r--r--include/asm-x86_64/floppy.h2
-rw-r--r--include/asm-x86_64/siginfo.h2
-rw-r--r--include/asm-x86_64/signal.h28
-rw-r--r--include/asm-x86_64/unistd.h2
-rw-r--r--include/linux/audit.h64
-rw-r--r--include/linux/auto_fs4.h2
-rw-r--r--include/linux/awe_voice.h6
-rw-r--r--include/linux/binfmts.h1
-rw-r--r--include/linux/compiler-gcc2.h5
-rw-r--r--include/linux/compiler.h6
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/edd.h2
-rw-r--r--include/linux/etherdevice.h2
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fddidevice.h2
-rw-r--r--include/linux/fs.h114
-rw-r--r--include/linux/gfp.h6
-rw-r--r--include/linux/hippidevice.h2
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_arp.h2
-rw-r--r--include/linux/if_ltalk.h2
-rw-r--r--include/linux/input.h5
-rw-r--r--include/linux/iso_fs.h147
-rw-r--r--include/linux/iso_fs_i.h27
-rw-r--r--include/linux/iso_fs_sb.h34
-rw-r--r--include/linux/ixjuser.h2
-rw-r--r--include/linux/kernel.h9
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/mm.h5
-rw-r--r--include/linux/mpage.h3
-rw-r--r--include/linux/net.h40
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/netfilter_ipv4.h3
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/page-flags.h1
-rw-r--r--include/linux/patchkey.h45
-rw-r--r--include/linux/pci.h3
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/rcupdate.h23
-rw-r--r--include/linux/reboot_fixups.h10
-rw-r--r--include/linux/reiserfs_acl.h12
-rw-r--r--include/linux/reiserfs_fs.h249
-rw-r--r--include/linux/reiserfs_xattr.h4
-rw-r--r--include/linux/rtnetlink.h8
-rw-r--r--include/linux/sched.h9
-rw-r--r--include/linux/signal.h17
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--include/linux/slab.h23
-rw-r--r--include/linux/sockios.h2
-rw-r--r--include/linux/soundcard.h34
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/linux/tc_act/tc_defact.h21
-rw-r--r--include/linux/trdevice.h2
-rw-r--r--include/linux/xfrm.h5
-rw-r--r--include/net/act_generic.h142
-rw-r--r--include/net/addrconf.h4
-rw-r--r--include/net/ax25.h10
-rw-r--r--include/net/icmp.h2
-rw-r--r--include/net/ip.h2
-rw-r--r--include/net/ipv6.h2
-rw-r--r--include/net/pkt_sched.h6
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/sctp/sm.h42
-rw-r--r--include/net/sctp/structs.h11
-rw-r--r--include/net/sock.h139
-rw-r--r--include/net/tc_act/tc_defact.h13
-rw-r--r--include/net/tcp.h13
-rw-r--r--include/net/udp.h2
-rw-r--r--include/net/xfrm.h10
-rw-r--r--include/video/edid.h9
-rw-r--r--include/video/tdfx.h2
271 files changed, 5357 insertions, 4127 deletions
diff --git a/include/asm-alpha/bug.h b/include/asm-alpha/bug.h
index ae1e0a5fa492..39a3e2a5017d 100644
--- a/include/asm-alpha/bug.h
+++ b/include/asm-alpha/bug.h
@@ -1,6 +1,7 @@
1#ifndef _ALPHA_BUG_H 1#ifndef _ALPHA_BUG_H
2#define _ALPHA_BUG_H 2#define _ALPHA_BUG_H
3 3
4#ifdef CONFIG_BUG
4#include <asm/pal.h> 5#include <asm/pal.h>
5 6
6/* ??? Would be nice to use .gprel32 here, but we can't be sure that the 7/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
@@ -10,6 +11,8 @@
10 : : "i" (PAL_bugchk), "i"(__LINE__), "i"(__FILE__)) 11 : : "i" (PAL_bugchk), "i"(__LINE__), "i"(__FILE__))
11 12
12#define HAVE_ARCH_BUG 13#define HAVE_ARCH_BUG
14#endif
15
13#include <asm-generic/bug.h> 16#include <asm-generic/bug.h>
14 17
15#endif 18#endif
diff --git a/include/asm-alpha/errno.h b/include/asm-alpha/errno.h
index c85ab6b9d6c6..69e2655249d2 100644
--- a/include/asm-alpha/errno.h
+++ b/include/asm-alpha/errno.h
@@ -116,4 +116,8 @@
116#define EKEYREVOKED 134 /* Key has been revoked */ 116#define EKEYREVOKED 134 /* Key has been revoked */
117#define EKEYREJECTED 135 /* Key was rejected by service */ 117#define EKEYREJECTED 135 /* Key was rejected by service */
118 118
119/* for robust mutexes */
120#define EOWNERDEAD 136 /* Owner died */
121#define ENOTRECOVERABLE 137 /* State not recoverable */
122
119#endif 123#endif
diff --git a/include/asm-alpha/siginfo.h b/include/asm-alpha/siginfo.h
index 86bcab59c52b..9822362a8424 100644
--- a/include/asm-alpha/siginfo.h
+++ b/include/asm-alpha/siginfo.h
@@ -4,8 +4,6 @@
4#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 4#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
5#define __ARCH_SI_TRAPNO 5#define __ARCH_SI_TRAPNO
6 6
7#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
8
9#include <asm-generic/siginfo.h> 7#include <asm-generic/siginfo.h>
10 8
11#endif 9#endif
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h
index 25f98bc5576f..1a2c52a056fb 100644
--- a/include/asm-alpha/signal.h
+++ b/include/asm-alpha/signal.h
@@ -109,34 +109,11 @@ typedef unsigned long sigset_t;
109#define MINSIGSTKSZ 4096 109#define MINSIGSTKSZ 4096
110#define SIGSTKSZ 16384 110#define SIGSTKSZ 16384
111 111
112
113#ifdef __KERNEL__
114/*
115 * These values of sa_flags are used only by the kernel as part of the
116 * irq handling routines.
117 *
118 * SA_INTERRUPT is also used by the irq handling routines.
119 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
120 */
121#define SA_PROBE SA_ONESHOT
122#define SA_SAMPLE_RANDOM SA_RESTART
123#define SA_SHIRQ 0x40000000
124#endif
125
126#define SIG_BLOCK 1 /* for blocking signals */ 112#define SIG_BLOCK 1 /* for blocking signals */
127#define SIG_UNBLOCK 2 /* for unblocking signals */ 113#define SIG_UNBLOCK 2 /* for unblocking signals */
128#define SIG_SETMASK 3 /* for setting the signal mask */ 114#define SIG_SETMASK 3 /* for setting the signal mask */
129 115
130/* Type of a signal handler. */ 116#include <asm-generic/signal.h>
131typedef void __signalfn_t(int);
132typedef __signalfn_t __user *__sighandler_t;
133
134typedef void __restorefn_t(void);
135typedef __restorefn_t __user *__sigrestore_t;
136
137#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
138#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
139#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
140 117
141#ifdef __KERNEL__ 118#ifdef __KERNEL__
142struct osf_sigaction { 119struct osf_sigaction {
diff --git a/include/asm-arm/arch-cl7500/vmalloc.h b/include/asm-arm/arch-cl7500/vmalloc.h
index 91883def4889..ba8d7a84456a 100644
--- a/include/asm-arm/arch-cl7500/vmalloc.h
+++ b/include/asm-arm/arch-cl7500/vmalloc.h
@@ -1,15 +1,4 @@
1/* 1/*
2 * linux/include/asm-arm/arch-cl7500/vmalloc.h 2 * linux/include/asm-arm/arch-cl7500/vmalloc.h
3 */ 3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (PAGE_OFFSET + 0x1c000000) 4#define VMALLOC_END (PAGE_OFFSET + 0x1c000000)
diff --git a/include/asm-arm/arch-clps711x/vmalloc.h b/include/asm-arm/arch-clps711x/vmalloc.h
index 42571ed5e493..a5dfe96abc96 100644
--- a/include/asm-arm/arch-clps711x/vmalloc.h
+++ b/include/asm-arm/arch-clps711x/vmalloc.h
@@ -17,15 +17,4 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
21/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-ebsa110/vmalloc.h b/include/asm-arm/arch-ebsa110/vmalloc.h
index 759659be109f..26674ba4683c 100644
--- a/include/asm-arm/arch-ebsa110/vmalloc.h
+++ b/include/asm-arm/arch-ebsa110/vmalloc.h
@@ -7,15 +7,4 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10
11/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after the
14 * physical memory until the kernel virtual memory starts. That means that
15 * any out-of-bounds memory accesses will hopefully be caught.
16 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
17 * area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21#define VMALLOC_END (PAGE_OFFSET + 0x1f000000) 10#define VMALLOC_END (PAGE_OFFSET + 0x1f000000)
diff --git a/include/asm-arm/arch-ebsa285/vmalloc.h b/include/asm-arm/arch-ebsa285/vmalloc.h
index def705a3c209..d1ca955ce434 100644
--- a/include/asm-arm/arch-ebsa285/vmalloc.h
+++ b/include/asm-arm/arch-ebsa285/vmalloc.h
@@ -8,17 +8,6 @@
8 8
9#include <linux/config.h> 9#include <linux/config.h>
10 10
11/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after the
14 * physical memory until the kernel virtual memory starts. That means that
15 * any out-of-bounds memory accesses will hopefully be caught.
16 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
17 * area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21
22#ifdef CONFIG_ARCH_FOOTBRIDGE 11#ifdef CONFIG_ARCH_FOOTBRIDGE
23#define VMALLOC_END (PAGE_OFFSET + 0x30000000) 12#define VMALLOC_END (PAGE_OFFSET + 0x30000000)
24#else 13#else
diff --git a/include/asm-arm/arch-epxa10db/vmalloc.h b/include/asm-arm/arch-epxa10db/vmalloc.h
index d31ef8584760..546fb7d2b6ad 100644
--- a/include/asm-arm/arch-epxa10db/vmalloc.h
+++ b/include/asm-arm/arch-epxa10db/vmalloc.h
@@ -17,15 +17,4 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
21/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-h720x/vmalloc.h b/include/asm-arm/arch-h720x/vmalloc.h
index 4af523a5e189..b4693cb821ef 100644
--- a/include/asm-arm/arch-h720x/vmalloc.h
+++ b/include/asm-arm/arch-h720x/vmalloc.h
@@ -5,17 +5,6 @@
5#ifndef __ARCH_ARM_VMALLOC_H 5#ifndef __ARCH_ARM_VMALLOC_H
6#define __ARCH_ARM_VMALLOC_H 6#define __ARCH_ARM_VMALLOC_H
7 7
8/*
9 * Just any arbitrary offset to the start of the vmalloc VM area: the
10 * current 8MB value just means that there will be a 8MB "hole" after the
11 * physical memory until the kernel virtual memory starts. That means that
12 * any out-of-bounds memory accesses will hopefully be caught.
13 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
14 * area for the same reason. ;)
15 */
16#define VMALLOC_OFFSET (8*1024*1024)
17#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
18#define VMALLOC_VMADDR(x) ((unsigned long)(x))
19#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 8#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
20 9
21#endif 10#endif
diff --git a/include/asm-arm/arch-imx/imxfb.h b/include/asm-arm/arch-imx/imxfb.h
new file mode 100644
index 000000000000..2346d454ab9c
--- /dev/null
+++ b/include/asm-arm/arch-imx/imxfb.h
@@ -0,0 +1,35 @@
1/*
2 * This structure describes the machine which we are running on.
3 */
4struct imxfb_mach_info {
5 u_long pixclock;
6
7 u_short xres;
8 u_short yres;
9
10 u_char bpp;
11 u_char hsync_len;
12 u_char left_margin;
13 u_char right_margin;
14
15 u_char vsync_len;
16 u_char upper_margin;
17 u_char lower_margin;
18 u_char sync;
19
20 u_int cmap_greyscale:1,
21 cmap_inverse:1,
22 cmap_static:1,
23 unused:29;
24
25 u_int pcr;
26 u_int pwmr;
27 u_int lscr1;
28
29 u_char * fixed_screen_cpu;
30 dma_addr_t fixed_screen_dma;
31
32 void (*lcd_power)(int);
33 void (*backlight_power)(int);
34};
35void set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info);
diff --git a/include/asm-arm/arch-imx/vmalloc.h b/include/asm-arm/arch-imx/vmalloc.h
index 252038f48163..cb6169127068 100644
--- a/include/asm-arm/arch-imx/vmalloc.h
+++ b/include/asm-arm/arch-imx/vmalloc.h
@@ -17,16 +17,4 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
21/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_VMADDR(x) ((unsigned long)(x))
32#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-integrator/cm.h b/include/asm-arm/arch-integrator/cm.h
index d31c1a71f781..1ab353e23595 100644
--- a/include/asm-arm/arch-integrator/cm.h
+++ b/include/asm-arm/arch-integrator/cm.h
@@ -24,9 +24,9 @@ void cm_control(u32, u32);
24#define CM_CTRL_LCDBIASDN (1 << 10) 24#define CM_CTRL_LCDBIASDN (1 << 10)
25#define CM_CTRL_LCDMUXSEL_MASK (7 << 11) 25#define CM_CTRL_LCDMUXSEL_MASK (7 << 11)
26#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11) 26#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11)
27#define CM_CTRL_LCDMUXSEL_SHARPLCD1 (3 << 11) 27#define CM_CTRL_LCDMUXSEL_VGA_16BPP (2 << 11)
28#define CM_CTRL_LCDMUXSEL_SHARPLCD2 (4 << 11) 28#define CM_CTRL_LCDMUXSEL_SHARPLCD (3 << 11)
29#define CM_CTRL_LCDMUXSEL_VGA (7 << 11) 29#define CM_CTRL_LCDMUXSEL_VGA_8421BPP (4 << 11)
30#define CM_CTRL_LCDEN0 (1 << 14) 30#define CM_CTRL_LCDEN0 (1 << 14)
31#define CM_CTRL_LCDEN1 (1 << 15) 31#define CM_CTRL_LCDEN1 (1 << 15)
32#define CM_CTRL_STATIC1 (1 << 16) 32#define CM_CTRL_STATIC1 (1 << 16)
diff --git a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h
index 6b67e41669f4..bd364f5a99bc 100644
--- a/include/asm-arm/arch-integrator/platform.h
+++ b/include/asm-arm/arch-integrator/platform.h
@@ -20,14 +20,14 @@
20 * * Copyright © ARM Limited 1998. All rights reserved. 20 * * Copyright © ARM Limited 1998. All rights reserved.
21 * ***********************************************************************/ 21 * ***********************************************************************/
22/* ************************************************************************ 22/* ************************************************************************
23 * 23 *
24 * Integrator address map 24 * Integrator address map
25 * 25 *
26 * NOTE: This is a multi-hosted header file for use with uHAL and 26 * NOTE: This is a multi-hosted header file for use with uHAL and
27 * supported debuggers. 27 * supported debuggers.
28 * 28 *
29 * $Id: platform.s,v 1.32 2000/02/18 10:51:39 asims Exp $ 29 * $Id: platform.s,v 1.32 2000/02/18 10:51:39 asims Exp $
30 * 30 *
31 * ***********************************************************************/ 31 * ***********************************************************************/
32 32
33#ifndef __address_h 33#ifndef __address_h
@@ -40,22 +40,22 @@
40 * Memory definitions 40 * Memory definitions
41 * ------------------------------------------------------------------------ 41 * ------------------------------------------------------------------------
42 * Integrator memory map 42 * Integrator memory map
43 * 43 *
44 */ 44 */
45#define INTEGRATOR_BOOT_ROM_LO 0x00000000 45#define INTEGRATOR_BOOT_ROM_LO 0x00000000
46#define INTEGRATOR_BOOT_ROM_HI 0x20000000 46#define INTEGRATOR_BOOT_ROM_HI 0x20000000
47#define INTEGRATOR_BOOT_ROM_BASE INTEGRATOR_BOOT_ROM_HI /* Normal position */ 47#define INTEGRATOR_BOOT_ROM_BASE INTEGRATOR_BOOT_ROM_HI /* Normal position */
48#define INTEGRATOR_BOOT_ROM_SIZE SZ_512K 48#define INTEGRATOR_BOOT_ROM_SIZE SZ_512K
49 49
50/* 50/*
51 * New Core Modules have different amounts of SSRAM, the amount of SSRAM 51 * New Core Modules have different amounts of SSRAM, the amount of SSRAM
52 * fitted can be found in HDR_STAT. 52 * fitted can be found in HDR_STAT.
53 * 53 *
54 * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to 54 * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to
55 * the minimum amount of SSRAM fitted on any core module. 55 * the minimum amount of SSRAM fitted on any core module.
56 * 56 *
57 * New Core Modules also alias the SSRAM. 57 * New Core Modules also alias the SSRAM.
58 * 58 *
59 */ 59 */
60#define INTEGRATOR_SSRAM_BASE 0x00000000 60#define INTEGRATOR_SSRAM_BASE 0x00000000
61#define INTEGRATOR_SSRAM_ALIAS_BASE 0x10800000 61#define INTEGRATOR_SSRAM_ALIAS_BASE 0x10800000
@@ -67,9 +67,9 @@
67#define INTEGRATOR_MBRD_SSRAM_BASE 0x28000000 67#define INTEGRATOR_MBRD_SSRAM_BASE 0x28000000
68#define INTEGRATOR_MBRD_SSRAM_SIZE SZ_512K 68#define INTEGRATOR_MBRD_SSRAM_SIZE SZ_512K
69 69
70/* 70/*
71 * SDRAM is a SIMM therefore the size is not known. 71 * SDRAM is a SIMM therefore the size is not known.
72 * 72 *
73 */ 73 */
74#define INTEGRATOR_SDRAM_BASE 0x00040000 74#define INTEGRATOR_SDRAM_BASE 0x00040000
75 75
@@ -79,9 +79,9 @@
79#define INTEGRATOR_HDR2_SDRAM_BASE 0xA0000000 79#define INTEGRATOR_HDR2_SDRAM_BASE 0xA0000000
80#define INTEGRATOR_HDR3_SDRAM_BASE 0xB0000000 80#define INTEGRATOR_HDR3_SDRAM_BASE 0xB0000000
81 81
82/* 82/*
83 * Logic expansion modules 83 * Logic expansion modules
84 * 84 *
85 */ 85 */
86#define INTEGRATOR_LOGIC_MODULES_BASE 0xC0000000 86#define INTEGRATOR_LOGIC_MODULES_BASE 0xC0000000
87#define INTEGRATOR_LOGIC_MODULE0_BASE 0xC0000000 87#define INTEGRATOR_LOGIC_MODULE0_BASE 0xC0000000
@@ -92,7 +92,7 @@
92/* ------------------------------------------------------------------------ 92/* ------------------------------------------------------------------------
93 * Integrator header card registers 93 * Integrator header card registers
94 * ------------------------------------------------------------------------ 94 * ------------------------------------------------------------------------
95 * 95 *
96 */ 96 */
97#define INTEGRATOR_HDR_ID_OFFSET 0x00 97#define INTEGRATOR_HDR_ID_OFFSET 0x00
98#define INTEGRATOR_HDR_PROC_OFFSET 0x04 98#define INTEGRATOR_HDR_PROC_OFFSET 0x04
@@ -185,12 +185,12 @@
185/* ------------------------------------------------------------------------ 185/* ------------------------------------------------------------------------
186 * Integrator system registers 186 * Integrator system registers
187 * ------------------------------------------------------------------------ 187 * ------------------------------------------------------------------------
188 * 188 *
189 */ 189 */
190 190
191/* 191/*
192 * System Controller 192 * System Controller
193 * 193 *
194 */ 194 */
195#define INTEGRATOR_SC_ID_OFFSET 0x00 195#define INTEGRATOR_SC_ID_OFFSET 0x00
196#define INTEGRATOR_SC_OSC_OFFSET 0x04 196#define INTEGRATOR_SC_OSC_OFFSET 0x04
@@ -230,11 +230,11 @@
230#define INTEGRATOR_SC_CTRL_URTS1 (1 << 6) 230#define INTEGRATOR_SC_CTRL_URTS1 (1 << 6)
231#define INTEGRATOR_SC_CTRL_UDTR1 (1 << 7) 231#define INTEGRATOR_SC_CTRL_UDTR1 (1 << 7)
232 232
233/* 233/*
234 * External Bus Interface 234 * External Bus Interface
235 * 235 *
236 */ 236 */
237#define INTEGRATOR_EBI_BASE 0x12000000 237#define INTEGRATOR_EBI_BASE 0x12000000
238 238
239#define INTEGRATOR_EBI_CSR0_OFFSET 0x00 239#define INTEGRATOR_EBI_CSR0_OFFSET 0x00
240#define INTEGRATOR_EBI_CSR1_OFFSET 0x04 240#define INTEGRATOR_EBI_CSR1_OFFSET 0x04
@@ -279,9 +279,9 @@
279#define INTEGRATOR_KBD_BASE 0x18000000 /* Keyboard */ 279#define INTEGRATOR_KBD_BASE 0x18000000 /* Keyboard */
280#define INTEGRATOR_MOUSE_BASE 0x19000000 /* Mouse */ 280#define INTEGRATOR_MOUSE_BASE 0x19000000 /* Mouse */
281 281
282/* 282/*
283 * LED's & Switches 283 * LED's & Switches
284 * 284 *
285 */ 285 */
286#define INTEGRATOR_DBG_ALPHA_OFFSET 0x00 286#define INTEGRATOR_DBG_ALPHA_OFFSET 0x00
287#define INTEGRATOR_DBG_LEDS_OFFSET 0x04 287#define INTEGRATOR_DBG_LEDS_OFFSET 0x04
@@ -300,7 +300,7 @@
300 * ------------------------------------------------------------------------ 300 * ------------------------------------------------------------------------
301 */ 301 */
302/* PS2 Keyboard interface */ 302/* PS2 Keyboard interface */
303#define KMI0_BASE INTEGRATOR_KBD_BASE 303#define KMI0_BASE INTEGRATOR_KBD_BASE
304 304
305/* PS2 Mouse interface */ 305/* PS2 Mouse interface */
306#define KMI1_BASE INTEGRATOR_MOUSE_BASE 306#define KMI1_BASE INTEGRATOR_MOUSE_BASE
@@ -313,7 +313,7 @@
313 * This represents a fairly liberal usage of address space. Even though 313 * This represents a fairly liberal usage of address space. Even though
314 * the V3 only has two windows (therefore we need to map stuff on the fly), 314 * the V3 only has two windows (therefore we need to map stuff on the fly),
315 * we maintain the same addresses, even if they're not mapped. 315 * we maintain the same addresses, even if they're not mapped.
316 * 316 *
317 */ 317 */
318#define PHYS_PCI_MEM_BASE 0x40000000 /* 512M to xxx */ 318#define PHYS_PCI_MEM_BASE 0x40000000 /* 512M to xxx */
319/* unused 256M from A0000000-AFFFFFFF might be used for I2O ??? 319/* unused 256M from A0000000-AFFFFFFF might be used for I2O ???
@@ -326,7 +326,7 @@
326 */ 326 */
327#define PHYS_PCI_V3_BASE 0x62000000 327#define PHYS_PCI_V3_BASE 0x62000000
328 328
329#define PCI_DRAMSIZE INTEGRATOR_SSRAM_SIZE 329#define PCI_DRAMSIZE INTEGRATOR_SSRAM_SIZE
330 330
331/* 'export' these to UHAL */ 331/* 'export' these to UHAL */
332#define UHAL_PCI_IO PCI_IO_BASE 332#define UHAL_PCI_IO PCI_IO_BASE
@@ -334,7 +334,7 @@
334#define UHAL_PCI_ALLOC_IO_BASE 0x00004000 334#define UHAL_PCI_ALLOC_IO_BASE 0x00004000
335#define UHAL_PCI_ALLOC_MEM_BASE PCI_MEM_BASE 335#define UHAL_PCI_ALLOC_MEM_BASE PCI_MEM_BASE
336#define UHAL_PCI_MAX_SLOT 20 336#define UHAL_PCI_MAX_SLOT 20
337 337
338/* ======================================================================== 338/* ========================================================================
339 * Start of uHAL definitions 339 * Start of uHAL definitions
340 * ======================================================================== 340 * ========================================================================
@@ -343,17 +343,17 @@
343/* ------------------------------------------------------------------------ 343/* ------------------------------------------------------------------------
344 * Integrator Interrupt Controllers 344 * Integrator Interrupt Controllers
345 * ------------------------------------------------------------------------ 345 * ------------------------------------------------------------------------
346 * 346 *
347 * Offsets from interrupt controller base 347 * Offsets from interrupt controller base
348 * 348 *
349 * System Controller interrupt controller base is 349 * System Controller interrupt controller base is
350 * 350 *
351 * INTEGRATOR_IC_BASE + (header_number << 6) 351 * INTEGRATOR_IC_BASE + (header_number << 6)
352 * 352 *
353 * Core Module interrupt controller base is 353 * Core Module interrupt controller base is
354 * 354 *
355 * INTEGRATOR_HDR_IC 355 * INTEGRATOR_HDR_IC
356 * 356 *
357 */ 357 */
358#define IRQ_STATUS 0 358#define IRQ_STATUS 0
359#define IRQ_RAW_STATUS 0x04 359#define IRQ_RAW_STATUS 0x04
@@ -374,22 +374,22 @@
374/* ------------------------------------------------------------------------ 374/* ------------------------------------------------------------------------
375 * Interrupts 375 * Interrupts
376 * ------------------------------------------------------------------------ 376 * ------------------------------------------------------------------------
377 * 377 *
378 * 378 *
379 * Each Core Module has two interrupts controllers, one on the core module 379 * Each Core Module has two interrupts controllers, one on the core module
380 * itself and one in the system controller on the motherboard. The 380 * itself and one in the system controller on the motherboard. The
381 * READ_INT macro in target.s reads both interrupt controllers and returns 381 * READ_INT macro in target.s reads both interrupt controllers and returns
382 * a 32 bit bitmask, bits 0 to 23 are interrupts from the system controller 382 * a 32 bit bitmask, bits 0 to 23 are interrupts from the system controller
383 * and bits 24 to 31 are from the core module. 383 * and bits 24 to 31 are from the core module.
384 * 384 *
385 * The following definitions relate to the bitmask returned by READ_INT. 385 * The following definitions relate to the bitmask returned by READ_INT.
386 * 386 *
387 */ 387 */
388 388
389/* ------------------------------------------------------------------------ 389/* ------------------------------------------------------------------------
390 * LED's - The header LED is not accessible via the uHAL API 390 * LED's - The header LED is not accessible via the uHAL API
391 * ------------------------------------------------------------------------ 391 * ------------------------------------------------------------------------
392 * 392 *
393 */ 393 */
394#define GREEN_LED 0x01 394#define GREEN_LED 0x01
395#define YELLOW_LED 0x02 395#define YELLOW_LED 0x02
@@ -399,44 +399,44 @@
399 399
400#define LED_BANK INTEGRATOR_DBG_LEDS 400#define LED_BANK INTEGRATOR_DBG_LEDS
401 401
402/* 402/*
403 * Memory definitions - run uHAL out of SSRAM. 403 * Memory definitions - run uHAL out of SSRAM.
404 * 404 *
405 */ 405 */
406#define uHAL_MEMORY_SIZE INTEGRATOR_SSRAM_SIZE 406#define uHAL_MEMORY_SIZE INTEGRATOR_SSRAM_SIZE
407 407
408/* 408/*
409 * Application Flash 409 * Application Flash
410 * 410 *
411 */ 411 */
412#define FLASH_BASE INTEGRATOR_FLASH_BASE 412#define FLASH_BASE INTEGRATOR_FLASH_BASE
413#define FLASH_SIZE INTEGRATOR_FLASH_SIZE 413#define FLASH_SIZE INTEGRATOR_FLASH_SIZE
414#define FLASH_END (FLASH_BASE + FLASH_SIZE - 1) 414#define FLASH_END (FLASH_BASE + FLASH_SIZE - 1)
415#define FLASH_BLOCK_SIZE SZ_128K 415#define FLASH_BLOCK_SIZE SZ_128K
416 416
417/* 417/*
418 * Boot Flash 418 * Boot Flash
419 * 419 *
420 */ 420 */
421#define EPROM_BASE INTEGRATOR_BOOT_ROM_HI 421#define EPROM_BASE INTEGRATOR_BOOT_ROM_HI
422#define EPROM_SIZE INTEGRATOR_BOOT_ROM_SIZE 422#define EPROM_SIZE INTEGRATOR_BOOT_ROM_SIZE
423#define EPROM_END (EPROM_BASE + EPROM_SIZE - 1) 423#define EPROM_END (EPROM_BASE + EPROM_SIZE - 1)
424 424
425/* 425/*
426 * Clean base - dummy 426 * Clean base - dummy
427 * 427 *
428 */ 428 */
429#define CLEAN_BASE EPROM_BASE 429#define CLEAN_BASE EPROM_BASE
430 430
431/* 431/*
432 * Timer definitions 432 * Timer definitions
433 * 433 *
434 * Only use timer 1 & 2 434 * Only use timer 1 & 2
435 * (both run at 24MHz and will need the clock divider set to 16). 435 * (both run at 24MHz and will need the clock divider set to 16).
436 * 436 *
437 * Timer 0 runs at bus frequency and therefore could vary and currently 437 * Timer 0 runs at bus frequency and therefore could vary and currently
438 * uHAL can't handle that. 438 * uHAL can't handle that.
439 * 439 *
440 */ 440 */
441 441
442#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE 442#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE
@@ -447,9 +447,9 @@
447#define MAX_PERIOD 699050 447#define MAX_PERIOD 699050
448#define TICKS_PER_uSEC 24 448#define TICKS_PER_uSEC 24
449 449
450/* 450/*
451 * These are useconds NOT ticks. 451 * These are useconds NOT ticks.
452 * 452 *
453 */ 453 */
454#define mSEC_1 1000 454#define mSEC_1 1000
455#define mSEC_5 (mSEC_1 * 5) 455#define mSEC_5 (mSEC_1 * 5)
diff --git a/include/asm-arm/arch-integrator/vmalloc.h b/include/asm-arm/arch-integrator/vmalloc.h
index 50e9aee79486..170cccece523 100644
--- a/include/asm-arm/arch-integrator/vmalloc.h
+++ b/include/asm-arm/arch-integrator/vmalloc.h
@@ -17,15 +17,4 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
21/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-iop3xx/vmalloc.h b/include/asm-arm/arch-iop3xx/vmalloc.h
index dc1d2a957164..0f2f6847f93c 100644
--- a/include/asm-arm/arch-iop3xx/vmalloc.h
+++ b/include/asm-arm/arch-iop3xx/vmalloc.h
@@ -10,9 +10,6 @@
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;) 11 * area for the same reason. ;)
12 */ 12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_VMADDR(x) ((unsigned long)(x))
16//#define VMALLOC_END (0xe8000000) 13//#define VMALLOC_END (0xe8000000)
17/* increase usable physical RAM to ~992M per RMK */ 14/* increase usable physical RAM to ~992M per RMK */
18#define VMALLOC_END (0xfe000000) 15#define VMALLOC_END (0xfe000000)
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h
index 509e44d528d8..901bba6d02b4 100644
--- a/include/asm-arm/arch-ixp2000/platform.h
+++ b/include/asm-arm/arch-ixp2000/platform.h
@@ -121,6 +121,7 @@ unsigned long ixp2000_gettimeoffset(void);
121 121
122struct pci_sys_data; 122struct pci_sys_data;
123 123
124u32 *ixp2000_pci_config_addr(unsigned int bus, unsigned int devfn, int where);
124void ixp2000_pci_preinit(void); 125void ixp2000_pci_preinit(void);
125int ixp2000_pci_setup(int, struct pci_sys_data*); 126int ixp2000_pci_setup(int, struct pci_sys_data*);
126struct pci_bus* ixp2000_pci_scan_bus(int, struct pci_sys_data*); 127struct pci_bus* ixp2000_pci_scan_bus(int, struct pci_sys_data*);
diff --git a/include/asm-arm/arch-ixp2000/vmalloc.h b/include/asm-arm/arch-ixp2000/vmalloc.h
index 2e4bcbcf31f0..473dff4ec561 100644
--- a/include/asm-arm/arch-ixp2000/vmalloc.h
+++ b/include/asm-arm/arch-ixp2000/vmalloc.h
@@ -17,7 +17,4 @@
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;) 18 * area for the same reason. ;)
19 */ 19 */
20#define VMALLOC_OFFSET (8*1024*1024)
21#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
22#define VMALLOC_VMADDR(x) ((unsigned long)(x))
23#define VMALLOC_END 0xfaffefff 20#define VMALLOC_END 0xfaffefff
diff --git a/include/asm-arm/arch-ixp4xx/vmalloc.h b/include/asm-arm/arch-ixp4xx/vmalloc.h
index da46e560ad6f..050d46e6b126 100644
--- a/include/asm-arm/arch-ixp4xx/vmalloc.h
+++ b/include/asm-arm/arch-ixp4xx/vmalloc.h
@@ -1,17 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-ixp4xx/vmalloc.h 2 * linux/include/asm-arm/arch-ixp4xx/vmalloc.h
3 */ 3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_VMADDR(x) ((unsigned long)(x))
16#define VMALLOC_END (0xFF000000) 4#define VMALLOC_END (0xFF000000)
17 5
diff --git a/include/asm-arm/arch-l7200/vmalloc.h b/include/asm-arm/arch-l7200/vmalloc.h
index edeaebe1f14a..816231eedaac 100644
--- a/include/asm-arm/arch-l7200/vmalloc.h
+++ b/include/asm-arm/arch-l7200/vmalloc.h
@@ -1,15 +1,4 @@
1/* 1/*
2 * linux/include/asm-arm/arch-l7200/vmalloc.h 2 * linux/include/asm-arm/arch-l7200/vmalloc.h
3 */ 3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 4#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-lh7a40x/vmalloc.h b/include/asm-arm/arch-lh7a40x/vmalloc.h
index 5ac607925bea..8163e45109b9 100644
--- a/include/asm-arm/arch-lh7a40x/vmalloc.h
+++ b/include/asm-arm/arch-lh7a40x/vmalloc.h
@@ -7,15 +7,4 @@
7 * version 2 as published by the Free Software Foundation. 7 * version 2 as published by the Free Software Foundation.
8 * 8 *
9 */ 9 */
10
11/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after
14 * the physical memory until the kernel virtual memory starts. That
15 * means that any out-of-bounds memory accesses will hopefully be
16 * caught. The vmalloc() routines leaves a hole of 4kB (one page)
17 * between each vmalloced area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21#define VMALLOC_END (0xe8000000) 10#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-omap/vmalloc.h b/include/asm-arm/arch-omap/vmalloc.h
index c6a83581a2fc..5b8bd8dae8be 100644
--- a/include/asm-arm/arch-omap/vmalloc.h
+++ b/include/asm-arm/arch-omap/vmalloc.h
@@ -17,17 +17,5 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
21/*
22 * Just any arbitrary offset to the start of the vmalloc VM area: the
23 * current 8MB value just means that there will be a 8MB "hole" after the
24 * physical memory until the kernel virtual memory starts. That means that
25 * any out-of-bounds memory accesses will hopefully be caught.
26 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
27 * area for the same reason. ;)
28 */
29#define VMALLOC_OFFSET (8*1024*1024)
30#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
31#define VMALLOC_VMADDR(x) ((unsigned long)(x))
32#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
33 21
diff --git a/include/asm-arm/arch-pxa/vmalloc.h b/include/asm-arm/arch-pxa/vmalloc.h
index 3381af6ddb0d..5bb450c7aa2c 100644
--- a/include/asm-arm/arch-pxa/vmalloc.h
+++ b/include/asm-arm/arch-pxa/vmalloc.h
@@ -8,15 +8,4 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11
12/*
13 * Just any arbitrary offset to the start of the vmalloc VM area: the
14 * current 8MB value just means that there will be a 8MB "hole" after the
15 * physical memory until the kernel virtual memory starts. That means that
16 * any out-of-bounds memory accesses will hopefully be caught.
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;)
19 */
20#define VMALLOC_OFFSET (8*1024*1024)
21#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
22#define VMALLOC_END (0xe8000000) 11#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-rpc/vmalloc.h b/include/asm-arm/arch-rpc/vmalloc.h
index a13c27f37d71..077046bb2f36 100644
--- a/include/asm-arm/arch-rpc/vmalloc.h
+++ b/include/asm-arm/arch-rpc/vmalloc.h
@@ -7,15 +7,4 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10
11/*
12 * Just any arbitrary offset to the start of the vmalloc VM area: the
13 * current 8MB value just means that there will be a 8MB "hole" after the
14 * physical memory until the kernel virtual memory starts. That means that
15 * any out-of-bounds memory accesses will hopefully be caught.
16 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
17 * area for the same reason. ;)
18 */
19#define VMALLOC_OFFSET (8*1024*1024)
20#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
21#define VMALLOC_END (PAGE_OFFSET + 0x1c000000) 10#define VMALLOC_END (PAGE_OFFSET + 0x1c000000)
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h
index 7ae8e1f45bc1..385b07d510da 100644
--- a/include/asm-arm/arch-s3c2410/regs-iis.h
+++ b/include/asm-arm/arch-s3c2410/regs-iis.h
@@ -14,6 +14,7 @@
14 * 26-06-2003 BJD Finished off definitions for register addresses 14 * 26-06-2003 BJD Finished off definitions for register addresses
15 * 12-03-2004 BJD Updated include protection 15 * 12-03-2004 BJD Updated include protection
16 * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL 16 * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL
17 * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400
17 */ 18 */
18 19
19#ifndef __ASM_ARCH_REGS_IIS_H 20#ifndef __ASM_ARCH_REGS_IIS_H
@@ -68,5 +69,14 @@
68#define S3C2410_IISFCON_RXMASK (0x3f) 69#define S3C2410_IISFCON_RXMASK (0x3f)
69#define S3C2410_IISFCON_RXSHIFT (0) 70#define S3C2410_IISFCON_RXSHIFT (0)
70 71
72#define S3C2400_IISFCON_TXDMA (1<<11)
73#define S3C2400_IISFCON_RXDMA (1<<10)
74#define S3C2400_IISFCON_TXENABLE (1<<9)
75#define S3C2400_IISFCON_RXENABLE (1<<8)
76#define S3C2400_IISFCON_TXMASK (0x07 << 4)
77#define S3C2400_IISFCON_TXSHIFT (4)
78#define S3C2400_IISFCON_RXMASK (0x07)
79#define S3C2400_IISFCON_RXSHIFT (0)
80
71#define S3C2410_IISFIFO (0x10) 81#define S3C2410_IISFIFO (0x10)
72#endif /* __ASM_ARCH_REGS_IIS_H */ 82#endif /* __ASM_ARCH_REGS_IIS_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h
index 1a1328ac0d79..a2d7d0cec042 100644
--- a/include/asm-arm/arch-s3c2410/regs-mem.h
+++ b/include/asm-arm/arch-s3c2410/regs-mem.h
@@ -12,6 +12,7 @@
12 * Changelog: 12 * Changelog:
13 * 29-Sep-2004 BJD Initial include for Linux 13 * 29-Sep-2004 BJD Initial include for Linux
14 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 14 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
15 * 04-Apr-2005 LCVR Added S3C2400 DRAM/BANKSIZE_MASK definitions
15 * 16 *
16*/ 17*/
17 18
@@ -183,6 +184,12 @@
183#define S3C2410_REFRESH_TRP_3clk (1<<20) 184#define S3C2410_REFRESH_TRP_3clk (1<<20)
184#define S3C2410_REFRESH_TRP_4clk (2<<20) 185#define S3C2410_REFRESH_TRP_4clk (2<<20)
185 186
187#define S3C2400_REFRESH_DRAM_TRP_MASK (3<<20)
188#define S3C2400_REFRESH_DRAM_TRP_1_5clk (0<<20)
189#define S3C2400_REFRESH_DRAM_TRP_2_5clk (1<<20)
190#define S3C2400_REFRESH_DRAM_TRP_3_5clk (2<<20)
191#define S3C2400_REFRESH_DRAM_TRP_4_5clk (3<<20)
192
186#define S3C2410_REFRESH_TSRC_MASK (3<<18) 193#define S3C2410_REFRESH_TSRC_MASK (3<<18)
187#define S3C2410_REFRESH_TSRC_4clk (0<<18) 194#define S3C2410_REFRESH_TSRC_4clk (0<<18)
188#define S3C2410_REFRESH_TSRC_5clk (1<<18) 195#define S3C2410_REFRESH_TSRC_5clk (1<<18)
@@ -205,6 +212,7 @@
205#define S3C2410_BANKSIZE_4M (0x5 << 0) 212#define S3C2410_BANKSIZE_4M (0x5 << 0)
206#define S3C2410_BANKSIZE_2M (0x4 << 0) 213#define S3C2410_BANKSIZE_2M (0x4 << 0)
207#define S3C2410_BANKSIZE_MASK (0x7 << 0) 214#define S3C2410_BANKSIZE_MASK (0x7 << 0)
215#define S3C2400_BANKSIZE_MASK (0x4 << 0)
208#define S3C2410_BANKSIZE_SCLK_EN (1<<4) 216#define S3C2410_BANKSIZE_SCLK_EN (1<<4)
209#define S3C2410_BANKSIZE_SCKE_EN (1<<5) 217#define S3C2410_BANKSIZE_SCKE_EN (1<<5)
210#define S3C2410_BANKSIZE_BURST (1<<7) 218#define S3C2410_BANKSIZE_BURST (1<<7)
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/arch-s3c2410/regs-spi.h
index cb502a88158b..338217858c73 100644
--- a/include/asm-arm/arch-s3c2410/regs-spi.h
+++ b/include/asm-arm/arch-s3c2410/regs-spi.h
@@ -12,6 +12,7 @@
12 * 20-04-2004 KF Created file 12 * 20-04-2004 KF Created file
13 * 04-10-2004 BJD Removed VA address (no longer mapped) 13 * 04-10-2004 BJD Removed VA address (no longer mapped)
14 * tidied file for submission 14 * tidied file for submission
15 * 03-04-2005 LCVR Added S3C2400_SPPIN_nCS definition
15 */ 16 */
16 17
17#ifndef __ASM_ARCH_REGS_SPI_H 18#ifndef __ASM_ARCH_REGS_SPI_H
@@ -46,6 +47,7 @@
46 47
47#define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */ 48#define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */
48#define S3C2410_SPPIN_RESERVED (1<<1) 49#define S3C2410_SPPIN_RESERVED (1<<1)
50#define S3C2400_SPPIN_nCS (1<<1) /* SPI Card Select */
49#define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ 51#define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */
50 52
51 53
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index ad4252e27799..d7a4a8354fa9 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -16,6 +16,7 @@
16 * 12-Oct-2004 BJD Take account of debug uart configuration 16 * 12-Oct-2004 BJD Take account of debug uart configuration
17 * 15-Nov-2004 BJD Fixed uart configuration 17 * 15-Nov-2004 BJD Fixed uart configuration
18 * 22-Feb-2005 BJD Added watchdog to uncompress 18 * 22-Feb-2005 BJD Added watchdog to uncompress
19 * 04-Apr-2005 LCVR Added support to S3C2400 (no cpuid at GSTATUS1)
19*/ 20*/
20 21
21#ifndef __ASM_ARCH_UNCOMPRESS_H 22#ifndef __ASM_ARCH_UNCOMPRESS_H
@@ -69,9 +70,12 @@ uart_rd(unsigned int reg)
69static void 70static void
70putc(char ch) 71putc(char ch)
71{ 72{
72 int cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); 73 int cpuid = S3C2410_GSTATUS1_2410;
73 74
75#ifndef CONFIG_CPU_S3C2400
76 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
74 cpuid &= S3C2410_GSTATUS1_IDMASK; 77 cpuid &= S3C2410_GSTATUS1_IDMASK;
78#endif
75 79
76 if (ch == '\n') 80 if (ch == '\n')
77 putc('\r'); /* expand newline to \r\n */ 81 putc('\r'); /* expand newline to \r\n */
diff --git a/include/asm-arm/arch-s3c2410/vmalloc.h b/include/asm-arm/arch-s3c2410/vmalloc.h
index 5fe72ad70904..33963cd5461b 100644
--- a/include/asm-arm/arch-s3c2410/vmalloc.h
+++ b/include/asm-arm/arch-s3c2410/vmalloc.h
@@ -19,18 +19,6 @@
19#ifndef __ASM_ARCH_VMALLOC_H 19#ifndef __ASM_ARCH_VMALLOC_H
20#define __ASM_ARCH_VMALLOC_H 20#define __ASM_ARCH_VMALLOC_H
21 21
22/*
23 * Just any arbitrary offset to the start of the vmalloc VM area: the
24 * current 8MB value just means that there will be a 8MB "hole" after the
25 * physical memory until the kernel virtual memory starts. That means that
26 * any out-of-bounds memory accesses will hopefully be caught.
27 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
28 * area for the same reason. ;)
29 */
30
31#define VMALLOC_OFFSET (8*1024*1024)
32#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
33#define VMALLOC_VMADDR(x) ((unsigned long)(x))
34#define VMALLOC_END (0xE0000000) 22#define VMALLOC_END (0xE0000000)
35 23
36#endif /* __ASM_ARCH_VMALLOC_H */ 24#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/include/asm-arm/arch-sa1100/vmalloc.h b/include/asm-arm/arch-sa1100/vmalloc.h
index 135bc9493c06..2fb1c6f3aa1b 100644
--- a/include/asm-arm/arch-sa1100/vmalloc.h
+++ b/include/asm-arm/arch-sa1100/vmalloc.h
@@ -1,15 +1,4 @@
1/* 1/*
2 * linux/include/asm-arm/arch-sa1100/vmalloc.h 2 * linux/include/asm-arm/arch-sa1100/vmalloc.h
3 */ 3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (0xe8000000) 4#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-shark/vmalloc.h b/include/asm-arm/arch-shark/vmalloc.h
index 1cc20098f690..10db5d188231 100644
--- a/include/asm-arm/arch-shark/vmalloc.h
+++ b/include/asm-arm/arch-shark/vmalloc.h
@@ -1,15 +1,4 @@
1/* 1/*
2 * linux/include/asm-arm/arch-rpc/vmalloc.h 2 * linux/include/asm-arm/arch-rpc/vmalloc.h
3 */ 3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13#define VMALLOC_OFFSET (8*1024*1024)
14#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
15#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 4#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-versatile/vmalloc.h b/include/asm-arm/arch-versatile/vmalloc.h
index adfb34829bfc..ac780df62156 100644
--- a/include/asm-arm/arch-versatile/vmalloc.h
+++ b/include/asm-arm/arch-versatile/vmalloc.h
@@ -18,16 +18,4 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21
22/*
23 * Just any arbitrary offset to the start of the vmalloc VM area: the
24 * current 8MB value just means that there will be a 8MB "hole" after the
25 * physical memory until the kernel virtual memory starts. That means that
26 * any out-of-bounds memory accesses will hopefully be caught.
27 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
28 * area for the same reason. ;)
29 */
30#define VMALLOC_OFFSET (8*1024*1024)
31#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
32#define VMALLOC_VMADDR(x) ((unsigned long)(x))
33#define VMALLOC_END (PAGE_OFFSET + 0x18000000) 21#define VMALLOC_END (PAGE_OFFSET + 0x18000000)
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
index 5e91b90a8181..24d11672eb60 100644
--- a/include/asm-arm/bug.h
+++ b/include/asm-arm/bug.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_BUG
6#ifdef CONFIG_DEBUG_BUGVERBOSE 7#ifdef CONFIG_DEBUG_BUGVERBOSE
7extern volatile void __bug(const char *file, int line, void *data); 8extern volatile void __bug(const char *file, int line, void *data);
8 9
@@ -17,6 +18,8 @@ extern volatile void __bug(const char *file, int line, void *data);
17#endif 18#endif
18 19
19#define HAVE_ARCH_BUG 20#define HAVE_ARCH_BUG
21#endif
22
20#include <asm-generic/bug.h> 23#include <asm-generic/bug.h>
21 24
22#endif 25#endif
diff --git a/include/asm-arm/hardware/amba_clcd.h b/include/asm-arm/hardware/amba_clcd.h
index 2149be7c7023..ce4cf5c1c05d 100644
--- a/include/asm-arm/hardware/amba_clcd.h
+++ b/include/asm-arm/hardware/amba_clcd.h
@@ -153,7 +153,7 @@ struct clcd_fb {
153 153
154static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) 154static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
155{ 155{
156 u32 val; 156 u32 val, cpl;
157 157
158 /* 158 /*
159 * Program the CLCD controller registers and start the CLCD 159 * Program the CLCD controller registers and start the CLCD
@@ -164,7 +164,10 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
164 val |= (fb->fb.var.left_margin - 1) << 24; 164 val |= (fb->fb.var.left_margin - 1) << 24;
165 regs->tim0 = val; 165 regs->tim0 = val;
166 166
167 val = fb->fb.var.yres - 1; 167 val = fb->fb.var.yres;
168 if (fb->panel->cntl & CNTL_LCDDUAL)
169 val /= 2;
170 val -= 1;
168 val |= (fb->fb.var.vsync_len - 1) << 10; 171 val |= (fb->fb.var.vsync_len - 1) << 10;
169 val |= fb->fb.var.lower_margin << 16; 172 val |= fb->fb.var.lower_margin << 16;
170 val |= fb->fb.var.upper_margin << 24; 173 val |= fb->fb.var.upper_margin << 24;
@@ -174,13 +177,17 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
174 val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS; 177 val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS;
175 val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS; 178 val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS;
176 179
177 if (fb->panel->cntl & CNTL_LCDTFT) 180 cpl = fb->fb.var.xres_virtual;
178 val |= (fb->fb.var.xres_virtual - 1) << 16; 181 if (fb->panel->cntl & CNTL_LCDTFT) /* TFT */
179 else if (fb->panel->cntl & CNTL_LCDBW) 182 /* / 1 */;
180 printk("what value for CPL for stnmono panels?"); 183 else if (!fb->fb.var.grayscale) /* STN color */
181 else 184 cpl = cpl * 8 / 3;
182 val |= ((fb->fb.var.xres_virtual * 8 / 3) - 1) << 16; 185 else if (fb->panel->cntl & CNTL_LCDMONO8) /* STN monochrome, 8bit */
183 regs->tim2 = val; 186 cpl /= 8;
187 else /* STN monochrome, 4bit */
188 cpl /= 4;
189
190 regs->tim2 = val | ((cpl - 1) << 16);
184 191
185 regs->tim3 = fb->panel->tim3; 192 regs->tim3 = fb->panel->tim3;
186 193
@@ -204,7 +211,7 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
204 case 16: 211 case 16:
205 val |= CNTL_LCDBPP16; 212 val |= CNTL_LCDBPP16;
206 break; 213 break;
207 case 24: 214 case 32:
208 val |= CNTL_LCDBPP24; 215 val |= CNTL_LCDBPP24;
209 break; 216 break;
210 } 217 }
@@ -215,8 +222,8 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
215 222
216static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) 223static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var)
217{ 224{
218 var->xres_virtual = var->xres = (var->xres + 7) & ~7; 225 var->xres_virtual = var->xres = (var->xres + 15) & ~15;
219 var->yres_virtual = var->yres; 226 var->yres_virtual = var->yres = (var->yres + 1) & ~1;
220 227
221#define CHECK(e,l,h) (var->e < l || var->e > h) 228#define CHECK(e,l,h) (var->e < l || var->e > h)
222 if (CHECK(right_margin, (5+1), 256) || /* back porch */ 229 if (CHECK(right_margin, (5+1), 256) || /* back porch */
diff --git a/include/asm-arm/hardware/clock.h b/include/asm-arm/hardware/clock.h
index 4983449ff2c7..19da861e523d 100644
--- a/include/asm-arm/hardware/clock.h
+++ b/include/asm-arm/hardware/clock.h
@@ -26,10 +26,13 @@ struct clk;
26/** 26/**
27 * clk_get - lookup and obtain a reference to a clock producer. 27 * clk_get - lookup and obtain a reference to a clock producer.
28 * @dev: device for clock "consumer" 28 * @dev: device for clock "consumer"
29 * @id: device ID 29 * @id: clock comsumer ID
30 * 30 *
31 * Returns a struct clk corresponding to the clock producer, or 31 * Returns a struct clk corresponding to the clock producer, or
32 * valid IS_ERR() condition containing errno. 32 * valid IS_ERR() condition containing errno. The implementation
33 * uses @dev and @id to determine the clock consumer, and thereby
34 * the clock producer. (IOW, @id may be identical strings, but
35 * clk_get may return different clock producers depending on @dev.)
33 */ 36 */
34struct clk *clk_get(struct device *dev, const char *id); 37struct clk *clk_get(struct device *dev, const char *id);
35 38
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 69bc7a3e8160..658ffa384fda 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -99,12 +99,16 @@ extern void __readwrite_bug(const char *fn);
99 */ 99 */
100#ifdef __io 100#ifdef __io
101#define outb(v,p) __raw_writeb(v,__io(p)) 101#define outb(v,p) __raw_writeb(v,__io(p))
102#define outw(v,p) __raw_writew(cpu_to_le16(v),__io(p)) 102#define outw(v,p) __raw_writew((__force __u16) \
103#define outl(v,p) __raw_writel(cpu_to_le32(v),__io(p)) 103 cpu_to_le16(v),__io(p))
104#define outl(v,p) __raw_writel((__force __u32) \
105 cpu_to_le32(v),__io(p))
104 106
105#define inb(p) ({ unsigned int __v = __raw_readb(__io(p)); __v; }) 107#define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __v; })
106#define inw(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(__io(p))); __v; }) 108#define inw(p) ({ __u16 __v = le16_to_cpu((__force __le16) \
107#define inl(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(__io(p))); __v; }) 109 __raw_readw(__io(p))); __v; })
110#define inl(p) ({ __u32 __v = le32_to_cpu((__force __le32) \
111 __raw_readl(__io(p))); __v; })
108 112
109#define outsb(p,d,l) __raw_writesb(__io(p),d,l) 113#define outsb(p,d,l) __raw_writesb(__io(p),d,l)
110#define outsw(p,d,l) __raw_writesw(__io(p),d,l) 114#define outsw(p,d,l) __raw_writesw(__io(p),d,l)
@@ -149,9 +153,11 @@ extern void _memset_io(void __iomem *, int, size_t);
149 * IO port primitives for more information. 153 * IO port primitives for more information.
150 */ 154 */
151#ifdef __mem_pci 155#ifdef __mem_pci
152#define readb(c) ({ unsigned int __v = __raw_readb(__mem_pci(c)); __v; }) 156#define readb(c) ({ __u8 __v = __raw_readb(__mem_pci(c)); __v; })
153#define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; }) 157#define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \
154#define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; }) 158 __raw_readw(__mem_pci(c))); __v; })
159#define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \
160 __raw_readl(__mem_pci(c))); __v; })
155#define readb_relaxed(addr) readb(addr) 161#define readb_relaxed(addr) readb(addr)
156#define readw_relaxed(addr) readw(addr) 162#define readw_relaxed(addr) readw(addr)
157#define readl_relaxed(addr) readl(addr) 163#define readl_relaxed(addr) readl(addr)
@@ -161,8 +167,10 @@ extern void _memset_io(void __iomem *, int, size_t);
161#define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l) 167#define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l)
162 168
163#define writeb(v,c) __raw_writeb(v,__mem_pci(c)) 169#define writeb(v,c) __raw_writeb(v,__mem_pci(c))
164#define writew(v,c) __raw_writew(cpu_to_le16(v),__mem_pci(c)) 170#define writew(v,c) __raw_writew((__force __u16) \
165#define writel(v,c) __raw_writel(cpu_to_le32(v),__mem_pci(c)) 171 cpu_to_le16(v),__mem_pci(c))
172#define writel(v,c) __raw_writel((__force __u32) \
173 cpu_to_le32(v),__mem_pci(c))
166 174
167#define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l) 175#define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l)
168#define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l) 176#define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l)
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 2df4eacf4fa9..a9892eb42a23 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -17,6 +17,23 @@
17#include <asm/arch/vmalloc.h> 17#include <asm/arch/vmalloc.h>
18 18
19/* 19/*
20 * Just any arbitrary offset to the start of the vmalloc VM area: the
21 * current 8MB value just means that there will be a 8MB "hole" after the
22 * physical memory until the kernel virtual memory starts. That means that
23 * any out-of-bounds memory accesses will hopefully be caught.
24 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
25 * area for the same reason. ;)
26 *
27 * Note that platforms may override VMALLOC_START, but they must provide
28 * VMALLOC_END. VMALLOC_END defines the (exclusive) limit of this space,
29 * which may not overlap IO space.
30 */
31#ifndef VMALLOC_START
32#define VMALLOC_OFFSET (8*1024*1024)
33#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
34#endif
35
36/*
20 * Hardware-wise, we have a two level page table structure, where the first 37 * Hardware-wise, we have a two level page table structure, where the first
21 * level has 4096 entries, and the second level has 256 entries. Each entry 38 * level has 4096 entries, and the second level has 256 entries. Each entry
22 * is one 32-bit word. Most of the bits in the second level entry are used 39 * is one 32-bit word. Most of the bits in the second level entry are used
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index 4a9845997a75..7d4118e09054 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -23,8 +23,6 @@
23#include <asm/procinfo.h> 23#include <asm/procinfo.h>
24#include <asm/types.h> 24#include <asm/types.h>
25 25
26#define KERNEL_STACK_SIZE PAGE_SIZE
27
28union debug_insn { 26union debug_insn {
29 u32 arm; 27 u32 arm;
30 u16 thumb; 28 u16 thumb;
@@ -87,8 +85,9 @@ unsigned long get_wchan(struct task_struct *p);
87 */ 85 */
88extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 86extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
89 87
90#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019]) 88#define KSTK_REGS(tsk) (((struct pt_regs *)(THREAD_START_SP + (unsigned long)(tsk)->thread_info)) - 1)
91#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017]) 89#define KSTK_EIP(tsk) KSTK_REGS(tsk)->ARM_pc
90#define KSTK_ESP(tsk) KSTK_REGS(tsk)->ARM_sp
92 91
93/* 92/*
94 * Prefetching support - only ARMv5. 93 * Prefetching support - only ARMv5.
diff --git a/include/asm-arm/rtc.h b/include/asm-arm/rtc.h
index aa7e16b2e225..370dfe77589d 100644
--- a/include/asm-arm/rtc.h
+++ b/include/asm-arm/rtc.h
@@ -18,9 +18,9 @@ struct rtc_ops {
18 void (*release)(void); 18 void (*release)(void);
19 int (*ioctl)(unsigned int, unsigned long); 19 int (*ioctl)(unsigned int, unsigned long);
20 20
21 void (*read_time)(struct rtc_time *); 21 int (*read_time)(struct rtc_time *);
22 int (*set_time)(struct rtc_time *); 22 int (*set_time)(struct rtc_time *);
23 void (*read_alarm)(struct rtc_wkalrm *); 23 int (*read_alarm)(struct rtc_wkalrm *);
24 int (*set_alarm)(struct rtc_wkalrm *); 24 int (*set_alarm)(struct rtc_wkalrm *);
25 int (*proc)(char *buf); 25 int (*proc)(char *buf);
26}; 26};
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
index b033e5fd60fa..46e69ae395af 100644
--- a/include/asm-arm/signal.h
+++ b/include/asm-arm/signal.h
@@ -114,34 +114,10 @@ typedef unsigned long sigset_t;
114#define SIGSTKSZ 8192 114#define SIGSTKSZ 8192
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117
118/*
119 * These values of sa_flags are used only by the kernel as part of the
120 * irq handling routines.
121 *
122 * SA_INTERRUPT is also used by the irq handling routines.
123 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
124 */
125#define SA_PROBE 0x80000000
126#define SA_SAMPLE_RANDOM 0x10000000
127#define SA_IRQNOMASK 0x08000000 117#define SA_IRQNOMASK 0x08000000
128#define SA_SHIRQ 0x04000000
129#endif 118#endif
130 119
131#define SIG_BLOCK 0 /* for blocking signals */ 120#include <asm-generic/signal.h>
132#define SIG_UNBLOCK 1 /* for unblocking signals */
133#define SIG_SETMASK 2 /* for setting the signal mask */
134
135/* Type of a signal handler. */
136typedef void __signalfn_t(int);
137typedef __signalfn_t __user *__sighandler_t;
138
139typedef void __restorefn_t(void);
140typedef __restorefn_t __user *__sigrestore_t;
141
142#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
143#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
144#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
145 121
146#ifdef __KERNEL__ 122#ifdef __KERNEL__
147struct old_sigaction { 123struct old_sigaction {
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h
index 2a8ab162412f..e50c4a39b699 100644
--- a/include/asm-arm/string.h
+++ b/include/asm-arm/string.h
@@ -29,15 +29,22 @@ extern void __memzero(void *ptr, __kernel_size_t n);
29 29
30#define memset(p,v,n) \ 30#define memset(p,v,n) \
31 ({ \ 31 ({ \
32 if ((n) != 0) { \ 32 void *__p = (p); size_t __n = n; \
33 if ((__n) != 0) { \
33 if (__builtin_constant_p((v)) && (v) == 0) \ 34 if (__builtin_constant_p((v)) && (v) == 0) \
34 __memzero((p),(n)); \ 35 __memzero((__p),(__n)); \
35 else \ 36 else \
36 memset((p),(v),(n)); \ 37 memset((__p),(v),(__n)); \
37 } \ 38 } \
38 (p); \ 39 (__p); \
39 }) 40 })
40 41
41#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); }) 42#define memzero(p,n) \
43 ({ \
44 void *__p = (p); size_t __n = n; \
45 if ((__n) != 0) \
46 __memzero((__p),(__n)); \
47 (__p); \
48 })
42 49
43#endif 50#endif
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index a61618fb433c..66c585c50cf9 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -14,6 +14,10 @@
14 14
15#include <asm/fpstate.h> 15#include <asm/fpstate.h>
16 16
17#define THREAD_SIZE_ORDER 1
18#define THREAD_SIZE 8192
19#define THREAD_START_SP (THREAD_SIZE - 8)
20
17#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
18 22
19struct task_struct; 23struct task_struct;
@@ -77,8 +81,6 @@ struct thread_info {
77#define init_thread_info (init_thread_union.thread_info) 81#define init_thread_info (init_thread_union.thread_info)
78#define init_stack (init_thread_union.stack) 82#define init_stack (init_thread_union.stack)
79 83
80#define THREAD_SIZE 8192
81
82/* 84/*
83 * how to get the thread information struct from C 85 * how to get the thread information struct from C
84 */ 86 */
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index a19ec09eaa01..ace27480886e 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -359,8 +359,7 @@
359#define __ARM_NR_cacheflush (__ARM_NR_BASE+2) 359#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
360#define __ARM_NR_usr26 (__ARM_NR_BASE+3) 360#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
361#define __ARM_NR_usr32 (__ARM_NR_BASE+4) 361#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
362 362#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
363#define __ARM_NR_set_tls (__ARM_NR_BASE+0x800)
364 363
365#define __sys2(x) #x 364#define __sys2(x) #x
366#define __sys1(x) __sys2(x) 365#define __sys1(x) __sys2(x)
diff --git a/include/asm-arm26/bug.h b/include/asm-arm26/bug.h
index 920b70533368..7177c7399967 100644
--- a/include/asm-arm26/bug.h
+++ b/include/asm-arm26/bug.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_BUG
6#ifdef CONFIG_DEBUG_BUGVERBOSE 7#ifdef CONFIG_DEBUG_BUGVERBOSE
7extern volatile void __bug(const char *file, int line, void *data); 8extern volatile void __bug(const char *file, int line, void *data);
8/* give file/line information */ 9/* give file/line information */
@@ -12,6 +13,8 @@ extern volatile void __bug(const char *file, int line, void *data);
12#endif 13#endif
13 14
14#define HAVE_ARCH_BUG 15#define HAVE_ARCH_BUG
16#endif
17
15#include <asm-generic/bug.h> 18#include <asm-generic/bug.h>
16 19
17#endif 20#endif
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h
index 6f62e51a2e5a..dedb29280303 100644
--- a/include/asm-arm26/signal.h
+++ b/include/asm-arm26/signal.h
@@ -114,30 +114,10 @@ typedef unsigned long sigset_t;
114#define SIGSTKSZ 8192 114#define SIGSTKSZ 8192
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117
118/*
119 * These values of sa_flags are used only by the kernel as part of the
120 * irq handling routines.
121 *
122 * SA_INTERRUPT is also used by the irq handling routines.
123 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
124 */
125#define SA_PROBE 0x80000000
126#define SA_SAMPLE_RANDOM 0x10000000
127#define SA_IRQNOMASK 0x08000000 117#define SA_IRQNOMASK 0x08000000
128#define SA_SHIRQ 0x04000000
129#endif 118#endif
130 119
131#define SIG_BLOCK 0 /* for blocking signals */ 120#include <asm-generic/signal.h>
132#define SIG_UNBLOCK 1 /* for unblocking signals */
133#define SIG_SETMASK 2 /* for setting the signal mask */
134
135/* Type of a signal handler. */
136typedef void (*__sighandler_t)(int);
137
138#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
139#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
140#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
141 121
142#ifdef __KERNEL__ 122#ifdef __KERNEL__
143struct old_sigaction { 123struct old_sigaction {
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index ddd8915e41e6..c767da1ef8f5 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -77,10 +77,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
77 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 77 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
78} while (0) 78} while (0)
79 79
80#define PAGE_BUG(page) do { \
81 BUG(); \
82} while (0)
83
84/* Pure 2^n version of get_order */ 80/* Pure 2^n version of get_order */
85static inline int get_order(unsigned long size) 81static inline int get_order(unsigned long size)
86{ 82{
diff --git a/include/asm-cris/signal.h b/include/asm-cris/signal.h
index 3f187ec4800a..dfe039593a78 100644
--- a/include/asm-cris/signal.h
+++ b/include/asm-cris/signal.h
@@ -108,30 +108,7 @@ typedef unsigned long sigset_t;
108#define MINSIGSTKSZ 2048 108#define MINSIGSTKSZ 2048
109#define SIGSTKSZ 8192 109#define SIGSTKSZ 8192
110 110
111#ifdef __KERNEL__ 111#include <asm-generic/signal.h>
112
113/*
114 * These values of sa_flags are used only by the kernel as part of the
115 * irq handling routines.
116 *
117 * SA_INTERRUPT is also used by the irq handling routines.
118 * SA_SHIRQ is for shared interrupt support
119 */
120#define SA_PROBE SA_ONESHOT
121#define SA_SAMPLE_RANDOM SA_RESTART
122#define SA_SHIRQ 0x04000000
123#endif
124
125#define SIG_BLOCK 0 /* for blocking signals */
126#define SIG_UNBLOCK 1 /* for unblocking signals */
127#define SIG_SETMASK 2 /* for setting the signal mask */
128
129/* Type of a signal handler. */
130typedef void (*__sighandler_t)(int);
131
132#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
133#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
134#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
135 112
136#ifdef __KERNEL__ 113#ifdef __KERNEL__
137struct old_sigaction { 114struct old_sigaction {
diff --git a/include/asm-frv/bug.h b/include/asm-frv/bug.h
index 011860b28818..074c0d5770eb 100644
--- a/include/asm-frv/bug.h
+++ b/include/asm-frv/bug.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15 15
16#ifdef CONFIG_BUG
16/* 17/*
17 * Tell the user there is some problem. 18 * Tell the user there is some problem.
18 */ 19 */
@@ -45,6 +46,7 @@ do { \
45#define HAVE_ARCH_KGDB_BAD_PAGE 46#define HAVE_ARCH_KGDB_BAD_PAGE
46#define kgdb_bad_page(page) do { kgdb_raise(SIGABRT); } while(0) 47#define kgdb_bad_page(page) do { kgdb_raise(SIGABRT); } while(0)
47#endif 48#endif
49#endif
48 50
49#include <asm-generic/bug.h> 51#include <asm-generic/bug.h>
50 52
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index 3c6d42a22dfe..d0a9c2f9c13e 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -349,9 +349,9 @@ static inline pmd_t *pmd_offset(pud_t *dir, unsigned long address)
349 349
350/* 350/*
351 * Define this to warn about kernel memory accesses that are 351 * Define this to warn about kernel memory accesses that are
352 * done without a 'verify_area(VERIFY_WRITE,..)' 352 * done without a 'access_ok(VERIFY_WRITE,..)'
353 */ 353 */
354#undef TEST_VERIFY_AREA 354#undef TEST_ACCESS_OK
355 355
356#define pte_present(x) (pte_val(x) & _PAGE_PRESENT) 356#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
357#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) 357#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
diff --git a/include/asm-frv/signal.h b/include/asm-frv/signal.h
index f18952f86a80..d407bde57eca 100644
--- a/include/asm-frv/signal.h
+++ b/include/asm-frv/signal.h
@@ -107,30 +107,7 @@ typedef unsigned long sigset_t;
107#define MINSIGSTKSZ 2048 107#define MINSIGSTKSZ 2048
108#define SIGSTKSZ 8192 108#define SIGSTKSZ 8192
109 109
110#ifdef __KERNEL__ 110#include <asm-generic/signal.h>
111
112/*
113 * These values of sa_flags are used only by the kernel as part of the
114 * irq handling routines.
115 *
116 * SA_INTERRUPT is also used by the irq handling routines.
117 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
118 */
119#define SA_PROBE SA_ONESHOT
120#define SA_SAMPLE_RANDOM SA_RESTART
121#define SA_SHIRQ 0x04000000
122#endif
123
124#define SIG_BLOCK 0 /* for blocking signals */
125#define SIG_UNBLOCK 1 /* for unblocking signals */
126#define SIG_SETMASK 2 /* for setting the signal mask */
127
128/* Type of a signal handler. */
129typedef void (*__sighandler_t)(int);
130
131#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
132#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
133#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
134 111
135#ifdef __KERNEL__ 112#ifdef __KERNEL__
136struct old_sigaction { 113struct old_sigaction {
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index e5913c3b715a..400c2b41896e 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -4,6 +4,7 @@
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/config.h> 5#include <linux/config.h>
6 6
7#ifdef CONFIG_BUG
7#ifndef HAVE_ARCH_BUG 8#ifndef HAVE_ARCH_BUG
8#define BUG() do { \ 9#define BUG() do { \
9 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 10 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
@@ -11,13 +12,6 @@
11} while (0) 12} while (0)
12#endif 13#endif
13 14
14#ifndef HAVE_ARCH_PAGE_BUG
15#define PAGE_BUG(page) do { \
16 printk("page BUG for page at %p\n", page); \
17 BUG(); \
18} while (0)
19#endif
20
21#ifndef HAVE_ARCH_BUG_ON 15#ifndef HAVE_ARCH_BUG_ON
22#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) 16#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
23#endif 17#endif
@@ -31,4 +25,18 @@
31} while (0) 25} while (0)
32#endif 26#endif
33 27
28#else /* !CONFIG_BUG */
29#ifndef HAVE_ARCH_BUG
30#define BUG()
31#endif
32
33#ifndef HAVE_ARCH_BUG_ON
34#define BUG_ON(condition) do { if (condition) ; } while(0)
35#endif
36
37#ifndef HAVE_ARCH_WARN_ON
38#define WARN_ON(condition) do { if (condition) ; } while(0)
39#endif
40#endif
41
34#endif 42#endif
diff --git a/include/asm-generic/errno.h b/include/asm-generic/errno.h
index 4dd2384bc38d..e8852c092fea 100644
--- a/include/asm-generic/errno.h
+++ b/include/asm-generic/errno.h
@@ -102,4 +102,8 @@
102#define EKEYREVOKED 128 /* Key has been revoked */ 102#define EKEYREVOKED 128 /* Key has been revoked */
103#define EKEYREJECTED 129 /* Key was rejected by service */ 103#define EKEYREJECTED 129 /* Key was rejected by service */
104 104
105/* for robust mutexes */
106#define EOWNERDEAD 130 /* Owner died */
107#define ENOTRECOVERABLE 131 /* State not recoverable */
108
105#endif 109#endif
diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h
index b1fcda9eac23..cfe3692b23e5 100644
--- a/include/asm-generic/resource.h
+++ b/include/asm-generic/resource.h
@@ -41,8 +41,11 @@
41#define RLIMIT_LOCKS 10 /* maximum file locks held */ 41#define RLIMIT_LOCKS 10 /* maximum file locks held */
42#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ 42#define RLIMIT_SIGPENDING 11 /* max number of pending signals */
43#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ 43#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */
44#define RLIMIT_NICE 13 /* max nice prio allowed to raise to
45 0-39 for nice level 19 .. -20 */
46#define RLIMIT_RTPRIO 14 /* maximum realtime priority */
44 47
45#define RLIM_NLIMITS 13 48#define RLIM_NLIMITS 15
46 49
47/* 50/*
48 * SuS says limits have to be unsigned. 51 * SuS says limits have to be unsigned.
@@ -81,6 +84,8 @@
81 [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ 84 [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \
82 [RLIMIT_SIGPENDING] = { 0, 0 }, \ 85 [RLIMIT_SIGPENDING] = { 0, 0 }, \
83 [RLIMIT_MSGQUEUE] = { MQ_BYTES_MAX, MQ_BYTES_MAX }, \ 86 [RLIMIT_MSGQUEUE] = { MQ_BYTES_MAX, MQ_BYTES_MAX }, \
87 [RLIMIT_NICE] = { 0, 0 }, \
88 [RLIMIT_RTPRIO] = { 0, 0 }, \
84} 89}
85 90
86#endif /* __KERNEL__ */ 91#endif /* __KERNEL__ */
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 976ac29598b7..195ccdc069e6 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -8,6 +8,8 @@ extern char _data[], _sdata[], _edata[];
8extern char __bss_start[], __bss_stop[]; 8extern char __bss_start[], __bss_stop[];
9extern char __init_begin[], __init_end[]; 9extern char __init_begin[], __init_end[];
10extern char _sinittext[], _einittext[]; 10extern char _sinittext[], _einittext[];
11extern char _sextratext[] __attribute__((weak));
12extern char _eextratext[] __attribute__((weak));
11extern char _end[]; 13extern char _end[];
12 14
13#endif /* _ASM_GENERIC_SECTIONS_H_ */ 15#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index 9cac8e8dde51..8786e01e0db8 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -236,11 +236,18 @@ typedef struct siginfo {
236#define SIGEV_THREAD 2 /* deliver via thread creation */ 236#define SIGEV_THREAD 2 /* deliver via thread creation */
237#define SIGEV_THREAD_ID 4 /* deliver to thread */ 237#define SIGEV_THREAD_ID 4 /* deliver to thread */
238 238
239#define SIGEV_MAX_SIZE 64 239/*
240#ifndef SIGEV_PAD_SIZE 240 * This works because the alignment is ok on all current architectures
241#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3) 241 * but we leave open this being overridden in the future
242 */
243#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
244#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
242#endif 245#endif
243 246
247#define SIGEV_MAX_SIZE 64
248#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
249 / sizeof(int))
250
244typedef struct sigevent { 251typedef struct sigevent {
245 sigval_t sigev_value; 252 sigval_t sigev_value;
246 int sigev_signo; 253 int sigev_signo;
diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h
new file mode 100644
index 000000000000..9418d6e9b8cd
--- /dev/null
+++ b/include/asm-generic/signal.h
@@ -0,0 +1,21 @@
1#ifndef SIG_BLOCK
2#define SIG_BLOCK 0 /* for blocking signals */
3#endif
4#ifndef SIG_UNBLOCK
5#define SIG_UNBLOCK 1 /* for unblocking signals */
6#endif
7#ifndef SIG_SETMASK
8#define SIG_SETMASK 2 /* for setting the signal mask */
9#endif
10
11#ifndef __ASSEMBLY__
12typedef void __signalfn_t(int);
13typedef __signalfn_t __user *__sighandler_t;
14
15typedef void __restorefn_t(void);
16typedef __restorefn_t __user *__sigrestore_t;
17
18#define SIG_DFL ((__force __sighandler_t)0) /* default signal handling */
19#define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */
20#define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */
21#endif
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index c856a43e3b45..6c90f0f36eec 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -76,46 +76,47 @@ static inline void __ustw(__u16 val, __u16 *addr)
76 ptr->x = val; 76 ptr->x = val;
77} 77}
78 78
79static inline unsigned long __get_unaligned(const void *ptr, size_t size) 79#define __get_unaligned(ptr, size) ({ \
80{ 80 const void *__gu_p = ptr; \
81 unsigned long val; 81 unsigned long val; \
82 switch (size) { 82 switch (size) { \
83 case 1: 83 case 1: \
84 val = *(const __u8 *)ptr; 84 val = *(const __u8 *)__gu_p; \
85 break; 85 break; \
86 case 2: 86 case 2: \
87 val = __uldw((const __u16 *)ptr); 87 val = __uldw(__gu_p); \
88 break; 88 break; \
89 case 4: 89 case 4: \
90 val = __uldl((const __u32 *)ptr); 90 val = __uldl(__gu_p); \
91 break; 91 break; \
92 case 8: 92 case 8: \
93 val = __uldq((const __u64 *)ptr); 93 val = __uldq(__gu_p); \
94 break; 94 break; \
95 default: 95 default: \
96 bad_unaligned_access_length(); 96 bad_unaligned_access_length(); \
97 }; 97 }; \
98 return val; 98 val; \
99} 99})
100 100
101static inline void __put_unaligned(unsigned long val, void *ptr, size_t size) 101#define __put_unaligned(val, ptr, size) \
102{ 102do { \
103 switch (size) { 103 void *__gu_p = ptr; \
104 case 1: 104 switch (size) { \
105 *(__u8 *)ptr = val; 105 case 1: \
106 break; 106 *(__u8 *)__gu_p = val; \
107 case 2: 107 break; \
108 __ustw(val, (__u16 *)ptr); 108 case 2: \
109 break; 109 __ustw(val, __gu_p); \
110 case 4: 110 break; \
111 __ustl(val, (__u32 *)ptr); 111 case 4: \
112 break; 112 __ustl(val, __gu_p); \
113 case 8: 113 break; \
114 __ustq(val, (__u64 *)ptr); 114 case 8: \
115 break; 115 __ustq(val, __gu_p); \
116 default: 116 break; \
117 bad_unaligned_access_length(); 117 default: \
118 }; 118 bad_unaligned_access_length(); \
119} 119 }; \
120} while(0)
120 121
121#endif /* _ASM_GENERIC_UNALIGNED_H */ 122#endif /* _ASM_GENERIC_UNALIGNED_H */
diff --git a/include/asm-h8300/signal.h b/include/asm-h8300/signal.h
index 3a08544a473e..8eccdc176163 100644
--- a/include/asm-h8300/signal.h
+++ b/include/asm-h8300/signal.h
@@ -107,29 +107,7 @@ typedef unsigned long sigset_t;
107#define MINSIGSTKSZ 2048 107#define MINSIGSTKSZ 2048
108#define SIGSTKSZ 8192 108#define SIGSTKSZ 8192
109 109
110#ifdef __KERNEL__ 110#include <asm-generic/signal.h>
111/*
112 * These values of sa_flags are used only by the kernel as part of the
113 * irq handling routines.
114 *
115 * SA_INTERRUPT is also used by the irq handling routines.
116 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
117 */
118#define SA_PROBE SA_ONESHOT
119#define SA_SAMPLE_RANDOM SA_RESTART
120#define SA_SHIRQ 0x04000000
121#endif
122
123#define SIG_BLOCK 0 /* for blocking signals */
124#define SIG_UNBLOCK 1 /* for unblocking signals */
125#define SIG_SETMASK 2 /* for setting the signal mask */
126
127/* Type of a signal handler. */
128typedef void (*__sighandler_t)(int);
129
130#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
131#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
132#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
133 111
134#ifdef __KERNEL__ 112#ifdef __KERNEL__
135struct old_sigaction { 113struct old_sigaction {
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index e1de67483f38..a5810cf7b578 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -109,7 +109,6 @@ extern int APIC_init_uniprocessor (void);
109extern void disable_APIC_timer(void); 109extern void disable_APIC_timer(void);
110extern void enable_APIC_timer(void); 110extern void enable_APIC_timer(void);
111 111
112extern int check_nmi_watchdog (void);
113extern void enable_NMI_through_LVT0 (void * dummy); 112extern void enable_NMI_through_LVT0 (void * dummy);
114 113
115extern unsigned int nmi_watchdog; 114extern unsigned int nmi_watchdog;
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h
index 706eb511c330..8f79de19eb94 100644
--- a/include/asm-i386/bug.h
+++ b/include/asm-i386/bug.h
@@ -9,6 +9,8 @@
9 * undefined" opcode for parsing in the trap handler. 9 * undefined" opcode for parsing in the trap handler.
10 */ 10 */
11 11
12#ifdef CONFIG_BUG
13#define HAVE_ARCH_BUG
12#ifdef CONFIG_DEBUG_BUGVERBOSE 14#ifdef CONFIG_DEBUG_BUGVERBOSE
13#define BUG() \ 15#define BUG() \
14 __asm__ __volatile__( "ud2\n" \ 16 __asm__ __volatile__( "ud2\n" \
@@ -18,8 +20,7 @@
18#else 20#else
19#define BUG() __asm__ __volatile__("ud2\n") 21#define BUG() __asm__ __volatile__("ud2\n")
20#endif 22#endif
23#endif
21 24
22#define HAVE_ARCH_BUG
23#include <asm-generic/bug.h> 25#include <asm-generic/bug.h>
24
25#endif 26#endif
diff --git a/include/asm-i386/checksum.h b/include/asm-i386/checksum.h
index d76a5f081c91..641342002bcd 100644
--- a/include/asm-i386/checksum.h
+++ b/include/asm-i386/checksum.h
@@ -33,7 +33,7 @@ asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsi
33 * passed in an incorrect kernel address to one of these functions. 33 * passed in an incorrect kernel address to one of these functions.
34 * 34 *
35 * If you use these functions directly please don't forget the 35 * If you use these functions directly please don't forget the
36 * verify_area(). 36 * access_ok().
37 */ 37 */
38static __inline__ 38static __inline__
39unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, 39unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst,
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index e147cabd3bfe..ff1187e80c32 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -87,8 +87,8 @@
87#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ 87#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */
88 88
89/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ 89/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */
90#define X86_FEATURE_LAHF_LM (5*32+ 0) /* LAHF/SAHF in long mode */ 90#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
91#define X86_FEATURE_CMP_LEGACY (5*32+ 1) /* If yes HyperThreading not valid */ 91#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */
92 92
93#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) 93#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
94#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) 94#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability)
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h
index 5c285aee7294..edf65be21a92 100644
--- a/include/asm-i386/e820.h
+++ b/include/asm-i386/e820.h
@@ -13,7 +13,7 @@
13#define __E820_HEADER 13#define __E820_HEADER
14 14
15#define E820MAP 0x2d0 /* our map */ 15#define E820MAP 0x2d0 /* our map */
16#define E820MAX 32 /* number of entries in E820MAP */ 16#define E820MAX 128 /* number of entries in E820MAP */
17#define E820NR 0x1e8 /* # entries in E820MAP */ 17#define E820NR 0x1e8 /* # entries in E820MAP */
18 18
19#define E820_RAM 1 19#define E820_RAM 1
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index f4782284807a..79727afb94c9 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -257,7 +257,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
257 return 0; 257 return 0;
258} 258}
259 259
260struct fd_routine_l { 260static struct fd_routine_l {
261 int (*_request_dma)(unsigned int dmanr, const char * device_id); 261 int (*_request_dma)(unsigned int dmanr, const char * device_id);
262 void (*_free_dma)(unsigned int dmanr); 262 void (*_free_dma)(unsigned int dmanr);
263 int (*_get_dma_residue)(unsigned int dummy); 263 int (*_get_dma_residue)(unsigned int dummy);
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index 6e20b079f1d3..16ef9f996e3f 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -92,6 +92,7 @@
92 92
93extern unsigned long hpet_tick; /* hpet clks count per tick */ 93extern unsigned long hpet_tick; /* hpet clks count per tick */
94extern unsigned long hpet_address; /* hpet memory map physical address */ 94extern unsigned long hpet_address; /* hpet memory map physical address */
95extern int hpet_use_timer;
95 96
96extern int hpet_rtc_timer_init(void); 97extern int hpet_rtc_timer_init(void);
97extern int hpet_enable(void); 98extern int hpet_enable(void);
diff --git a/include/asm-i386/module.h b/include/asm-i386/module.h
index 508865e26308..eb7f2b4234aa 100644
--- a/include/asm-i386/module.h
+++ b/include/asm-i386/module.h
@@ -52,8 +52,8 @@ struct mod_arch_specific
52#define MODULE_PROC_FAMILY "CYRIXIII " 52#define MODULE_PROC_FAMILY "CYRIXIII "
53#elif defined CONFIG_MVIAC3_2 53#elif defined CONFIG_MVIAC3_2
54#define MODULE_PROC_FAMILY "VIAC3-2 " 54#define MODULE_PROC_FAMILY "VIAC3-2 "
55#elif CONFIG_MGEODE 55#elif CONFIG_MGEODEGX1
56#define MODULE_PROC_FAMILY "GEODE " 56#define MODULE_PROC_FAMILY "GEODEGX1 "
57#else 57#else
58#error unknown processor family 58#error unknown processor family
59#endif 59#endif
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 5c725425d863..8d60c2b4b003 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -193,9 +193,9 @@ extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
193/* 193/*
194 * Define this if things work differently on an i386 and an i486: 194 * Define this if things work differently on an i386 and an i486:
195 * it will (on an i486) warn about kernel memory accesses that are 195 * it will (on an i486) warn about kernel memory accesses that are
196 * done without a 'verify_area(VERIFY_WRITE,..)' 196 * done without a 'access_ok(VERIFY_WRITE,..)'
197 */ 197 */
198#undef TEST_VERIFY_AREA 198#undef TEST_ACCESS_OK
199 199
200/* The boot page tables (all created as a single array) */ 200/* The boot page tables (all created as a single array) */
201extern unsigned long pg0[]; 201extern unsigned long pg0[];
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index 8814b54c75d4..7a32184d54bf 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -16,7 +16,7 @@
16#define MAXMEM_PFN PFN_DOWN(MAXMEM) 16#define MAXMEM_PFN PFN_DOWN(MAXMEM)
17#define MAX_NONPAE_PFN (1 << 20) 17#define MAX_NONPAE_PFN (1 << 20)
18 18
19#define PARAM_SIZE 2048 19#define PARAM_SIZE 4096
20#define COMMAND_LINE_SIZE 256 20#define COMMAND_LINE_SIZE 256
21 21
22#define OLD_CL_MAGIC_ADDR 0x90020 22#define OLD_CL_MAGIC_ADDR 0x90020
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index 7ef343b6812d..cbb47d34aa31 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -110,34 +110,7 @@ typedef unsigned long sigset_t;
110#define MINSIGSTKSZ 2048 110#define MINSIGSTKSZ 2048
111#define SIGSTKSZ 8192 111#define SIGSTKSZ 8192
112 112
113#ifdef __KERNEL__ 113#include <asm-generic/signal.h>
114
115/*
116 * These values of sa_flags are used only by the kernel as part of the
117 * irq handling routines.
118 *
119 * SA_INTERRUPT is also used by the irq handling routines.
120 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
121 */
122#define SA_PROBE SA_ONESHOT
123#define SA_SAMPLE_RANDOM SA_RESTART
124#define SA_SHIRQ 0x04000000
125#endif
126
127#define SIG_BLOCK 0 /* for blocking signals */
128#define SIG_UNBLOCK 1 /* for unblocking signals */
129#define SIG_SETMASK 2 /* for setting the signal mask */
130
131/* Type of a signal handler. */
132typedef void __signalfn_t(int);
133typedef __signalfn_t __user *__sighandler_t;
134
135typedef void __restorefn_t(void);
136typedef __restorefn_t __user *__sigrestore_t;
137
138#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
139#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
140#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
141 114
142#ifdef __KERNEL__ 115#ifdef __KERNEL__
143struct old_sigaction { 116struct old_sigaction {
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 1679983d053f..6a78ac58c194 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -198,47 +198,80 @@ static inline void * __memcpy(void * to, const void * from, size_t n)
198int d0, d1, d2; 198int d0, d1, d2;
199__asm__ __volatile__( 199__asm__ __volatile__(
200 "rep ; movsl\n\t" 200 "rep ; movsl\n\t"
201 "testb $2,%b4\n\t" 201 "movl %4,%%ecx\n\t"
202 "je 1f\n\t" 202 "andl $3,%%ecx\n\t"
203 "movsw\n" 203#if 1 /* want to pay 2 byte penalty for a chance to skip microcoded rep? */
204 "1:\ttestb $1,%b4\n\t" 204 "jz 1f\n\t"
205 "je 2f\n\t" 205#endif
206 "movsb\n" 206 "rep ; movsb\n\t"
207 "2:" 207 "1:"
208 : "=&c" (d0), "=&D" (d1), "=&S" (d2) 208 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
209 :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from) 209 : "0" (n/4), "g" (n), "1" ((long) to), "2" ((long) from)
210 : "memory"); 210 : "memory");
211return (to); 211return (to);
212} 212}
213 213
214/* 214/*
215 * This looks horribly ugly, but the compiler can optimize it totally, 215 * This looks ugly, but the compiler can optimize it totally,
216 * as the count is constant. 216 * as the count is constant.
217 */ 217 */
218static inline void * __constant_memcpy(void * to, const void * from, size_t n) 218static inline void * __constant_memcpy(void * to, const void * from, size_t n)
219{ 219{
220 if (n <= 128) 220 long esi, edi;
221 return __builtin_memcpy(to, from, n); 221 if (!n) return to;
222 222#if 1 /* want to do small copies with non-string ops? */
223#define COMMON(x) \ 223 switch (n) {
224__asm__ __volatile__( \ 224 case 1: *(char*)to = *(char*)from; return to;
225 "rep ; movsl" \ 225 case 2: *(short*)to = *(short*)from; return to;
226 x \ 226 case 4: *(int*)to = *(int*)from; return to;
227 : "=&c" (d0), "=&D" (d1), "=&S" (d2) \ 227#if 1 /* including those doable with two moves? */
228 : "0" (n/4),"1" ((long) to),"2" ((long) from) \ 228 case 3: *(short*)to = *(short*)from;
229 : "memory"); 229 *((char*)to+2) = *((char*)from+2); return to;
230{ 230 case 5: *(int*)to = *(int*)from;
231 int d0, d1, d2; 231 *((char*)to+4) = *((char*)from+4); return to;
232 case 6: *(int*)to = *(int*)from;
233 *((short*)to+2) = *((short*)from+2); return to;
234 case 8: *(int*)to = *(int*)from;
235 *((int*)to+1) = *((int*)from+1); return to;
236#endif
237 }
238#endif
239 esi = (long) from;
240 edi = (long) to;
241 if (n >= 5*4) {
242 /* large block: use rep prefix */
243 int ecx;
244 __asm__ __volatile__(
245 "rep ; movsl"
246 : "=&c" (ecx), "=&D" (edi), "=&S" (esi)
247 : "0" (n/4), "1" (edi),"2" (esi)
248 : "memory"
249 );
250 } else {
251 /* small block: don't clobber ecx + smaller code */
252 if (n >= 4*4) __asm__ __volatile__("movsl"
253 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
254 if (n >= 3*4) __asm__ __volatile__("movsl"
255 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
256 if (n >= 2*4) __asm__ __volatile__("movsl"
257 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
258 if (n >= 1*4) __asm__ __volatile__("movsl"
259 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
260 }
232 switch (n % 4) { 261 switch (n % 4) {
233 case 0: COMMON(""); return to; 262 /* tail */
234 case 1: COMMON("\n\tmovsb"); return to; 263 case 0: return to;
235 case 2: COMMON("\n\tmovsw"); return to; 264 case 1: __asm__ __volatile__("movsb"
236 default: COMMON("\n\tmovsw\n\tmovsb"); return to; 265 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
266 return to;
267 case 2: __asm__ __volatile__("movsw"
268 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
269 return to;
270 default: __asm__ __volatile__("movsw\n\tmovsb"
271 :"=&D"(edi),"=&S"(esi):"0"(edi),"1"(esi):"memory");
272 return to;
237 } 273 }
238} 274}
239
240#undef COMMON
241}
242 275
243#define __HAVE_ARCH_MEMCPY 276#define __HAVE_ARCH_MEMCPY
244 277
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 6f74d4c44a0e..3db717a244f0 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -81,7 +81,7 @@ static inline unsigned long _get_base(char * addr)
81#define loadsegment(seg,value) \ 81#define loadsegment(seg,value) \
82 asm volatile("\n" \ 82 asm volatile("\n" \
83 "1:\t" \ 83 "1:\t" \
84 "movl %0,%%" #seg "\n" \ 84 "mov %0,%%" #seg "\n" \
85 "2:\n" \ 85 "2:\n" \
86 ".section .fixup,\"ax\"\n" \ 86 ".section .fixup,\"ax\"\n" \
87 "3:\t" \ 87 "3:\t" \
@@ -93,13 +93,13 @@ static inline unsigned long _get_base(char * addr)
93 ".align 4\n\t" \ 93 ".align 4\n\t" \
94 ".long 1b,3b\n" \ 94 ".long 1b,3b\n" \
95 ".previous" \ 95 ".previous" \
96 : :"m" (*(unsigned int *)&(value))) 96 : :"m" (value))
97 97
98/* 98/*
99 * Save a segment register away 99 * Save a segment register away
100 */ 100 */
101#define savesegment(seg, value) \ 101#define savesegment(seg, value) \
102 asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value))) 102 asm volatile("mov %%" #seg ",%0":"=m" (value))
103 103
104/* 104/*
105 * Clear and set 'TS' bit respectively 105 * Clear and set 'TS' bit respectively
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
index 925d54cee475..7232528e2d0c 100644
--- a/include/asm-ia64/bitops.h
+++ b/include/asm-ia64/bitops.h
@@ -314,8 +314,8 @@ __ffs (unsigned long x)
314#ifdef __KERNEL__ 314#ifdef __KERNEL__
315 315
316/* 316/*
317 * find_last_zero_bit - find the last zero bit in a 64 bit quantity 317 * Return bit number of last (most-significant) bit set. Undefined
318 * @x: The value to search 318 * for x==0. Bits are numbered from 0..63 (e.g., ia64_fls(9) == 3).
319 */ 319 */
320static inline unsigned long 320static inline unsigned long
321ia64_fls (unsigned long x) 321ia64_fls (unsigned long x)
@@ -327,10 +327,23 @@ ia64_fls (unsigned long x)
327 return exp - 0xffff; 327 return exp - 0xffff;
328} 328}
329 329
330/*
331 * Find the last (most significant) bit set. Returns 0 for x==0 and
332 * bits are numbered from 1..32 (e.g., fls(9) == 4).
333 */
330static inline int 334static inline int
331fls (int x) 335fls (int t)
332{ 336{
333 return ia64_fls((unsigned int) x); 337 unsigned long x = t & 0xffffffffu;
338
339 if (!x)
340 return 0;
341 x |= x >> 1;
342 x |= x >> 2;
343 x |= x >> 4;
344 x |= x >> 8;
345 x |= x >> 16;
346 return ia64_popcnt(x);
334} 347}
335 348
336/* 349/*
diff --git a/include/asm-ia64/bug.h b/include/asm-ia64/bug.h
index 2c0cd51e8856..3aa0a0a5474b 100644
--- a/include/asm-ia64/bug.h
+++ b/include/asm-ia64/bug.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_IA64_BUG_H 1#ifndef _ASM_IA64_BUG_H
2#define _ASM_IA64_BUG_H 2#define _ASM_IA64_BUG_H
3 3
4#ifdef CONFIG_BUG
4#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) 5#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
5# define ia64_abort() __builtin_trap() 6# define ia64_abort() __builtin_trap()
6#else 7#else
@@ -8,8 +9,10 @@
8#endif 9#endif
9#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) 10#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
10 11
11/* should this BUG should be made generic? */ 12/* should this BUG be made generic? */
12#define HAVE_ARCH_BUG 13#define HAVE_ARCH_BUG
14#endif
15
13#include <asm-generic/bug.h> 16#include <asm-generic/bug.h>
14 17
15#endif 18#endif
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h
index 7c357dfbae50..4fb4e439b05c 100644
--- a/include/asm-ia64/gcc_intrin.h
+++ b/include/asm-ia64/gcc_intrin.h
@@ -133,13 +133,17 @@ register unsigned long ia64_r13 asm ("r13") __attribute_used__;
133 ia64_intri_res; \ 133 ia64_intri_res; \
134}) 134})
135 135
136#define ia64_popcnt(x) \ 136#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
137({ \ 137# define ia64_popcnt(x) __builtin_popcountl(x)
138#else
139# define ia64_popcnt(x) \
140 ({ \
138 __u64 ia64_intri_res; \ 141 __u64 ia64_intri_res; \
139 asm ("popcnt %0=%1" : "=r" (ia64_intri_res) : "r" (x)); \ 142 asm ("popcnt %0=%1" : "=r" (ia64_intri_res) : "r" (x)); \
140 \ 143 \
141 ia64_intri_res; \ 144 ia64_intri_res; \
142}) 145 })
146#endif
143 147
144#define ia64_getf_exp(x) \ 148#define ia64_getf_exp(x) \
145({ \ 149({ \
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index 041ab8c51a64..cd4e06b74ab6 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -81,6 +81,7 @@ extern __u8 isa_irq_to_vector_map[16];
81 81
82extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ 82extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
83 83
84extern int assign_irq_vector_nopanic (int irq); /* allocate a free vector without panic */
84extern int assign_irq_vector (int irq); /* allocate a free vector */ 85extern int assign_irq_vector (int irq); /* allocate a free vector */
85extern void free_irq_vector (int vector); 86extern void free_irq_vector (int vector);
86extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 87extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 5dd477ffb88e..2303a10ee595 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -67,6 +67,7 @@
67#define PAL_REGISTER_INFO 39 /* return AR and CR register information*/ 67#define PAL_REGISTER_INFO 39 /* return AR and CR register information*/
68#define PAL_SHUTDOWN 40 /* enter processor shutdown state */ 68#define PAL_SHUTDOWN 40 /* enter processor shutdown state */
69#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ 69#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */
70#define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */
70 71
71#define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ 72#define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */
72#define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ 73#define PAL_HALT_INFO 257 /* return the low power capabilities of processor */
@@ -1559,6 +1560,73 @@ ia64_pal_prefetch_visibility (s64 trans_type)
1559 return iprv.status; 1560 return iprv.status;
1560} 1561}
1561 1562
1563/* data structure for getting information on logical to physical mappings */
1564typedef union pal_log_overview_u {
1565 struct {
1566 u64 num_log :16, /* Total number of logical
1567 * processors on this die
1568 */
1569 tpc :8, /* Threads per core */
1570 reserved3 :8, /* Reserved */
1571 cpp :8, /* Cores per processor */
1572 reserved2 :8, /* Reserved */
1573 ppid :8, /* Physical processor ID */
1574 reserved1 :8; /* Reserved */
1575 } overview_bits;
1576 u64 overview_data;
1577} pal_log_overview_t;
1578
1579typedef union pal_proc_n_log_info1_u{
1580 struct {
1581 u64 tid :16, /* Thread id */
1582 reserved2 :16, /* Reserved */
1583 cid :16, /* Core id */
1584 reserved1 :16; /* Reserved */
1585 } ppli1_bits;
1586 u64 ppli1_data;
1587} pal_proc_n_log_info1_t;
1588
1589typedef union pal_proc_n_log_info2_u {
1590 struct {
1591 u64 la :16, /* Logical address */
1592 reserved :48; /* Reserved */
1593 } ppli2_bits;
1594 u64 ppli2_data;
1595} pal_proc_n_log_info2_t;
1596
1597typedef struct pal_logical_to_physical_s
1598{
1599 pal_log_overview_t overview;
1600 pal_proc_n_log_info1_t ppli1;
1601 pal_proc_n_log_info2_t ppli2;
1602} pal_logical_to_physical_t;
1603
1604#define overview_num_log overview.overview_bits.num_log
1605#define overview_tpc overview.overview_bits.tpc
1606#define overview_cpp overview.overview_bits.cpp
1607#define overview_ppid overview.overview_bits.ppid
1608#define log1_tid ppli1.ppli1_bits.tid
1609#define log1_cid ppli1.ppli1_bits.cid
1610#define log2_la ppli2.ppli2_bits.la
1611
1612/* Get information on logical to physical processor mappings. */
1613static inline s64
1614ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
1615{
1616 struct ia64_pal_retval iprv;
1617
1618 PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0);
1619
1620 if (iprv.status == PAL_STATUS_SUCCESS)
1621 {
1622 if (proc_number == 0)
1623 mapping->overview.overview_data = iprv.v0;
1624 mapping->ppli1.ppli1_data = iprv.v1;
1625 mapping->ppli2.ppli2_data = iprv.v2;
1626 }
1627
1628 return iprv.status;
1629}
1562#endif /* __ASSEMBLY__ */ 1630#endif /* __ASSEMBLY__ */
1563 1631
1564#endif /* _ASM_IA64_PAL_H */ 1632#endif /* _ASM_IA64_PAL_H */
diff --git a/include/asm-ia64/perfmon.h b/include/asm-ia64/perfmon.h
index 136c60e6bfcc..ed5416c5b1ac 100644
--- a/include/asm-ia64/perfmon.h
+++ b/include/asm-ia64/perfmon.h
@@ -254,6 +254,18 @@ extern int pfm_mod_write_dbrs(struct task_struct *task, void *req, unsigned int
254#define PFM_CPUINFO_DCR_PP 0x2 /* if set the system wide session has started */ 254#define PFM_CPUINFO_DCR_PP 0x2 /* if set the system wide session has started */
255#define PFM_CPUINFO_EXCL_IDLE 0x4 /* the system wide session excludes the idle task */ 255#define PFM_CPUINFO_EXCL_IDLE 0x4 /* the system wide session excludes the idle task */
256 256
257/*
258 * sysctl control structure. visible to sampling formats
259 */
260typedef struct {
261 int debug; /* turn on/off debugging via syslog */
262 int debug_ovfl; /* turn on/off debug printk in overflow handler */
263 int fastctxsw; /* turn on/off fast (unsecure) ctxsw */
264 int expert_mode; /* turn on/off value checking */
265} pfm_sysctl_t;
266extern pfm_sysctl_t pfm_sysctl;
267
268
257#endif /* __KERNEL__ */ 269#endif /* __KERNEL__ */
258 270
259#endif /* _ASM_IA64_PERFMON_H */ 271#endif /* _ASM_IA64_PERFMON_H */
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index 0f05dc8bd460..a5f214554afd 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -22,146 +22,124 @@
22 22
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24 24
25/* 25DECLARE_PER_CPU(unsigned long *, __pgtable_quicklist);
26 * Very stupidly, we used to get new pgd's and pmd's, init their contents 26#define pgtable_quicklist __ia64_per_cpu_var(__pgtable_quicklist)
27 * to point to the NULL versions of the next level page table, later on 27DECLARE_PER_CPU(long, __pgtable_quicklist_size);
28 * completely re-init them the same way, then free them up. This wasted 28#define pgtable_quicklist_size __ia64_per_cpu_var(__pgtable_quicklist_size)
29 * a lot of work and caused unnecessary memory traffic. How broken...
30 * We fix this by caching them.
31 */
32#define pgd_quicklist (local_cpu_data->pgd_quick)
33#define pmd_quicklist (local_cpu_data->pmd_quick)
34#define pgtable_cache_size (local_cpu_data->pgtable_cache_sz)
35 29
36static inline pgd_t* 30static inline long pgtable_quicklist_total_size(void)
37pgd_alloc_one_fast (struct mm_struct *mm) 31{
32 long ql_size = 0;
33 int cpuid;
34
35 for_each_online_cpu(cpuid) {
36 ql_size += per_cpu(__pgtable_quicklist_size, cpuid);
37 }
38 return ql_size;
39}
40
41static inline void *pgtable_quicklist_alloc(void)
38{ 42{
39 unsigned long *ret = NULL; 43 unsigned long *ret = NULL;
40 44
41 preempt_disable(); 45 preempt_disable();
42 46
43 ret = pgd_quicklist; 47 ret = pgtable_quicklist;
44 if (likely(ret != NULL)) { 48 if (likely(ret != NULL)) {
45 pgd_quicklist = (unsigned long *)(*ret); 49 pgtable_quicklist = (unsigned long *)(*ret);
46 ret[0] = 0; 50 ret[0] = 0;
47 --pgtable_cache_size; 51 --pgtable_quicklist_size;
48 } else 52 preempt_enable();
49 ret = NULL; 53 } else {
50 54 preempt_enable();
51 preempt_enable(); 55 ret = (unsigned long *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
56 }
52 57
53 return (pgd_t *) ret; 58 return ret;
54} 59}
55 60
56static inline pgd_t* 61static inline void pgtable_quicklist_free(void *pgtable_entry)
57pgd_alloc (struct mm_struct *mm)
58{ 62{
59 /* the VM system never calls pgd_alloc_one_fast(), so we do it here. */ 63#ifdef CONFIG_NUMA
60 pgd_t *pgd = pgd_alloc_one_fast(mm); 64 unsigned long nid = page_to_nid(virt_to_page(pgtable_entry));
61 65
62 if (unlikely(pgd == NULL)) { 66 if (unlikely(nid != numa_node_id())) {
63 pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); 67 free_page((unsigned long)pgtable_entry);
68 return;
64 } 69 }
65 return pgd; 70#endif
66}
67 71
68static inline void
69pgd_free (pgd_t *pgd)
70{
71 preempt_disable(); 72 preempt_disable();
72 *(unsigned long *)pgd = (unsigned long) pgd_quicklist; 73 *(unsigned long *)pgtable_entry = (unsigned long)pgtable_quicklist;
73 pgd_quicklist = (unsigned long *) pgd; 74 pgtable_quicklist = (unsigned long *)pgtable_entry;
74 ++pgtable_cache_size; 75 ++pgtable_quicklist_size;
75 preempt_enable(); 76 preempt_enable();
76} 77}
77 78
78static inline void 79static inline pgd_t *pgd_alloc(struct mm_struct *mm)
79pud_populate (struct mm_struct *mm, pud_t *pud_entry, pmd_t *pmd)
80{ 80{
81 pud_val(*pud_entry) = __pa(pmd); 81 return pgtable_quicklist_alloc();
82} 82}
83 83
84static inline pmd_t* 84static inline void pgd_free(pgd_t * pgd)
85pmd_alloc_one_fast (struct mm_struct *mm, unsigned long addr)
86{ 85{
87 unsigned long *ret = NULL; 86 pgtable_quicklist_free(pgd);
88
89 preempt_disable();
90
91 ret = (unsigned long *)pmd_quicklist;
92 if (likely(ret != NULL)) {
93 pmd_quicklist = (unsigned long *)(*ret);
94 ret[0] = 0;
95 --pgtable_cache_size;
96 }
97
98 preempt_enable();
99
100 return (pmd_t *)ret;
101} 87}
102 88
103static inline pmd_t* 89static inline void
104pmd_alloc_one (struct mm_struct *mm, unsigned long addr) 90pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
105{ 91{
106 pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); 92 pud_val(*pud_entry) = __pa(pmd);
93}
107 94
108 return pmd; 95static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
96{
97 return pgtable_quicklist_alloc();
109} 98}
110 99
111static inline void 100static inline void pmd_free(pmd_t * pmd)
112pmd_free (pmd_t *pmd)
113{ 101{
114 preempt_disable(); 102 pgtable_quicklist_free(pmd);
115 *(unsigned long *)pmd = (unsigned long) pmd_quicklist;
116 pmd_quicklist = (unsigned long *) pmd;
117 ++pgtable_cache_size;
118 preempt_enable();
119} 103}
120 104
121#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) 105#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd)
122 106
123static inline void 107static inline void
124pmd_populate (struct mm_struct *mm, pmd_t *pmd_entry, struct page *pte) 108pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte)
125{ 109{
126 pmd_val(*pmd_entry) = page_to_phys(pte); 110 pmd_val(*pmd_entry) = page_to_phys(pte);
127} 111}
128 112
129static inline void 113static inline void
130pmd_populate_kernel (struct mm_struct *mm, pmd_t *pmd_entry, pte_t *pte) 114pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
131{ 115{
132 pmd_val(*pmd_entry) = __pa(pte); 116 pmd_val(*pmd_entry) = __pa(pte);
133} 117}
134 118
135static inline struct page * 119static inline struct page *pte_alloc_one(struct mm_struct *mm,
136pte_alloc_one (struct mm_struct *mm, unsigned long addr) 120 unsigned long addr)
137{ 121{
138 struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); 122 return virt_to_page(pgtable_quicklist_alloc());
139
140 return pte;
141} 123}
142 124
143static inline pte_t * 125static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
144pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr) 126 unsigned long addr)
145{ 127{
146 pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); 128 return pgtable_quicklist_alloc();
147
148 return pte;
149} 129}
150 130
151static inline void 131static inline void pte_free(struct page *pte)
152pte_free (struct page *pte)
153{ 132{
154 __free_page(pte); 133 pgtable_quicklist_free(page_address(pte));
155} 134}
156 135
157static inline void 136static inline void pte_free_kernel(pte_t * pte)
158pte_free_kernel (pte_t *pte)
159{ 137{
160 free_page((unsigned long) pte); 138 pgtable_quicklist_free(pte);
161} 139}
162 140
163#define __pte_free_tlb(tlb, pte) tlb_remove_page((tlb), (pte)) 141#define __pte_free_tlb(tlb, pte) pte_free(pte)
164 142
165extern void check_pgt_cache (void); 143extern void check_pgt_cache(void);
166 144
167#endif /* _ASM_IA64_PGALLOC_H */ 145#endif /* _ASM_IA64_PGALLOC_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 2807f8d766d4..9e1ba8b7fb68 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -137,9 +137,6 @@ struct cpuinfo_ia64 {
137 __u64 nsec_per_cyc; /* (1000000000<<IA64_NSEC_PER_CYC_SHIFT)/itc_freq */ 137 __u64 nsec_per_cyc; /* (1000000000<<IA64_NSEC_PER_CYC_SHIFT)/itc_freq */
138 __u64 unimpl_va_mask; /* mask of unimplemented virtual address bits (from PAL) */ 138 __u64 unimpl_va_mask; /* mask of unimplemented virtual address bits (from PAL) */
139 __u64 unimpl_pa_mask; /* mask of unimplemented physical address bits (from PAL) */ 139 __u64 unimpl_pa_mask; /* mask of unimplemented physical address bits (from PAL) */
140 __u64 *pgd_quick;
141 __u64 *pmd_quick;
142 __u64 pgtable_cache_sz;
143 __u64 itc_freq; /* frequency of ITC counter */ 140 __u64 itc_freq; /* frequency of ITC counter */
144 __u64 proc_freq; /* frequency of processor */ 141 __u64 proc_freq; /* frequency of processor */
145 __u64 cyc_per_usec; /* itc_freq/1000000 */ 142 __u64 cyc_per_usec; /* itc_freq/1000000 */
@@ -151,6 +148,13 @@ struct cpuinfo_ia64 {
151#ifdef CONFIG_SMP 148#ifdef CONFIG_SMP
152 __u64 loops_per_jiffy; 149 __u64 loops_per_jiffy;
153 int cpu; 150 int cpu;
151 __u32 socket_id; /* physical processor socket id */
152 __u16 core_id; /* core id */
153 __u16 thread_id; /* thread id */
154 __u16 num_log; /* Total number of logical processors on
155 * this socket that were successfully booted */
156 __u8 cores_per_socket; /* Cores per processor socket */
157 __u8 threads_per_core; /* Threads per core */
154#endif 158#endif
155 159
156 /* CPUID-derived information: */ 160 /* CPUID-derived information: */
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index ea1ed377de4c..29df88bdd2bc 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -91,6 +91,7 @@ extern spinlock_t sal_lock;
91#define SAL_PCI_CONFIG_READ 0x01000010 91#define SAL_PCI_CONFIG_READ 0x01000010
92#define SAL_PCI_CONFIG_WRITE 0x01000011 92#define SAL_PCI_CONFIG_WRITE 0x01000011
93#define SAL_FREQ_BASE 0x01000012 93#define SAL_FREQ_BASE 0x01000012
94#define SAL_PHYSICAL_ID_INFO 0x01000013
94 95
95#define SAL_UPDATE_PAL 0x01000020 96#define SAL_UPDATE_PAL 0x01000020
96 97
@@ -815,6 +816,17 @@ ia64_sal_update_pal (u64 param_buf, u64 scratch_buf, u64 scratch_buf_size,
815 return isrv.status; 816 return isrv.status;
816} 817}
817 818
819/* Get physical processor die mapping in the platform. */
820static inline s64
821ia64_sal_physical_id_info(u16 *splid)
822{
823 struct ia64_sal_retval isrv;
824 SAL_CALL(isrv, SAL_PHYSICAL_ID_INFO, 0, 0, 0, 0, 0, 0, 0);
825 if (splid)
826 *splid = isrv.v0;
827 return isrv.status;
828}
829
818extern unsigned long sal_platform_features; 830extern unsigned long sal_platform_features;
819 831
820extern int (*salinfo_platform_oemdata)(const u8 *, u8 **, u64 *); 832extern int (*salinfo_platform_oemdata)(const u8 *, u8 **, u64 *);
@@ -832,6 +844,44 @@ extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64,
832 u64, u64, u64, u64, u64); 844 u64, u64, u64, u64, u64);
833extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64, 845extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
834 u64, u64, u64, u64, u64); 846 u64, u64, u64, u64, u64);
847#ifdef CONFIG_HOTPLUG_CPU
848/*
849 * System Abstraction Layer Specification
850 * Section 3.2.5.1: OS_BOOT_RENDEZ to SAL return State.
851 * Note: region regs are stored first in head.S _start. Hence they must
852 * stay up front.
853 */
854struct sal_to_os_boot {
855 u64 rr[8]; /* Region Registers */
856 u64 br[6]; /* br0: return addr into SAL boot rendez routine */
857 u64 gr1; /* SAL:GP */
858 u64 gr12; /* SAL:SP */
859 u64 gr13; /* SAL: Task Pointer */
860 u64 fpsr;
861 u64 pfs;
862 u64 rnat;
863 u64 unat;
864 u64 bspstore;
865 u64 dcr; /* Default Control Register */
866 u64 iva;
867 u64 pta;
868 u64 itv;
869 u64 pmv;
870 u64 cmcv;
871 u64 lrr[2];
872 u64 gr[4];
873 u64 pr; /* Predicate registers */
874 u64 lc; /* Loop Count */
875 struct ia64_fpreg fp[20];
876};
877
878/*
879 * Global array allocated for NR_CPUS at boot time
880 */
881extern struct sal_to_os_boot sal_boot_rendez_state[NR_CPUS];
882
883extern void ia64_jump_to_sal(struct sal_to_os_boot *);
884#endif
835 885
836extern void ia64_sal_handler_init(void *entry_point, void *gpval); 886extern void ia64_sal_handler_init(void *entry_point, void *gpval);
837 887
diff --git a/include/asm-ia64/siginfo.h b/include/asm-ia64/siginfo.h
index d55f139cbcdc..9294e4b0c8bc 100644
--- a/include/asm-ia64/siginfo.h
+++ b/include/asm-ia64/siginfo.h
@@ -8,9 +8,7 @@
8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co 8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
9 */ 9 */
10 10
11#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4) 11#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
12
13#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
14 12
15#define HAVE_ARCH_SIGINFO_T 13#define HAVE_ARCH_SIGINFO_T
16#define HAVE_ARCH_COPY_SIGINFO 14#define HAVE_ARCH_COPY_SIGINFO
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h
index 660a759744dd..608168d713d3 100644
--- a/include/asm-ia64/signal.h
+++ b/include/asm-ia64/signal.h
@@ -114,27 +114,11 @@
114#define _NSIG_BPW 64 114#define _NSIG_BPW 64
115#define _NSIG_WORDS (_NSIG / _NSIG_BPW) 115#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
116 116
117/*
118 * These values of sa_flags are used only by the kernel as part of the
119 * irq handling routines.
120 *
121 * SA_INTERRUPT is also used by the irq handling routines.
122 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
123 */
124#define SA_PROBE SA_ONESHOT
125#define SA_SAMPLE_RANDOM SA_RESTART
126#define SA_SHIRQ 0x04000000
127#define SA_PERCPU_IRQ 0x02000000 117#define SA_PERCPU_IRQ 0x02000000
128 118
129#endif /* __KERNEL__ */ 119#endif /* __KERNEL__ */
130 120
131#define SIG_BLOCK 0 /* for blocking signals */ 121#include <asm-generic/signal.h>
132#define SIG_UNBLOCK 1 /* for unblocking signals */
133#define SIG_SETMASK 2 /* for setting the signal mask */
134
135#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
136#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
137#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
138 122
139# ifndef __ASSEMBLY__ 123# ifndef __ASSEMBLY__
140 124
@@ -143,9 +127,6 @@
143/* Avoid too many header ordering problems. */ 127/* Avoid too many header ordering problems. */
144struct siginfo; 128struct siginfo;
145 129
146/* Type of a signal handler. */
147typedef void __user (*__sighandler_t)(int);
148
149typedef struct sigaltstack { 130typedef struct sigaltstack {
150 void __user *ss_sp; 131 void __user *ss_sp;
151 int ss_flags; 132 int ss_flags;
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index c4a227acfeb0..3ba1a061e4ae 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -56,6 +56,10 @@ extern struct smp_boot_data {
56extern char no_int_routing __devinitdata; 56extern char no_int_routing __devinitdata;
57 57
58extern cpumask_t cpu_online_map; 58extern cpumask_t cpu_online_map;
59extern cpumask_t cpu_core_map[NR_CPUS];
60extern cpumask_t cpu_sibling_map[NR_CPUS];
61extern int smp_num_siblings;
62extern int smp_num_cpucores;
59extern void __iomem *ipi_base_addr; 63extern void __iomem *ipi_base_addr;
60extern unsigned char smp_int_redirect; 64extern unsigned char smp_int_redirect;
61 65
@@ -124,6 +128,7 @@ extern int smp_call_function_single (int cpuid, void (*func) (void *info), void
124extern void smp_send_reschedule (int cpu); 128extern void smp_send_reschedule (int cpu);
125extern void lock_ipi_calllock(void); 129extern void lock_ipi_calllock(void);
126extern void unlock_ipi_calllock(void); 130extern void unlock_ipi_calllock(void);
131extern void identify_siblings (struct cpuinfo_ia64 *);
127 132
128#else 133#else
129 134
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
index c916bd22767a..1bfdfb4d7b01 100644
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -136,6 +136,7 @@
136 */ 136 */
137#define CAC_BASE (CACHED | AS_CAC_SPACE) 137#define CAC_BASE (CACHED | AS_CAC_SPACE)
138#define AMO_BASE (UNCACHED | AS_AMO_SPACE) 138#define AMO_BASE (UNCACHED | AS_AMO_SPACE)
139#define AMO_PHYS_BASE (UNCACHED_PHYS | AS_AMO_SPACE)
139#define GET_BASE (CACHED | AS_GET_SPACE) 140#define GET_BASE (CACHED | AS_GET_SPACE)
140 141
141/* 142/*
@@ -154,12 +155,20 @@
154 * the chiplet id is zero. If we implement TIO-TIO dma, we might need 155 * the chiplet id is zero. If we implement TIO-TIO dma, we might need
155 * to insert a chiplet id into this macro. However, it is our belief 156 * to insert a chiplet id into this macro. However, it is our belief
156 * right now that this chiplet id will be ICE, which is also zero. 157 * right now that this chiplet id will be ICE, which is also zero.
158 * Nasid starts on bit 40.
157 */ 159 */
158#define PHYS_TO_TIODMA(x) ( (((u64)(x) & NASID_MASK) << 2) | NODE_OFFSET(x)) 160#define PHYS_TO_TIODMA(x) ( (((u64)(NASID_GET(x))) << 40) | NODE_OFFSET(x))
159#define PHYS_TO_DMA(x) ( (((u64)(x) & NASID_MASK) >> 2) | NODE_OFFSET(x)) 161#define PHYS_TO_DMA(x) ( (((u64)(x) & NASID_MASK) >> 2) | NODE_OFFSET(x))
160 162
161 163
162/* 164/*
165 * Macros to test for address type.
166 */
167#define IS_AMO_ADDRESS(x) (((u64)(x) & (REGION_BITS | AS_MASK)) == AMO_BASE)
168#define IS_AMO_PHYS_ADDRESS(x) (((u64)(x) & (REGION_BITS | AS_MASK)) == AMO_PHYS_BASE)
169
170
171/*
163 * The following definitions pertain to the IO special address 172 * The following definitions pertain to the IO special address
164 * space. They define the location of the big and little windows 173 * space. They define the location of the big and little windows
165 * of any given node. 174 * of any given node.
@@ -168,7 +177,10 @@
168#define TIO_BWIN_SIZE_BITS 30 /* big window size: 1G */ 177#define TIO_BWIN_SIZE_BITS 30 /* big window size: 1G */
169#define NODE_SWIN_BASE(n, w) ((w == 0) ? NODE_BWIN_BASE((n), SWIN0_BIGWIN) \ 178#define NODE_SWIN_BASE(n, w) ((w == 0) ? NODE_BWIN_BASE((n), SWIN0_BIGWIN) \
170 : RAW_NODE_SWIN_BASE(n, w)) 179 : RAW_NODE_SWIN_BASE(n, w))
180#define TIO_SWIN_BASE(n, w) (TIO_IO_BASE(n) + \
181 ((u64) (w) << TIO_SWIN_SIZE_BITS))
171#define NODE_IO_BASE(n) (GLOBAL_MMR_SPACE | NASID_SPACE(n)) 182#define NODE_IO_BASE(n) (GLOBAL_MMR_SPACE | NASID_SPACE(n))
183#define TIO_IO_BASE(n) (UNCACHED | NASID_SPACE(n))
172#define BWIN_SIZE (1UL << BWIN_SIZE_BITS) 184#define BWIN_SIZE (1UL << BWIN_SIZE_BITS)
173#define NODE_BWIN_BASE0(n) (NODE_IO_BASE(n) + BWIN_SIZE) 185#define NODE_BWIN_BASE0(n) (NODE_IO_BASE(n) + BWIN_SIZE)
174#define NODE_BWIN_BASE(n, w) (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS)) 186#define NODE_BWIN_BASE(n, w) (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS))
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
index 7c349f07916a..635fdce854a8 100644
--- a/include/asm-ia64/sn/arch.h
+++ b/include/asm-ia64/sn/arch.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * SGI specific setup. 6 * SGI specific setup.
7 * 7 *
8 * Copyright (C) 1995-1997,1999,2001-2004 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 */ 10 */
11#ifndef _ASM_IA64_SN_ARCH_H 11#ifndef _ASM_IA64_SN_ARCH_H
@@ -47,6 +47,21 @@ DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
47#define MAX_COMPACT_NODES 2048 47#define MAX_COMPACT_NODES 2048
48#define CPUS_PER_NODE 4 48#define CPUS_PER_NODE 4
49 49
50
51/*
52 * Compact node ID to nasid mappings kept in the per-cpu data areas of each
53 * cpu.
54 */
55DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
56#define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
57
58
59
60extern u8 sn_partition_id;
61extern u8 sn_system_size;
62extern u8 sn_sharing_domain_size;
63extern u8 sn_region_size;
64
50extern void sn_flush_all_caches(long addr, long bytes); 65extern void sn_flush_all_caches(long addr, long bytes);
51 66
52#endif /* _ASM_IA64_SN_ARCH_H */ 67#endif /* _ASM_IA64_SN_ARCH_H */
diff --git a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h
index 0ec27f99c181..f50da3d91d07 100644
--- a/include/asm-ia64/sn/bte.h
+++ b/include/asm-ia64/sn/bte.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9 9
@@ -13,8 +13,12 @@
13#include <linux/timer.h> 13#include <linux/timer.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/cache.h> 15#include <linux/cache.h>
16#include <asm/sn/pda.h>
16#include <asm/sn/types.h> 17#include <asm/sn/types.h>
18#include <asm/sn/shub_mmr.h>
17 19
20#define IBCT_NOTIFY (0x1UL << 4)
21#define IBCT_ZFIL_MODE (0x1UL << 0)
18 22
19/* #define BTE_DEBUG */ 23/* #define BTE_DEBUG */
20/* #define BTE_DEBUG_VERBOSE */ 24/* #define BTE_DEBUG_VERBOSE */
@@ -39,8 +43,36 @@
39 43
40 44
41/* Define hardware */ 45/* Define hardware */
42#define BTES_PER_NODE 2 46#define BTES_PER_NODE (is_shub2() ? 4 : 2)
47#define MAX_BTES_PER_NODE 4
43 48
49#define BTE2OFF_CTRL (0)
50#define BTE2OFF_SRC (SH2_BT_ENG_SRC_ADDR_0 - SH2_BT_ENG_CSR_0)
51#define BTE2OFF_DEST (SH2_BT_ENG_DEST_ADDR_0 - SH2_BT_ENG_CSR_0)
52#define BTE2OFF_NOTIFY (SH2_BT_ENG_NOTIF_ADDR_0 - SH2_BT_ENG_CSR_0)
53
54#define BTE_BASE_ADDR(interface) \
55 (is_shub2() ? (interface == 0) ? SH2_BT_ENG_CSR_0 : \
56 (interface == 1) ? SH2_BT_ENG_CSR_1 : \
57 (interface == 2) ? SH2_BT_ENG_CSR_2 : \
58 SH2_BT_ENG_CSR_3 \
59 : (interface == 0) ? IIO_IBLS0 : IIO_IBLS1)
60
61#define BTE_SOURCE_ADDR(base) \
62 (is_shub2() ? base + (BTE2OFF_SRC/8) \
63 : base + (BTEOFF_SRC/8))
64
65#define BTE_DEST_ADDR(base) \
66 (is_shub2() ? base + (BTE2OFF_DEST/8) \
67 : base + (BTEOFF_DEST/8))
68
69#define BTE_CTRL_ADDR(base) \
70 (is_shub2() ? base + (BTE2OFF_CTRL/8) \
71 : base + (BTEOFF_CTRL/8))
72
73#define BTE_NOTIF_ADDR(base) \
74 (is_shub2() ? base + (BTE2OFF_NOTIFY/8) \
75 : base + (BTEOFF_NOTIFY/8))
44 76
45/* Define hardware modes */ 77/* Define hardware modes */
46#define BTE_NOTIFY (IBCT_NOTIFY) 78#define BTE_NOTIFY (IBCT_NOTIFY)
@@ -68,14 +100,18 @@
68#define BTE_LNSTAT_STORE(_bte, _x) \ 100#define BTE_LNSTAT_STORE(_bte, _x) \
69 HUB_S(_bte->bte_base_addr, (_x)) 101 HUB_S(_bte->bte_base_addr, (_x))
70#define BTE_SRC_STORE(_bte, _x) \ 102#define BTE_SRC_STORE(_bte, _x) \
71 HUB_S(_bte->bte_base_addr + (BTEOFF_SRC/8), (_x)) 103 HUB_S(_bte->bte_source_addr, (_x))
72#define BTE_DEST_STORE(_bte, _x) \ 104#define BTE_DEST_STORE(_bte, _x) \
73 HUB_S(_bte->bte_base_addr + (BTEOFF_DEST/8), (_x)) 105 HUB_S(_bte->bte_destination_addr, (_x))
74#define BTE_CTRL_STORE(_bte, _x) \ 106#define BTE_CTRL_STORE(_bte, _x) \
75 HUB_S(_bte->bte_base_addr + (BTEOFF_CTRL/8), (_x)) 107 HUB_S(_bte->bte_control_addr, (_x))
76#define BTE_NOTIF_STORE(_bte, _x) \ 108#define BTE_NOTIF_STORE(_bte, _x) \
77 HUB_S(_bte->bte_base_addr + (BTEOFF_NOTIFY/8), (_x)) 109 HUB_S(_bte->bte_notify_addr, (_x))
78 110
111#define BTE_START_TRANSFER(_bte, _len, _mode) \
112 is_shub2() ? BTE_CTRL_STORE(_bte, IBLS_BUSY | (_mode << 24) | _len) \
113 : BTE_LNSTAT_STORE(_bte, _len); \
114 BTE_CTRL_STORE(_bte, _mode)
79 115
80/* Possible results from bte_copy and bte_unaligned_copy */ 116/* Possible results from bte_copy and bte_unaligned_copy */
81/* The following error codes map into the BTE hardware codes 117/* The following error codes map into the BTE hardware codes
@@ -110,6 +146,10 @@ typedef enum {
110struct bteinfo_s { 146struct bteinfo_s {
111 volatile u64 notify ____cacheline_aligned; 147 volatile u64 notify ____cacheline_aligned;
112 u64 *bte_base_addr ____cacheline_aligned; 148 u64 *bte_base_addr ____cacheline_aligned;
149 u64 *bte_source_addr;
150 u64 *bte_destination_addr;
151 u64 *bte_control_addr;
152 u64 *bte_notify_addr;
113 spinlock_t spinlock; 153 spinlock_t spinlock;
114 cnodeid_t bte_cnode; /* cnode */ 154 cnodeid_t bte_cnode; /* cnode */
115 int bte_error_count; /* Number of errors encountered */ 155 int bte_error_count; /* Number of errors encountered */
@@ -117,6 +157,7 @@ struct bteinfo_s {
117 int cleanup_active; /* Interface is locked for cleanup */ 157 int cleanup_active; /* Interface is locked for cleanup */
118 volatile bte_result_t bh_error; /* error while processing */ 158 volatile bte_result_t bh_error; /* error while processing */
119 volatile u64 *most_rcnt_na; 159 volatile u64 *most_rcnt_na;
160 struct bteinfo_s *btes_to_try[MAX_BTES_PER_NODE];
120}; 161};
121 162
122 163
diff --git a/include/asm-ia64/sn/fetchop.h b/include/asm-ia64/sn/fetchop.h
deleted file mode 100644
index 5f4ad8f4b5d2..000000000000
--- a/include/asm-ia64/sn/fetchop.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved.
8 */
9
10#ifndef _ASM_IA64_SN_FETCHOP_H
11#define _ASM_IA64_SN_FETCHOP_H
12
13#include <linux/config.h>
14
15#define FETCHOP_BASENAME "sgi_fetchop"
16#define FETCHOP_FULLNAME "/dev/sgi_fetchop"
17
18
19
20#define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */
21
22#define FETCHOP_LOAD 0
23#define FETCHOP_INCREMENT 8
24#define FETCHOP_DECREMENT 16
25#define FETCHOP_CLEAR 24
26
27#define FETCHOP_STORE 0
28#define FETCHOP_AND 24
29#define FETCHOP_OR 32
30
31#define FETCHOP_CLEAR_CACHE 56
32
33#define FETCHOP_LOAD_OP(addr, op) ( \
34 *(volatile long *)((char*) (addr) + (op)))
35
36#define FETCHOP_STORE_OP(addr, op, x) ( \
37 *(volatile long *)((char*) (addr) + (op)) = (long) (x))
38
39#ifdef __KERNEL__
40
41/*
42 * Convert a region 6 (kaddr) address to the address of the fetchop variable
43 */
44#define FETCHOP_KADDR_TO_MSPEC_ADDR(kaddr) TO_MSPEC(kaddr)
45
46
47/*
48 * Each Atomic Memory Operation (AMO formerly known as fetchop)
49 * variable is 64 bytes long. The first 8 bytes are used. The
50 * remaining 56 bytes are unaddressable due to the operation taking
51 * that portion of the address.
52 *
53 * NOTE: The AMO_t _MUST_ be placed in either the first or second half
54 * of the cache line. The cache line _MUST NOT_ be used for anything
55 * other than additional AMO_t entries. This is because there are two
56 * addresses which reference the same physical cache line. One will
57 * be a cached entry with the memory type bits all set. This address
58 * may be loaded into processor cache. The AMO_t will be referenced
59 * uncached via the memory special memory type. If any portion of the
60 * cached cache-line is modified, when that line is flushed, it will
61 * overwrite the uncached value in physical memory and lead to
62 * inconsistency.
63 */
64typedef struct {
65 u64 variable;
66 u64 unused[7];
67} AMO_t;
68
69
70/*
71 * The following APIs are externalized to the kernel to allocate/free pages of
72 * fetchop variables.
73 * fetchop_kalloc_page - Allocate/initialize 1 fetchop page on the
74 * specified cnode.
75 * fetchop_kfree_page - Free a previously allocated fetchop page
76 */
77
78unsigned long fetchop_kalloc_page(int nid);
79void fetchop_kfree_page(unsigned long maddr);
80
81
82#endif /* __KERNEL__ */
83
84#endif /* _ASM_IA64_SN_FETCHOP_H */
85
diff --git a/include/asm-ia64/sn/geo.h b/include/asm-ia64/sn/geo.h
index f566343d25f8..84b254603b8d 100644
--- a/include/asm-ia64/sn/geo.h
+++ b/include/asm-ia64/sn/geo.h
@@ -18,32 +18,34 @@
18#define GEOID_SIZE 8 /* Would 16 be better? The size can 18#define GEOID_SIZE 8 /* Would 16 be better? The size can
19 be different on different platforms. */ 19 be different on different platforms. */
20 20
21#define MAX_SLABS 0xe /* slabs per module */ 21#define MAX_SLOTS 0xf /* slots per module */
22#define MAX_SLABS 0xf /* slabs per slot */
22 23
23typedef unsigned char geo_type_t; 24typedef unsigned char geo_type_t;
24 25
25/* Fields common to all substructures */ 26/* Fields common to all substructures */
26typedef struct geo_any_s { 27typedef struct geo_common_s {
27 moduleid_t module; /* The module (box) this h/w lives in */ 28 moduleid_t module; /* The module (box) this h/w lives in */
28 geo_type_t type; /* What type of h/w is named by this geoid_t */ 29 geo_type_t type; /* What type of h/w is named by this geoid_t */
29 slabid_t slab; /* The logical assembly within the module */ 30 slabid_t slab:4; /* slab (ASIC), 0 .. 15 within slot */
30} geo_any_t; 31 slotid_t slot:4; /* slot (Blade), 0 .. 15 within module */
32} geo_common_t;
31 33
32/* Additional fields for particular types of hardware */ 34/* Additional fields for particular types of hardware */
33typedef struct geo_node_s { 35typedef struct geo_node_s {
34 geo_any_t any; /* No additional fields needed */ 36 geo_common_t common; /* No additional fields needed */
35} geo_node_t; 37} geo_node_t;
36 38
37typedef struct geo_rtr_s { 39typedef struct geo_rtr_s {
38 geo_any_t any; /* No additional fields needed */ 40 geo_common_t common; /* No additional fields needed */
39} geo_rtr_t; 41} geo_rtr_t;
40 42
41typedef struct geo_iocntl_s { 43typedef struct geo_iocntl_s {
42 geo_any_t any; /* No additional fields needed */ 44 geo_common_t common; /* No additional fields needed */
43} geo_iocntl_t; 45} geo_iocntl_t;
44 46
45typedef struct geo_pcicard_s { 47typedef struct geo_pcicard_s {
46 geo_iocntl_t any; 48 geo_iocntl_t common;
47 char bus; /* Bus/widget number */ 49 char bus; /* Bus/widget number */
48 char slot; /* PCI slot number */ 50 char slot; /* PCI slot number */
49} geo_pcicard_t; 51} geo_pcicard_t;
@@ -62,14 +64,14 @@ typedef struct geo_mem_s {
62 64
63 65
64typedef union geoid_u { 66typedef union geoid_u {
65 geo_any_t any; 67 geo_common_t common;
66 geo_node_t node; 68 geo_node_t node;
67 geo_iocntl_t iocntl; 69 geo_iocntl_t iocntl;
68 geo_pcicard_t pcicard; 70 geo_pcicard_t pcicard;
69 geo_rtr_t rtr; 71 geo_rtr_t rtr;
70 geo_cpu_t cpu; 72 geo_cpu_t cpu;
71 geo_mem_t mem; 73 geo_mem_t mem;
72 char padsize[GEOID_SIZE]; 74 char padsize[GEOID_SIZE];
73} geoid_t; 75} geoid_t;
74 76
75 77
@@ -104,19 +106,26 @@ typedef union geoid_u {
104#define INVALID_CNODEID ((cnodeid_t)-1) 106#define INVALID_CNODEID ((cnodeid_t)-1)
105#define INVALID_PNODEID ((pnodeid_t)-1) 107#define INVALID_PNODEID ((pnodeid_t)-1)
106#define INVALID_SLAB (slabid_t)-1 108#define INVALID_SLAB (slabid_t)-1
109#define INVALID_SLOT (slotid_t)-1
107#define INVALID_MODULE ((moduleid_t)-1) 110#define INVALID_MODULE ((moduleid_t)-1)
108#define INVALID_PARTID ((partid_t)-1) 111#define INVALID_PARTID ((partid_t)-1)
109 112
110static inline slabid_t geo_slab(geoid_t g) 113static inline slabid_t geo_slab(geoid_t g)
111{ 114{
112 return (g.any.type == GEO_TYPE_INVALID) ? 115 return (g.common.type == GEO_TYPE_INVALID) ?
113 INVALID_SLAB : g.any.slab; 116 INVALID_SLAB : g.common.slab;
117}
118
119static inline slotid_t geo_slot(geoid_t g)
120{
121 return (g.common.type == GEO_TYPE_INVALID) ?
122 INVALID_SLOT : g.common.slot;
114} 123}
115 124
116static inline moduleid_t geo_module(geoid_t g) 125static inline moduleid_t geo_module(geoid_t g)
117{ 126{
118 return (g.any.type == GEO_TYPE_INVALID) ? 127 return (g.common.type == GEO_TYPE_INVALID) ?
119 INVALID_MODULE : g.any.module; 128 INVALID_MODULE : g.common.module;
120} 129}
121 130
122extern geoid_t cnodeid_get_geoid(cnodeid_t cnode); 131extern geoid_t cnodeid_get_geoid(cnodeid_t cnode);
diff --git a/include/asm-ia64/sn/l1.h b/include/asm-ia64/sn/l1.h
index d5dbd55e44b5..08050d37b662 100644
--- a/include/asm-ia64/sn/l1.h
+++ b/include/asm-ia64/sn/l1.h
@@ -29,8 +29,9 @@
29#define L1_BRICKTYPE_CHI_CG 0x76 /* v */ 29#define L1_BRICKTYPE_CHI_CG 0x76 /* v */
30#define L1_BRICKTYPE_X 0x78 /* x */ 30#define L1_BRICKTYPE_X 0x78 /* x */
31#define L1_BRICKTYPE_X2 0x79 /* y */ 31#define L1_BRICKTYPE_X2 0x79 /* y */
32#define L1_BRICKTYPE_SA 0x5e /* ^ */ /* TIO bringup brick */ 32#define L1_BRICKTYPE_SA 0x5e /* ^ */
33#define L1_BRICKTYPE_PA 0x6a /* j */ 33#define L1_BRICKTYPE_PA 0x6a /* j */
34#define L1_BRICKTYPE_IA 0x6b /* k */ 34#define L1_BRICKTYPE_IA 0x6b /* k */
35#define L1_BRICKTYPE_ATHENA 0x2b /* + */
35 36
36#endif /* _ASM_IA64_SN_L1_H */ 37#endif /* _ASM_IA64_SN_L1_H */
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
index 2fbde33656e6..7138b1eafd6b 100644
--- a/include/asm-ia64/sn/nodepda.h
+++ b/include/asm-ia64/sn/nodepda.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#ifndef _ASM_IA64_SN_NODEPDA_H 8#ifndef _ASM_IA64_SN_NODEPDA_H
9#define _ASM_IA64_SN_NODEPDA_H 9#define _ASM_IA64_SN_NODEPDA_H
@@ -13,7 +13,6 @@
13#include <asm/irq.h> 13#include <asm/irq.h>
14#include <asm/sn/arch.h> 14#include <asm/sn/arch.h>
15#include <asm/sn/intr.h> 15#include <asm/sn/intr.h>
16#include <asm/sn/pda.h>
17#include <asm/sn/bte.h> 16#include <asm/sn/bte.h>
18 17
19/* 18/*
@@ -43,7 +42,7 @@ struct nodepda_s {
43 /* 42 /*
44 * The BTEs on this node are shared by the local cpus 43 * The BTEs on this node are shared by the local cpus
45 */ 44 */
46 struct bteinfo_s bte_if[BTES_PER_NODE]; /* Virtual Interface */ 45 struct bteinfo_s bte_if[MAX_BTES_PER_NODE]; /* Virtual Interface */
47 struct timer_list bte_recovery_timer; 46 struct timer_list bte_recovery_timer;
48 spinlock_t bte_recovery_lock; 47 spinlock_t bte_recovery_lock;
49 48
@@ -67,20 +66,18 @@ typedef struct nodepda_s nodepda_t;
67 * The next set of definitions provides this. 66 * The next set of definitions provides this.
68 * Routines are expected to use 67 * Routines are expected to use
69 * 68 *
70 * nodepda -> to access node PDA for the node on which code is running 69 * sn_nodepda - to access node PDA for the node on which code is running
71 * subnodepda -> to access subnode PDA for the subnode on which code is running 70 * NODEPDA(cnodeid) - to access node PDA for cnodeid
72 *
73 * NODEPDA(cnode) -> to access node PDA for cnodeid
74 * SUBNODEPDA(cnode,sn) -> to access subnode PDA for cnodeid/subnode
75 */ 71 */
76 72
77#define nodepda pda->p_nodepda /* Ptr to this node's PDA */ 73DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda);
78#define NODEPDA(cnode) (nodepda->pernode_pdaindr[cnode]) 74#define sn_nodepda (__get_cpu_var(__sn_nodepda))
75#define NODEPDA(cnodeid) (sn_nodepda->pernode_pdaindr[cnodeid])
79 76
80/* 77/*
81 * Check if given a compact node id the corresponding node has all the 78 * Check if given a compact node id the corresponding node has all the
82 * cpus disabled. 79 * cpus disabled.
83 */ 80 */
84#define is_headless_node(cnode) (nr_cpus_node(cnode) == 0) 81#define is_headless_node(cnodeid) (nr_cpus_node(cnodeid) == 0)
85 82
86#endif /* _ASM_IA64_SN_NODEPDA_H */ 83#endif /* _ASM_IA64_SN_NODEPDA_H */
diff --git a/include/asm-ia64/sn/pcibus_provider_defs.h b/include/asm-ia64/sn/pcibus_provider_defs.h
new file mode 100644
index 000000000000..04e27d5b3820
--- /dev/null
+++ b/include/asm-ia64/sn/pcibus_provider_defs.h
@@ -0,0 +1,52 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
9#define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
10
11/*
12 * SN pci asic types. Do not ever renumber these or reuse values. The
13 * values must agree with what prom thinks they are.
14 */
15
16#define PCIIO_ASIC_TYPE_UNKNOWN 0
17#define PCIIO_ASIC_TYPE_PPB 1
18#define PCIIO_ASIC_TYPE_PIC 2
19#define PCIIO_ASIC_TYPE_TIOCP 3
20#define PCIIO_ASIC_TYPE_TIOCA 4
21
22#define PCIIO_ASIC_MAX_TYPES 5
23
24/*
25 * Common pciio bus provider data. There should be one of these as the
26 * first field in any pciio based provider soft structure (e.g. pcibr_soft
27 * tioca_soft, etc).
28 */
29
30struct pcibus_bussoft {
31 uint32_t bs_asic_type; /* chipset type */
32 uint32_t bs_xid; /* xwidget id */
33 uint64_t bs_persist_busnum; /* Persistent Bus Number */
34 uint64_t bs_legacy_io; /* legacy io pio addr */
35 uint64_t bs_legacy_mem; /* legacy mem pio addr */
36 uint64_t bs_base; /* widget base */
37 struct xwidget_info *bs_xwidget_info;
38};
39
40/*
41 * SN pci bus indirection
42 */
43
44struct sn_pcibus_provider {
45 dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t);
46 dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t);
47 void (*dma_unmap)(struct pci_dev *, dma_addr_t, int);
48 void * (*bus_fixup)(struct pcibus_bussoft *);
49};
50
51extern struct sn_pcibus_provider *sn_pci_provider[];
52#endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h
new file mode 100644
index 000000000000..ed4031d80811
--- /dev/null
+++ b/include/asm-ia64/sn/pcidev.h
@@ -0,0 +1,58 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_PCIDEV_H
9#define _ASM_IA64_SN_PCI_PCIDEV_H
10
11#include <linux/pci.h>
12
13extern struct sn_irq_info **sn_irq;
14
15#define SN_PCIDEV_INFO(pci_dev) \
16 ((struct pcidev_info *)(pci_dev)->sysdata)
17
18/*
19 * Given a pci_bus, return the sn pcibus_bussoft struct. Note that
20 * this only works for root busses, not for busses represented by PPB's.
21 */
22
23#define SN_PCIBUS_BUSSOFT(pci_bus) \
24 ((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
25
26/*
27 * Given a struct pci_dev, return the sn pcibus_bussoft struct. Note
28 * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due
29 * due to possible PPB's in the path.
30 */
31
32#define SN_PCIDEV_BUSSOFT(pci_dev) \
33 (SN_PCIDEV_INFO(pci_dev)->pdi_host_pcidev_info->pdi_pcibus_info)
34
35#define SN_PCIDEV_BUSPROVIDER(pci_dev) \
36 (SN_PCIDEV_INFO(pci_dev)->pdi_provider)
37
38#define PCIIO_BUS_NONE 255 /* bus 255 reserved */
39#define PCIIO_SLOT_NONE 255
40#define PCIIO_FUNC_NONE 255
41#define PCIIO_VENDOR_ID_NONE (-1)
42
43struct pcidev_info {
44 uint64_t pdi_pio_mapped_addr[7]; /* 6 BARs PLUS 1 ROM */
45 uint64_t pdi_slot_host_handle; /* Bus and devfn Host pci_dev */
46
47 struct pcibus_bussoft *pdi_pcibus_info; /* Kernel common bus soft */
48 struct pcidev_info *pdi_host_pcidev_info; /* Kernel Host pci_dev */
49 struct pci_dev *pdi_linux_pcidev; /* Kernel pci_dev */
50
51 struct sn_irq_info *pdi_sn_irq_info;
52 struct sn_pcibus_provider *pdi_provider; /* sn pci ops */
53};
54
55extern void sn_irq_fixup(struct pci_dev *pci_dev,
56 struct sn_irq_info *sn_irq_info);
57
58#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */
diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h
index e940d3647c80..ea5590c76ca4 100644
--- a/include/asm-ia64/sn/pda.h
+++ b/include/asm-ia64/sn/pda.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#ifndef _ASM_IA64_SN_PDA_H 8#ifndef _ASM_IA64_SN_PDA_H
9#define _ASM_IA64_SN_PDA_H 9#define _ASM_IA64_SN_PDA_H
@@ -11,7 +11,6 @@
11#include <linux/cache.h> 11#include <linux/cache.h>
12#include <asm/percpu.h> 12#include <asm/percpu.h>
13#include <asm/system.h> 13#include <asm/system.h>
14#include <asm/sn/bte.h>
15 14
16 15
17/* 16/*
@@ -25,14 +24,6 @@
25 24
26typedef struct pda_s { 25typedef struct pda_s {
27 26
28 /* Having a pointer in the begining of PDA tends to increase
29 * the chance of having this pointer in cache. (Yes something
30 * else gets pushed out). Doing this reduces the number of memory
31 * access to all nodepda variables to be one
32 */
33 struct nodepda_s *p_nodepda; /* Pointer to Per node PDA */
34 struct subnodepda_s *p_subnodepda; /* Pointer to CPU subnode PDA */
35
36 /* 27 /*
37 * Support for SN LEDs 28 * Support for SN LEDs
38 */ 29 */
@@ -50,7 +41,6 @@ typedef struct pda_s {
50 41
51 unsigned long sn_soft_irr[4]; 42 unsigned long sn_soft_irr[4];
52 unsigned long sn_in_service_ivecs[4]; 43 unsigned long sn_in_service_ivecs[4];
53 short cnodeid_to_nasid_table[MAX_NUMNODES];
54 int sn_lb_int_war_ticks; 44 int sn_lb_int_war_ticks;
55 int sn_last_irq; 45 int sn_last_irq;
56 int sn_first_irq; 46 int sn_first_irq;
diff --git a/include/asm-ia64/sn/shub_mmr.h b/include/asm-ia64/sn/shub_mmr.h
index 5c2fcf13d5ce..323fa0cd8d83 100644
--- a/include/asm-ia64/sn/shub_mmr.h
+++ b/include/asm-ia64/sn/shub_mmr.h
@@ -4,7 +4,7 @@
4 * License. See the file "COPYING" in the main directory of this archive 4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 5 * for more details.
6 * 6 *
7 * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. 7 * Copyright (c) 2001-2005 Silicon Graphics, Inc. All rights reserved.
8 */ 8 */
9 9
10#ifndef _ASM_IA64_SN_SHUB_MMR_H 10#ifndef _ASM_IA64_SN_SHUB_MMR_H
@@ -129,6 +129,23 @@
129#define SH_EVENT_OCCURRED_II_INT1_SHFT 30 129#define SH_EVENT_OCCURRED_II_INT1_SHFT 30
130#define SH_EVENT_OCCURRED_II_INT1_MASK 0x0000000040000000 130#define SH_EVENT_OCCURRED_II_INT1_MASK 0x0000000040000000
131 131
132/* SH2_EVENT_OCCURRED_EXTIO_INT2 */
133/* Description: Pending SHUB 2 EXT IO INT2 */
134#define SH2_EVENT_OCCURRED_EXTIO_INT2_SHFT 33
135#define SH2_EVENT_OCCURRED_EXTIO_INT2_MASK 0x0000000200000000
136
137/* SH2_EVENT_OCCURRED_EXTIO_INT3 */
138/* Description: Pending SHUB 2 EXT IO INT3 */
139#define SH2_EVENT_OCCURRED_EXTIO_INT3_SHFT 34
140#define SH2_EVENT_OCCURRED_EXTIO_INT3_MASK 0x0000000400000000
141
142#define SH_ALL_INT_MASK \
143 (SH_EVENT_OCCURRED_UART_INT_MASK | SH_EVENT_OCCURRED_IPI_INT_MASK | \
144 SH_EVENT_OCCURRED_II_INT0_MASK | SH_EVENT_OCCURRED_II_INT1_MASK | \
145 SH_EVENT_OCCURRED_II_INT1_MASK | SH2_EVENT_OCCURRED_EXTIO_INT2_MASK | \
146 SH2_EVENT_OCCURRED_EXTIO_INT3_MASK)
147
148
132/* ==================================================================== */ 149/* ==================================================================== */
133/* LEDS */ 150/* LEDS */
134/* ==================================================================== */ 151/* ==================================================================== */
@@ -368,6 +385,17 @@
368#define SH_EVENT_OCCURRED_RTC3_INT_MASK 0x0000000004000000 385#define SH_EVENT_OCCURRED_RTC3_INT_MASK 0x0000000004000000
369 386
370/* ==================================================================== */ 387/* ==================================================================== */
388/* Register "SH_IPI_ACCESS" */
389/* CPU interrupt Access Permission Bits */
390/* ==================================================================== */
391
392#define SH1_IPI_ACCESS 0x0000000110060480
393#define SH2_IPI_ACCESS0 0x0000000010060c00
394#define SH2_IPI_ACCESS1 0x0000000010060c80
395#define SH2_IPI_ACCESS2 0x0000000010060d00
396#define SH2_IPI_ACCESS3 0x0000000010060d80
397
398/* ==================================================================== */
371/* Register "SH_INT_CMPB" */ 399/* Register "SH_INT_CMPB" */
372/* RTC Compare Value for Processor B */ 400/* RTC Compare Value for Processor B */
373/* ==================================================================== */ 401/* ==================================================================== */
@@ -412,6 +440,19 @@
412#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT 0 440#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT 0
413#define SH_INT_CMPD_REAL_TIME_CMPD_MASK 0x007fffffffffffff 441#define SH_INT_CMPD_REAL_TIME_CMPD_MASK 0x007fffffffffffff
414 442
443/* ==================================================================== */
444/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC0" */
445/* privilege vector for acc=0 */
446/* ==================================================================== */
447
448#define SH1_MD_DQLP_MMR_DIR_PRIVEC0 0x0000000100030300
449
450/* ==================================================================== */
451/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC0" */
452/* privilege vector for acc=0 */
453/* ==================================================================== */
454
455#define SH1_MD_DQRP_MMR_DIR_PRIVEC0 0x0000000100050300
415 456
416/* ==================================================================== */ 457/* ==================================================================== */
417/* Some MMRs are functionally identical (or close enough) on both SHUB1 */ 458/* Some MMRs are functionally identical (or close enough) on both SHUB1 */
@@ -438,4 +479,22 @@
438#define SH_INT_CMPC shubmmr(SH, INT_CMPC) 479#define SH_INT_CMPC shubmmr(SH, INT_CMPC)
439#define SH_INT_CMPD shubmmr(SH, INT_CMPD) 480#define SH_INT_CMPD shubmmr(SH, INT_CMPD)
440 481
482/* ========================================================================== */
483/* Register "SH2_BT_ENG_CSR_0" */
484/* Engine 0 Control and Status Register */
485/* ========================================================================== */
486
487#define SH2_BT_ENG_CSR_0 0x0000000030040000
488#define SH2_BT_ENG_SRC_ADDR_0 0x0000000030040080
489#define SH2_BT_ENG_DEST_ADDR_0 0x0000000030040100
490#define SH2_BT_ENG_NOTIF_ADDR_0 0x0000000030040180
491
492/* ========================================================================== */
493/* BTE interfaces 1-3 */
494/* ========================================================================== */
495
496#define SH2_BT_ENG_CSR_1 0x0000000030050000
497#define SH2_BT_ENG_CSR_2 0x0000000030060000
498#define SH2_BT_ENG_CSR_3 0x0000000030070000
499
441#endif /* _ASM_IA64_SN_SHUB_MMR_H */ 500#endif /* _ASM_IA64_SN_SHUB_MMR_H */
diff --git a/include/asm-ia64/sn/shubio.h b/include/asm-ia64/sn/shubio.h
index fbd880e6bb96..831b72111fdc 100644
--- a/include/asm-ia64/sn/shubio.h
+++ b/include/asm-ia64/sn/shubio.h
@@ -3,292 +3,287 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#ifndef _ASM_IA64_SN_SHUBIO_H 9#ifndef _ASM_IA64_SN_SHUBIO_H
10#define _ASM_IA64_SN_SHUBIO_H 10#define _ASM_IA64_SN_SHUBIO_H
11 11
12#define HUB_WIDGET_ID_MAX 0xf 12#define HUB_WIDGET_ID_MAX 0xf
13#define IIO_NUM_ITTES 7 13#define IIO_NUM_ITTES 7
14#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1) 14#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1)
15 15
16#define IIO_WID 0x00400000 /* Crosstalk Widget Identification */ 16#define IIO_WID 0x00400000 /* Crosstalk Widget Identification */
17 /* This register is also accessible from 17 /* This register is also accessible from
18 * Crosstalk at address 0x0. */ 18 * Crosstalk at address 0x0. */
19#define IIO_WSTAT 0x00400008 /* Crosstalk Widget Status */ 19#define IIO_WSTAT 0x00400008 /* Crosstalk Widget Status */
20#define IIO_WCR 0x00400020 /* Crosstalk Widget Control Register */ 20#define IIO_WCR 0x00400020 /* Crosstalk Widget Control Register */
21#define IIO_ILAPR 0x00400100 /* IO Local Access Protection Register */ 21#define IIO_ILAPR 0x00400100 /* IO Local Access Protection Register */
22#define IIO_ILAPO 0x00400108 /* IO Local Access Protection Override */ 22#define IIO_ILAPO 0x00400108 /* IO Local Access Protection Override */
23#define IIO_IOWA 0x00400110 /* IO Outbound Widget Access */ 23#define IIO_IOWA 0x00400110 /* IO Outbound Widget Access */
24#define IIO_IIWA 0x00400118 /* IO Inbound Widget Access */ 24#define IIO_IIWA 0x00400118 /* IO Inbound Widget Access */
25#define IIO_IIDEM 0x00400120 /* IO Inbound Device Error Mask */ 25#define IIO_IIDEM 0x00400120 /* IO Inbound Device Error Mask */
26#define IIO_ILCSR 0x00400128 /* IO LLP Control and Status Register */ 26#define IIO_ILCSR 0x00400128 /* IO LLP Control and Status Register */
27#define IIO_ILLR 0x00400130 /* IO LLP Log Register */ 27#define IIO_ILLR 0x00400130 /* IO LLP Log Register */
28#define IIO_IIDSR 0x00400138 /* IO Interrupt Destination */ 28#define IIO_IIDSR 0x00400138 /* IO Interrupt Destination */
29 29
30#define IIO_IGFX0 0x00400140 /* IO Graphics Node-Widget Map 0 */ 30#define IIO_IGFX0 0x00400140 /* IO Graphics Node-Widget Map 0 */
31#define IIO_IGFX1 0x00400148 /* IO Graphics Node-Widget Map 1 */ 31#define IIO_IGFX1 0x00400148 /* IO Graphics Node-Widget Map 1 */
32 32
33#define IIO_ISCR0 0x00400150 /* IO Scratch Register 0 */ 33#define IIO_ISCR0 0x00400150 /* IO Scratch Register 0 */
34#define IIO_ISCR1 0x00400158 /* IO Scratch Register 1 */ 34#define IIO_ISCR1 0x00400158 /* IO Scratch Register 1 */
35 35
36#define IIO_ITTE1 0x00400160 /* IO Translation Table Entry 1 */ 36#define IIO_ITTE1 0x00400160 /* IO Translation Table Entry 1 */
37#define IIO_ITTE2 0x00400168 /* IO Translation Table Entry 2 */ 37#define IIO_ITTE2 0x00400168 /* IO Translation Table Entry 2 */
38#define IIO_ITTE3 0x00400170 /* IO Translation Table Entry 3 */ 38#define IIO_ITTE3 0x00400170 /* IO Translation Table Entry 3 */
39#define IIO_ITTE4 0x00400178 /* IO Translation Table Entry 4 */ 39#define IIO_ITTE4 0x00400178 /* IO Translation Table Entry 4 */
40#define IIO_ITTE5 0x00400180 /* IO Translation Table Entry 5 */ 40#define IIO_ITTE5 0x00400180 /* IO Translation Table Entry 5 */
41#define IIO_ITTE6 0x00400188 /* IO Translation Table Entry 6 */ 41#define IIO_ITTE6 0x00400188 /* IO Translation Table Entry 6 */
42#define IIO_ITTE7 0x00400190 /* IO Translation Table Entry 7 */ 42#define IIO_ITTE7 0x00400190 /* IO Translation Table Entry 7 */
43 43
44#define IIO_IPRB0 0x00400198 /* IO PRB Entry 0 */ 44#define IIO_IPRB0 0x00400198 /* IO PRB Entry 0 */
45#define IIO_IPRB8 0x004001A0 /* IO PRB Entry 8 */ 45#define IIO_IPRB8 0x004001A0 /* IO PRB Entry 8 */
46#define IIO_IPRB9 0x004001A8 /* IO PRB Entry 9 */ 46#define IIO_IPRB9 0x004001A8 /* IO PRB Entry 9 */
47#define IIO_IPRBA 0x004001B0 /* IO PRB Entry A */ 47#define IIO_IPRBA 0x004001B0 /* IO PRB Entry A */
48#define IIO_IPRBB 0x004001B8 /* IO PRB Entry B */ 48#define IIO_IPRBB 0x004001B8 /* IO PRB Entry B */
49#define IIO_IPRBC 0x004001C0 /* IO PRB Entry C */ 49#define IIO_IPRBC 0x004001C0 /* IO PRB Entry C */
50#define IIO_IPRBD 0x004001C8 /* IO PRB Entry D */ 50#define IIO_IPRBD 0x004001C8 /* IO PRB Entry D */
51#define IIO_IPRBE 0x004001D0 /* IO PRB Entry E */ 51#define IIO_IPRBE 0x004001D0 /* IO PRB Entry E */
52#define IIO_IPRBF 0x004001D8 /* IO PRB Entry F */ 52#define IIO_IPRBF 0x004001D8 /* IO PRB Entry F */
53 53
54#define IIO_IXCC 0x004001E0 /* IO Crosstalk Credit Count Timeout */ 54#define IIO_IXCC 0x004001E0 /* IO Crosstalk Credit Count Timeout */
55#define IIO_IMEM 0x004001E8 /* IO Miscellaneous Error Mask */ 55#define IIO_IMEM 0x004001E8 /* IO Miscellaneous Error Mask */
56#define IIO_IXTT 0x004001F0 /* IO Crosstalk Timeout Threshold */ 56#define IIO_IXTT 0x004001F0 /* IO Crosstalk Timeout Threshold */
57#define IIO_IECLR 0x004001F8 /* IO Error Clear Register */ 57#define IIO_IECLR 0x004001F8 /* IO Error Clear Register */
58#define IIO_IBCR 0x00400200 /* IO BTE Control Register */ 58#define IIO_IBCR 0x00400200 /* IO BTE Control Register */
59 59
60#define IIO_IXSM 0x00400208 /* IO Crosstalk Spurious Message */ 60#define IIO_IXSM 0x00400208 /* IO Crosstalk Spurious Message */
61#define IIO_IXSS 0x00400210 /* IO Crosstalk Spurious Sideband */ 61#define IIO_IXSS 0x00400210 /* IO Crosstalk Spurious Sideband */
62 62
63#define IIO_ILCT 0x00400218 /* IO LLP Channel Test */ 63#define IIO_ILCT 0x00400218 /* IO LLP Channel Test */
64 64
65#define IIO_IIEPH1 0x00400220 /* IO Incoming Error Packet Header, Part 1 */ 65#define IIO_IIEPH1 0x00400220 /* IO Incoming Error Packet Header, Part 1 */
66#define IIO_IIEPH2 0x00400228 /* IO Incoming Error Packet Header, Part 2 */ 66#define IIO_IIEPH2 0x00400228 /* IO Incoming Error Packet Header, Part 2 */
67 67
68 68#define IIO_ISLAPR 0x00400230 /* IO SXB Local Access Protection Regster */
69#define IIO_ISLAPR 0x00400230 /* IO SXB Local Access Protection Regster */ 69#define IIO_ISLAPO 0x00400238 /* IO SXB Local Access Protection Override */
70#define IIO_ISLAPO 0x00400238 /* IO SXB Local Access Protection Override */ 70
71 71#define IIO_IWI 0x00400240 /* IO Wrapper Interrupt Register */
72#define IIO_IWI 0x00400240 /* IO Wrapper Interrupt Register */ 72#define IIO_IWEL 0x00400248 /* IO Wrapper Error Log Register */
73#define IIO_IWEL 0x00400248 /* IO Wrapper Error Log Register */ 73#define IIO_IWC 0x00400250 /* IO Wrapper Control Register */
74#define IIO_IWC 0x00400250 /* IO Wrapper Control Register */ 74#define IIO_IWS 0x00400258 /* IO Wrapper Status Register */
75#define IIO_IWS 0x00400258 /* IO Wrapper Status Register */ 75#define IIO_IWEIM 0x00400260 /* IO Wrapper Error Interrupt Masking Register */
76#define IIO_IWEIM 0x00400260 /* IO Wrapper Error Interrupt Masking Register */ 76
77 77#define IIO_IPCA 0x00400300 /* IO PRB Counter Adjust */
78#define IIO_IPCA 0x00400300 /* IO PRB Counter Adjust */ 78
79 79#define IIO_IPRTE0_A 0x00400308 /* IO PIO Read Address Table Entry 0, Part A */
80#define IIO_IPRTE0_A 0x00400308 /* IO PIO Read Address Table Entry 0, Part A */ 80#define IIO_IPRTE1_A 0x00400310 /* IO PIO Read Address Table Entry 1, Part A */
81#define IIO_IPRTE1_A 0x00400310 /* IO PIO Read Address Table Entry 1, Part A */ 81#define IIO_IPRTE2_A 0x00400318 /* IO PIO Read Address Table Entry 2, Part A */
82#define IIO_IPRTE2_A 0x00400318 /* IO PIO Read Address Table Entry 2, Part A */ 82#define IIO_IPRTE3_A 0x00400320 /* IO PIO Read Address Table Entry 3, Part A */
83#define IIO_IPRTE3_A 0x00400320 /* IO PIO Read Address Table Entry 3, Part A */ 83#define IIO_IPRTE4_A 0x00400328 /* IO PIO Read Address Table Entry 4, Part A */
84#define IIO_IPRTE4_A 0x00400328 /* IO PIO Read Address Table Entry 4, Part A */ 84#define IIO_IPRTE5_A 0x00400330 /* IO PIO Read Address Table Entry 5, Part A */
85#define IIO_IPRTE5_A 0x00400330 /* IO PIO Read Address Table Entry 5, Part A */ 85#define IIO_IPRTE6_A 0x00400338 /* IO PIO Read Address Table Entry 6, Part A */
86#define IIO_IPRTE6_A 0x00400338 /* IO PIO Read Address Table Entry 6, Part A */ 86#define IIO_IPRTE7_A 0x00400340 /* IO PIO Read Address Table Entry 7, Part A */
87#define IIO_IPRTE7_A 0x00400340 /* IO PIO Read Address Table Entry 7, Part A */ 87
88 88#define IIO_IPRTE0_B 0x00400348 /* IO PIO Read Address Table Entry 0, Part B */
89#define IIO_IPRTE0_B 0x00400348 /* IO PIO Read Address Table Entry 0, Part B */ 89#define IIO_IPRTE1_B 0x00400350 /* IO PIO Read Address Table Entry 1, Part B */
90#define IIO_IPRTE1_B 0x00400350 /* IO PIO Read Address Table Entry 1, Part B */ 90#define IIO_IPRTE2_B 0x00400358 /* IO PIO Read Address Table Entry 2, Part B */
91#define IIO_IPRTE2_B 0x00400358 /* IO PIO Read Address Table Entry 2, Part B */ 91#define IIO_IPRTE3_B 0x00400360 /* IO PIO Read Address Table Entry 3, Part B */
92#define IIO_IPRTE3_B 0x00400360 /* IO PIO Read Address Table Entry 3, Part B */ 92#define IIO_IPRTE4_B 0x00400368 /* IO PIO Read Address Table Entry 4, Part B */
93#define IIO_IPRTE4_B 0x00400368 /* IO PIO Read Address Table Entry 4, Part B */ 93#define IIO_IPRTE5_B 0x00400370 /* IO PIO Read Address Table Entry 5, Part B */
94#define IIO_IPRTE5_B 0x00400370 /* IO PIO Read Address Table Entry 5, Part B */ 94#define IIO_IPRTE6_B 0x00400378 /* IO PIO Read Address Table Entry 6, Part B */
95#define IIO_IPRTE6_B 0x00400378 /* IO PIO Read Address Table Entry 6, Part B */ 95#define IIO_IPRTE7_B 0x00400380 /* IO PIO Read Address Table Entry 7, Part B */
96#define IIO_IPRTE7_B 0x00400380 /* IO PIO Read Address Table Entry 7, Part B */ 96
97 97#define IIO_IPDR 0x00400388 /* IO PIO Deallocation Register */
98#define IIO_IPDR 0x00400388 /* IO PIO Deallocation Register */ 98#define IIO_ICDR 0x00400390 /* IO CRB Entry Deallocation Register */
99#define IIO_ICDR 0x00400390 /* IO CRB Entry Deallocation Register */ 99#define IIO_IFDR 0x00400398 /* IO IOQ FIFO Depth Register */
100#define IIO_IFDR 0x00400398 /* IO IOQ FIFO Depth Register */ 100#define IIO_IIAP 0x004003A0 /* IO IIQ Arbitration Parameters */
101#define IIO_IIAP 0x004003A0 /* IO IIQ Arbitration Parameters */ 101#define IIO_ICMR 0x004003A8 /* IO CRB Management Register */
102#define IIO_ICMR 0x004003A8 /* IO CRB Management Register */ 102#define IIO_ICCR 0x004003B0 /* IO CRB Control Register */
103#define IIO_ICCR 0x004003B0 /* IO CRB Control Register */ 103#define IIO_ICTO 0x004003B8 /* IO CRB Timeout */
104#define IIO_ICTO 0x004003B8 /* IO CRB Timeout */ 104#define IIO_ICTP 0x004003C0 /* IO CRB Timeout Prescalar */
105#define IIO_ICTP 0x004003C0 /* IO CRB Timeout Prescalar */ 105
106 106#define IIO_ICRB0_A 0x00400400 /* IO CRB Entry 0_A */
107#define IIO_ICRB0_A 0x00400400 /* IO CRB Entry 0_A */ 107#define IIO_ICRB0_B 0x00400408 /* IO CRB Entry 0_B */
108#define IIO_ICRB0_B 0x00400408 /* IO CRB Entry 0_B */ 108#define IIO_ICRB0_C 0x00400410 /* IO CRB Entry 0_C */
109#define IIO_ICRB0_C 0x00400410 /* IO CRB Entry 0_C */ 109#define IIO_ICRB0_D 0x00400418 /* IO CRB Entry 0_D */
110#define IIO_ICRB0_D 0x00400418 /* IO CRB Entry 0_D */ 110#define IIO_ICRB0_E 0x00400420 /* IO CRB Entry 0_E */
111#define IIO_ICRB0_E 0x00400420 /* IO CRB Entry 0_E */ 111
112 112#define IIO_ICRB1_A 0x00400430 /* IO CRB Entry 1_A */
113#define IIO_ICRB1_A 0x00400430 /* IO CRB Entry 1_A */ 113#define IIO_ICRB1_B 0x00400438 /* IO CRB Entry 1_B */
114#define IIO_ICRB1_B 0x00400438 /* IO CRB Entry 1_B */ 114#define IIO_ICRB1_C 0x00400440 /* IO CRB Entry 1_C */
115#define IIO_ICRB1_C 0x00400440 /* IO CRB Entry 1_C */ 115#define IIO_ICRB1_D 0x00400448 /* IO CRB Entry 1_D */
116#define IIO_ICRB1_D 0x00400448 /* IO CRB Entry 1_D */ 116#define IIO_ICRB1_E 0x00400450 /* IO CRB Entry 1_E */
117#define IIO_ICRB1_E 0x00400450 /* IO CRB Entry 1_E */ 117
118 118#define IIO_ICRB2_A 0x00400460 /* IO CRB Entry 2_A */
119#define IIO_ICRB2_A 0x00400460 /* IO CRB Entry 2_A */ 119#define IIO_ICRB2_B 0x00400468 /* IO CRB Entry 2_B */
120#define IIO_ICRB2_B 0x00400468 /* IO CRB Entry 2_B */ 120#define IIO_ICRB2_C 0x00400470 /* IO CRB Entry 2_C */
121#define IIO_ICRB2_C 0x00400470 /* IO CRB Entry 2_C */ 121#define IIO_ICRB2_D 0x00400478 /* IO CRB Entry 2_D */
122#define IIO_ICRB2_D 0x00400478 /* IO CRB Entry 2_D */ 122#define IIO_ICRB2_E 0x00400480 /* IO CRB Entry 2_E */
123#define IIO_ICRB2_E 0x00400480 /* IO CRB Entry 2_E */ 123
124 124#define IIO_ICRB3_A 0x00400490 /* IO CRB Entry 3_A */
125#define IIO_ICRB3_A 0x00400490 /* IO CRB Entry 3_A */ 125#define IIO_ICRB3_B 0x00400498 /* IO CRB Entry 3_B */
126#define IIO_ICRB3_B 0x00400498 /* IO CRB Entry 3_B */ 126#define IIO_ICRB3_C 0x004004a0 /* IO CRB Entry 3_C */
127#define IIO_ICRB3_C 0x004004a0 /* IO CRB Entry 3_C */ 127#define IIO_ICRB3_D 0x004004a8 /* IO CRB Entry 3_D */
128#define IIO_ICRB3_D 0x004004a8 /* IO CRB Entry 3_D */ 128#define IIO_ICRB3_E 0x004004b0 /* IO CRB Entry 3_E */
129#define IIO_ICRB3_E 0x004004b0 /* IO CRB Entry 3_E */ 129
130 130#define IIO_ICRB4_A 0x004004c0 /* IO CRB Entry 4_A */
131#define IIO_ICRB4_A 0x004004c0 /* IO CRB Entry 4_A */ 131#define IIO_ICRB4_B 0x004004c8 /* IO CRB Entry 4_B */
132#define IIO_ICRB4_B 0x004004c8 /* IO CRB Entry 4_B */ 132#define IIO_ICRB4_C 0x004004d0 /* IO CRB Entry 4_C */
133#define IIO_ICRB4_C 0x004004d0 /* IO CRB Entry 4_C */ 133#define IIO_ICRB4_D 0x004004d8 /* IO CRB Entry 4_D */
134#define IIO_ICRB4_D 0x004004d8 /* IO CRB Entry 4_D */ 134#define IIO_ICRB4_E 0x004004e0 /* IO CRB Entry 4_E */
135#define IIO_ICRB4_E 0x004004e0 /* IO CRB Entry 4_E */ 135
136 136#define IIO_ICRB5_A 0x004004f0 /* IO CRB Entry 5_A */
137#define IIO_ICRB5_A 0x004004f0 /* IO CRB Entry 5_A */ 137#define IIO_ICRB5_B 0x004004f8 /* IO CRB Entry 5_B */
138#define IIO_ICRB5_B 0x004004f8 /* IO CRB Entry 5_B */ 138#define IIO_ICRB5_C 0x00400500 /* IO CRB Entry 5_C */
139#define IIO_ICRB5_C 0x00400500 /* IO CRB Entry 5_C */ 139#define IIO_ICRB5_D 0x00400508 /* IO CRB Entry 5_D */
140#define IIO_ICRB5_D 0x00400508 /* IO CRB Entry 5_D */ 140#define IIO_ICRB5_E 0x00400510 /* IO CRB Entry 5_E */
141#define IIO_ICRB5_E 0x00400510 /* IO CRB Entry 5_E */ 141
142 142#define IIO_ICRB6_A 0x00400520 /* IO CRB Entry 6_A */
143#define IIO_ICRB6_A 0x00400520 /* IO CRB Entry 6_A */ 143#define IIO_ICRB6_B 0x00400528 /* IO CRB Entry 6_B */
144#define IIO_ICRB6_B 0x00400528 /* IO CRB Entry 6_B */ 144#define IIO_ICRB6_C 0x00400530 /* IO CRB Entry 6_C */
145#define IIO_ICRB6_C 0x00400530 /* IO CRB Entry 6_C */ 145#define IIO_ICRB6_D 0x00400538 /* IO CRB Entry 6_D */
146#define IIO_ICRB6_D 0x00400538 /* IO CRB Entry 6_D */ 146#define IIO_ICRB6_E 0x00400540 /* IO CRB Entry 6_E */
147#define IIO_ICRB6_E 0x00400540 /* IO CRB Entry 6_E */ 147
148 148#define IIO_ICRB7_A 0x00400550 /* IO CRB Entry 7_A */
149#define IIO_ICRB7_A 0x00400550 /* IO CRB Entry 7_A */ 149#define IIO_ICRB7_B 0x00400558 /* IO CRB Entry 7_B */
150#define IIO_ICRB7_B 0x00400558 /* IO CRB Entry 7_B */ 150#define IIO_ICRB7_C 0x00400560 /* IO CRB Entry 7_C */
151#define IIO_ICRB7_C 0x00400560 /* IO CRB Entry 7_C */ 151#define IIO_ICRB7_D 0x00400568 /* IO CRB Entry 7_D */
152#define IIO_ICRB7_D 0x00400568 /* IO CRB Entry 7_D */ 152#define IIO_ICRB7_E 0x00400570 /* IO CRB Entry 7_E */
153#define IIO_ICRB7_E 0x00400570 /* IO CRB Entry 7_E */ 153
154 154#define IIO_ICRB8_A 0x00400580 /* IO CRB Entry 8_A */
155#define IIO_ICRB8_A 0x00400580 /* IO CRB Entry 8_A */ 155#define IIO_ICRB8_B 0x00400588 /* IO CRB Entry 8_B */
156#define IIO_ICRB8_B 0x00400588 /* IO CRB Entry 8_B */ 156#define IIO_ICRB8_C 0x00400590 /* IO CRB Entry 8_C */
157#define IIO_ICRB8_C 0x00400590 /* IO CRB Entry 8_C */ 157#define IIO_ICRB8_D 0x00400598 /* IO CRB Entry 8_D */
158#define IIO_ICRB8_D 0x00400598 /* IO CRB Entry 8_D */ 158#define IIO_ICRB8_E 0x004005a0 /* IO CRB Entry 8_E */
159#define IIO_ICRB8_E 0x004005a0 /* IO CRB Entry 8_E */ 159
160 160#define IIO_ICRB9_A 0x004005b0 /* IO CRB Entry 9_A */
161#define IIO_ICRB9_A 0x004005b0 /* IO CRB Entry 9_A */ 161#define IIO_ICRB9_B 0x004005b8 /* IO CRB Entry 9_B */
162#define IIO_ICRB9_B 0x004005b8 /* IO CRB Entry 9_B */ 162#define IIO_ICRB9_C 0x004005c0 /* IO CRB Entry 9_C */
163#define IIO_ICRB9_C 0x004005c0 /* IO CRB Entry 9_C */ 163#define IIO_ICRB9_D 0x004005c8 /* IO CRB Entry 9_D */
164#define IIO_ICRB9_D 0x004005c8 /* IO CRB Entry 9_D */ 164#define IIO_ICRB9_E 0x004005d0 /* IO CRB Entry 9_E */
165#define IIO_ICRB9_E 0x004005d0 /* IO CRB Entry 9_E */ 165
166 166#define IIO_ICRBA_A 0x004005e0 /* IO CRB Entry A_A */
167#define IIO_ICRBA_A 0x004005e0 /* IO CRB Entry A_A */ 167#define IIO_ICRBA_B 0x004005e8 /* IO CRB Entry A_B */
168#define IIO_ICRBA_B 0x004005e8 /* IO CRB Entry A_B */ 168#define IIO_ICRBA_C 0x004005f0 /* IO CRB Entry A_C */
169#define IIO_ICRBA_C 0x004005f0 /* IO CRB Entry A_C */ 169#define IIO_ICRBA_D 0x004005f8 /* IO CRB Entry A_D */
170#define IIO_ICRBA_D 0x004005f8 /* IO CRB Entry A_D */ 170#define IIO_ICRBA_E 0x00400600 /* IO CRB Entry A_E */
171#define IIO_ICRBA_E 0x00400600 /* IO CRB Entry A_E */ 171
172 172#define IIO_ICRBB_A 0x00400610 /* IO CRB Entry B_A */
173#define IIO_ICRBB_A 0x00400610 /* IO CRB Entry B_A */ 173#define IIO_ICRBB_B 0x00400618 /* IO CRB Entry B_B */
174#define IIO_ICRBB_B 0x00400618 /* IO CRB Entry B_B */ 174#define IIO_ICRBB_C 0x00400620 /* IO CRB Entry B_C */
175#define IIO_ICRBB_C 0x00400620 /* IO CRB Entry B_C */ 175#define IIO_ICRBB_D 0x00400628 /* IO CRB Entry B_D */
176#define IIO_ICRBB_D 0x00400628 /* IO CRB Entry B_D */ 176#define IIO_ICRBB_E 0x00400630 /* IO CRB Entry B_E */
177#define IIO_ICRBB_E 0x00400630 /* IO CRB Entry B_E */ 177
178 178#define IIO_ICRBC_A 0x00400640 /* IO CRB Entry C_A */
179#define IIO_ICRBC_A 0x00400640 /* IO CRB Entry C_A */ 179#define IIO_ICRBC_B 0x00400648 /* IO CRB Entry C_B */
180#define IIO_ICRBC_B 0x00400648 /* IO CRB Entry C_B */ 180#define IIO_ICRBC_C 0x00400650 /* IO CRB Entry C_C */
181#define IIO_ICRBC_C 0x00400650 /* IO CRB Entry C_C */ 181#define IIO_ICRBC_D 0x00400658 /* IO CRB Entry C_D */
182#define IIO_ICRBC_D 0x00400658 /* IO CRB Entry C_D */ 182#define IIO_ICRBC_E 0x00400660 /* IO CRB Entry C_E */
183#define IIO_ICRBC_E 0x00400660 /* IO CRB Entry C_E */ 183
184 184#define IIO_ICRBD_A 0x00400670 /* IO CRB Entry D_A */
185#define IIO_ICRBD_A 0x00400670 /* IO CRB Entry D_A */ 185#define IIO_ICRBD_B 0x00400678 /* IO CRB Entry D_B */
186#define IIO_ICRBD_B 0x00400678 /* IO CRB Entry D_B */ 186#define IIO_ICRBD_C 0x00400680 /* IO CRB Entry D_C */
187#define IIO_ICRBD_C 0x00400680 /* IO CRB Entry D_C */ 187#define IIO_ICRBD_D 0x00400688 /* IO CRB Entry D_D */
188#define IIO_ICRBD_D 0x00400688 /* IO CRB Entry D_D */ 188#define IIO_ICRBD_E 0x00400690 /* IO CRB Entry D_E */
189#define IIO_ICRBD_E 0x00400690 /* IO CRB Entry D_E */ 189
190 190#define IIO_ICRBE_A 0x004006a0 /* IO CRB Entry E_A */
191#define IIO_ICRBE_A 0x004006a0 /* IO CRB Entry E_A */ 191#define IIO_ICRBE_B 0x004006a8 /* IO CRB Entry E_B */
192#define IIO_ICRBE_B 0x004006a8 /* IO CRB Entry E_B */ 192#define IIO_ICRBE_C 0x004006b0 /* IO CRB Entry E_C */
193#define IIO_ICRBE_C 0x004006b0 /* IO CRB Entry E_C */ 193#define IIO_ICRBE_D 0x004006b8 /* IO CRB Entry E_D */
194#define IIO_ICRBE_D 0x004006b8 /* IO CRB Entry E_D */ 194#define IIO_ICRBE_E 0x004006c0 /* IO CRB Entry E_E */
195#define IIO_ICRBE_E 0x004006c0 /* IO CRB Entry E_E */ 195
196 196#define IIO_ICSML 0x00400700 /* IO CRB Spurious Message Low */
197#define IIO_ICSML 0x00400700 /* IO CRB Spurious Message Low */ 197#define IIO_ICSMM 0x00400708 /* IO CRB Spurious Message Middle */
198#define IIO_ICSMM 0x00400708 /* IO CRB Spurious Message Middle */ 198#define IIO_ICSMH 0x00400710 /* IO CRB Spurious Message High */
199#define IIO_ICSMH 0x00400710 /* IO CRB Spurious Message High */ 199
200 200#define IIO_IDBSS 0x00400718 /* IO Debug Submenu Select */
201#define IIO_IDBSS 0x00400718 /* IO Debug Submenu Select */ 201
202 202#define IIO_IBLS0 0x00410000 /* IO BTE Length Status 0 */
203#define IIO_IBLS0 0x00410000 /* IO BTE Length Status 0 */ 203#define IIO_IBSA0 0x00410008 /* IO BTE Source Address 0 */
204#define IIO_IBSA0 0x00410008 /* IO BTE Source Address 0 */ 204#define IIO_IBDA0 0x00410010 /* IO BTE Destination Address 0 */
205#define IIO_IBDA0 0x00410010 /* IO BTE Destination Address 0 */ 205#define IIO_IBCT0 0x00410018 /* IO BTE Control Terminate 0 */
206#define IIO_IBCT0 0x00410018 /* IO BTE Control Terminate 0 */ 206#define IIO_IBNA0 0x00410020 /* IO BTE Notification Address 0 */
207#define IIO_IBNA0 0x00410020 /* IO BTE Notification Address 0 */ 207#define IIO_IBIA0 0x00410028 /* IO BTE Interrupt Address 0 */
208#define IIO_IBIA0 0x00410028 /* IO BTE Interrupt Address 0 */ 208#define IIO_IBLS1 0x00420000 /* IO BTE Length Status 1 */
209#define IIO_IBLS1 0x00420000 /* IO BTE Length Status 1 */ 209#define IIO_IBSA1 0x00420008 /* IO BTE Source Address 1 */
210#define IIO_IBSA1 0x00420008 /* IO BTE Source Address 1 */ 210#define IIO_IBDA1 0x00420010 /* IO BTE Destination Address 1 */
211#define IIO_IBDA1 0x00420010 /* IO BTE Destination Address 1 */ 211#define IIO_IBCT1 0x00420018 /* IO BTE Control Terminate 1 */
212#define IIO_IBCT1 0x00420018 /* IO BTE Control Terminate 1 */ 212#define IIO_IBNA1 0x00420020 /* IO BTE Notification Address 1 */
213#define IIO_IBNA1 0x00420020 /* IO BTE Notification Address 1 */ 213#define IIO_IBIA1 0x00420028 /* IO BTE Interrupt Address 1 */
214#define IIO_IBIA1 0x00420028 /* IO BTE Interrupt Address 1 */ 214
215 215#define IIO_IPCR 0x00430000 /* IO Performance Control */
216#define IIO_IPCR 0x00430000 /* IO Performance Control */ 216#define IIO_IPPR 0x00430008 /* IO Performance Profiling */
217#define IIO_IPPR 0x00430008 /* IO Performance Profiling */ 217
218 218/************************************************************************
219 219 * *
220/************************************************************************
221 * *
222 * Description: This register echoes some information from the * 220 * Description: This register echoes some information from the *
223 * LB_REV_ID register. It is available through Crosstalk as described * 221 * LB_REV_ID register. It is available through Crosstalk as described *
224 * above. The REV_NUM and MFG_NUM fields receive their values from * 222 * above. The REV_NUM and MFG_NUM fields receive their values from *
225 * the REVISION and MANUFACTURER fields in the LB_REV_ID register. * 223 * the REVISION and MANUFACTURER fields in the LB_REV_ID register. *
226 * The PART_NUM field's value is the Crosstalk device ID number that * 224 * The PART_NUM field's value is the Crosstalk device ID number that *
227 * Steve Miller assigned to the SHub chip. * 225 * Steve Miller assigned to the SHub chip. *
228 * * 226 * *
229 ************************************************************************/ 227 ************************************************************************/
230 228
231typedef union ii_wid_u { 229typedef union ii_wid_u {
232 uint64_t ii_wid_regval; 230 uint64_t ii_wid_regval;
233 struct { 231 struct {
234 uint64_t w_rsvd_1 : 1; 232 uint64_t w_rsvd_1:1;
235 uint64_t w_mfg_num : 11; 233 uint64_t w_mfg_num:11;
236 uint64_t w_part_num : 16; 234 uint64_t w_part_num:16;
237 uint64_t w_rev_num : 4; 235 uint64_t w_rev_num:4;
238 uint64_t w_rsvd : 32; 236 uint64_t w_rsvd:32;
239 } ii_wid_fld_s; 237 } ii_wid_fld_s;
240} ii_wid_u_t; 238} ii_wid_u_t;
241 239
242
243/************************************************************************ 240/************************************************************************
244 * * 241 * *
245 * The fields in this register are set upon detection of an error * 242 * The fields in this register are set upon detection of an error *
246 * and cleared by various mechanisms, as explained in the * 243 * and cleared by various mechanisms, as explained in the *
247 * description. * 244 * description. *
248 * * 245 * *
249 ************************************************************************/ 246 ************************************************************************/
250 247
251typedef union ii_wstat_u { 248typedef union ii_wstat_u {
252 uint64_t ii_wstat_regval; 249 uint64_t ii_wstat_regval;
253 struct { 250 struct {
254 uint64_t w_pending : 4; 251 uint64_t w_pending:4;
255 uint64_t w_xt_crd_to : 1; 252 uint64_t w_xt_crd_to:1;
256 uint64_t w_xt_tail_to : 1; 253 uint64_t w_xt_tail_to:1;
257 uint64_t w_rsvd_3 : 3; 254 uint64_t w_rsvd_3:3;
258 uint64_t w_tx_mx_rty : 1; 255 uint64_t w_tx_mx_rty:1;
259 uint64_t w_rsvd_2 : 6; 256 uint64_t w_rsvd_2:6;
260 uint64_t w_llp_tx_cnt : 8; 257 uint64_t w_llp_tx_cnt:8;
261 uint64_t w_rsvd_1 : 8; 258 uint64_t w_rsvd_1:8;
262 uint64_t w_crazy : 1; 259 uint64_t w_crazy:1;
263 uint64_t w_rsvd : 31; 260 uint64_t w_rsvd:31;
264 } ii_wstat_fld_s; 261 } ii_wstat_fld_s;
265} ii_wstat_u_t; 262} ii_wstat_u_t;
266 263
267
268/************************************************************************ 264/************************************************************************
269 * * 265 * *
270 * Description: This is a read-write enabled register. It controls * 266 * Description: This is a read-write enabled register. It controls *
271 * various aspects of the Crosstalk flow control. * 267 * various aspects of the Crosstalk flow control. *
272 * * 268 * *
273 ************************************************************************/ 269 ************************************************************************/
274 270
275typedef union ii_wcr_u { 271typedef union ii_wcr_u {
276 uint64_t ii_wcr_regval; 272 uint64_t ii_wcr_regval;
277 struct { 273 struct {
278 uint64_t w_wid : 4; 274 uint64_t w_wid:4;
279 uint64_t w_tag : 1; 275 uint64_t w_tag:1;
280 uint64_t w_rsvd_1 : 8; 276 uint64_t w_rsvd_1:8;
281 uint64_t w_dst_crd : 3; 277 uint64_t w_dst_crd:3;
282 uint64_t w_f_bad_pkt : 1; 278 uint64_t w_f_bad_pkt:1;
283 uint64_t w_dir_con : 1; 279 uint64_t w_dir_con:1;
284 uint64_t w_e_thresh : 5; 280 uint64_t w_e_thresh:5;
285 uint64_t w_rsvd : 41; 281 uint64_t w_rsvd:41;
286 } ii_wcr_fld_s; 282 } ii_wcr_fld_s;
287} ii_wcr_u_t; 283} ii_wcr_u_t;
288 284
289
290/************************************************************************ 285/************************************************************************
291 * * 286 * *
292 * Description: This register's value is a bit vector that guards * 287 * Description: This register's value is a bit vector that guards *
293 * access to local registers within the II as well as to external * 288 * access to local registers within the II as well as to external *
294 * Crosstalk widgets. Each bit in the register corresponds to a * 289 * Crosstalk widgets. Each bit in the register corresponds to a *
@@ -311,21 +306,18 @@ typedef union ii_wcr_u {
311 * region ID bits are enabled in this same register. It can also be * 306 * region ID bits are enabled in this same register. It can also be *
312 * accessed through the IAlias space by the local processors. * 307 * accessed through the IAlias space by the local processors. *
313 * The reset value of this register allows access by all nodes. * 308 * The reset value of this register allows access by all nodes. *
314 * * 309 * *
315 ************************************************************************/ 310 ************************************************************************/
316 311
317typedef union ii_ilapr_u { 312typedef union ii_ilapr_u {
318 uint64_t ii_ilapr_regval; 313 uint64_t ii_ilapr_regval;
319 struct { 314 struct {
320 uint64_t i_region : 64; 315 uint64_t i_region:64;
321 } ii_ilapr_fld_s; 316 } ii_ilapr_fld_s;
322} ii_ilapr_u_t; 317} ii_ilapr_u_t;
323 318
324
325
326
327/************************************************************************ 319/************************************************************************
328 * * 320 * *
329 * Description: A write to this register of the 64-bit value * 321 * Description: A write to this register of the 64-bit value *
330 * "SGIrules" in ASCII, will cause the bit in the ILAPR register * 322 * "SGIrules" in ASCII, will cause the bit in the ILAPR register *
331 * corresponding to the region of the requestor to be set (allow * 323 * corresponding to the region of the requestor to be set (allow *
@@ -334,59 +326,54 @@ typedef union ii_ilapr_u {
334 * This register can also be accessed through the IAlias space. * 326 * This register can also be accessed through the IAlias space. *
335 * However, this access will not change the access permissions in the * 327 * However, this access will not change the access permissions in the *
336 * ILAPR. * 328 * ILAPR. *
337 * * 329 * *
338 ************************************************************************/ 330 ************************************************************************/
339 331
340typedef union ii_ilapo_u { 332typedef union ii_ilapo_u {
341 uint64_t ii_ilapo_regval; 333 uint64_t ii_ilapo_regval;
342 struct { 334 struct {
343 uint64_t i_io_ovrride : 64; 335 uint64_t i_io_ovrride:64;
344 } ii_ilapo_fld_s; 336 } ii_ilapo_fld_s;
345} ii_ilapo_u_t; 337} ii_ilapo_u_t;
346 338
347
348
349/************************************************************************ 339/************************************************************************
350 * * 340 * *
351 * This register qualifies all the PIO and Graphics writes launched * 341 * This register qualifies all the PIO and Graphics writes launched *
352 * from the SHUB towards a widget. * 342 * from the SHUB towards a widget. *
353 * * 343 * *
354 ************************************************************************/ 344 ************************************************************************/
355 345
356typedef union ii_iowa_u { 346typedef union ii_iowa_u {
357 uint64_t ii_iowa_regval; 347 uint64_t ii_iowa_regval;
358 struct { 348 struct {
359 uint64_t i_w0_oac : 1; 349 uint64_t i_w0_oac:1;
360 uint64_t i_rsvd_1 : 7; 350 uint64_t i_rsvd_1:7;
361 uint64_t i_wx_oac : 8; 351 uint64_t i_wx_oac:8;
362 uint64_t i_rsvd : 48; 352 uint64_t i_rsvd:48;
363 } ii_iowa_fld_s; 353 } ii_iowa_fld_s;
364} ii_iowa_u_t; 354} ii_iowa_u_t;
365 355
366
367/************************************************************************ 356/************************************************************************
368 * * 357 * *
369 * Description: This register qualifies all the requests launched * 358 * Description: This register qualifies all the requests launched *
370 * from a widget towards the Shub. This register is intended to be * 359 * from a widget towards the Shub. This register is intended to be *
371 * used by software in case of misbehaving widgets. * 360 * used by software in case of misbehaving widgets. *
372 * * 361 * *
373 * * 362 * *
374 ************************************************************************/ 363 ************************************************************************/
375 364
376typedef union ii_iiwa_u { 365typedef union ii_iiwa_u {
377 uint64_t ii_iiwa_regval; 366 uint64_t ii_iiwa_regval;
378 struct { 367 struct {
379 uint64_t i_w0_iac : 1; 368 uint64_t i_w0_iac:1;
380 uint64_t i_rsvd_1 : 7; 369 uint64_t i_rsvd_1:7;
381 uint64_t i_wx_iac : 8; 370 uint64_t i_wx_iac:8;
382 uint64_t i_rsvd : 48; 371 uint64_t i_rsvd:48;
383 } ii_iiwa_fld_s; 372 } ii_iiwa_fld_s;
384} ii_iiwa_u_t; 373} ii_iiwa_u_t;
385 374
386
387
388/************************************************************************ 375/************************************************************************
389 * * 376 * *
390 * Description: This register qualifies all the operations launched * 377 * Description: This register qualifies all the operations launched *
391 * from a widget towards the SHub. It allows individual access * 378 * from a widget towards the SHub. It allows individual access *
392 * control for up to 8 devices per widget. A device refers to * 379 * control for up to 8 devices per widget. A device refers to *
@@ -401,72 +388,69 @@ typedef union ii_iiwa_u {
401 * The bits in this field are set by writing a 1 to them. Incoming * 388 * The bits in this field are set by writing a 1 to them. Incoming *
402 * replies from Crosstalk are not subject to this access control * 389 * replies from Crosstalk are not subject to this access control *
403 * mechanism. * 390 * mechanism. *
404 * * 391 * *
405 ************************************************************************/ 392 ************************************************************************/
406 393
407typedef union ii_iidem_u { 394typedef union ii_iidem_u {
408 uint64_t ii_iidem_regval; 395 uint64_t ii_iidem_regval;
409 struct { 396 struct {
410 uint64_t i_w8_dxs : 8; 397 uint64_t i_w8_dxs:8;
411 uint64_t i_w9_dxs : 8; 398 uint64_t i_w9_dxs:8;
412 uint64_t i_wa_dxs : 8; 399 uint64_t i_wa_dxs:8;
413 uint64_t i_wb_dxs : 8; 400 uint64_t i_wb_dxs:8;
414 uint64_t i_wc_dxs : 8; 401 uint64_t i_wc_dxs:8;
415 uint64_t i_wd_dxs : 8; 402 uint64_t i_wd_dxs:8;
416 uint64_t i_we_dxs : 8; 403 uint64_t i_we_dxs:8;
417 uint64_t i_wf_dxs : 8; 404 uint64_t i_wf_dxs:8;
418 } ii_iidem_fld_s; 405 } ii_iidem_fld_s;
419} ii_iidem_u_t; 406} ii_iidem_u_t;
420 407
421
422/************************************************************************ 408/************************************************************************
423 * * 409 * *
424 * This register contains the various programmable fields necessary * 410 * This register contains the various programmable fields necessary *
425 * for controlling and observing the LLP signals. * 411 * for controlling and observing the LLP signals. *
426 * * 412 * *
427 ************************************************************************/ 413 ************************************************************************/
428 414
429typedef union ii_ilcsr_u { 415typedef union ii_ilcsr_u {
430 uint64_t ii_ilcsr_regval; 416 uint64_t ii_ilcsr_regval;
431 struct { 417 struct {
432 uint64_t i_nullto : 6; 418 uint64_t i_nullto:6;
433 uint64_t i_rsvd_4 : 2; 419 uint64_t i_rsvd_4:2;
434 uint64_t i_wrmrst : 1; 420 uint64_t i_wrmrst:1;
435 uint64_t i_rsvd_3 : 1; 421 uint64_t i_rsvd_3:1;
436 uint64_t i_llp_en : 1; 422 uint64_t i_llp_en:1;
437 uint64_t i_bm8 : 1; 423 uint64_t i_bm8:1;
438 uint64_t i_llp_stat : 2; 424 uint64_t i_llp_stat:2;
439 uint64_t i_remote_power : 1; 425 uint64_t i_remote_power:1;
440 uint64_t i_rsvd_2 : 1; 426 uint64_t i_rsvd_2:1;
441 uint64_t i_maxrtry : 10; 427 uint64_t i_maxrtry:10;
442 uint64_t i_d_avail_sel : 2; 428 uint64_t i_d_avail_sel:2;
443 uint64_t i_rsvd_1 : 4; 429 uint64_t i_rsvd_1:4;
444 uint64_t i_maxbrst : 10; 430 uint64_t i_maxbrst:10;
445 uint64_t i_rsvd : 22; 431 uint64_t i_rsvd:22;
446 432
447 } ii_ilcsr_fld_s; 433 } ii_ilcsr_fld_s;
448} ii_ilcsr_u_t; 434} ii_ilcsr_u_t;
449 435
450
451/************************************************************************ 436/************************************************************************
452 * * 437 * *
453 * This is simply a status registers that monitors the LLP error * 438 * This is simply a status registers that monitors the LLP error *
454 * rate. * 439 * rate. *
455 * * 440 * *
456 ************************************************************************/ 441 ************************************************************************/
457 442
458typedef union ii_illr_u { 443typedef union ii_illr_u {
459 uint64_t ii_illr_regval; 444 uint64_t ii_illr_regval;
460 struct { 445 struct {
461 uint64_t i_sn_cnt : 16; 446 uint64_t i_sn_cnt:16;
462 uint64_t i_cb_cnt : 16; 447 uint64_t i_cb_cnt:16;
463 uint64_t i_rsvd : 32; 448 uint64_t i_rsvd:32;
464 } ii_illr_fld_s; 449 } ii_illr_fld_s;
465} ii_illr_u_t; 450} ii_illr_u_t;
466 451
467
468/************************************************************************ 452/************************************************************************
469 * * 453 * *
470 * Description: All II-detected non-BTE error interrupts are * 454 * Description: All II-detected non-BTE error interrupts are *
471 * specified via this register. * 455 * specified via this register. *
472 * NOTE: The PI interrupt register address is hardcoded in the II. If * 456 * NOTE: The PI interrupt register address is hardcoded in the II. If *
@@ -476,107 +460,100 @@ typedef union ii_illr_u {
476 * PI_ID==1, then the II sends the interrupt request to address * 460 * PI_ID==1, then the II sends the interrupt request to address *
477 * offset 0x01A0_0090 within the local register address space of PI1 * 461 * offset 0x01A0_0090 within the local register address space of PI1 *
478 * on the node specified by the NODE field. * 462 * on the node specified by the NODE field. *
479 * * 463 * *
480 ************************************************************************/ 464 ************************************************************************/
481 465
482typedef union ii_iidsr_u { 466typedef union ii_iidsr_u {
483 uint64_t ii_iidsr_regval; 467 uint64_t ii_iidsr_regval;
484 struct { 468 struct {
485 uint64_t i_level : 8; 469 uint64_t i_level:8;
486 uint64_t i_pi_id : 1; 470 uint64_t i_pi_id:1;
487 uint64_t i_node : 11; 471 uint64_t i_node:11;
488 uint64_t i_rsvd_3 : 4; 472 uint64_t i_rsvd_3:4;
489 uint64_t i_enable : 1; 473 uint64_t i_enable:1;
490 uint64_t i_rsvd_2 : 3; 474 uint64_t i_rsvd_2:3;
491 uint64_t i_int_sent : 2; 475 uint64_t i_int_sent:2;
492 uint64_t i_rsvd_1 : 2; 476 uint64_t i_rsvd_1:2;
493 uint64_t i_pi0_forward_int : 1; 477 uint64_t i_pi0_forward_int:1;
494 uint64_t i_pi1_forward_int : 1; 478 uint64_t i_pi1_forward_int:1;
495 uint64_t i_rsvd : 30; 479 uint64_t i_rsvd:30;
496 } ii_iidsr_fld_s; 480 } ii_iidsr_fld_s;
497} ii_iidsr_u_t; 481} ii_iidsr_u_t;
498 482
499
500
501/************************************************************************ 483/************************************************************************
502 * * 484 * *
503 * There are two instances of this register. This register is used * 485 * There are two instances of this register. This register is used *
504 * for matching up the incoming responses from the graphics widget to * 486 * for matching up the incoming responses from the graphics widget to *
505 * the processor that initiated the graphics operation. The * 487 * the processor that initiated the graphics operation. The *
506 * write-responses are converted to graphics credits and returned to * 488 * write-responses are converted to graphics credits and returned to *
507 * the processor so that the processor interface can manage the flow * 489 * the processor so that the processor interface can manage the flow *
508 * control. * 490 * control. *
509 * * 491 * *
510 ************************************************************************/ 492 ************************************************************************/
511 493
512typedef union ii_igfx0_u { 494typedef union ii_igfx0_u {
513 uint64_t ii_igfx0_regval; 495 uint64_t ii_igfx0_regval;
514 struct { 496 struct {
515 uint64_t i_w_num : 4; 497 uint64_t i_w_num:4;
516 uint64_t i_pi_id : 1; 498 uint64_t i_pi_id:1;
517 uint64_t i_n_num : 12; 499 uint64_t i_n_num:12;
518 uint64_t i_p_num : 1; 500 uint64_t i_p_num:1;
519 uint64_t i_rsvd : 46; 501 uint64_t i_rsvd:46;
520 } ii_igfx0_fld_s; 502 } ii_igfx0_fld_s;
521} ii_igfx0_u_t; 503} ii_igfx0_u_t;
522 504
523
524/************************************************************************ 505/************************************************************************
525 * * 506 * *
526 * There are two instances of this register. This register is used * 507 * There are two instances of this register. This register is used *
527 * for matching up the incoming responses from the graphics widget to * 508 * for matching up the incoming responses from the graphics widget to *
528 * the processor that initiated the graphics operation. The * 509 * the processor that initiated the graphics operation. The *
529 * write-responses are converted to graphics credits and returned to * 510 * write-responses are converted to graphics credits and returned to *
530 * the processor so that the processor interface can manage the flow * 511 * the processor so that the processor interface can manage the flow *
531 * control. * 512 * control. *
532 * * 513 * *
533 ************************************************************************/ 514 ************************************************************************/
534 515
535typedef union ii_igfx1_u { 516typedef union ii_igfx1_u {
536 uint64_t ii_igfx1_regval; 517 uint64_t ii_igfx1_regval;
537 struct { 518 struct {
538 uint64_t i_w_num : 4; 519 uint64_t i_w_num:4;
539 uint64_t i_pi_id : 1; 520 uint64_t i_pi_id:1;
540 uint64_t i_n_num : 12; 521 uint64_t i_n_num:12;
541 uint64_t i_p_num : 1; 522 uint64_t i_p_num:1;
542 uint64_t i_rsvd : 46; 523 uint64_t i_rsvd:46;
543 } ii_igfx1_fld_s; 524 } ii_igfx1_fld_s;
544} ii_igfx1_u_t; 525} ii_igfx1_u_t;
545 526
546
547/************************************************************************ 527/************************************************************************
548 * * 528 * *
549 * There are two instances of this registers. These registers are * 529 * There are two instances of this registers. These registers are *
550 * used as scratch registers for software use. * 530 * used as scratch registers for software use. *
551 * * 531 * *
552 ************************************************************************/ 532 ************************************************************************/
553 533
554typedef union ii_iscr0_u { 534typedef union ii_iscr0_u {
555 uint64_t ii_iscr0_regval; 535 uint64_t ii_iscr0_regval;
556 struct { 536 struct {
557 uint64_t i_scratch : 64; 537 uint64_t i_scratch:64;
558 } ii_iscr0_fld_s; 538 } ii_iscr0_fld_s;
559} ii_iscr0_u_t; 539} ii_iscr0_u_t;
560 540
561
562
563/************************************************************************ 541/************************************************************************
564 * * 542 * *
565 * There are two instances of this registers. These registers are * 543 * There are two instances of this registers. These registers are *
566 * used as scratch registers for software use. * 544 * used as scratch registers for software use. *
567 * * 545 * *
568 ************************************************************************/ 546 ************************************************************************/
569 547
570typedef union ii_iscr1_u { 548typedef union ii_iscr1_u {
571 uint64_t ii_iscr1_regval; 549 uint64_t ii_iscr1_regval;
572 struct { 550 struct {
573 uint64_t i_scratch : 64; 551 uint64_t i_scratch:64;
574 } ii_iscr1_fld_s; 552 } ii_iscr1_fld_s;
575} ii_iscr1_u_t; 553} ii_iscr1_u_t;
576 554
577
578/************************************************************************ 555/************************************************************************
579 * * 556 * *
580 * Description: There are seven instances of translation table entry * 557 * Description: There are seven instances of translation table entry *
581 * registers. Each register maps a Shub Big Window to a 48-bit * 558 * registers. Each register maps a Shub Big Window to a 48-bit *
582 * address on Crosstalk. * 559 * address on Crosstalk. *
@@ -599,23 +576,22 @@ typedef union ii_iscr1_u {
599 * Crosstalk space addressable by the Shub is thus the lower * 576 * Crosstalk space addressable by the Shub is thus the lower *
600 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 577 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
601 * of this space can be accessed. * 578 * of this space can be accessed. *
602 * * 579 * *
603 ************************************************************************/ 580 ************************************************************************/
604 581
605typedef union ii_itte1_u { 582typedef union ii_itte1_u {
606 uint64_t ii_itte1_regval; 583 uint64_t ii_itte1_regval;
607 struct { 584 struct {
608 uint64_t i_offset : 5; 585 uint64_t i_offset:5;
609 uint64_t i_rsvd_1 : 3; 586 uint64_t i_rsvd_1:3;
610 uint64_t i_w_num : 4; 587 uint64_t i_w_num:4;
611 uint64_t i_iosp : 1; 588 uint64_t i_iosp:1;
612 uint64_t i_rsvd : 51; 589 uint64_t i_rsvd:51;
613 } ii_itte1_fld_s; 590 } ii_itte1_fld_s;
614} ii_itte1_u_t; 591} ii_itte1_u_t;
615 592
616
617/************************************************************************ 593/************************************************************************
618 * * 594 * *
619 * Description: There are seven instances of translation table entry * 595 * Description: There are seven instances of translation table entry *
620 * registers. Each register maps a Shub Big Window to a 48-bit * 596 * registers. Each register maps a Shub Big Window to a 48-bit *
621 * address on Crosstalk. * 597 * address on Crosstalk. *
@@ -638,23 +614,22 @@ typedef union ii_itte1_u {
638 * Crosstalk space addressable by the Shub is thus the lower * 614 * Crosstalk space addressable by the Shub is thus the lower *
639 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 615 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
640 * of this space can be accessed. * 616 * of this space can be accessed. *
641 * * 617 * *
642 ************************************************************************/ 618 ************************************************************************/
643 619
644typedef union ii_itte2_u { 620typedef union ii_itte2_u {
645 uint64_t ii_itte2_regval; 621 uint64_t ii_itte2_regval;
646 struct { 622 struct {
647 uint64_t i_offset : 5; 623 uint64_t i_offset:5;
648 uint64_t i_rsvd_1 : 3; 624 uint64_t i_rsvd_1:3;
649 uint64_t i_w_num : 4; 625 uint64_t i_w_num:4;
650 uint64_t i_iosp : 1; 626 uint64_t i_iosp:1;
651 uint64_t i_rsvd : 51; 627 uint64_t i_rsvd:51;
652 } ii_itte2_fld_s; 628 } ii_itte2_fld_s;
653} ii_itte2_u_t; 629} ii_itte2_u_t;
654 630
655
656/************************************************************************ 631/************************************************************************
657 * * 632 * *
658 * Description: There are seven instances of translation table entry * 633 * Description: There are seven instances of translation table entry *
659 * registers. Each register maps a Shub Big Window to a 48-bit * 634 * registers. Each register maps a Shub Big Window to a 48-bit *
660 * address on Crosstalk. * 635 * address on Crosstalk. *
@@ -677,23 +652,22 @@ typedef union ii_itte2_u {
677 * Crosstalk space addressable by the SHub is thus the lower * 652 * Crosstalk space addressable by the SHub is thus the lower *
678 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 653 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
679 * of this space can be accessed. * 654 * of this space can be accessed. *
680 * * 655 * *
681 ************************************************************************/ 656 ************************************************************************/
682 657
683typedef union ii_itte3_u { 658typedef union ii_itte3_u {
684 uint64_t ii_itte3_regval; 659 uint64_t ii_itte3_regval;
685 struct { 660 struct {
686 uint64_t i_offset : 5; 661 uint64_t i_offset:5;
687 uint64_t i_rsvd_1 : 3; 662 uint64_t i_rsvd_1:3;
688 uint64_t i_w_num : 4; 663 uint64_t i_w_num:4;
689 uint64_t i_iosp : 1; 664 uint64_t i_iosp:1;
690 uint64_t i_rsvd : 51; 665 uint64_t i_rsvd:51;
691 } ii_itte3_fld_s; 666 } ii_itte3_fld_s;
692} ii_itte3_u_t; 667} ii_itte3_u_t;
693 668
694
695/************************************************************************ 669/************************************************************************
696 * * 670 * *
697 * Description: There are seven instances of translation table entry * 671 * Description: There are seven instances of translation table entry *
698 * registers. Each register maps a SHub Big Window to a 48-bit * 672 * registers. Each register maps a SHub Big Window to a 48-bit *
699 * address on Crosstalk. * 673 * address on Crosstalk. *
@@ -716,23 +690,22 @@ typedef union ii_itte3_u {
716 * Crosstalk space addressable by the SHub is thus the lower * 690 * Crosstalk space addressable by the SHub is thus the lower *
717 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 691 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
718 * of this space can be accessed. * 692 * of this space can be accessed. *
719 * * 693 * *
720 ************************************************************************/ 694 ************************************************************************/
721 695
722typedef union ii_itte4_u { 696typedef union ii_itte4_u {
723 uint64_t ii_itte4_regval; 697 uint64_t ii_itte4_regval;
724 struct { 698 struct {
725 uint64_t i_offset : 5; 699 uint64_t i_offset:5;
726 uint64_t i_rsvd_1 : 3; 700 uint64_t i_rsvd_1:3;
727 uint64_t i_w_num : 4; 701 uint64_t i_w_num:4;
728 uint64_t i_iosp : 1; 702 uint64_t i_iosp:1;
729 uint64_t i_rsvd : 51; 703 uint64_t i_rsvd:51;
730 } ii_itte4_fld_s; 704 } ii_itte4_fld_s;
731} ii_itte4_u_t; 705} ii_itte4_u_t;
732 706
733
734/************************************************************************ 707/************************************************************************
735 * * 708 * *
736 * Description: There are seven instances of translation table entry * 709 * Description: There are seven instances of translation table entry *
737 * registers. Each register maps a SHub Big Window to a 48-bit * 710 * registers. Each register maps a SHub Big Window to a 48-bit *
738 * address on Crosstalk. * 711 * address on Crosstalk. *
@@ -755,23 +728,22 @@ typedef union ii_itte4_u {
755 * Crosstalk space addressable by the Shub is thus the lower * 728 * Crosstalk space addressable by the Shub is thus the lower *
756 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 729 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
757 * of this space can be accessed. * 730 * of this space can be accessed. *
758 * * 731 * *
759 ************************************************************************/ 732 ************************************************************************/
760 733
761typedef union ii_itte5_u { 734typedef union ii_itte5_u {
762 uint64_t ii_itte5_regval; 735 uint64_t ii_itte5_regval;
763 struct { 736 struct {
764 uint64_t i_offset : 5; 737 uint64_t i_offset:5;
765 uint64_t i_rsvd_1 : 3; 738 uint64_t i_rsvd_1:3;
766 uint64_t i_w_num : 4; 739 uint64_t i_w_num:4;
767 uint64_t i_iosp : 1; 740 uint64_t i_iosp:1;
768 uint64_t i_rsvd : 51; 741 uint64_t i_rsvd:51;
769 } ii_itte5_fld_s; 742 } ii_itte5_fld_s;
770} ii_itte5_u_t; 743} ii_itte5_u_t;
771 744
772
773/************************************************************************ 745/************************************************************************
774 * * 746 * *
775 * Description: There are seven instances of translation table entry * 747 * Description: There are seven instances of translation table entry *
776 * registers. Each register maps a Shub Big Window to a 48-bit * 748 * registers. Each register maps a Shub Big Window to a 48-bit *
777 * address on Crosstalk. * 749 * address on Crosstalk. *
@@ -794,23 +766,22 @@ typedef union ii_itte5_u {
794 * Crosstalk space addressable by the Shub is thus the lower * 766 * Crosstalk space addressable by the Shub is thus the lower *
795 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 767 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
796 * of this space can be accessed. * 768 * of this space can be accessed. *
797 * * 769 * *
798 ************************************************************************/ 770 ************************************************************************/
799 771
800typedef union ii_itte6_u { 772typedef union ii_itte6_u {
801 uint64_t ii_itte6_regval; 773 uint64_t ii_itte6_regval;
802 struct { 774 struct {
803 uint64_t i_offset : 5; 775 uint64_t i_offset:5;
804 uint64_t i_rsvd_1 : 3; 776 uint64_t i_rsvd_1:3;
805 uint64_t i_w_num : 4; 777 uint64_t i_w_num:4;
806 uint64_t i_iosp : 1; 778 uint64_t i_iosp:1;
807 uint64_t i_rsvd : 51; 779 uint64_t i_rsvd:51;
808 } ii_itte6_fld_s; 780 } ii_itte6_fld_s;
809} ii_itte6_u_t; 781} ii_itte6_u_t;
810 782
811
812/************************************************************************ 783/************************************************************************
813 * * 784 * *
814 * Description: There are seven instances of translation table entry * 785 * Description: There are seven instances of translation table entry *
815 * registers. Each register maps a Shub Big Window to a 48-bit * 786 * registers. Each register maps a Shub Big Window to a 48-bit *
816 * address on Crosstalk. * 787 * address on Crosstalk. *
@@ -833,23 +804,22 @@ typedef union ii_itte6_u {
833 * Crosstalk space addressable by the SHub is thus the lower * 804 * Crosstalk space addressable by the SHub is thus the lower *
834 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> * 805 * 8-GBytes per widget (N-mode), only <SUP >7</SUP>/<SUB >32nds</SUB> *
835 * of this space can be accessed. * 806 * of this space can be accessed. *
836 * * 807 * *
837 ************************************************************************/ 808 ************************************************************************/
838 809
839typedef union ii_itte7_u { 810typedef union ii_itte7_u {
840 uint64_t ii_itte7_regval; 811 uint64_t ii_itte7_regval;
841 struct { 812 struct {
842 uint64_t i_offset : 5; 813 uint64_t i_offset:5;
843 uint64_t i_rsvd_1 : 3; 814 uint64_t i_rsvd_1:3;
844 uint64_t i_w_num : 4; 815 uint64_t i_w_num:4;
845 uint64_t i_iosp : 1; 816 uint64_t i_iosp:1;
846 uint64_t i_rsvd : 51; 817 uint64_t i_rsvd:51;
847 } ii_itte7_fld_s; 818 } ii_itte7_fld_s;
848} ii_itte7_u_t; 819} ii_itte7_u_t;
849 820
850
851/************************************************************************ 821/************************************************************************
852 * * 822 * *
853 * Description: There are 9 instances of this register, one per * 823 * Description: There are 9 instances of this register, one per *
854 * actual widget in this implementation of SHub and Crossbow. * 824 * actual widget in this implementation of SHub and Crossbow. *
855 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 825 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -868,33 +838,32 @@ typedef union ii_itte7_u {
868 * register; the write will correct the C field and capture its new * 838 * register; the write will correct the C field and capture its new *
869 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 839 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
870 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 840 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
871 * . * 841 * . *
872 * * 842 * *
873 ************************************************************************/ 843 ************************************************************************/
874 844
875typedef union ii_iprb0_u { 845typedef union ii_iprb0_u {
876 uint64_t ii_iprb0_regval; 846 uint64_t ii_iprb0_regval;
877 struct { 847 struct {
878 uint64_t i_c : 8; 848 uint64_t i_c:8;
879 uint64_t i_na : 14; 849 uint64_t i_na:14;
880 uint64_t i_rsvd_2 : 2; 850 uint64_t i_rsvd_2:2;
881 uint64_t i_nb : 14; 851 uint64_t i_nb:14;
882 uint64_t i_rsvd_1 : 2; 852 uint64_t i_rsvd_1:2;
883 uint64_t i_m : 2; 853 uint64_t i_m:2;
884 uint64_t i_f : 1; 854 uint64_t i_f:1;
885 uint64_t i_of_cnt : 5; 855 uint64_t i_of_cnt:5;
886 uint64_t i_error : 1; 856 uint64_t i_error:1;
887 uint64_t i_rd_to : 1; 857 uint64_t i_rd_to:1;
888 uint64_t i_spur_wr : 1; 858 uint64_t i_spur_wr:1;
889 uint64_t i_spur_rd : 1; 859 uint64_t i_spur_rd:1;
890 uint64_t i_rsvd : 11; 860 uint64_t i_rsvd:11;
891 uint64_t i_mult_err : 1; 861 uint64_t i_mult_err:1;
892 } ii_iprb0_fld_s; 862 } ii_iprb0_fld_s;
893} ii_iprb0_u_t; 863} ii_iprb0_u_t;
894 864
895
896/************************************************************************ 865/************************************************************************
897 * * 866 * *
898 * Description: There are 9 instances of this register, one per * 867 * Description: There are 9 instances of this register, one per *
899 * actual widget in this implementation of SHub and Crossbow. * 868 * actual widget in this implementation of SHub and Crossbow. *
900 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 869 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -913,33 +882,32 @@ typedef union ii_iprb0_u {
913 * register; the write will correct the C field and capture its new * 882 * register; the write will correct the C field and capture its new *
914 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 883 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
915 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 884 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
916 * . * 885 * . *
917 * * 886 * *
918 ************************************************************************/ 887 ************************************************************************/
919 888
920typedef union ii_iprb8_u { 889typedef union ii_iprb8_u {
921 uint64_t ii_iprb8_regval; 890 uint64_t ii_iprb8_regval;
922 struct { 891 struct {
923 uint64_t i_c : 8; 892 uint64_t i_c:8;
924 uint64_t i_na : 14; 893 uint64_t i_na:14;
925 uint64_t i_rsvd_2 : 2; 894 uint64_t i_rsvd_2:2;
926 uint64_t i_nb : 14; 895 uint64_t i_nb:14;
927 uint64_t i_rsvd_1 : 2; 896 uint64_t i_rsvd_1:2;
928 uint64_t i_m : 2; 897 uint64_t i_m:2;
929 uint64_t i_f : 1; 898 uint64_t i_f:1;
930 uint64_t i_of_cnt : 5; 899 uint64_t i_of_cnt:5;
931 uint64_t i_error : 1; 900 uint64_t i_error:1;
932 uint64_t i_rd_to : 1; 901 uint64_t i_rd_to:1;
933 uint64_t i_spur_wr : 1; 902 uint64_t i_spur_wr:1;
934 uint64_t i_spur_rd : 1; 903 uint64_t i_spur_rd:1;
935 uint64_t i_rsvd : 11; 904 uint64_t i_rsvd:11;
936 uint64_t i_mult_err : 1; 905 uint64_t i_mult_err:1;
937 } ii_iprb8_fld_s; 906 } ii_iprb8_fld_s;
938} ii_iprb8_u_t; 907} ii_iprb8_u_t;
939 908
940
941/************************************************************************ 909/************************************************************************
942 * * 910 * *
943 * Description: There are 9 instances of this register, one per * 911 * Description: There are 9 instances of this register, one per *
944 * actual widget in this implementation of SHub and Crossbow. * 912 * actual widget in this implementation of SHub and Crossbow. *
945 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 913 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -958,33 +926,32 @@ typedef union ii_iprb8_u {
958 * register; the write will correct the C field and capture its new * 926 * register; the write will correct the C field and capture its new *
959 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 927 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
960 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 928 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
961 * . * 929 * . *
962 * * 930 * *
963 ************************************************************************/ 931 ************************************************************************/
964 932
965typedef union ii_iprb9_u { 933typedef union ii_iprb9_u {
966 uint64_t ii_iprb9_regval; 934 uint64_t ii_iprb9_regval;
967 struct { 935 struct {
968 uint64_t i_c : 8; 936 uint64_t i_c:8;
969 uint64_t i_na : 14; 937 uint64_t i_na:14;
970 uint64_t i_rsvd_2 : 2; 938 uint64_t i_rsvd_2:2;
971 uint64_t i_nb : 14; 939 uint64_t i_nb:14;
972 uint64_t i_rsvd_1 : 2; 940 uint64_t i_rsvd_1:2;
973 uint64_t i_m : 2; 941 uint64_t i_m:2;
974 uint64_t i_f : 1; 942 uint64_t i_f:1;
975 uint64_t i_of_cnt : 5; 943 uint64_t i_of_cnt:5;
976 uint64_t i_error : 1; 944 uint64_t i_error:1;
977 uint64_t i_rd_to : 1; 945 uint64_t i_rd_to:1;
978 uint64_t i_spur_wr : 1; 946 uint64_t i_spur_wr:1;
979 uint64_t i_spur_rd : 1; 947 uint64_t i_spur_rd:1;
980 uint64_t i_rsvd : 11; 948 uint64_t i_rsvd:11;
981 uint64_t i_mult_err : 1; 949 uint64_t i_mult_err:1;
982 } ii_iprb9_fld_s; 950 } ii_iprb9_fld_s;
983} ii_iprb9_u_t; 951} ii_iprb9_u_t;
984 952
985
986/************************************************************************ 953/************************************************************************
987 * * 954 * *
988 * Description: There are 9 instances of this register, one per * 955 * Description: There are 9 instances of this register, one per *
989 * actual widget in this implementation of SHub and Crossbow. * 956 * actual widget in this implementation of SHub and Crossbow. *
990 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 957 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -1003,33 +970,32 @@ typedef union ii_iprb9_u {
1003 * register; the write will correct the C field and capture its new * 970 * register; the write will correct the C field and capture its new *
1004 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 971 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
1005 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 972 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
1006 * * 973 * *
1007 * * 974 * *
1008 ************************************************************************/ 975 ************************************************************************/
1009 976
1010typedef union ii_iprba_u { 977typedef union ii_iprba_u {
1011 uint64_t ii_iprba_regval; 978 uint64_t ii_iprba_regval;
1012 struct { 979 struct {
1013 uint64_t i_c : 8; 980 uint64_t i_c:8;
1014 uint64_t i_na : 14; 981 uint64_t i_na:14;
1015 uint64_t i_rsvd_2 : 2; 982 uint64_t i_rsvd_2:2;
1016 uint64_t i_nb : 14; 983 uint64_t i_nb:14;
1017 uint64_t i_rsvd_1 : 2; 984 uint64_t i_rsvd_1:2;
1018 uint64_t i_m : 2; 985 uint64_t i_m:2;
1019 uint64_t i_f : 1; 986 uint64_t i_f:1;
1020 uint64_t i_of_cnt : 5; 987 uint64_t i_of_cnt:5;
1021 uint64_t i_error : 1; 988 uint64_t i_error:1;
1022 uint64_t i_rd_to : 1; 989 uint64_t i_rd_to:1;
1023 uint64_t i_spur_wr : 1; 990 uint64_t i_spur_wr:1;
1024 uint64_t i_spur_rd : 1; 991 uint64_t i_spur_rd:1;
1025 uint64_t i_rsvd : 11; 992 uint64_t i_rsvd:11;
1026 uint64_t i_mult_err : 1; 993 uint64_t i_mult_err:1;
1027 } ii_iprba_fld_s; 994 } ii_iprba_fld_s;
1028} ii_iprba_u_t; 995} ii_iprba_u_t;
1029 996
1030
1031/************************************************************************ 997/************************************************************************
1032 * * 998 * *
1033 * Description: There are 9 instances of this register, one per * 999 * Description: There are 9 instances of this register, one per *
1034 * actual widget in this implementation of SHub and Crossbow. * 1000 * actual widget in this implementation of SHub and Crossbow. *
1035 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 1001 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -1048,33 +1014,32 @@ typedef union ii_iprba_u {
1048 * register; the write will correct the C field and capture its new * 1014 * register; the write will correct the C field and capture its new *
1049 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 1015 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
1050 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 1016 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
1051 * . * 1017 * . *
1052 * * 1018 * *
1053 ************************************************************************/ 1019 ************************************************************************/
1054 1020
1055typedef union ii_iprbb_u { 1021typedef union ii_iprbb_u {
1056 uint64_t ii_iprbb_regval; 1022 uint64_t ii_iprbb_regval;
1057 struct { 1023 struct {
1058 uint64_t i_c : 8; 1024 uint64_t i_c:8;
1059 uint64_t i_na : 14; 1025 uint64_t i_na:14;
1060 uint64_t i_rsvd_2 : 2; 1026 uint64_t i_rsvd_2:2;
1061 uint64_t i_nb : 14; 1027 uint64_t i_nb:14;
1062 uint64_t i_rsvd_1 : 2; 1028 uint64_t i_rsvd_1:2;
1063 uint64_t i_m : 2; 1029 uint64_t i_m:2;
1064 uint64_t i_f : 1; 1030 uint64_t i_f:1;
1065 uint64_t i_of_cnt : 5; 1031 uint64_t i_of_cnt:5;
1066 uint64_t i_error : 1; 1032 uint64_t i_error:1;
1067 uint64_t i_rd_to : 1; 1033 uint64_t i_rd_to:1;
1068 uint64_t i_spur_wr : 1; 1034 uint64_t i_spur_wr:1;
1069 uint64_t i_spur_rd : 1; 1035 uint64_t i_spur_rd:1;
1070 uint64_t i_rsvd : 11; 1036 uint64_t i_rsvd:11;
1071 uint64_t i_mult_err : 1; 1037 uint64_t i_mult_err:1;
1072 } ii_iprbb_fld_s; 1038 } ii_iprbb_fld_s;
1073} ii_iprbb_u_t; 1039} ii_iprbb_u_t;
1074 1040
1075
1076/************************************************************************ 1041/************************************************************************
1077 * * 1042 * *
1078 * Description: There are 9 instances of this register, one per * 1043 * Description: There are 9 instances of this register, one per *
1079 * actual widget in this implementation of SHub and Crossbow. * 1044 * actual widget in this implementation of SHub and Crossbow. *
1080 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 1045 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -1093,33 +1058,32 @@ typedef union ii_iprbb_u {
1093 * register; the write will correct the C field and capture its new * 1058 * register; the write will correct the C field and capture its new *
1094 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 1059 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
1095 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 1060 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
1096 * . * 1061 * . *
1097 * * 1062 * *
1098 ************************************************************************/ 1063 ************************************************************************/
1099 1064
1100typedef union ii_iprbc_u { 1065typedef union ii_iprbc_u {
1101 uint64_t ii_iprbc_regval; 1066 uint64_t ii_iprbc_regval;
1102 struct { 1067 struct {
1103 uint64_t i_c : 8; 1068 uint64_t i_c:8;
1104 uint64_t i_na : 14; 1069 uint64_t i_na:14;
1105 uint64_t i_rsvd_2 : 2; 1070 uint64_t i_rsvd_2:2;
1106 uint64_t i_nb : 14; 1071 uint64_t i_nb:14;
1107 uint64_t i_rsvd_1 : 2; 1072 uint64_t i_rsvd_1:2;
1108 uint64_t i_m : 2; 1073 uint64_t i_m:2;
1109 uint64_t i_f : 1; 1074 uint64_t i_f:1;
1110 uint64_t i_of_cnt : 5; 1075 uint64_t i_of_cnt:5;
1111 uint64_t i_error : 1; 1076 uint64_t i_error:1;
1112 uint64_t i_rd_to : 1; 1077 uint64_t i_rd_to:1;
1113 uint64_t i_spur_wr : 1; 1078 uint64_t i_spur_wr:1;
1114 uint64_t i_spur_rd : 1; 1079 uint64_t i_spur_rd:1;
1115 uint64_t i_rsvd : 11; 1080 uint64_t i_rsvd:11;
1116 uint64_t i_mult_err : 1; 1081 uint64_t i_mult_err:1;
1117 } ii_iprbc_fld_s; 1082 } ii_iprbc_fld_s;
1118} ii_iprbc_u_t; 1083} ii_iprbc_u_t;
1119 1084
1120
1121/************************************************************************ 1085/************************************************************************
1122 * * 1086 * *
1123 * Description: There are 9 instances of this register, one per * 1087 * Description: There are 9 instances of this register, one per *
1124 * actual widget in this implementation of SHub and Crossbow. * 1088 * actual widget in this implementation of SHub and Crossbow. *
1125 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 1089 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -1138,33 +1102,32 @@ typedef union ii_iprbc_u {
1138 * register; the write will correct the C field and capture its new * 1102 * register; the write will correct the C field and capture its new *
1139 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 1103 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
1140 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 1104 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
1141 * . * 1105 * . *
1142 * * 1106 * *
1143 ************************************************************************/ 1107 ************************************************************************/
1144 1108
1145typedef union ii_iprbd_u { 1109typedef union ii_iprbd_u {
1146 uint64_t ii_iprbd_regval; 1110 uint64_t ii_iprbd_regval;
1147 struct { 1111 struct {
1148 uint64_t i_c : 8; 1112 uint64_t i_c:8;
1149 uint64_t i_na : 14; 1113 uint64_t i_na:14;
1150 uint64_t i_rsvd_2 : 2; 1114 uint64_t i_rsvd_2:2;
1151 uint64_t i_nb : 14; 1115 uint64_t i_nb:14;
1152 uint64_t i_rsvd_1 : 2; 1116 uint64_t i_rsvd_1:2;
1153 uint64_t i_m : 2; 1117 uint64_t i_m:2;
1154 uint64_t i_f : 1; 1118 uint64_t i_f:1;
1155 uint64_t i_of_cnt : 5; 1119 uint64_t i_of_cnt:5;
1156 uint64_t i_error : 1; 1120 uint64_t i_error:1;
1157 uint64_t i_rd_to : 1; 1121 uint64_t i_rd_to:1;
1158 uint64_t i_spur_wr : 1; 1122 uint64_t i_spur_wr:1;
1159 uint64_t i_spur_rd : 1; 1123 uint64_t i_spur_rd:1;
1160 uint64_t i_rsvd : 11; 1124 uint64_t i_rsvd:11;
1161 uint64_t i_mult_err : 1; 1125 uint64_t i_mult_err:1;
1162 } ii_iprbd_fld_s; 1126 } ii_iprbd_fld_s;
1163} ii_iprbd_u_t; 1127} ii_iprbd_u_t;
1164 1128
1165
1166/************************************************************************ 1129/************************************************************************
1167 * * 1130 * *
1168 * Description: There are 9 instances of this register, one per * 1131 * Description: There are 9 instances of this register, one per *
1169 * actual widget in this implementation of SHub and Crossbow. * 1132 * actual widget in this implementation of SHub and Crossbow. *
1170 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 1133 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -1183,33 +1146,32 @@ typedef union ii_iprbd_u {
1183 * register; the write will correct the C field and capture its new * 1146 * register; the write will correct the C field and capture its new *
1184 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 1147 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
1185 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 1148 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
1186 * . * 1149 * . *
1187 * * 1150 * *
1188 ************************************************************************/ 1151 ************************************************************************/
1189 1152
1190typedef union ii_iprbe_u { 1153typedef union ii_iprbe_u {
1191 uint64_t ii_iprbe_regval; 1154 uint64_t ii_iprbe_regval;
1192 struct { 1155 struct {
1193 uint64_t i_c : 8; 1156 uint64_t i_c:8;
1194 uint64_t i_na : 14; 1157 uint64_t i_na:14;
1195 uint64_t i_rsvd_2 : 2; 1158 uint64_t i_rsvd_2:2;
1196 uint64_t i_nb : 14; 1159 uint64_t i_nb:14;
1197 uint64_t i_rsvd_1 : 2; 1160 uint64_t i_rsvd_1:2;
1198 uint64_t i_m : 2; 1161 uint64_t i_m:2;
1199 uint64_t i_f : 1; 1162 uint64_t i_f:1;
1200 uint64_t i_of_cnt : 5; 1163 uint64_t i_of_cnt:5;
1201 uint64_t i_error : 1; 1164 uint64_t i_error:1;
1202 uint64_t i_rd_to : 1; 1165 uint64_t i_rd_to:1;
1203 uint64_t i_spur_wr : 1; 1166 uint64_t i_spur_wr:1;
1204 uint64_t i_spur_rd : 1; 1167 uint64_t i_spur_rd:1;
1205 uint64_t i_rsvd : 11; 1168 uint64_t i_rsvd:11;
1206 uint64_t i_mult_err : 1; 1169 uint64_t i_mult_err:1;
1207 } ii_iprbe_fld_s; 1170 } ii_iprbe_fld_s;
1208} ii_iprbe_u_t; 1171} ii_iprbe_u_t;
1209 1172
1210
1211/************************************************************************ 1173/************************************************************************
1212 * * 1174 * *
1213 * Description: There are 9 instances of this register, one per * 1175 * Description: There are 9 instances of this register, one per *
1214 * actual widget in this implementation of Shub and Crossbow. * 1176 * actual widget in this implementation of Shub and Crossbow. *
1215 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 * 1177 * Note: Crossbow only has ports for Widgets 8 through F, widget 0 *
@@ -1228,33 +1190,32 @@ typedef union ii_iprbe_u {
1228 * register; the write will correct the C field and capture its new * 1190 * register; the write will correct the C field and capture its new *
1229 * value in the internal register. Even if IECLR[E_PRB_x] is set, the * 1191 * value in the internal register. Even if IECLR[E_PRB_x] is set, the *
1230 * SPUR_WR bit will persist if IPRBx hasn't yet been written. * 1192 * SPUR_WR bit will persist if IPRBx hasn't yet been written. *
1231 * . * 1193 * . *
1232 * * 1194 * *
1233 ************************************************************************/ 1195 ************************************************************************/
1234 1196
1235typedef union ii_iprbf_u { 1197typedef union ii_iprbf_u {
1236 uint64_t ii_iprbf_regval; 1198 uint64_t ii_iprbf_regval;
1237 struct { 1199 struct {
1238 uint64_t i_c : 8; 1200 uint64_t i_c:8;
1239 uint64_t i_na : 14; 1201 uint64_t i_na:14;
1240 uint64_t i_rsvd_2 : 2; 1202 uint64_t i_rsvd_2:2;
1241 uint64_t i_nb : 14; 1203 uint64_t i_nb:14;
1242 uint64_t i_rsvd_1 : 2; 1204 uint64_t i_rsvd_1:2;
1243 uint64_t i_m : 2; 1205 uint64_t i_m:2;
1244 uint64_t i_f : 1; 1206 uint64_t i_f:1;
1245 uint64_t i_of_cnt : 5; 1207 uint64_t i_of_cnt:5;
1246 uint64_t i_error : 1; 1208 uint64_t i_error:1;
1247 uint64_t i_rd_to : 1; 1209 uint64_t i_rd_to:1;
1248 uint64_t i_spur_wr : 1; 1210 uint64_t i_spur_wr:1;
1249 uint64_t i_spur_rd : 1; 1211 uint64_t i_spur_rd:1;
1250 uint64_t i_rsvd : 11; 1212 uint64_t i_rsvd:11;
1251 uint64_t i_mult_err : 1; 1213 uint64_t i_mult_err:1;
1252 } ii_iprbe_fld_s; 1214 } ii_iprbe_fld_s;
1253} ii_iprbf_u_t; 1215} ii_iprbf_u_t;
1254 1216
1255
1256/************************************************************************ 1217/************************************************************************
1257 * * 1218 * *
1258 * This register specifies the timeout value to use for monitoring * 1219 * This register specifies the timeout value to use for monitoring *
1259 * Crosstalk credits which are used outbound to Crosstalk. An * 1220 * Crosstalk credits which are used outbound to Crosstalk. An *
1260 * internal counter called the Crosstalk Credit Timeout Counter * 1221 * internal counter called the Crosstalk Credit Timeout Counter *
@@ -1267,20 +1228,19 @@ typedef union ii_iprbf_u {
1267 * Crosstalk Credit Timeout has occurred. The internal counter is not * 1228 * Crosstalk Credit Timeout has occurred. The internal counter is not *
1268 * readable from software, and stops counting at its maximum value, * 1229 * readable from software, and stops counting at its maximum value, *
1269 * so it cannot cause more than one interrupt. * 1230 * so it cannot cause more than one interrupt. *
1270 * * 1231 * *
1271 ************************************************************************/ 1232 ************************************************************************/
1272 1233
1273typedef union ii_ixcc_u { 1234typedef union ii_ixcc_u {
1274 uint64_t ii_ixcc_regval; 1235 uint64_t ii_ixcc_regval;
1275 struct { 1236 struct {
1276 uint64_t i_time_out : 26; 1237 uint64_t i_time_out:26;
1277 uint64_t i_rsvd : 38; 1238 uint64_t i_rsvd:38;
1278 } ii_ixcc_fld_s; 1239 } ii_ixcc_fld_s;
1279} ii_ixcc_u_t; 1240} ii_ixcc_u_t;
1280 1241
1281
1282/************************************************************************ 1242/************************************************************************
1283 * * 1243 * *
1284 * Description: This register qualifies all the PIO and DMA * 1244 * Description: This register qualifies all the PIO and DMA *
1285 * operations launched from widget 0 towards the SHub. In * 1245 * operations launched from widget 0 towards the SHub. In *
1286 * addition, it also qualifies accesses by the BTE streams. * 1246 * addition, it also qualifies accesses by the BTE streams. *
@@ -1292,27 +1252,25 @@ typedef union ii_ixcc_u {
1292 * the Wx_IAC field. The bits in this field are set by writing a 1 to * 1252 * the Wx_IAC field. The bits in this field are set by writing a 1 to *
1293 * them. Incoming replies from Crosstalk are not subject to this * 1253 * them. Incoming replies from Crosstalk are not subject to this *
1294 * access control mechanism. * 1254 * access control mechanism. *
1295 * * 1255 * *
1296 ************************************************************************/ 1256 ************************************************************************/
1297 1257
1298typedef union ii_imem_u { 1258typedef union ii_imem_u {
1299 uint64_t ii_imem_regval; 1259 uint64_t ii_imem_regval;
1300 struct { 1260 struct {
1301 uint64_t i_w0_esd : 1; 1261 uint64_t i_w0_esd:1;
1302 uint64_t i_rsvd_3 : 3; 1262 uint64_t i_rsvd_3:3;
1303 uint64_t i_b0_esd : 1; 1263 uint64_t i_b0_esd:1;
1304 uint64_t i_rsvd_2 : 3; 1264 uint64_t i_rsvd_2:3;
1305 uint64_t i_b1_esd : 1; 1265 uint64_t i_b1_esd:1;
1306 uint64_t i_rsvd_1 : 3; 1266 uint64_t i_rsvd_1:3;
1307 uint64_t i_clr_precise : 1; 1267 uint64_t i_clr_precise:1;
1308 uint64_t i_rsvd : 51; 1268 uint64_t i_rsvd:51;
1309 } ii_imem_fld_s; 1269 } ii_imem_fld_s;
1310} ii_imem_u_t; 1270} ii_imem_u_t;
1311 1271
1312
1313
1314/************************************************************************ 1272/************************************************************************
1315 * * 1273 * *
1316 * Description: This register specifies the timeout value to use for * 1274 * Description: This register specifies the timeout value to use for *
1317 * monitoring Crosstalk tail flits coming into the Shub in the * 1275 * monitoring Crosstalk tail flits coming into the Shub in the *
1318 * TAIL_TO field. An internal counter associated with this register * 1276 * TAIL_TO field. An internal counter associated with this register *
@@ -1332,90 +1290,87 @@ typedef union ii_imem_u {
1332 * the value in the RRSP_TO field, a Read Response Timeout has * 1290 * the value in the RRSP_TO field, a Read Response Timeout has *
1333 * occurred, and error handling occurs as described in the Error * 1291 * occurred, and error handling occurs as described in the Error *
1334 * Handling section of this document. * 1292 * Handling section of this document. *
1335 * * 1293 * *
1336 ************************************************************************/ 1294 ************************************************************************/
1337 1295
1338typedef union ii_ixtt_u { 1296typedef union ii_ixtt_u {
1339 uint64_t ii_ixtt_regval; 1297 uint64_t ii_ixtt_regval;
1340 struct { 1298 struct {
1341 uint64_t i_tail_to : 26; 1299 uint64_t i_tail_to:26;
1342 uint64_t i_rsvd_1 : 6; 1300 uint64_t i_rsvd_1:6;
1343 uint64_t i_rrsp_ps : 23; 1301 uint64_t i_rrsp_ps:23;
1344 uint64_t i_rrsp_to : 5; 1302 uint64_t i_rrsp_to:5;
1345 uint64_t i_rsvd : 4; 1303 uint64_t i_rsvd:4;
1346 } ii_ixtt_fld_s; 1304 } ii_ixtt_fld_s;
1347} ii_ixtt_u_t; 1305} ii_ixtt_u_t;
1348 1306
1349
1350/************************************************************************ 1307/************************************************************************
1351 * * 1308 * *
1352 * Writing a 1 to the fields of this register clears the appropriate * 1309 * Writing a 1 to the fields of this register clears the appropriate *
1353 * error bits in other areas of SHub. Note that when the * 1310 * error bits in other areas of SHub. Note that when the *
1354 * E_PRB_x bits are used to clear error bits in PRB registers, * 1311 * E_PRB_x bits are used to clear error bits in PRB registers, *
1355 * SPUR_RD and SPUR_WR may persist, because they require additional * 1312 * SPUR_RD and SPUR_WR may persist, because they require additional *
1356 * action to clear them. See the IPRBx and IXSS Register * 1313 * action to clear them. See the IPRBx and IXSS Register *
1357 * specifications. * 1314 * specifications. *
1358 * * 1315 * *
1359 ************************************************************************/ 1316 ************************************************************************/
1360 1317
1361typedef union ii_ieclr_u { 1318typedef union ii_ieclr_u {
1362 uint64_t ii_ieclr_regval; 1319 uint64_t ii_ieclr_regval;
1363 struct { 1320 struct {
1364 uint64_t i_e_prb_0 : 1; 1321 uint64_t i_e_prb_0:1;
1365 uint64_t i_rsvd : 7; 1322 uint64_t i_rsvd:7;
1366 uint64_t i_e_prb_8 : 1; 1323 uint64_t i_e_prb_8:1;
1367 uint64_t i_e_prb_9 : 1; 1324 uint64_t i_e_prb_9:1;
1368 uint64_t i_e_prb_a : 1; 1325 uint64_t i_e_prb_a:1;
1369 uint64_t i_e_prb_b : 1; 1326 uint64_t i_e_prb_b:1;
1370 uint64_t i_e_prb_c : 1; 1327 uint64_t i_e_prb_c:1;
1371 uint64_t i_e_prb_d : 1; 1328 uint64_t i_e_prb_d:1;
1372 uint64_t i_e_prb_e : 1; 1329 uint64_t i_e_prb_e:1;
1373 uint64_t i_e_prb_f : 1; 1330 uint64_t i_e_prb_f:1;
1374 uint64_t i_e_crazy : 1; 1331 uint64_t i_e_crazy:1;
1375 uint64_t i_e_bte_0 : 1; 1332 uint64_t i_e_bte_0:1;
1376 uint64_t i_e_bte_1 : 1; 1333 uint64_t i_e_bte_1:1;
1377 uint64_t i_reserved_1 : 10; 1334 uint64_t i_reserved_1:10;
1378 uint64_t i_spur_rd_hdr : 1; 1335 uint64_t i_spur_rd_hdr:1;
1379 uint64_t i_cam_intr_to : 1; 1336 uint64_t i_cam_intr_to:1;
1380 uint64_t i_cam_overflow : 1; 1337 uint64_t i_cam_overflow:1;
1381 uint64_t i_cam_read_miss : 1; 1338 uint64_t i_cam_read_miss:1;
1382 uint64_t i_ioq_rep_underflow : 1; 1339 uint64_t i_ioq_rep_underflow:1;
1383 uint64_t i_ioq_req_underflow : 1; 1340 uint64_t i_ioq_req_underflow:1;
1384 uint64_t i_ioq_rep_overflow : 1; 1341 uint64_t i_ioq_rep_overflow:1;
1385 uint64_t i_ioq_req_overflow : 1; 1342 uint64_t i_ioq_req_overflow:1;
1386 uint64_t i_iiq_rep_overflow : 1; 1343 uint64_t i_iiq_rep_overflow:1;
1387 uint64_t i_iiq_req_overflow : 1; 1344 uint64_t i_iiq_req_overflow:1;
1388 uint64_t i_ii_xn_rep_cred_overflow : 1; 1345 uint64_t i_ii_xn_rep_cred_overflow:1;
1389 uint64_t i_ii_xn_req_cred_overflow : 1; 1346 uint64_t i_ii_xn_req_cred_overflow:1;
1390 uint64_t i_ii_xn_invalid_cmd : 1; 1347 uint64_t i_ii_xn_invalid_cmd:1;
1391 uint64_t i_xn_ii_invalid_cmd : 1; 1348 uint64_t i_xn_ii_invalid_cmd:1;
1392 uint64_t i_reserved_2 : 21; 1349 uint64_t i_reserved_2:21;
1393 } ii_ieclr_fld_s; 1350 } ii_ieclr_fld_s;
1394} ii_ieclr_u_t; 1351} ii_ieclr_u_t;
1395 1352
1396
1397/************************************************************************ 1353/************************************************************************
1398 * * 1354 * *
1399 * This register controls both BTEs. SOFT_RESET is intended for * 1355 * This register controls both BTEs. SOFT_RESET is intended for *
1400 * recovery after an error. COUNT controls the total number of CRBs * 1356 * recovery after an error. COUNT controls the total number of CRBs *
1401 * that both BTEs (combined) can use, which affects total BTE * 1357 * that both BTEs (combined) can use, which affects total BTE *
1402 * bandwidth. * 1358 * bandwidth. *
1403 * * 1359 * *
1404 ************************************************************************/ 1360 ************************************************************************/
1405 1361
1406typedef union ii_ibcr_u { 1362typedef union ii_ibcr_u {
1407 uint64_t ii_ibcr_regval; 1363 uint64_t ii_ibcr_regval;
1408 struct { 1364 struct {
1409 uint64_t i_count : 4; 1365 uint64_t i_count:4;
1410 uint64_t i_rsvd_1 : 4; 1366 uint64_t i_rsvd_1:4;
1411 uint64_t i_soft_reset : 1; 1367 uint64_t i_soft_reset:1;
1412 uint64_t i_rsvd : 55; 1368 uint64_t i_rsvd:55;
1413 } ii_ibcr_fld_s; 1369 } ii_ibcr_fld_s;
1414} ii_ibcr_u_t; 1370} ii_ibcr_u_t;
1415 1371
1416
1417/************************************************************************ 1372/************************************************************************
1418 * * 1373 * *
1419 * This register contains the header of a spurious read response * 1374 * This register contains the header of a spurious read response *
1420 * received from Crosstalk. A spurious read response is defined as a * 1375 * received from Crosstalk. A spurious read response is defined as a *
1421 * read response received by II from a widget for which (1) the SIDN * 1376 * read response received by II from a widget for which (1) the SIDN *
@@ -1440,49 +1395,47 @@ typedef union ii_ibcr_u {
1440 * will be set. Any SPUR_RD bits in any other PRB registers indicate * 1395 * will be set. Any SPUR_RD bits in any other PRB registers indicate *
1441 * spurious messages from other widets which were detected after the * 1396 * spurious messages from other widets which were detected after the *
1442 * header was captured.. * 1397 * header was captured.. *
1443 * * 1398 * *
1444 ************************************************************************/ 1399 ************************************************************************/
1445 1400
1446typedef union ii_ixsm_u { 1401typedef union ii_ixsm_u {
1447 uint64_t ii_ixsm_regval; 1402 uint64_t ii_ixsm_regval;
1448 struct { 1403 struct {
1449 uint64_t i_byte_en : 32; 1404 uint64_t i_byte_en:32;
1450 uint64_t i_reserved : 1; 1405 uint64_t i_reserved:1;
1451 uint64_t i_tag : 3; 1406 uint64_t i_tag:3;
1452 uint64_t i_alt_pactyp : 4; 1407 uint64_t i_alt_pactyp:4;
1453 uint64_t i_bo : 1; 1408 uint64_t i_bo:1;
1454 uint64_t i_error : 1; 1409 uint64_t i_error:1;
1455 uint64_t i_vbpm : 1; 1410 uint64_t i_vbpm:1;
1456 uint64_t i_gbr : 1; 1411 uint64_t i_gbr:1;
1457 uint64_t i_ds : 2; 1412 uint64_t i_ds:2;
1458 uint64_t i_ct : 1; 1413 uint64_t i_ct:1;
1459 uint64_t i_tnum : 5; 1414 uint64_t i_tnum:5;
1460 uint64_t i_pactyp : 4; 1415 uint64_t i_pactyp:4;
1461 uint64_t i_sidn : 4; 1416 uint64_t i_sidn:4;
1462 uint64_t i_didn : 4; 1417 uint64_t i_didn:4;
1463 } ii_ixsm_fld_s; 1418 } ii_ixsm_fld_s;
1464} ii_ixsm_u_t; 1419} ii_ixsm_u_t;
1465 1420
1466
1467/************************************************************************ 1421/************************************************************************
1468 * * 1422 * *
1469 * This register contains the sideband bits of a spurious read * 1423 * This register contains the sideband bits of a spurious read *
1470 * response received from Crosstalk. * 1424 * response received from Crosstalk. *
1471 * * 1425 * *
1472 ************************************************************************/ 1426 ************************************************************************/
1473 1427
1474typedef union ii_ixss_u { 1428typedef union ii_ixss_u {
1475 uint64_t ii_ixss_regval; 1429 uint64_t ii_ixss_regval;
1476 struct { 1430 struct {
1477 uint64_t i_sideband : 8; 1431 uint64_t i_sideband:8;
1478 uint64_t i_rsvd : 55; 1432 uint64_t i_rsvd:55;
1479 uint64_t i_valid : 1; 1433 uint64_t i_valid:1;
1480 } ii_ixss_fld_s; 1434 } ii_ixss_fld_s;
1481} ii_ixss_u_t; 1435} ii_ixss_u_t;
1482 1436
1483
1484/************************************************************************ 1437/************************************************************************
1485 * * 1438 * *
1486 * This register enables software to access the II LLP's test port. * 1439 * This register enables software to access the II LLP's test port. *
1487 * Refer to the LLP 2.5 documentation for an explanation of the test * 1440 * Refer to the LLP 2.5 documentation for an explanation of the test *
1488 * port. Software can write to this register to program the values * 1441 * port. Software can write to this register to program the values *
@@ -1490,27 +1443,26 @@ typedef union ii_ixss_u {
1490 * TestMask and TestSeed). Similarly, software can read from this * 1443 * TestMask and TestSeed). Similarly, software can read from this *
1491 * register to obtain the values of the test port's status outputs * 1444 * register to obtain the values of the test port's status outputs *
1492 * (TestCBerr, TestValid and TestData). * 1445 * (TestCBerr, TestValid and TestData). *
1493 * * 1446 * *
1494 ************************************************************************/ 1447 ************************************************************************/
1495 1448
1496typedef union ii_ilct_u { 1449typedef union ii_ilct_u {
1497 uint64_t ii_ilct_regval; 1450 uint64_t ii_ilct_regval;
1498 struct { 1451 struct {
1499 uint64_t i_test_seed : 20; 1452 uint64_t i_test_seed:20;
1500 uint64_t i_test_mask : 8; 1453 uint64_t i_test_mask:8;
1501 uint64_t i_test_data : 20; 1454 uint64_t i_test_data:20;
1502 uint64_t i_test_valid : 1; 1455 uint64_t i_test_valid:1;
1503 uint64_t i_test_cberr : 1; 1456 uint64_t i_test_cberr:1;
1504 uint64_t i_test_flit : 3; 1457 uint64_t i_test_flit:3;
1505 uint64_t i_test_clear : 1; 1458 uint64_t i_test_clear:1;
1506 uint64_t i_test_err_capture : 1; 1459 uint64_t i_test_err_capture:1;
1507 uint64_t i_rsvd : 9; 1460 uint64_t i_rsvd:9;
1508 } ii_ilct_fld_s; 1461 } ii_ilct_fld_s;
1509} ii_ilct_u_t; 1462} ii_ilct_u_t;
1510 1463
1511
1512/************************************************************************ 1464/************************************************************************
1513 * * 1465 * *
1514 * If the II detects an illegal incoming Duplonet packet (request or * 1466 * If the II detects an illegal incoming Duplonet packet (request or *
1515 * reply) when VALID==0 in the IIEPH1 register, then it saves the * 1467 * reply) when VALID==0 in the IIEPH1 register, then it saves the *
1516 * contents of the packet's header flit in the IIEPH1 and IIEPH2 * 1468 * contents of the packet's header flit in the IIEPH1 and IIEPH2 *
@@ -1526,575 +1478,549 @@ typedef union ii_ilct_u {
1526 * packet when VALID==1 in the IIEPH1 register, then it merely sets * 1478 * packet when VALID==1 in the IIEPH1 register, then it merely sets *
1527 * the OVERRUN bit to indicate that a subsequent error has happened, * 1479 * the OVERRUN bit to indicate that a subsequent error has happened, *
1528 * and does nothing further. * 1480 * and does nothing further. *
1529 * * 1481 * *
1530 ************************************************************************/ 1482 ************************************************************************/
1531 1483
1532typedef union ii_iieph1_u { 1484typedef union ii_iieph1_u {
1533 uint64_t ii_iieph1_regval; 1485 uint64_t ii_iieph1_regval;
1534 struct { 1486 struct {
1535 uint64_t i_command : 7; 1487 uint64_t i_command:7;
1536 uint64_t i_rsvd_5 : 1; 1488 uint64_t i_rsvd_5:1;
1537 uint64_t i_suppl : 14; 1489 uint64_t i_suppl:14;
1538 uint64_t i_rsvd_4 : 1; 1490 uint64_t i_rsvd_4:1;
1539 uint64_t i_source : 14; 1491 uint64_t i_source:14;
1540 uint64_t i_rsvd_3 : 1; 1492 uint64_t i_rsvd_3:1;
1541 uint64_t i_err_type : 4; 1493 uint64_t i_err_type:4;
1542 uint64_t i_rsvd_2 : 4; 1494 uint64_t i_rsvd_2:4;
1543 uint64_t i_overrun : 1; 1495 uint64_t i_overrun:1;
1544 uint64_t i_rsvd_1 : 3; 1496 uint64_t i_rsvd_1:3;
1545 uint64_t i_valid : 1; 1497 uint64_t i_valid:1;
1546 uint64_t i_rsvd : 13; 1498 uint64_t i_rsvd:13;
1547 } ii_iieph1_fld_s; 1499 } ii_iieph1_fld_s;
1548} ii_iieph1_u_t; 1500} ii_iieph1_u_t;
1549 1501
1550
1551/************************************************************************ 1502/************************************************************************
1552 * * 1503 * *
1553 * This register holds the Address field from the header flit of an * 1504 * This register holds the Address field from the header flit of an *
1554 * incoming erroneous Duplonet packet, along with the tail bit which * 1505 * incoming erroneous Duplonet packet, along with the tail bit which *
1555 * accompanied this header flit. This register is essentially an * 1506 * accompanied this header flit. This register is essentially an *
1556 * extension of IIEPH1. Two registers were necessary because the 64 * 1507 * extension of IIEPH1. Two registers were necessary because the 64 *
1557 * bits available in only a single register were insufficient to * 1508 * bits available in only a single register were insufficient to *
1558 * capture the entire header flit of an erroneous packet. * 1509 * capture the entire header flit of an erroneous packet. *
1559 * * 1510 * *
1560 ************************************************************************/ 1511 ************************************************************************/
1561 1512
1562typedef union ii_iieph2_u { 1513typedef union ii_iieph2_u {
1563 uint64_t ii_iieph2_regval; 1514 uint64_t ii_iieph2_regval;
1564 struct { 1515 struct {
1565 uint64_t i_rsvd_0 : 3; 1516 uint64_t i_rsvd_0:3;
1566 uint64_t i_address : 47; 1517 uint64_t i_address:47;
1567 uint64_t i_rsvd_1 : 10; 1518 uint64_t i_rsvd_1:10;
1568 uint64_t i_tail : 1; 1519 uint64_t i_tail:1;
1569 uint64_t i_rsvd : 3; 1520 uint64_t i_rsvd:3;
1570 } ii_iieph2_fld_s; 1521 } ii_iieph2_fld_s;
1571} ii_iieph2_u_t; 1522} ii_iieph2_u_t;
1572 1523
1573
1574/******************************/ 1524/******************************/
1575 1525
1576
1577
1578/************************************************************************ 1526/************************************************************************
1579 * * 1527 * *
1580 * This register's value is a bit vector that guards access from SXBs * 1528 * This register's value is a bit vector that guards access from SXBs *
1581 * to local registers within the II as well as to external Crosstalk * 1529 * to local registers within the II as well as to external Crosstalk *
1582 * widgets * 1530 * widgets *
1583 * * 1531 * *
1584 ************************************************************************/ 1532 ************************************************************************/
1585 1533
1586typedef union ii_islapr_u { 1534typedef union ii_islapr_u {
1587 uint64_t ii_islapr_regval; 1535 uint64_t ii_islapr_regval;
1588 struct { 1536 struct {
1589 uint64_t i_region : 64; 1537 uint64_t i_region:64;
1590 } ii_islapr_fld_s; 1538 } ii_islapr_fld_s;
1591} ii_islapr_u_t; 1539} ii_islapr_u_t;
1592 1540
1593
1594/************************************************************************ 1541/************************************************************************
1595 * * 1542 * *
1596 * A write to this register of the 56-bit value "Pup+Bun" will cause * 1543 * A write to this register of the 56-bit value "Pup+Bun" will cause *
1597 * the bit in the ISLAPR register corresponding to the region of the * 1544 * the bit in the ISLAPR register corresponding to the region of the *
1598 * requestor to be set (access allowed). ( 1545 * requestor to be set (access allowed). (
1599 * * 1546 * *
1600 ************************************************************************/ 1547 ************************************************************************/
1601 1548
1602typedef union ii_islapo_u { 1549typedef union ii_islapo_u {
1603 uint64_t ii_islapo_regval; 1550 uint64_t ii_islapo_regval;
1604 struct { 1551 struct {
1605 uint64_t i_io_sbx_ovrride : 56; 1552 uint64_t i_io_sbx_ovrride:56;
1606 uint64_t i_rsvd : 8; 1553 uint64_t i_rsvd:8;
1607 } ii_islapo_fld_s; 1554 } ii_islapo_fld_s;
1608} ii_islapo_u_t; 1555} ii_islapo_u_t;
1609 1556
1610/************************************************************************ 1557/************************************************************************
1611 * * 1558 * *
1612 * Determines how long the wrapper will wait aftr an interrupt is * 1559 * Determines how long the wrapper will wait aftr an interrupt is *
1613 * initially issued from the II before it times out the outstanding * 1560 * initially issued from the II before it times out the outstanding *
1614 * interrupt and drops it from the interrupt queue. * 1561 * interrupt and drops it from the interrupt queue. *
1615 * * 1562 * *
1616 ************************************************************************/ 1563 ************************************************************************/
1617 1564
1618typedef union ii_iwi_u { 1565typedef union ii_iwi_u {
1619 uint64_t ii_iwi_regval; 1566 uint64_t ii_iwi_regval;
1620 struct { 1567 struct {
1621 uint64_t i_prescale : 24; 1568 uint64_t i_prescale:24;
1622 uint64_t i_rsvd : 8; 1569 uint64_t i_rsvd:8;
1623 uint64_t i_timeout : 8; 1570 uint64_t i_timeout:8;
1624 uint64_t i_rsvd1 : 8; 1571 uint64_t i_rsvd1:8;
1625 uint64_t i_intrpt_retry_period : 8; 1572 uint64_t i_intrpt_retry_period:8;
1626 uint64_t i_rsvd2 : 8; 1573 uint64_t i_rsvd2:8;
1627 } ii_iwi_fld_s; 1574 } ii_iwi_fld_s;
1628} ii_iwi_u_t; 1575} ii_iwi_u_t;
1629 1576
1630/************************************************************************ 1577/************************************************************************
1631 * * 1578 * *
1632 * Log errors which have occurred in the II wrapper. The errors are * 1579 * Log errors which have occurred in the II wrapper. The errors are *
1633 * cleared by writing to the IECLR register. * 1580 * cleared by writing to the IECLR register. *
1634 * * 1581 * *
1635 ************************************************************************/ 1582 ************************************************************************/
1636 1583
1637typedef union ii_iwel_u { 1584typedef union ii_iwel_u {
1638 uint64_t ii_iwel_regval; 1585 uint64_t ii_iwel_regval;
1639 struct { 1586 struct {
1640 uint64_t i_intr_timed_out : 1; 1587 uint64_t i_intr_timed_out:1;
1641 uint64_t i_rsvd : 7; 1588 uint64_t i_rsvd:7;
1642 uint64_t i_cam_overflow : 1; 1589 uint64_t i_cam_overflow:1;
1643 uint64_t i_cam_read_miss : 1; 1590 uint64_t i_cam_read_miss:1;
1644 uint64_t i_rsvd1 : 2; 1591 uint64_t i_rsvd1:2;
1645 uint64_t i_ioq_rep_underflow : 1; 1592 uint64_t i_ioq_rep_underflow:1;
1646 uint64_t i_ioq_req_underflow : 1; 1593 uint64_t i_ioq_req_underflow:1;
1647 uint64_t i_ioq_rep_overflow : 1; 1594 uint64_t i_ioq_rep_overflow:1;
1648 uint64_t i_ioq_req_overflow : 1; 1595 uint64_t i_ioq_req_overflow:1;
1649 uint64_t i_iiq_rep_overflow : 1; 1596 uint64_t i_iiq_rep_overflow:1;
1650 uint64_t i_iiq_req_overflow : 1; 1597 uint64_t i_iiq_req_overflow:1;
1651 uint64_t i_rsvd2 : 6; 1598 uint64_t i_rsvd2:6;
1652 uint64_t i_ii_xn_rep_cred_over_under: 1; 1599 uint64_t i_ii_xn_rep_cred_over_under:1;
1653 uint64_t i_ii_xn_req_cred_over_under: 1; 1600 uint64_t i_ii_xn_req_cred_over_under:1;
1654 uint64_t i_rsvd3 : 6; 1601 uint64_t i_rsvd3:6;
1655 uint64_t i_ii_xn_invalid_cmd : 1; 1602 uint64_t i_ii_xn_invalid_cmd:1;
1656 uint64_t i_xn_ii_invalid_cmd : 1; 1603 uint64_t i_xn_ii_invalid_cmd:1;
1657 uint64_t i_rsvd4 : 30; 1604 uint64_t i_rsvd4:30;
1658 } ii_iwel_fld_s; 1605 } ii_iwel_fld_s;
1659} ii_iwel_u_t; 1606} ii_iwel_u_t;
1660 1607
1661/************************************************************************ 1608/************************************************************************
1662 * * 1609 * *
1663 * Controls the II wrapper. * 1610 * Controls the II wrapper. *
1664 * * 1611 * *
1665 ************************************************************************/ 1612 ************************************************************************/
1666 1613
1667typedef union ii_iwc_u { 1614typedef union ii_iwc_u {
1668 uint64_t ii_iwc_regval; 1615 uint64_t ii_iwc_regval;
1669 struct { 1616 struct {
1670 uint64_t i_dma_byte_swap : 1; 1617 uint64_t i_dma_byte_swap:1;
1671 uint64_t i_rsvd : 3; 1618 uint64_t i_rsvd:3;
1672 uint64_t i_cam_read_lines_reset : 1; 1619 uint64_t i_cam_read_lines_reset:1;
1673 uint64_t i_rsvd1 : 3; 1620 uint64_t i_rsvd1:3;
1674 uint64_t i_ii_xn_cred_over_under_log: 1; 1621 uint64_t i_ii_xn_cred_over_under_log:1;
1675 uint64_t i_rsvd2 : 19; 1622 uint64_t i_rsvd2:19;
1676 uint64_t i_xn_rep_iq_depth : 5; 1623 uint64_t i_xn_rep_iq_depth:5;
1677 uint64_t i_rsvd3 : 3; 1624 uint64_t i_rsvd3:3;
1678 uint64_t i_xn_req_iq_depth : 5; 1625 uint64_t i_xn_req_iq_depth:5;
1679 uint64_t i_rsvd4 : 3; 1626 uint64_t i_rsvd4:3;
1680 uint64_t i_iiq_depth : 6; 1627 uint64_t i_iiq_depth:6;
1681 uint64_t i_rsvd5 : 12; 1628 uint64_t i_rsvd5:12;
1682 uint64_t i_force_rep_cred : 1; 1629 uint64_t i_force_rep_cred:1;
1683 uint64_t i_force_req_cred : 1; 1630 uint64_t i_force_req_cred:1;
1684 } ii_iwc_fld_s; 1631 } ii_iwc_fld_s;
1685} ii_iwc_u_t; 1632} ii_iwc_u_t;
1686 1633
1687/************************************************************************ 1634/************************************************************************
1688 * * 1635 * *
1689 * Status in the II wrapper. * 1636 * Status in the II wrapper. *
1690 * * 1637 * *
1691 ************************************************************************/ 1638 ************************************************************************/
1692 1639
1693typedef union ii_iws_u { 1640typedef union ii_iws_u {
1694 uint64_t ii_iws_regval; 1641 uint64_t ii_iws_regval;
1695 struct { 1642 struct {
1696 uint64_t i_xn_rep_iq_credits : 5; 1643 uint64_t i_xn_rep_iq_credits:5;
1697 uint64_t i_rsvd : 3; 1644 uint64_t i_rsvd:3;
1698 uint64_t i_xn_req_iq_credits : 5; 1645 uint64_t i_xn_req_iq_credits:5;
1699 uint64_t i_rsvd1 : 51; 1646 uint64_t i_rsvd1:51;
1700 } ii_iws_fld_s; 1647 } ii_iws_fld_s;
1701} ii_iws_u_t; 1648} ii_iws_u_t;
1702 1649
1703/************************************************************************ 1650/************************************************************************
1704 * * 1651 * *
1705 * Masks errors in the IWEL register. * 1652 * Masks errors in the IWEL register. *
1706 * * 1653 * *
1707 ************************************************************************/ 1654 ************************************************************************/
1708 1655
1709typedef union ii_iweim_u { 1656typedef union ii_iweim_u {
1710 uint64_t ii_iweim_regval; 1657 uint64_t ii_iweim_regval;
1711 struct { 1658 struct {
1712 uint64_t i_intr_timed_out : 1; 1659 uint64_t i_intr_timed_out:1;
1713 uint64_t i_rsvd : 7; 1660 uint64_t i_rsvd:7;
1714 uint64_t i_cam_overflow : 1; 1661 uint64_t i_cam_overflow:1;
1715 uint64_t i_cam_read_miss : 1; 1662 uint64_t i_cam_read_miss:1;
1716 uint64_t i_rsvd1 : 2; 1663 uint64_t i_rsvd1:2;
1717 uint64_t i_ioq_rep_underflow : 1; 1664 uint64_t i_ioq_rep_underflow:1;
1718 uint64_t i_ioq_req_underflow : 1; 1665 uint64_t i_ioq_req_underflow:1;
1719 uint64_t i_ioq_rep_overflow : 1; 1666 uint64_t i_ioq_rep_overflow:1;
1720 uint64_t i_ioq_req_overflow : 1; 1667 uint64_t i_ioq_req_overflow:1;
1721 uint64_t i_iiq_rep_overflow : 1; 1668 uint64_t i_iiq_rep_overflow:1;
1722 uint64_t i_iiq_req_overflow : 1; 1669 uint64_t i_iiq_req_overflow:1;
1723 uint64_t i_rsvd2 : 6; 1670 uint64_t i_rsvd2:6;
1724 uint64_t i_ii_xn_rep_cred_overflow : 1; 1671 uint64_t i_ii_xn_rep_cred_overflow:1;
1725 uint64_t i_ii_xn_req_cred_overflow : 1; 1672 uint64_t i_ii_xn_req_cred_overflow:1;
1726 uint64_t i_rsvd3 : 6; 1673 uint64_t i_rsvd3:6;
1727 uint64_t i_ii_xn_invalid_cmd : 1; 1674 uint64_t i_ii_xn_invalid_cmd:1;
1728 uint64_t i_xn_ii_invalid_cmd : 1; 1675 uint64_t i_xn_ii_invalid_cmd:1;
1729 uint64_t i_rsvd4 : 30; 1676 uint64_t i_rsvd4:30;
1730 } ii_iweim_fld_s; 1677 } ii_iweim_fld_s;
1731} ii_iweim_u_t; 1678} ii_iweim_u_t;
1732 1679
1733
1734/************************************************************************ 1680/************************************************************************
1735 * * 1681 * *
1736 * A write to this register causes a particular field in the * 1682 * A write to this register causes a particular field in the *
1737 * corresponding widget's PRB entry to be adjusted up or down by 1. * 1683 * corresponding widget's PRB entry to be adjusted up or down by 1. *
1738 * This counter should be used when recovering from error and reset * 1684 * This counter should be used when recovering from error and reset *
1739 * conditions. Note that software would be capable of causing * 1685 * conditions. Note that software would be capable of causing *
1740 * inadvertent overflow or underflow of these counters. * 1686 * inadvertent overflow or underflow of these counters. *
1741 * * 1687 * *
1742 ************************************************************************/ 1688 ************************************************************************/
1743 1689
1744typedef union ii_ipca_u { 1690typedef union ii_ipca_u {
1745 uint64_t ii_ipca_regval; 1691 uint64_t ii_ipca_regval;
1746 struct { 1692 struct {
1747 uint64_t i_wid : 4; 1693 uint64_t i_wid:4;
1748 uint64_t i_adjust : 1; 1694 uint64_t i_adjust:1;
1749 uint64_t i_rsvd_1 : 3; 1695 uint64_t i_rsvd_1:3;
1750 uint64_t i_field : 2; 1696 uint64_t i_field:2;
1751 uint64_t i_rsvd : 54; 1697 uint64_t i_rsvd:54;
1752 } ii_ipca_fld_s; 1698 } ii_ipca_fld_s;
1753} ii_ipca_u_t; 1699} ii_ipca_u_t;
1754 1700
1755
1756/************************************************************************ 1701/************************************************************************
1757 * * 1702 * *
1758 * There are 8 instances of this register. This register contains * 1703 * There are 8 instances of this register. This register contains *
1759 * the information that the II has to remember once it has launched a * 1704 * the information that the II has to remember once it has launched a *
1760 * PIO Read operation. The contents are used to form the correct * 1705 * PIO Read operation. The contents are used to form the correct *
1761 * Router Network packet and direct the Crosstalk reply to the * 1706 * Router Network packet and direct the Crosstalk reply to the *
1762 * appropriate processor. * 1707 * appropriate processor. *
1763 * * 1708 * *
1764 ************************************************************************/ 1709 ************************************************************************/
1765 1710
1766
1767typedef union ii_iprte0a_u { 1711typedef union ii_iprte0a_u {
1768 uint64_t ii_iprte0a_regval; 1712 uint64_t ii_iprte0a_regval;
1769 struct { 1713 struct {
1770 uint64_t i_rsvd_1 : 54; 1714 uint64_t i_rsvd_1:54;
1771 uint64_t i_widget : 4; 1715 uint64_t i_widget:4;
1772 uint64_t i_to_cnt : 5; 1716 uint64_t i_to_cnt:5;
1773 uint64_t i_vld : 1; 1717 uint64_t i_vld:1;
1774 } ii_iprte0a_fld_s; 1718 } ii_iprte0a_fld_s;
1775} ii_iprte0a_u_t; 1719} ii_iprte0a_u_t;
1776 1720
1777
1778/************************************************************************ 1721/************************************************************************
1779 * * 1722 * *
1780 * There are 8 instances of this register. This register contains * 1723 * There are 8 instances of this register. This register contains *
1781 * the information that the II has to remember once it has launched a * 1724 * the information that the II has to remember once it has launched a *
1782 * PIO Read operation. The contents are used to form the correct * 1725 * PIO Read operation. The contents are used to form the correct *
1783 * Router Network packet and direct the Crosstalk reply to the * 1726 * Router Network packet and direct the Crosstalk reply to the *
1784 * appropriate processor. * 1727 * appropriate processor. *
1785 * * 1728 * *
1786 ************************************************************************/ 1729 ************************************************************************/
1787 1730
1788typedef union ii_iprte1a_u { 1731typedef union ii_iprte1a_u {
1789 uint64_t ii_iprte1a_regval; 1732 uint64_t ii_iprte1a_regval;
1790 struct { 1733 struct {
1791 uint64_t i_rsvd_1 : 54; 1734 uint64_t i_rsvd_1:54;
1792 uint64_t i_widget : 4; 1735 uint64_t i_widget:4;
1793 uint64_t i_to_cnt : 5; 1736 uint64_t i_to_cnt:5;
1794 uint64_t i_vld : 1; 1737 uint64_t i_vld:1;
1795 } ii_iprte1a_fld_s; 1738 } ii_iprte1a_fld_s;
1796} ii_iprte1a_u_t; 1739} ii_iprte1a_u_t;
1797 1740
1798
1799/************************************************************************ 1741/************************************************************************
1800 * * 1742 * *
1801 * There are 8 instances of this register. This register contains * 1743 * There are 8 instances of this register. This register contains *
1802 * the information that the II has to remember once it has launched a * 1744 * the information that the II has to remember once it has launched a *
1803 * PIO Read operation. The contents are used to form the correct * 1745 * PIO Read operation. The contents are used to form the correct *
1804 * Router Network packet and direct the Crosstalk reply to the * 1746 * Router Network packet and direct the Crosstalk reply to the *
1805 * appropriate processor. * 1747 * appropriate processor. *
1806 * * 1748 * *
1807 ************************************************************************/ 1749 ************************************************************************/
1808 1750
1809typedef union ii_iprte2a_u { 1751typedef union ii_iprte2a_u {
1810 uint64_t ii_iprte2a_regval; 1752 uint64_t ii_iprte2a_regval;
1811 struct { 1753 struct {
1812 uint64_t i_rsvd_1 : 54; 1754 uint64_t i_rsvd_1:54;
1813 uint64_t i_widget : 4; 1755 uint64_t i_widget:4;
1814 uint64_t i_to_cnt : 5; 1756 uint64_t i_to_cnt:5;
1815 uint64_t i_vld : 1; 1757 uint64_t i_vld:1;
1816 } ii_iprte2a_fld_s; 1758 } ii_iprte2a_fld_s;
1817} ii_iprte2a_u_t; 1759} ii_iprte2a_u_t;
1818 1760
1819
1820/************************************************************************ 1761/************************************************************************
1821 * * 1762 * *
1822 * There are 8 instances of this register. This register contains * 1763 * There are 8 instances of this register. This register contains *
1823 * the information that the II has to remember once it has launched a * 1764 * the information that the II has to remember once it has launched a *
1824 * PIO Read operation. The contents are used to form the correct * 1765 * PIO Read operation. The contents are used to form the correct *
1825 * Router Network packet and direct the Crosstalk reply to the * 1766 * Router Network packet and direct the Crosstalk reply to the *
1826 * appropriate processor. * 1767 * appropriate processor. *
1827 * * 1768 * *
1828 ************************************************************************/ 1769 ************************************************************************/
1829 1770
1830typedef union ii_iprte3a_u { 1771typedef union ii_iprte3a_u {
1831 uint64_t ii_iprte3a_regval; 1772 uint64_t ii_iprte3a_regval;
1832 struct { 1773 struct {
1833 uint64_t i_rsvd_1 : 54; 1774 uint64_t i_rsvd_1:54;
1834 uint64_t i_widget : 4; 1775 uint64_t i_widget:4;
1835 uint64_t i_to_cnt : 5; 1776 uint64_t i_to_cnt:5;
1836 uint64_t i_vld : 1; 1777 uint64_t i_vld:1;
1837 } ii_iprte3a_fld_s; 1778 } ii_iprte3a_fld_s;
1838} ii_iprte3a_u_t; 1779} ii_iprte3a_u_t;
1839 1780
1840
1841/************************************************************************ 1781/************************************************************************
1842 * * 1782 * *
1843 * There are 8 instances of this register. This register contains * 1783 * There are 8 instances of this register. This register contains *
1844 * the information that the II has to remember once it has launched a * 1784 * the information that the II has to remember once it has launched a *
1845 * PIO Read operation. The contents are used to form the correct * 1785 * PIO Read operation. The contents are used to form the correct *
1846 * Router Network packet and direct the Crosstalk reply to the * 1786 * Router Network packet and direct the Crosstalk reply to the *
1847 * appropriate processor. * 1787 * appropriate processor. *
1848 * * 1788 * *
1849 ************************************************************************/ 1789 ************************************************************************/
1850 1790
1851typedef union ii_iprte4a_u { 1791typedef union ii_iprte4a_u {
1852 uint64_t ii_iprte4a_regval; 1792 uint64_t ii_iprte4a_regval;
1853 struct { 1793 struct {
1854 uint64_t i_rsvd_1 : 54; 1794 uint64_t i_rsvd_1:54;
1855 uint64_t i_widget : 4; 1795 uint64_t i_widget:4;
1856 uint64_t i_to_cnt : 5; 1796 uint64_t i_to_cnt:5;
1857 uint64_t i_vld : 1; 1797 uint64_t i_vld:1;
1858 } ii_iprte4a_fld_s; 1798 } ii_iprte4a_fld_s;
1859} ii_iprte4a_u_t; 1799} ii_iprte4a_u_t;
1860 1800
1861
1862/************************************************************************ 1801/************************************************************************
1863 * * 1802 * *
1864 * There are 8 instances of this register. This register contains * 1803 * There are 8 instances of this register. This register contains *
1865 * the information that the II has to remember once it has launched a * 1804 * the information that the II has to remember once it has launched a *
1866 * PIO Read operation. The contents are used to form the correct * 1805 * PIO Read operation. The contents are used to form the correct *
1867 * Router Network packet and direct the Crosstalk reply to the * 1806 * Router Network packet and direct the Crosstalk reply to the *
1868 * appropriate processor. * 1807 * appropriate processor. *
1869 * * 1808 * *
1870 ************************************************************************/ 1809 ************************************************************************/
1871 1810
1872typedef union ii_iprte5a_u { 1811typedef union ii_iprte5a_u {
1873 uint64_t ii_iprte5a_regval; 1812 uint64_t ii_iprte5a_regval;
1874 struct { 1813 struct {
1875 uint64_t i_rsvd_1 : 54; 1814 uint64_t i_rsvd_1:54;
1876 uint64_t i_widget : 4; 1815 uint64_t i_widget:4;
1877 uint64_t i_to_cnt : 5; 1816 uint64_t i_to_cnt:5;
1878 uint64_t i_vld : 1; 1817 uint64_t i_vld:1;
1879 } ii_iprte5a_fld_s; 1818 } ii_iprte5a_fld_s;
1880} ii_iprte5a_u_t; 1819} ii_iprte5a_u_t;
1881 1820
1882
1883/************************************************************************ 1821/************************************************************************
1884 * * 1822 * *
1885 * There are 8 instances of this register. This register contains * 1823 * There are 8 instances of this register. This register contains *
1886 * the information that the II has to remember once it has launched a * 1824 * the information that the II has to remember once it has launched a *
1887 * PIO Read operation. The contents are used to form the correct * 1825 * PIO Read operation. The contents are used to form the correct *
1888 * Router Network packet and direct the Crosstalk reply to the * 1826 * Router Network packet and direct the Crosstalk reply to the *
1889 * appropriate processor. * 1827 * appropriate processor. *
1890 * * 1828 * *
1891 ************************************************************************/ 1829 ************************************************************************/
1892 1830
1893typedef union ii_iprte6a_u { 1831typedef union ii_iprte6a_u {
1894 uint64_t ii_iprte6a_regval; 1832 uint64_t ii_iprte6a_regval;
1895 struct { 1833 struct {
1896 uint64_t i_rsvd_1 : 54; 1834 uint64_t i_rsvd_1:54;
1897 uint64_t i_widget : 4; 1835 uint64_t i_widget:4;
1898 uint64_t i_to_cnt : 5; 1836 uint64_t i_to_cnt:5;
1899 uint64_t i_vld : 1; 1837 uint64_t i_vld:1;
1900 } ii_iprte6a_fld_s; 1838 } ii_iprte6a_fld_s;
1901} ii_iprte6a_u_t; 1839} ii_iprte6a_u_t;
1902 1840
1903
1904/************************************************************************ 1841/************************************************************************
1905 * * 1842 * *
1906 * There are 8 instances of this register. This register contains * 1843 * There are 8 instances of this register. This register contains *
1907 * the information that the II has to remember once it has launched a * 1844 * the information that the II has to remember once it has launched a *
1908 * PIO Read operation. The contents are used to form the correct * 1845 * PIO Read operation. The contents are used to form the correct *
1909 * Router Network packet and direct the Crosstalk reply to the * 1846 * Router Network packet and direct the Crosstalk reply to the *
1910 * appropriate processor. * 1847 * appropriate processor. *
1911 * * 1848 * *
1912 ************************************************************************/ 1849 ************************************************************************/
1913 1850
1914typedef union ii_iprte7a_u { 1851typedef union ii_iprte7a_u {
1915 uint64_t ii_iprte7a_regval; 1852 uint64_t ii_iprte7a_regval;
1916 struct { 1853 struct {
1917 uint64_t i_rsvd_1 : 54; 1854 uint64_t i_rsvd_1:54;
1918 uint64_t i_widget : 4; 1855 uint64_t i_widget:4;
1919 uint64_t i_to_cnt : 5; 1856 uint64_t i_to_cnt:5;
1920 uint64_t i_vld : 1; 1857 uint64_t i_vld:1;
1921 } ii_iprtea7_fld_s; 1858 } ii_iprtea7_fld_s;
1922} ii_iprte7a_u_t; 1859} ii_iprte7a_u_t;
1923 1860
1924
1925
1926/************************************************************************ 1861/************************************************************************
1927 * * 1862 * *
1928 * There are 8 instances of this register. This register contains * 1863 * There are 8 instances of this register. This register contains *
1929 * the information that the II has to remember once it has launched a * 1864 * the information that the II has to remember once it has launched a *
1930 * PIO Read operation. The contents are used to form the correct * 1865 * PIO Read operation. The contents are used to form the correct *
1931 * Router Network packet and direct the Crosstalk reply to the * 1866 * Router Network packet and direct the Crosstalk reply to the *
1932 * appropriate processor. * 1867 * appropriate processor. *
1933 * * 1868 * *
1934 ************************************************************************/ 1869 ************************************************************************/
1935 1870
1936
1937typedef union ii_iprte0b_u { 1871typedef union ii_iprte0b_u {
1938 uint64_t ii_iprte0b_regval; 1872 uint64_t ii_iprte0b_regval;
1939 struct { 1873 struct {
1940 uint64_t i_rsvd_1 : 3; 1874 uint64_t i_rsvd_1:3;
1941 uint64_t i_address : 47; 1875 uint64_t i_address:47;
1942 uint64_t i_init : 3; 1876 uint64_t i_init:3;
1943 uint64_t i_source : 11; 1877 uint64_t i_source:11;
1944 } ii_iprte0b_fld_s; 1878 } ii_iprte0b_fld_s;
1945} ii_iprte0b_u_t; 1879} ii_iprte0b_u_t;
1946 1880
1947
1948/************************************************************************ 1881/************************************************************************
1949 * * 1882 * *
1950 * There are 8 instances of this register. This register contains * 1883 * There are 8 instances of this register. This register contains *
1951 * the information that the II has to remember once it has launched a * 1884 * the information that the II has to remember once it has launched a *
1952 * PIO Read operation. The contents are used to form the correct * 1885 * PIO Read operation. The contents are used to form the correct *
1953 * Router Network packet and direct the Crosstalk reply to the * 1886 * Router Network packet and direct the Crosstalk reply to the *
1954 * appropriate processor. * 1887 * appropriate processor. *
1955 * * 1888 * *
1956 ************************************************************************/ 1889 ************************************************************************/
1957 1890
1958typedef union ii_iprte1b_u { 1891typedef union ii_iprte1b_u {
1959 uint64_t ii_iprte1b_regval; 1892 uint64_t ii_iprte1b_regval;
1960 struct { 1893 struct {
1961 uint64_t i_rsvd_1 : 3; 1894 uint64_t i_rsvd_1:3;
1962 uint64_t i_address : 47; 1895 uint64_t i_address:47;
1963 uint64_t i_init : 3; 1896 uint64_t i_init:3;
1964 uint64_t i_source : 11; 1897 uint64_t i_source:11;
1965 } ii_iprte1b_fld_s; 1898 } ii_iprte1b_fld_s;
1966} ii_iprte1b_u_t; 1899} ii_iprte1b_u_t;
1967 1900
1968
1969/************************************************************************ 1901/************************************************************************
1970 * * 1902 * *
1971 * There are 8 instances of this register. This register contains * 1903 * There are 8 instances of this register. This register contains *
1972 * the information that the II has to remember once it has launched a * 1904 * the information that the II has to remember once it has launched a *
1973 * PIO Read operation. The contents are used to form the correct * 1905 * PIO Read operation. The contents are used to form the correct *
1974 * Router Network packet and direct the Crosstalk reply to the * 1906 * Router Network packet and direct the Crosstalk reply to the *
1975 * appropriate processor. * 1907 * appropriate processor. *
1976 * * 1908 * *
1977 ************************************************************************/ 1909 ************************************************************************/
1978 1910
1979typedef union ii_iprte2b_u { 1911typedef union ii_iprte2b_u {
1980 uint64_t ii_iprte2b_regval; 1912 uint64_t ii_iprte2b_regval;
1981 struct { 1913 struct {
1982 uint64_t i_rsvd_1 : 3; 1914 uint64_t i_rsvd_1:3;
1983 uint64_t i_address : 47; 1915 uint64_t i_address:47;
1984 uint64_t i_init : 3; 1916 uint64_t i_init:3;
1985 uint64_t i_source : 11; 1917 uint64_t i_source:11;
1986 } ii_iprte2b_fld_s; 1918 } ii_iprte2b_fld_s;
1987} ii_iprte2b_u_t; 1919} ii_iprte2b_u_t;
1988 1920
1989
1990/************************************************************************ 1921/************************************************************************
1991 * * 1922 * *
1992 * There are 8 instances of this register. This register contains * 1923 * There are 8 instances of this register. This register contains *
1993 * the information that the II has to remember once it has launched a * 1924 * the information that the II has to remember once it has launched a *
1994 * PIO Read operation. The contents are used to form the correct * 1925 * PIO Read operation. The contents are used to form the correct *
1995 * Router Network packet and direct the Crosstalk reply to the * 1926 * Router Network packet and direct the Crosstalk reply to the *
1996 * appropriate processor. * 1927 * appropriate processor. *
1997 * * 1928 * *
1998 ************************************************************************/ 1929 ************************************************************************/
1999 1930
2000typedef union ii_iprte3b_u { 1931typedef union ii_iprte3b_u {
2001 uint64_t ii_iprte3b_regval; 1932 uint64_t ii_iprte3b_regval;
2002 struct { 1933 struct {
2003 uint64_t i_rsvd_1 : 3; 1934 uint64_t i_rsvd_1:3;
2004 uint64_t i_address : 47; 1935 uint64_t i_address:47;
2005 uint64_t i_init : 3; 1936 uint64_t i_init:3;
2006 uint64_t i_source : 11; 1937 uint64_t i_source:11;
2007 } ii_iprte3b_fld_s; 1938 } ii_iprte3b_fld_s;
2008} ii_iprte3b_u_t; 1939} ii_iprte3b_u_t;
2009 1940
2010
2011/************************************************************************ 1941/************************************************************************
2012 * * 1942 * *
2013 * There are 8 instances of this register. This register contains * 1943 * There are 8 instances of this register. This register contains *
2014 * the information that the II has to remember once it has launched a * 1944 * the information that the II has to remember once it has launched a *
2015 * PIO Read operation. The contents are used to form the correct * 1945 * PIO Read operation. The contents are used to form the correct *
2016 * Router Network packet and direct the Crosstalk reply to the * 1946 * Router Network packet and direct the Crosstalk reply to the *
2017 * appropriate processor. * 1947 * appropriate processor. *
2018 * * 1948 * *
2019 ************************************************************************/ 1949 ************************************************************************/
2020 1950
2021typedef union ii_iprte4b_u { 1951typedef union ii_iprte4b_u {
2022 uint64_t ii_iprte4b_regval; 1952 uint64_t ii_iprte4b_regval;
2023 struct { 1953 struct {
2024 uint64_t i_rsvd_1 : 3; 1954 uint64_t i_rsvd_1:3;
2025 uint64_t i_address : 47; 1955 uint64_t i_address:47;
2026 uint64_t i_init : 3; 1956 uint64_t i_init:3;
2027 uint64_t i_source : 11; 1957 uint64_t i_source:11;
2028 } ii_iprte4b_fld_s; 1958 } ii_iprte4b_fld_s;
2029} ii_iprte4b_u_t; 1959} ii_iprte4b_u_t;
2030 1960
2031
2032/************************************************************************ 1961/************************************************************************
2033 * * 1962 * *
2034 * There are 8 instances of this register. This register contains * 1963 * There are 8 instances of this register. This register contains *
2035 * the information that the II has to remember once it has launched a * 1964 * the information that the II has to remember once it has launched a *
2036 * PIO Read operation. The contents are used to form the correct * 1965 * PIO Read operation. The contents are used to form the correct *
2037 * Router Network packet and direct the Crosstalk reply to the * 1966 * Router Network packet and direct the Crosstalk reply to the *
2038 * appropriate processor. * 1967 * appropriate processor. *
2039 * * 1968 * *
2040 ************************************************************************/ 1969 ************************************************************************/
2041 1970
2042typedef union ii_iprte5b_u { 1971typedef union ii_iprte5b_u {
2043 uint64_t ii_iprte5b_regval; 1972 uint64_t ii_iprte5b_regval;
2044 struct { 1973 struct {
2045 uint64_t i_rsvd_1 : 3; 1974 uint64_t i_rsvd_1:3;
2046 uint64_t i_address : 47; 1975 uint64_t i_address:47;
2047 uint64_t i_init : 3; 1976 uint64_t i_init:3;
2048 uint64_t i_source : 11; 1977 uint64_t i_source:11;
2049 } ii_iprte5b_fld_s; 1978 } ii_iprte5b_fld_s;
2050} ii_iprte5b_u_t; 1979} ii_iprte5b_u_t;
2051 1980
2052
2053/************************************************************************ 1981/************************************************************************
2054 * * 1982 * *
2055 * There are 8 instances of this register. This register contains * 1983 * There are 8 instances of this register. This register contains *
2056 * the information that the II has to remember once it has launched a * 1984 * the information that the II has to remember once it has launched a *
2057 * PIO Read operation. The contents are used to form the correct * 1985 * PIO Read operation. The contents are used to form the correct *
2058 * Router Network packet and direct the Crosstalk reply to the * 1986 * Router Network packet and direct the Crosstalk reply to the *
2059 * appropriate processor. * 1987 * appropriate processor. *
2060 * * 1988 * *
2061 ************************************************************************/ 1989 ************************************************************************/
2062 1990
2063typedef union ii_iprte6b_u { 1991typedef union ii_iprte6b_u {
2064 uint64_t ii_iprte6b_regval; 1992 uint64_t ii_iprte6b_regval;
2065 struct { 1993 struct {
2066 uint64_t i_rsvd_1 : 3; 1994 uint64_t i_rsvd_1:3;
2067 uint64_t i_address : 47; 1995 uint64_t i_address:47;
2068 uint64_t i_init : 3; 1996 uint64_t i_init:3;
2069 uint64_t i_source : 11; 1997 uint64_t i_source:11;
2070 1998
2071 } ii_iprte6b_fld_s; 1999 } ii_iprte6b_fld_s;
2072} ii_iprte6b_u_t; 2000} ii_iprte6b_u_t;
2073 2001
2074
2075/************************************************************************ 2002/************************************************************************
2076 * * 2003 * *
2077 * There are 8 instances of this register. This register contains * 2004 * There are 8 instances of this register. This register contains *
2078 * the information that the II has to remember once it has launched a * 2005 * the information that the II has to remember once it has launched a *
2079 * PIO Read operation. The contents are used to form the correct * 2006 * PIO Read operation. The contents are used to form the correct *
2080 * Router Network packet and direct the Crosstalk reply to the * 2007 * Router Network packet and direct the Crosstalk reply to the *
2081 * appropriate processor. * 2008 * appropriate processor. *
2082 * * 2009 * *
2083 ************************************************************************/ 2010 ************************************************************************/
2084 2011
2085typedef union ii_iprte7b_u { 2012typedef union ii_iprte7b_u {
2086 uint64_t ii_iprte7b_regval; 2013 uint64_t ii_iprte7b_regval;
2087 struct { 2014 struct {
2088 uint64_t i_rsvd_1 : 3; 2015 uint64_t i_rsvd_1:3;
2089 uint64_t i_address : 47; 2016 uint64_t i_address:47;
2090 uint64_t i_init : 3; 2017 uint64_t i_init:3;
2091 uint64_t i_source : 11; 2018 uint64_t i_source:11;
2092 } ii_iprte7b_fld_s; 2019 } ii_iprte7b_fld_s;
2093} ii_iprte7b_u_t; 2020} ii_iprte7b_u_t;
2094 2021
2095
2096/************************************************************************ 2022/************************************************************************
2097 * * 2023 * *
2098 * Description: SHub II contains a feature which did not exist in * 2024 * Description: SHub II contains a feature which did not exist in *
2099 * the Hub which automatically cleans up after a Read Response * 2025 * the Hub which automatically cleans up after a Read Response *
2100 * timeout, including deallocation of the IPRTE and recovery of IBuf * 2026 * timeout, including deallocation of the IPRTE and recovery of IBuf *
@@ -2108,23 +2034,22 @@ typedef union ii_iprte7b_u {
2108 * Note that this register does not affect the contents of the IPRTE * 2034 * Note that this register does not affect the contents of the IPRTE *
2109 * registers. The Valid bits in those registers have to be * 2035 * registers. The Valid bits in those registers have to be *
2110 * specifically turned off by software. * 2036 * specifically turned off by software. *
2111 * * 2037 * *
2112 ************************************************************************/ 2038 ************************************************************************/
2113 2039
2114typedef union ii_ipdr_u { 2040typedef union ii_ipdr_u {
2115 uint64_t ii_ipdr_regval; 2041 uint64_t ii_ipdr_regval;
2116 struct { 2042 struct {
2117 uint64_t i_te : 3; 2043 uint64_t i_te:3;
2118 uint64_t i_rsvd_1 : 1; 2044 uint64_t i_rsvd_1:1;
2119 uint64_t i_pnd : 1; 2045 uint64_t i_pnd:1;
2120 uint64_t i_init_rpcnt : 1; 2046 uint64_t i_init_rpcnt:1;
2121 uint64_t i_rsvd : 58; 2047 uint64_t i_rsvd:58;
2122 } ii_ipdr_fld_s; 2048 } ii_ipdr_fld_s;
2123} ii_ipdr_u_t; 2049} ii_ipdr_u_t;
2124 2050
2125
2126/************************************************************************ 2051/************************************************************************
2127 * * 2052 * *
2128 * A write to this register causes a CRB entry to be returned to the * 2053 * A write to this register causes a CRB entry to be returned to the *
2129 * queue of free CRBs. The entry should have previously been cleared * 2054 * queue of free CRBs. The entry should have previously been cleared *
2130 * (mark bit) via backdoor access to the pertinent CRB entry. This * 2055 * (mark bit) via backdoor access to the pertinent CRB entry. This *
@@ -2137,21 +2062,20 @@ typedef union ii_ipdr_u {
2137 * software clears the mark bit, and finally 4) software writes to * 2062 * software clears the mark bit, and finally 4) software writes to *
2138 * the ICDR register to return the CRB entry to the list of free CRB * 2063 * the ICDR register to return the CRB entry to the list of free CRB *
2139 * entries. * 2064 * entries. *
2140 * * 2065 * *
2141 ************************************************************************/ 2066 ************************************************************************/
2142 2067
2143typedef union ii_icdr_u { 2068typedef union ii_icdr_u {
2144 uint64_t ii_icdr_regval; 2069 uint64_t ii_icdr_regval;
2145 struct { 2070 struct {
2146 uint64_t i_crb_num : 4; 2071 uint64_t i_crb_num:4;
2147 uint64_t i_pnd : 1; 2072 uint64_t i_pnd:1;
2148 uint64_t i_rsvd : 59; 2073 uint64_t i_rsvd:59;
2149 } ii_icdr_fld_s; 2074 } ii_icdr_fld_s;
2150} ii_icdr_u_t; 2075} ii_icdr_u_t;
2151 2076
2152
2153/************************************************************************ 2077/************************************************************************
2154 * * 2078 * *
2155 * This register provides debug access to two FIFOs inside of II. * 2079 * This register provides debug access to two FIFOs inside of II. *
2156 * Both IOQ_MAX* fields of this register contain the instantaneous * 2080 * Both IOQ_MAX* fields of this register contain the instantaneous *
2157 * depth (in units of the number of available entries) of the * 2081 * depth (in units of the number of available entries) of the *
@@ -2164,130 +2088,124 @@ typedef union ii_icdr_u {
2164 * this register is written. If there are any active entries in any * 2088 * this register is written. If there are any active entries in any *
2165 * of these FIFOs when this register is written, the results are * 2089 * of these FIFOs when this register is written, the results are *
2166 * undefined. * 2090 * undefined. *
2167 * * 2091 * *
2168 ************************************************************************/ 2092 ************************************************************************/
2169 2093
2170typedef union ii_ifdr_u { 2094typedef union ii_ifdr_u {
2171 uint64_t ii_ifdr_regval; 2095 uint64_t ii_ifdr_regval;
2172 struct { 2096 struct {
2173 uint64_t i_ioq_max_rq : 7; 2097 uint64_t i_ioq_max_rq:7;
2174 uint64_t i_set_ioq_rq : 1; 2098 uint64_t i_set_ioq_rq:1;
2175 uint64_t i_ioq_max_rp : 7; 2099 uint64_t i_ioq_max_rp:7;
2176 uint64_t i_set_ioq_rp : 1; 2100 uint64_t i_set_ioq_rp:1;
2177 uint64_t i_rsvd : 48; 2101 uint64_t i_rsvd:48;
2178 } ii_ifdr_fld_s; 2102 } ii_ifdr_fld_s;
2179} ii_ifdr_u_t; 2103} ii_ifdr_u_t;
2180 2104
2181
2182/************************************************************************ 2105/************************************************************************
2183 * * 2106 * *
2184 * This register allows the II to become sluggish in removing * 2107 * This register allows the II to become sluggish in removing *
2185 * messages from its inbound queue (IIQ). This will cause messages to * 2108 * messages from its inbound queue (IIQ). This will cause messages to *
2186 * back up in either virtual channel. Disabling the "molasses" mode * 2109 * back up in either virtual channel. Disabling the "molasses" mode *
2187 * subsequently allows the II to be tested under stress. In the * 2110 * subsequently allows the II to be tested under stress. In the *
2188 * sluggish ("Molasses") mode, the localized effects of congestion * 2111 * sluggish ("Molasses") mode, the localized effects of congestion *
2189 * can be observed. * 2112 * can be observed. *
2190 * * 2113 * *
2191 ************************************************************************/ 2114 ************************************************************************/
2192 2115
2193typedef union ii_iiap_u { 2116typedef union ii_iiap_u {
2194 uint64_t ii_iiap_regval; 2117 uint64_t ii_iiap_regval;
2195 struct { 2118 struct {
2196 uint64_t i_rq_mls : 6; 2119 uint64_t i_rq_mls:6;
2197 uint64_t i_rsvd_1 : 2; 2120 uint64_t i_rsvd_1:2;
2198 uint64_t i_rp_mls : 6; 2121 uint64_t i_rp_mls:6;
2199 uint64_t i_rsvd : 50; 2122 uint64_t i_rsvd:50;
2200 } ii_iiap_fld_s; 2123 } ii_iiap_fld_s;
2201} ii_iiap_u_t; 2124} ii_iiap_u_t;
2202 2125
2203
2204/************************************************************************ 2126/************************************************************************
2205 * * 2127 * *
2206 * This register allows several parameters of CRB operation to be * 2128 * This register allows several parameters of CRB operation to be *
2207 * set. Note that writing to this register can have catastrophic side * 2129 * set. Note that writing to this register can have catastrophic side *
2208 * effects, if the CRB is not quiescent, i.e. if the CRB is * 2130 * effects, if the CRB is not quiescent, i.e. if the CRB is *
2209 * processing protocol messages when the write occurs. * 2131 * processing protocol messages when the write occurs. *
2210 * * 2132 * *
2211 ************************************************************************/ 2133 ************************************************************************/
2212 2134
2213typedef union ii_icmr_u { 2135typedef union ii_icmr_u {
2214 uint64_t ii_icmr_regval; 2136 uint64_t ii_icmr_regval;
2215 struct { 2137 struct {
2216 uint64_t i_sp_msg : 1; 2138 uint64_t i_sp_msg:1;
2217 uint64_t i_rd_hdr : 1; 2139 uint64_t i_rd_hdr:1;
2218 uint64_t i_rsvd_4 : 2; 2140 uint64_t i_rsvd_4:2;
2219 uint64_t i_c_cnt : 4; 2141 uint64_t i_c_cnt:4;
2220 uint64_t i_rsvd_3 : 4; 2142 uint64_t i_rsvd_3:4;
2221 uint64_t i_clr_rqpd : 1; 2143 uint64_t i_clr_rqpd:1;
2222 uint64_t i_clr_rppd : 1; 2144 uint64_t i_clr_rppd:1;
2223 uint64_t i_rsvd_2 : 2; 2145 uint64_t i_rsvd_2:2;
2224 uint64_t i_fc_cnt : 4; 2146 uint64_t i_fc_cnt:4;
2225 uint64_t i_crb_vld : 15; 2147 uint64_t i_crb_vld:15;
2226 uint64_t i_crb_mark : 15; 2148 uint64_t i_crb_mark:15;
2227 uint64_t i_rsvd_1 : 2; 2149 uint64_t i_rsvd_1:2;
2228 uint64_t i_precise : 1; 2150 uint64_t i_precise:1;
2229 uint64_t i_rsvd : 11; 2151 uint64_t i_rsvd:11;
2230 } ii_icmr_fld_s; 2152 } ii_icmr_fld_s;
2231} ii_icmr_u_t; 2153} ii_icmr_u_t;
2232 2154
2233
2234/************************************************************************ 2155/************************************************************************
2235 * * 2156 * *
2236 * This register allows control of the table portion of the CRB * 2157 * This register allows control of the table portion of the CRB *
2237 * logic via software. Control operations from this register have * 2158 * logic via software. Control operations from this register have *
2238 * priority over all incoming Crosstalk or BTE requests. * 2159 * priority over all incoming Crosstalk or BTE requests. *
2239 * * 2160 * *
2240 ************************************************************************/ 2161 ************************************************************************/
2241 2162
2242typedef union ii_iccr_u { 2163typedef union ii_iccr_u {
2243 uint64_t ii_iccr_regval; 2164 uint64_t ii_iccr_regval;
2244 struct { 2165 struct {
2245 uint64_t i_crb_num : 4; 2166 uint64_t i_crb_num:4;
2246 uint64_t i_rsvd_1 : 4; 2167 uint64_t i_rsvd_1:4;
2247 uint64_t i_cmd : 8; 2168 uint64_t i_cmd:8;
2248 uint64_t i_pending : 1; 2169 uint64_t i_pending:1;
2249 uint64_t i_rsvd : 47; 2170 uint64_t i_rsvd:47;
2250 } ii_iccr_fld_s; 2171 } ii_iccr_fld_s;
2251} ii_iccr_u_t; 2172} ii_iccr_u_t;
2252 2173
2253
2254/************************************************************************ 2174/************************************************************************
2255 * * 2175 * *
2256 * This register allows the maximum timeout value to be programmed. * 2176 * This register allows the maximum timeout value to be programmed. *
2257 * * 2177 * *
2258 ************************************************************************/ 2178 ************************************************************************/
2259 2179
2260typedef union ii_icto_u { 2180typedef union ii_icto_u {
2261 uint64_t ii_icto_regval; 2181 uint64_t ii_icto_regval;
2262 struct { 2182 struct {
2263 uint64_t i_timeout : 8; 2183 uint64_t i_timeout:8;
2264 uint64_t i_rsvd : 56; 2184 uint64_t i_rsvd:56;
2265 } ii_icto_fld_s; 2185 } ii_icto_fld_s;
2266} ii_icto_u_t; 2186} ii_icto_u_t;
2267 2187
2268
2269/************************************************************************ 2188/************************************************************************
2270 * * 2189 * *
2271 * This register allows the timeout prescalar to be programmed. An * 2190 * This register allows the timeout prescalar to be programmed. An *
2272 * internal counter is associated with this register. When the * 2191 * internal counter is associated with this register. When the *
2273 * internal counter reaches the value of the PRESCALE field, the * 2192 * internal counter reaches the value of the PRESCALE field, the *
2274 * timer registers in all valid CRBs are incremented (CRBx_D[TIMEOUT] * 2193 * timer registers in all valid CRBs are incremented (CRBx_D[TIMEOUT] *
2275 * field). The internal counter resets to zero, and then continues * 2194 * field). The internal counter resets to zero, and then continues *
2276 * counting. * 2195 * counting. *
2277 * * 2196 * *
2278 ************************************************************************/ 2197 ************************************************************************/
2279 2198
2280typedef union ii_ictp_u { 2199typedef union ii_ictp_u {
2281 uint64_t ii_ictp_regval; 2200 uint64_t ii_ictp_regval;
2282 struct { 2201 struct {
2283 uint64_t i_prescale : 24; 2202 uint64_t i_prescale:24;
2284 uint64_t i_rsvd : 40; 2203 uint64_t i_rsvd:40;
2285 } ii_ictp_fld_s; 2204 } ii_ictp_fld_s;
2286} ii_ictp_u_t; 2205} ii_ictp_u_t;
2287 2206
2288
2289/************************************************************************ 2207/************************************************************************
2290 * * 2208 * *
2291 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * 2209 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are *
2292 * used for Crosstalk operations (both cacheline and partial * 2210 * used for Crosstalk operations (both cacheline and partial *
2293 * operations) or BTE/IO. Because the CRB entries are very wide, five * 2211 * operations) or BTE/IO. Because the CRB entries are very wide, five *
@@ -2306,243 +2224,234 @@ typedef union ii_ictp_u {
2306 * recovering any potential error state from before the reset). * 2224 * recovering any potential error state from before the reset). *
2307 * The following four tables summarize the format for the four * 2225 * The following four tables summarize the format for the four *
2308 * registers that are used for each ICRB# Entry. * 2226 * registers that are used for each ICRB# Entry. *
2309 * * 2227 * *
2310 ************************************************************************/ 2228 ************************************************************************/
2311 2229
2312typedef union ii_icrb0_a_u { 2230typedef union ii_icrb0_a_u {
2313 uint64_t ii_icrb0_a_regval; 2231 uint64_t ii_icrb0_a_regval;
2314 struct { 2232 struct {
2315 uint64_t ia_iow : 1; 2233 uint64_t ia_iow:1;
2316 uint64_t ia_vld : 1; 2234 uint64_t ia_vld:1;
2317 uint64_t ia_addr : 47; 2235 uint64_t ia_addr:47;
2318 uint64_t ia_tnum : 5; 2236 uint64_t ia_tnum:5;
2319 uint64_t ia_sidn : 4; 2237 uint64_t ia_sidn:4;
2320 uint64_t ia_rsvd : 6; 2238 uint64_t ia_rsvd:6;
2321 } ii_icrb0_a_fld_s; 2239 } ii_icrb0_a_fld_s;
2322} ii_icrb0_a_u_t; 2240} ii_icrb0_a_u_t;
2323 2241
2324
2325/************************************************************************ 2242/************************************************************************
2326 * * 2243 * *
2327 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * 2244 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are *
2328 * used for Crosstalk operations (both cacheline and partial * 2245 * used for Crosstalk operations (both cacheline and partial *
2329 * operations) or BTE/IO. Because the CRB entries are very wide, five * 2246 * operations) or BTE/IO. Because the CRB entries are very wide, five *
2330 * registers (_A to _E) are required to read and write each entry. * 2247 * registers (_A to _E) are required to read and write each entry. *
2331 * * 2248 * *
2332 ************************************************************************/ 2249 ************************************************************************/
2333 2250
2334typedef union ii_icrb0_b_u { 2251typedef union ii_icrb0_b_u {
2335 uint64_t ii_icrb0_b_regval; 2252 uint64_t ii_icrb0_b_regval;
2336 struct { 2253 struct {
2337 uint64_t ib_xt_err : 1; 2254 uint64_t ib_xt_err:1;
2338 uint64_t ib_mark : 1; 2255 uint64_t ib_mark:1;
2339 uint64_t ib_ln_uce : 1; 2256 uint64_t ib_ln_uce:1;
2340 uint64_t ib_errcode : 3; 2257 uint64_t ib_errcode:3;
2341 uint64_t ib_error : 1; 2258 uint64_t ib_error:1;
2342 uint64_t ib_stall__bte_1 : 1; 2259 uint64_t ib_stall__bte_1:1;
2343 uint64_t ib_stall__bte_0 : 1; 2260 uint64_t ib_stall__bte_0:1;
2344 uint64_t ib_stall__intr : 1; 2261 uint64_t ib_stall__intr:1;
2345 uint64_t ib_stall_ib : 1; 2262 uint64_t ib_stall_ib:1;
2346 uint64_t ib_intvn : 1; 2263 uint64_t ib_intvn:1;
2347 uint64_t ib_wb : 1; 2264 uint64_t ib_wb:1;
2348 uint64_t ib_hold : 1; 2265 uint64_t ib_hold:1;
2349 uint64_t ib_ack : 1; 2266 uint64_t ib_ack:1;
2350 uint64_t ib_resp : 1; 2267 uint64_t ib_resp:1;
2351 uint64_t ib_ack_cnt : 11; 2268 uint64_t ib_ack_cnt:11;
2352 uint64_t ib_rsvd : 7; 2269 uint64_t ib_rsvd:7;
2353 uint64_t ib_exc : 5; 2270 uint64_t ib_exc:5;
2354 uint64_t ib_init : 3; 2271 uint64_t ib_init:3;
2355 uint64_t ib_imsg : 8; 2272 uint64_t ib_imsg:8;
2356 uint64_t ib_imsgtype : 2; 2273 uint64_t ib_imsgtype:2;
2357 uint64_t ib_use_old : 1; 2274 uint64_t ib_use_old:1;
2358 uint64_t ib_rsvd_1 : 11; 2275 uint64_t ib_rsvd_1:11;
2359 } ii_icrb0_b_fld_s; 2276 } ii_icrb0_b_fld_s;
2360} ii_icrb0_b_u_t; 2277} ii_icrb0_b_u_t;
2361 2278
2362
2363/************************************************************************ 2279/************************************************************************
2364 * * 2280 * *
2365 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * 2281 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are *
2366 * used for Crosstalk operations (both cacheline and partial * 2282 * used for Crosstalk operations (both cacheline and partial *
2367 * operations) or BTE/IO. Because the CRB entries are very wide, five * 2283 * operations) or BTE/IO. Because the CRB entries are very wide, five *
2368 * registers (_A to _E) are required to read and write each entry. * 2284 * registers (_A to _E) are required to read and write each entry. *
2369 * * 2285 * *
2370 ************************************************************************/ 2286 ************************************************************************/
2371 2287
2372typedef union ii_icrb0_c_u { 2288typedef union ii_icrb0_c_u {
2373 uint64_t ii_icrb0_c_regval; 2289 uint64_t ii_icrb0_c_regval;
2374 struct { 2290 struct {
2375 uint64_t ic_source : 15; 2291 uint64_t ic_source:15;
2376 uint64_t ic_size : 2; 2292 uint64_t ic_size:2;
2377 uint64_t ic_ct : 1; 2293 uint64_t ic_ct:1;
2378 uint64_t ic_bte_num : 1; 2294 uint64_t ic_bte_num:1;
2379 uint64_t ic_gbr : 1; 2295 uint64_t ic_gbr:1;
2380 uint64_t ic_resprqd : 1; 2296 uint64_t ic_resprqd:1;
2381 uint64_t ic_bo : 1; 2297 uint64_t ic_bo:1;
2382 uint64_t ic_suppl : 15; 2298 uint64_t ic_suppl:15;
2383 uint64_t ic_rsvd : 27; 2299 uint64_t ic_rsvd:27;
2384 } ii_icrb0_c_fld_s; 2300 } ii_icrb0_c_fld_s;
2385} ii_icrb0_c_u_t; 2301} ii_icrb0_c_u_t;
2386 2302
2387
2388/************************************************************************ 2303/************************************************************************
2389 * * 2304 * *
2390 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * 2305 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are *
2391 * used for Crosstalk operations (both cacheline and partial * 2306 * used for Crosstalk operations (both cacheline and partial *
2392 * operations) or BTE/IO. Because the CRB entries are very wide, five * 2307 * operations) or BTE/IO. Because the CRB entries are very wide, five *
2393 * registers (_A to _E) are required to read and write each entry. * 2308 * registers (_A to _E) are required to read and write each entry. *
2394 * * 2309 * *
2395 ************************************************************************/ 2310 ************************************************************************/
2396 2311
2397typedef union ii_icrb0_d_u { 2312typedef union ii_icrb0_d_u {
2398 uint64_t ii_icrb0_d_regval; 2313 uint64_t ii_icrb0_d_regval;
2399 struct { 2314 struct {
2400 uint64_t id_pa_be : 43; 2315 uint64_t id_pa_be:43;
2401 uint64_t id_bte_op : 1; 2316 uint64_t id_bte_op:1;
2402 uint64_t id_pr_psc : 4; 2317 uint64_t id_pr_psc:4;
2403 uint64_t id_pr_cnt : 4; 2318 uint64_t id_pr_cnt:4;
2404 uint64_t id_sleep : 1; 2319 uint64_t id_sleep:1;
2405 uint64_t id_rsvd : 11; 2320 uint64_t id_rsvd:11;
2406 } ii_icrb0_d_fld_s; 2321 } ii_icrb0_d_fld_s;
2407} ii_icrb0_d_u_t; 2322} ii_icrb0_d_u_t;
2408 2323
2409
2410/************************************************************************ 2324/************************************************************************
2411 * * 2325 * *
2412 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are * 2326 * Description: There are 15 CRB Entries (ICRB0 to ICRBE) that are *
2413 * used for Crosstalk operations (both cacheline and partial * 2327 * used for Crosstalk operations (both cacheline and partial *
2414 * operations) or BTE/IO. Because the CRB entries are very wide, five * 2328 * operations) or BTE/IO. Because the CRB entries are very wide, five *
2415 * registers (_A to _E) are required to read and write each entry. * 2329 * registers (_A to _E) are required to read and write each entry. *
2416 * * 2330 * *
2417 ************************************************************************/ 2331 ************************************************************************/
2418 2332
2419typedef union ii_icrb0_e_u { 2333typedef union ii_icrb0_e_u {
2420 uint64_t ii_icrb0_e_regval; 2334 uint64_t ii_icrb0_e_regval;
2421 struct { 2335 struct {
2422 uint64_t ie_timeout : 8; 2336 uint64_t ie_timeout:8;
2423 uint64_t ie_context : 15; 2337 uint64_t ie_context:15;
2424 uint64_t ie_rsvd : 1; 2338 uint64_t ie_rsvd:1;
2425 uint64_t ie_tvld : 1; 2339 uint64_t ie_tvld:1;
2426 uint64_t ie_cvld : 1; 2340 uint64_t ie_cvld:1;
2427 uint64_t ie_rsvd_0 : 38; 2341 uint64_t ie_rsvd_0:38;
2428 } ii_icrb0_e_fld_s; 2342 } ii_icrb0_e_fld_s;
2429} ii_icrb0_e_u_t; 2343} ii_icrb0_e_u_t;
2430 2344
2431
2432/************************************************************************ 2345/************************************************************************
2433 * * 2346 * *
2434 * This register contains the lower 64 bits of the header of the * 2347 * This register contains the lower 64 bits of the header of the *
2435 * spurious message captured by II. Valid when the SP_MSG bit in ICMR * 2348 * spurious message captured by II. Valid when the SP_MSG bit in ICMR *
2436 * register is set. * 2349 * register is set. *
2437 * * 2350 * *
2438 ************************************************************************/ 2351 ************************************************************************/
2439 2352
2440typedef union ii_icsml_u { 2353typedef union ii_icsml_u {
2441 uint64_t ii_icsml_regval; 2354 uint64_t ii_icsml_regval;
2442 struct { 2355 struct {
2443 uint64_t i_tt_addr : 47; 2356 uint64_t i_tt_addr:47;
2444 uint64_t i_newsuppl_ex : 14; 2357 uint64_t i_newsuppl_ex:14;
2445 uint64_t i_reserved : 2; 2358 uint64_t i_reserved:2;
2446 uint64_t i_overflow : 1; 2359 uint64_t i_overflow:1;
2447 } ii_icsml_fld_s; 2360 } ii_icsml_fld_s;
2448} ii_icsml_u_t; 2361} ii_icsml_u_t;
2449 2362
2450
2451/************************************************************************ 2363/************************************************************************
2452 * * 2364 * *
2453 * This register contains the middle 64 bits of the header of the * 2365 * This register contains the middle 64 bits of the header of the *
2454 * spurious message captured by II. Valid when the SP_MSG bit in ICMR * 2366 * spurious message captured by II. Valid when the SP_MSG bit in ICMR *
2455 * register is set. * 2367 * register is set. *
2456 * * 2368 * *
2457 ************************************************************************/ 2369 ************************************************************************/
2458 2370
2459typedef union ii_icsmm_u { 2371typedef union ii_icsmm_u {
2460 uint64_t ii_icsmm_regval; 2372 uint64_t ii_icsmm_regval;
2461 struct { 2373 struct {
2462 uint64_t i_tt_ack_cnt : 11; 2374 uint64_t i_tt_ack_cnt:11;
2463 uint64_t i_reserved : 53; 2375 uint64_t i_reserved:53;
2464 } ii_icsmm_fld_s; 2376 } ii_icsmm_fld_s;
2465} ii_icsmm_u_t; 2377} ii_icsmm_u_t;
2466 2378
2467
2468/************************************************************************ 2379/************************************************************************
2469 * * 2380 * *
2470 * This register contains the microscopic state, all the inputs to * 2381 * This register contains the microscopic state, all the inputs to *
2471 * the protocol table, captured with the spurious message. Valid when * 2382 * the protocol table, captured with the spurious message. Valid when *
2472 * the SP_MSG bit in the ICMR register is set. * 2383 * the SP_MSG bit in the ICMR register is set. *
2473 * * 2384 * *
2474 ************************************************************************/ 2385 ************************************************************************/
2475 2386
2476typedef union ii_icsmh_u { 2387typedef union ii_icsmh_u {
2477 uint64_t ii_icsmh_regval; 2388 uint64_t ii_icsmh_regval;
2478 struct { 2389 struct {
2479 uint64_t i_tt_vld : 1; 2390 uint64_t i_tt_vld:1;
2480 uint64_t i_xerr : 1; 2391 uint64_t i_xerr:1;
2481 uint64_t i_ft_cwact_o : 1; 2392 uint64_t i_ft_cwact_o:1;
2482 uint64_t i_ft_wact_o : 1; 2393 uint64_t i_ft_wact_o:1;
2483 uint64_t i_ft_active_o : 1; 2394 uint64_t i_ft_active_o:1;
2484 uint64_t i_sync : 1; 2395 uint64_t i_sync:1;
2485 uint64_t i_mnusg : 1; 2396 uint64_t i_mnusg:1;
2486 uint64_t i_mnusz : 1; 2397 uint64_t i_mnusz:1;
2487 uint64_t i_plusz : 1; 2398 uint64_t i_plusz:1;
2488 uint64_t i_plusg : 1; 2399 uint64_t i_plusg:1;
2489 uint64_t i_tt_exc : 5; 2400 uint64_t i_tt_exc:5;
2490 uint64_t i_tt_wb : 1; 2401 uint64_t i_tt_wb:1;
2491 uint64_t i_tt_hold : 1; 2402 uint64_t i_tt_hold:1;
2492 uint64_t i_tt_ack : 1; 2403 uint64_t i_tt_ack:1;
2493 uint64_t i_tt_resp : 1; 2404 uint64_t i_tt_resp:1;
2494 uint64_t i_tt_intvn : 1; 2405 uint64_t i_tt_intvn:1;
2495 uint64_t i_g_stall_bte1 : 1; 2406 uint64_t i_g_stall_bte1:1;
2496 uint64_t i_g_stall_bte0 : 1; 2407 uint64_t i_g_stall_bte0:1;
2497 uint64_t i_g_stall_il : 1; 2408 uint64_t i_g_stall_il:1;
2498 uint64_t i_g_stall_ib : 1; 2409 uint64_t i_g_stall_ib:1;
2499 uint64_t i_tt_imsg : 8; 2410 uint64_t i_tt_imsg:8;
2500 uint64_t i_tt_imsgtype : 2; 2411 uint64_t i_tt_imsgtype:2;
2501 uint64_t i_tt_use_old : 1; 2412 uint64_t i_tt_use_old:1;
2502 uint64_t i_tt_respreqd : 1; 2413 uint64_t i_tt_respreqd:1;
2503 uint64_t i_tt_bte_num : 1; 2414 uint64_t i_tt_bte_num:1;
2504 uint64_t i_cbn : 1; 2415 uint64_t i_cbn:1;
2505 uint64_t i_match : 1; 2416 uint64_t i_match:1;
2506 uint64_t i_rpcnt_lt_34 : 1; 2417 uint64_t i_rpcnt_lt_34:1;
2507 uint64_t i_rpcnt_ge_34 : 1; 2418 uint64_t i_rpcnt_ge_34:1;
2508 uint64_t i_rpcnt_lt_18 : 1; 2419 uint64_t i_rpcnt_lt_18:1;
2509 uint64_t i_rpcnt_ge_18 : 1; 2420 uint64_t i_rpcnt_ge_18:1;
2510 uint64_t i_rpcnt_lt_2 : 1; 2421 uint64_t i_rpcnt_lt_2:1;
2511 uint64_t i_rpcnt_ge_2 : 1; 2422 uint64_t i_rpcnt_ge_2:1;
2512 uint64_t i_rqcnt_lt_18 : 1; 2423 uint64_t i_rqcnt_lt_18:1;
2513 uint64_t i_rqcnt_ge_18 : 1; 2424 uint64_t i_rqcnt_ge_18:1;
2514 uint64_t i_rqcnt_lt_2 : 1; 2425 uint64_t i_rqcnt_lt_2:1;
2515 uint64_t i_rqcnt_ge_2 : 1; 2426 uint64_t i_rqcnt_ge_2:1;
2516 uint64_t i_tt_device : 7; 2427 uint64_t i_tt_device:7;
2517 uint64_t i_tt_init : 3; 2428 uint64_t i_tt_init:3;
2518 uint64_t i_reserved : 5; 2429 uint64_t i_reserved:5;
2519 } ii_icsmh_fld_s; 2430 } ii_icsmh_fld_s;
2520} ii_icsmh_u_t; 2431} ii_icsmh_u_t;
2521 2432
2522
2523/************************************************************************ 2433/************************************************************************
2524 * * 2434 * *
2525 * The Shub DEBUG unit provides a 3-bit selection signal to the * 2435 * The Shub DEBUG unit provides a 3-bit selection signal to the *
2526 * II core and a 3-bit selection signal to the fsbclk domain in the II * 2436 * II core and a 3-bit selection signal to the fsbclk domain in the II *
2527 * wrapper. * 2437 * wrapper. *
2528 * * 2438 * *
2529 ************************************************************************/ 2439 ************************************************************************/
2530 2440
2531typedef union ii_idbss_u { 2441typedef union ii_idbss_u {
2532 uint64_t ii_idbss_regval; 2442 uint64_t ii_idbss_regval;
2533 struct { 2443 struct {
2534 uint64_t i_iioclk_core_submenu : 3; 2444 uint64_t i_iioclk_core_submenu:3;
2535 uint64_t i_rsvd : 5; 2445 uint64_t i_rsvd:5;
2536 uint64_t i_fsbclk_wrapper_submenu : 3; 2446 uint64_t i_fsbclk_wrapper_submenu:3;
2537 uint64_t i_rsvd_1 : 5; 2447 uint64_t i_rsvd_1:5;
2538 uint64_t i_iioclk_menu : 5; 2448 uint64_t i_iioclk_menu:5;
2539 uint64_t i_rsvd_2 : 43; 2449 uint64_t i_rsvd_2:43;
2540 } ii_idbss_fld_s; 2450 } ii_idbss_fld_s;
2541} ii_idbss_u_t; 2451} ii_idbss_u_t;
2542 2452
2543
2544/************************************************************************ 2453/************************************************************************
2545 * * 2454 * *
2546 * Description: This register is used to set up the length for a * 2455 * Description: This register is used to set up the length for a *
2547 * transfer and then to monitor the progress of that transfer. This * 2456 * transfer and then to monitor the progress of that transfer. This *
2548 * register needs to be initialized before a transfer is started. A * 2457 * register needs to be initialized before a transfer is started. A *
@@ -2553,63 +2462,60 @@ typedef union ii_idbss_u {
2553 * transfer completes, hardware will clear the Busy bit. The length * 2462 * transfer completes, hardware will clear the Busy bit. The length *
2554 * field will also contain the number of cache lines left to be * 2463 * field will also contain the number of cache lines left to be *
2555 * transferred. * 2464 * transferred. *
2556 * * 2465 * *
2557 ************************************************************************/ 2466 ************************************************************************/
2558 2467
2559typedef union ii_ibls0_u { 2468typedef union ii_ibls0_u {
2560 uint64_t ii_ibls0_regval; 2469 uint64_t ii_ibls0_regval;
2561 struct { 2470 struct {
2562 uint64_t i_length : 16; 2471 uint64_t i_length:16;
2563 uint64_t i_error : 1; 2472 uint64_t i_error:1;
2564 uint64_t i_rsvd_1 : 3; 2473 uint64_t i_rsvd_1:3;
2565 uint64_t i_busy : 1; 2474 uint64_t i_busy:1;
2566 uint64_t i_rsvd : 43; 2475 uint64_t i_rsvd:43;
2567 } ii_ibls0_fld_s; 2476 } ii_ibls0_fld_s;
2568} ii_ibls0_u_t; 2477} ii_ibls0_u_t;
2569 2478
2570
2571/************************************************************************ 2479/************************************************************************
2572 * * 2480 * *
2573 * This register should be loaded before a transfer is started. The * 2481 * This register should be loaded before a transfer is started. The *
2574 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * 2482 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical *
2575 * address as described in Section 1.3, Figure2 and Figure3. Since * 2483 * address as described in Section 1.3, Figure2 and Figure3. Since *
2576 * the bottom 7 bits of the address are always taken to be zero, BTE * 2484 * the bottom 7 bits of the address are always taken to be zero, BTE *
2577 * transfers are always cacheline-aligned. * 2485 * transfers are always cacheline-aligned. *
2578 * * 2486 * *
2579 ************************************************************************/ 2487 ************************************************************************/
2580 2488
2581typedef union ii_ibsa0_u { 2489typedef union ii_ibsa0_u {
2582 uint64_t ii_ibsa0_regval; 2490 uint64_t ii_ibsa0_regval;
2583 struct { 2491 struct {
2584 uint64_t i_rsvd_1 : 7; 2492 uint64_t i_rsvd_1:7;
2585 uint64_t i_addr : 42; 2493 uint64_t i_addr:42;
2586 uint64_t i_rsvd : 15; 2494 uint64_t i_rsvd:15;
2587 } ii_ibsa0_fld_s; 2495 } ii_ibsa0_fld_s;
2588} ii_ibsa0_u_t; 2496} ii_ibsa0_u_t;
2589 2497
2590
2591/************************************************************************ 2498/************************************************************************
2592 * * 2499 * *
2593 * This register should be loaded before a transfer is started. The * 2500 * This register should be loaded before a transfer is started. The *
2594 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * 2501 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical *
2595 * address as described in Section 1.3, Figure2 and Figure3. Since * 2502 * address as described in Section 1.3, Figure2 and Figure3. Since *
2596 * the bottom 7 bits of the address are always taken to be zero, BTE * 2503 * the bottom 7 bits of the address are always taken to be zero, BTE *
2597 * transfers are always cacheline-aligned. * 2504 * transfers are always cacheline-aligned. *
2598 * * 2505 * *
2599 ************************************************************************/ 2506 ************************************************************************/
2600 2507
2601typedef union ii_ibda0_u { 2508typedef union ii_ibda0_u {
2602 uint64_t ii_ibda0_regval; 2509 uint64_t ii_ibda0_regval;
2603 struct { 2510 struct {
2604 uint64_t i_rsvd_1 : 7; 2511 uint64_t i_rsvd_1:7;
2605 uint64_t i_addr : 42; 2512 uint64_t i_addr:42;
2606 uint64_t i_rsvd : 15; 2513 uint64_t i_rsvd:15;
2607 } ii_ibda0_fld_s; 2514 } ii_ibda0_fld_s;
2608} ii_ibda0_u_t; 2515} ii_ibda0_u_t;
2609 2516
2610
2611/************************************************************************ 2517/************************************************************************
2612 * * 2518 * *
2613 * Writing to this register sets up the attributes of the transfer * 2519 * Writing to this register sets up the attributes of the transfer *
2614 * and initiates the transfer operation. Reading this register has * 2520 * and initiates the transfer operation. Reading this register has *
2615 * the side effect of terminating any transfer in progress. Note: * 2521 * the side effect of terminating any transfer in progress. Note: *
@@ -2617,61 +2523,58 @@ typedef union ii_ibda0_u {
2617 * other BTE. If a BTE stream has to be stopped (due to error * 2523 * other BTE. If a BTE stream has to be stopped (due to error *
2618 * handling for example), both BTE streams should be stopped and * 2524 * handling for example), both BTE streams should be stopped and *
2619 * their transfers discarded. * 2525 * their transfers discarded. *
2620 * * 2526 * *
2621 ************************************************************************/ 2527 ************************************************************************/
2622 2528
2623typedef union ii_ibct0_u { 2529typedef union ii_ibct0_u {
2624 uint64_t ii_ibct0_regval; 2530 uint64_t ii_ibct0_regval;
2625 struct { 2531 struct {
2626 uint64_t i_zerofill : 1; 2532 uint64_t i_zerofill:1;
2627 uint64_t i_rsvd_2 : 3; 2533 uint64_t i_rsvd_2:3;
2628 uint64_t i_notify : 1; 2534 uint64_t i_notify:1;
2629 uint64_t i_rsvd_1 : 3; 2535 uint64_t i_rsvd_1:3;
2630 uint64_t i_poison : 1; 2536 uint64_t i_poison:1;
2631 uint64_t i_rsvd : 55; 2537 uint64_t i_rsvd:55;
2632 } ii_ibct0_fld_s; 2538 } ii_ibct0_fld_s;
2633} ii_ibct0_u_t; 2539} ii_ibct0_u_t;
2634 2540
2635
2636/************************************************************************ 2541/************************************************************************
2637 * * 2542 * *
2638 * This register contains the address to which the WINV is sent. * 2543 * This register contains the address to which the WINV is sent. *
2639 * This address has to be cache line aligned. * 2544 * This address has to be cache line aligned. *
2640 * * 2545 * *
2641 ************************************************************************/ 2546 ************************************************************************/
2642 2547
2643typedef union ii_ibna0_u { 2548typedef union ii_ibna0_u {
2644 uint64_t ii_ibna0_regval; 2549 uint64_t ii_ibna0_regval;
2645 struct { 2550 struct {
2646 uint64_t i_rsvd_1 : 7; 2551 uint64_t i_rsvd_1:7;
2647 uint64_t i_addr : 42; 2552 uint64_t i_addr:42;
2648 uint64_t i_rsvd : 15; 2553 uint64_t i_rsvd:15;
2649 } ii_ibna0_fld_s; 2554 } ii_ibna0_fld_s;
2650} ii_ibna0_u_t; 2555} ii_ibna0_u_t;
2651 2556
2652
2653/************************************************************************ 2557/************************************************************************
2654 * * 2558 * *
2655 * This register contains the programmable level as well as the node * 2559 * This register contains the programmable level as well as the node *
2656 * ID and PI unit of the processor to which the interrupt will be * 2560 * ID and PI unit of the processor to which the interrupt will be *
2657 * sent. * 2561 * sent. *
2658 * * 2562 * *
2659 ************************************************************************/ 2563 ************************************************************************/
2660 2564
2661typedef union ii_ibia0_u { 2565typedef union ii_ibia0_u {
2662 uint64_t ii_ibia0_regval; 2566 uint64_t ii_ibia0_regval;
2663 struct { 2567 struct {
2664 uint64_t i_rsvd_2 : 1; 2568 uint64_t i_rsvd_2:1;
2665 uint64_t i_node_id : 11; 2569 uint64_t i_node_id:11;
2666 uint64_t i_rsvd_1 : 4; 2570 uint64_t i_rsvd_1:4;
2667 uint64_t i_level : 7; 2571 uint64_t i_level:7;
2668 uint64_t i_rsvd : 41; 2572 uint64_t i_rsvd:41;
2669 } ii_ibia0_fld_s; 2573 } ii_ibia0_fld_s;
2670} ii_ibia0_u_t; 2574} ii_ibia0_u_t;
2671 2575
2672
2673/************************************************************************ 2576/************************************************************************
2674 * * 2577 * *
2675 * Description: This register is used to set up the length for a * 2578 * Description: This register is used to set up the length for a *
2676 * transfer and then to monitor the progress of that transfer. This * 2579 * transfer and then to monitor the progress of that transfer. This *
2677 * register needs to be initialized before a transfer is started. A * 2580 * register needs to be initialized before a transfer is started. A *
@@ -2682,63 +2585,60 @@ typedef union ii_ibia0_u {
2682 * transfer completes, hardware will clear the Busy bit. The length * 2585 * transfer completes, hardware will clear the Busy bit. The length *
2683 * field will also contain the number of cache lines left to be * 2586 * field will also contain the number of cache lines left to be *
2684 * transferred. * 2587 * transferred. *
2685 * * 2588 * *
2686 ************************************************************************/ 2589 ************************************************************************/
2687 2590
2688typedef union ii_ibls1_u { 2591typedef union ii_ibls1_u {
2689 uint64_t ii_ibls1_regval; 2592 uint64_t ii_ibls1_regval;
2690 struct { 2593 struct {
2691 uint64_t i_length : 16; 2594 uint64_t i_length:16;
2692 uint64_t i_error : 1; 2595 uint64_t i_error:1;
2693 uint64_t i_rsvd_1 : 3; 2596 uint64_t i_rsvd_1:3;
2694 uint64_t i_busy : 1; 2597 uint64_t i_busy:1;
2695 uint64_t i_rsvd : 43; 2598 uint64_t i_rsvd:43;
2696 } ii_ibls1_fld_s; 2599 } ii_ibls1_fld_s;
2697} ii_ibls1_u_t; 2600} ii_ibls1_u_t;
2698 2601
2699
2700/************************************************************************ 2602/************************************************************************
2701 * * 2603 * *
2702 * This register should be loaded before a transfer is started. The * 2604 * This register should be loaded before a transfer is started. The *
2703 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * 2605 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical *
2704 * address as described in Section 1.3, Figure2 and Figure3. Since * 2606 * address as described in Section 1.3, Figure2 and Figure3. Since *
2705 * the bottom 7 bits of the address are always taken to be zero, BTE * 2607 * the bottom 7 bits of the address are always taken to be zero, BTE *
2706 * transfers are always cacheline-aligned. * 2608 * transfers are always cacheline-aligned. *
2707 * * 2609 * *
2708 ************************************************************************/ 2610 ************************************************************************/
2709 2611
2710typedef union ii_ibsa1_u { 2612typedef union ii_ibsa1_u {
2711 uint64_t ii_ibsa1_regval; 2613 uint64_t ii_ibsa1_regval;
2712 struct { 2614 struct {
2713 uint64_t i_rsvd_1 : 7; 2615 uint64_t i_rsvd_1:7;
2714 uint64_t i_addr : 33; 2616 uint64_t i_addr:33;
2715 uint64_t i_rsvd : 24; 2617 uint64_t i_rsvd:24;
2716 } ii_ibsa1_fld_s; 2618 } ii_ibsa1_fld_s;
2717} ii_ibsa1_u_t; 2619} ii_ibsa1_u_t;
2718 2620
2719
2720/************************************************************************ 2621/************************************************************************
2721 * * 2622 * *
2722 * This register should be loaded before a transfer is started. The * 2623 * This register should be loaded before a transfer is started. The *
2723 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical * 2624 * address to be loaded in bits 39:0 is the 40-bit TRex+ physical *
2724 * address as described in Section 1.3, Figure2 and Figure3. Since * 2625 * address as described in Section 1.3, Figure2 and Figure3. Since *
2725 * the bottom 7 bits of the address are always taken to be zero, BTE * 2626 * the bottom 7 bits of the address are always taken to be zero, BTE *
2726 * transfers are always cacheline-aligned. * 2627 * transfers are always cacheline-aligned. *
2727 * * 2628 * *
2728 ************************************************************************/ 2629 ************************************************************************/
2729 2630
2730typedef union ii_ibda1_u { 2631typedef union ii_ibda1_u {
2731 uint64_t ii_ibda1_regval; 2632 uint64_t ii_ibda1_regval;
2732 struct { 2633 struct {
2733 uint64_t i_rsvd_1 : 7; 2634 uint64_t i_rsvd_1:7;
2734 uint64_t i_addr : 33; 2635 uint64_t i_addr:33;
2735 uint64_t i_rsvd : 24; 2636 uint64_t i_rsvd:24;
2736 } ii_ibda1_fld_s; 2637 } ii_ibda1_fld_s;
2737} ii_ibda1_u_t; 2638} ii_ibda1_u_t;
2738 2639
2739
2740/************************************************************************ 2640/************************************************************************
2741 * * 2641 * *
2742 * Writing to this register sets up the attributes of the transfer * 2642 * Writing to this register sets up the attributes of the transfer *
2743 * and initiates the transfer operation. Reading this register has * 2643 * and initiates the transfer operation. Reading this register has *
2744 * the side effect of terminating any transfer in progress. Note: * 2644 * the side effect of terminating any transfer in progress. Note: *
@@ -2746,61 +2646,58 @@ typedef union ii_ibda1_u {
2746 * other BTE. If a BTE stream has to be stopped (due to error * 2646 * other BTE. If a BTE stream has to be stopped (due to error *
2747 * handling for example), both BTE streams should be stopped and * 2647 * handling for example), both BTE streams should be stopped and *
2748 * their transfers discarded. * 2648 * their transfers discarded. *
2749 * * 2649 * *
2750 ************************************************************************/ 2650 ************************************************************************/
2751 2651
2752typedef union ii_ibct1_u { 2652typedef union ii_ibct1_u {
2753 uint64_t ii_ibct1_regval; 2653 uint64_t ii_ibct1_regval;
2754 struct { 2654 struct {
2755 uint64_t i_zerofill : 1; 2655 uint64_t i_zerofill:1;
2756 uint64_t i_rsvd_2 : 3; 2656 uint64_t i_rsvd_2:3;
2757 uint64_t i_notify : 1; 2657 uint64_t i_notify:1;
2758 uint64_t i_rsvd_1 : 3; 2658 uint64_t i_rsvd_1:3;
2759 uint64_t i_poison : 1; 2659 uint64_t i_poison:1;
2760 uint64_t i_rsvd : 55; 2660 uint64_t i_rsvd:55;
2761 } ii_ibct1_fld_s; 2661 } ii_ibct1_fld_s;
2762} ii_ibct1_u_t; 2662} ii_ibct1_u_t;
2763 2663
2764
2765/************************************************************************ 2664/************************************************************************
2766 * * 2665 * *
2767 * This register contains the address to which the WINV is sent. * 2666 * This register contains the address to which the WINV is sent. *
2768 * This address has to be cache line aligned. * 2667 * This address has to be cache line aligned. *
2769 * * 2668 * *
2770 ************************************************************************/ 2669 ************************************************************************/
2771 2670
2772typedef union ii_ibna1_u { 2671typedef union ii_ibna1_u {
2773 uint64_t ii_ibna1_regval; 2672 uint64_t ii_ibna1_regval;
2774 struct { 2673 struct {
2775 uint64_t i_rsvd_1 : 7; 2674 uint64_t i_rsvd_1:7;
2776 uint64_t i_addr : 33; 2675 uint64_t i_addr:33;
2777 uint64_t i_rsvd : 24; 2676 uint64_t i_rsvd:24;
2778 } ii_ibna1_fld_s; 2677 } ii_ibna1_fld_s;
2779} ii_ibna1_u_t; 2678} ii_ibna1_u_t;
2780 2679
2781
2782/************************************************************************ 2680/************************************************************************
2783 * * 2681 * *
2784 * This register contains the programmable level as well as the node * 2682 * This register contains the programmable level as well as the node *
2785 * ID and PI unit of the processor to which the interrupt will be * 2683 * ID and PI unit of the processor to which the interrupt will be *
2786 * sent. * 2684 * sent. *
2787 * * 2685 * *
2788 ************************************************************************/ 2686 ************************************************************************/
2789 2687
2790typedef union ii_ibia1_u { 2688typedef union ii_ibia1_u {
2791 uint64_t ii_ibia1_regval; 2689 uint64_t ii_ibia1_regval;
2792 struct { 2690 struct {
2793 uint64_t i_pi_id : 1; 2691 uint64_t i_pi_id:1;
2794 uint64_t i_node_id : 8; 2692 uint64_t i_node_id:8;
2795 uint64_t i_rsvd_1 : 7; 2693 uint64_t i_rsvd_1:7;
2796 uint64_t i_level : 7; 2694 uint64_t i_level:7;
2797 uint64_t i_rsvd : 41; 2695 uint64_t i_rsvd:41;
2798 } ii_ibia1_fld_s; 2696 } ii_ibia1_fld_s;
2799} ii_ibia1_u_t; 2697} ii_ibia1_u_t;
2800 2698
2801
2802/************************************************************************ 2699/************************************************************************
2803 * * 2700 * *
2804 * This register defines the resources that feed information into * 2701 * This register defines the resources that feed information into *
2805 * the two performance counters located in the IO Performance * 2702 * the two performance counters located in the IO Performance *
2806 * Profiling Register. There are 17 different quantities that can be * 2703 * Profiling Register. There are 17 different quantities that can be *
@@ -2811,133 +2708,129 @@ typedef union ii_ibia1_u {
2811 * other is available from the other performance counter. Hence, the * 2708 * other is available from the other performance counter. Hence, the *
2812 * II supports all 17*16=272 possible combinations of quantities to * 2709 * II supports all 17*16=272 possible combinations of quantities to *
2813 * measure. * 2710 * measure. *
2814 * * 2711 * *
2815 ************************************************************************/ 2712 ************************************************************************/
2816 2713
2817typedef union ii_ipcr_u { 2714typedef union ii_ipcr_u {
2818 uint64_t ii_ipcr_regval; 2715 uint64_t ii_ipcr_regval;
2819 struct { 2716 struct {
2820 uint64_t i_ippr0_c : 4; 2717 uint64_t i_ippr0_c:4;
2821 uint64_t i_ippr1_c : 4; 2718 uint64_t i_ippr1_c:4;
2822 uint64_t i_icct : 8; 2719 uint64_t i_icct:8;
2823 uint64_t i_rsvd : 48; 2720 uint64_t i_rsvd:48;
2824 } ii_ipcr_fld_s; 2721 } ii_ipcr_fld_s;
2825} ii_ipcr_u_t; 2722} ii_ipcr_u_t;
2826 2723
2827
2828/************************************************************************ 2724/************************************************************************
2829 * * 2725 * *
2830 * * 2726 * *
2831 * * 2727 * *
2832 ************************************************************************/ 2728 ************************************************************************/
2833 2729
2834typedef union ii_ippr_u { 2730typedef union ii_ippr_u {
2835 uint64_t ii_ippr_regval; 2731 uint64_t ii_ippr_regval;
2836 struct { 2732 struct {
2837 uint64_t i_ippr0 : 32; 2733 uint64_t i_ippr0:32;
2838 uint64_t i_ippr1 : 32; 2734 uint64_t i_ippr1:32;
2839 } ii_ippr_fld_s; 2735 } ii_ippr_fld_s;
2840} ii_ippr_u_t; 2736} ii_ippr_u_t;
2841 2737
2842 2738/************************************************************************
2843 2739 * *
2844/************************************************************************** 2740 * The following defines which were not formed into structures are *
2845 * * 2741 * probably indentical to another register, and the name of the *
2846 * The following defines which were not formed into structures are * 2742 * register is provided against each of these registers. This *
2847 * probably indentical to another register, and the name of the * 2743 * information needs to be checked carefully *
2848 * register is provided against each of these registers. This * 2744 * *
2849 * information needs to be checked carefully * 2745 * IIO_ICRB1_A IIO_ICRB0_A *
2850 * * 2746 * IIO_ICRB1_B IIO_ICRB0_B *
2851 * IIO_ICRB1_A IIO_ICRB0_A * 2747 * IIO_ICRB1_C IIO_ICRB0_C *
2852 * IIO_ICRB1_B IIO_ICRB0_B * 2748 * IIO_ICRB1_D IIO_ICRB0_D *
2853 * IIO_ICRB1_C IIO_ICRB0_C * 2749 * IIO_ICRB1_E IIO_ICRB0_E *
2854 * IIO_ICRB1_D IIO_ICRB0_D * 2750 * IIO_ICRB2_A IIO_ICRB0_A *
2855 * IIO_ICRB1_E IIO_ICRB0_E * 2751 * IIO_ICRB2_B IIO_ICRB0_B *
2856 * IIO_ICRB2_A IIO_ICRB0_A * 2752 * IIO_ICRB2_C IIO_ICRB0_C *
2857 * IIO_ICRB2_B IIO_ICRB0_B * 2753 * IIO_ICRB2_D IIO_ICRB0_D *
2858 * IIO_ICRB2_C IIO_ICRB0_C * 2754 * IIO_ICRB2_E IIO_ICRB0_E *
2859 * IIO_ICRB2_D IIO_ICRB0_D * 2755 * IIO_ICRB3_A IIO_ICRB0_A *
2860 * IIO_ICRB2_E IIO_ICRB0_E * 2756 * IIO_ICRB3_B IIO_ICRB0_B *
2861 * IIO_ICRB3_A IIO_ICRB0_A * 2757 * IIO_ICRB3_C IIO_ICRB0_C *
2862 * IIO_ICRB3_B IIO_ICRB0_B * 2758 * IIO_ICRB3_D IIO_ICRB0_D *
2863 * IIO_ICRB3_C IIO_ICRB0_C * 2759 * IIO_ICRB3_E IIO_ICRB0_E *
2864 * IIO_ICRB3_D IIO_ICRB0_D * 2760 * IIO_ICRB4_A IIO_ICRB0_A *
2865 * IIO_ICRB3_E IIO_ICRB0_E * 2761 * IIO_ICRB4_B IIO_ICRB0_B *
2866 * IIO_ICRB4_A IIO_ICRB0_A * 2762 * IIO_ICRB4_C IIO_ICRB0_C *
2867 * IIO_ICRB4_B IIO_ICRB0_B * 2763 * IIO_ICRB4_D IIO_ICRB0_D *
2868 * IIO_ICRB4_C IIO_ICRB0_C * 2764 * IIO_ICRB4_E IIO_ICRB0_E *
2869 * IIO_ICRB4_D IIO_ICRB0_D * 2765 * IIO_ICRB5_A IIO_ICRB0_A *
2870 * IIO_ICRB4_E IIO_ICRB0_E * 2766 * IIO_ICRB5_B IIO_ICRB0_B *
2871 * IIO_ICRB5_A IIO_ICRB0_A * 2767 * IIO_ICRB5_C IIO_ICRB0_C *
2872 * IIO_ICRB5_B IIO_ICRB0_B * 2768 * IIO_ICRB5_D IIO_ICRB0_D *
2873 * IIO_ICRB5_C IIO_ICRB0_C * 2769 * IIO_ICRB5_E IIO_ICRB0_E *
2874 * IIO_ICRB5_D IIO_ICRB0_D * 2770 * IIO_ICRB6_A IIO_ICRB0_A *
2875 * IIO_ICRB5_E IIO_ICRB0_E * 2771 * IIO_ICRB6_B IIO_ICRB0_B *
2876 * IIO_ICRB6_A IIO_ICRB0_A * 2772 * IIO_ICRB6_C IIO_ICRB0_C *
2877 * IIO_ICRB6_B IIO_ICRB0_B * 2773 * IIO_ICRB6_D IIO_ICRB0_D *
2878 * IIO_ICRB6_C IIO_ICRB0_C * 2774 * IIO_ICRB6_E IIO_ICRB0_E *
2879 * IIO_ICRB6_D IIO_ICRB0_D * 2775 * IIO_ICRB7_A IIO_ICRB0_A *
2880 * IIO_ICRB6_E IIO_ICRB0_E * 2776 * IIO_ICRB7_B IIO_ICRB0_B *
2881 * IIO_ICRB7_A IIO_ICRB0_A * 2777 * IIO_ICRB7_C IIO_ICRB0_C *
2882 * IIO_ICRB7_B IIO_ICRB0_B * 2778 * IIO_ICRB7_D IIO_ICRB0_D *
2883 * IIO_ICRB7_C IIO_ICRB0_C * 2779 * IIO_ICRB7_E IIO_ICRB0_E *
2884 * IIO_ICRB7_D IIO_ICRB0_D * 2780 * IIO_ICRB8_A IIO_ICRB0_A *
2885 * IIO_ICRB7_E IIO_ICRB0_E * 2781 * IIO_ICRB8_B IIO_ICRB0_B *
2886 * IIO_ICRB8_A IIO_ICRB0_A * 2782 * IIO_ICRB8_C IIO_ICRB0_C *
2887 * IIO_ICRB8_B IIO_ICRB0_B * 2783 * IIO_ICRB8_D IIO_ICRB0_D *
2888 * IIO_ICRB8_C IIO_ICRB0_C * 2784 * IIO_ICRB8_E IIO_ICRB0_E *
2889 * IIO_ICRB8_D IIO_ICRB0_D * 2785 * IIO_ICRB9_A IIO_ICRB0_A *
2890 * IIO_ICRB8_E IIO_ICRB0_E * 2786 * IIO_ICRB9_B IIO_ICRB0_B *
2891 * IIO_ICRB9_A IIO_ICRB0_A * 2787 * IIO_ICRB9_C IIO_ICRB0_C *
2892 * IIO_ICRB9_B IIO_ICRB0_B * 2788 * IIO_ICRB9_D IIO_ICRB0_D *
2893 * IIO_ICRB9_C IIO_ICRB0_C * 2789 * IIO_ICRB9_E IIO_ICRB0_E *
2894 * IIO_ICRB9_D IIO_ICRB0_D * 2790 * IIO_ICRBA_A IIO_ICRB0_A *
2895 * IIO_ICRB9_E IIO_ICRB0_E * 2791 * IIO_ICRBA_B IIO_ICRB0_B *
2896 * IIO_ICRBA_A IIO_ICRB0_A * 2792 * IIO_ICRBA_C IIO_ICRB0_C *
2897 * IIO_ICRBA_B IIO_ICRB0_B * 2793 * IIO_ICRBA_D IIO_ICRB0_D *
2898 * IIO_ICRBA_C IIO_ICRB0_C * 2794 * IIO_ICRBA_E IIO_ICRB0_E *
2899 * IIO_ICRBA_D IIO_ICRB0_D * 2795 * IIO_ICRBB_A IIO_ICRB0_A *
2900 * IIO_ICRBA_E IIO_ICRB0_E * 2796 * IIO_ICRBB_B IIO_ICRB0_B *
2901 * IIO_ICRBB_A IIO_ICRB0_A * 2797 * IIO_ICRBB_C IIO_ICRB0_C *
2902 * IIO_ICRBB_B IIO_ICRB0_B * 2798 * IIO_ICRBB_D IIO_ICRB0_D *
2903 * IIO_ICRBB_C IIO_ICRB0_C * 2799 * IIO_ICRBB_E IIO_ICRB0_E *
2904 * IIO_ICRBB_D IIO_ICRB0_D * 2800 * IIO_ICRBC_A IIO_ICRB0_A *
2905 * IIO_ICRBB_E IIO_ICRB0_E * 2801 * IIO_ICRBC_B IIO_ICRB0_B *
2906 * IIO_ICRBC_A IIO_ICRB0_A * 2802 * IIO_ICRBC_C IIO_ICRB0_C *
2907 * IIO_ICRBC_B IIO_ICRB0_B * 2803 * IIO_ICRBC_D IIO_ICRB0_D *
2908 * IIO_ICRBC_C IIO_ICRB0_C * 2804 * IIO_ICRBC_E IIO_ICRB0_E *
2909 * IIO_ICRBC_D IIO_ICRB0_D * 2805 * IIO_ICRBD_A IIO_ICRB0_A *
2910 * IIO_ICRBC_E IIO_ICRB0_E * 2806 * IIO_ICRBD_B IIO_ICRB0_B *
2911 * IIO_ICRBD_A IIO_ICRB0_A * 2807 * IIO_ICRBD_C IIO_ICRB0_C *
2912 * IIO_ICRBD_B IIO_ICRB0_B * 2808 * IIO_ICRBD_D IIO_ICRB0_D *
2913 * IIO_ICRBD_C IIO_ICRB0_C * 2809 * IIO_ICRBD_E IIO_ICRB0_E *
2914 * IIO_ICRBD_D IIO_ICRB0_D * 2810 * IIO_ICRBE_A IIO_ICRB0_A *
2915 * IIO_ICRBD_E IIO_ICRB0_E * 2811 * IIO_ICRBE_B IIO_ICRB0_B *
2916 * IIO_ICRBE_A IIO_ICRB0_A * 2812 * IIO_ICRBE_C IIO_ICRB0_C *
2917 * IIO_ICRBE_B IIO_ICRB0_B * 2813 * IIO_ICRBE_D IIO_ICRB0_D *
2918 * IIO_ICRBE_C IIO_ICRB0_C * 2814 * IIO_ICRBE_E IIO_ICRB0_E *
2919 * IIO_ICRBE_D IIO_ICRB0_D * 2815 * *
2920 * IIO_ICRBE_E IIO_ICRB0_E * 2816 ************************************************************************/
2921 * *
2922 **************************************************************************/
2923
2924 2817
2925/* 2818/*
2926 * Slightly friendlier names for some common registers. 2819 * Slightly friendlier names for some common registers.
2927 */ 2820 */
2928#define IIO_WIDGET IIO_WID /* Widget identification */ 2821#define IIO_WIDGET IIO_WID /* Widget identification */
2929#define IIO_WIDGET_STAT IIO_WSTAT /* Widget status register */ 2822#define IIO_WIDGET_STAT IIO_WSTAT /* Widget status register */
2930#define IIO_WIDGET_CTRL IIO_WCR /* Widget control register */ 2823#define IIO_WIDGET_CTRL IIO_WCR /* Widget control register */
2931#define IIO_PROTECT IIO_ILAPR /* IO interface protection */ 2824#define IIO_PROTECT IIO_ILAPR /* IO interface protection */
2932#define IIO_PROTECT_OVRRD IIO_ILAPO /* IO protect override */ 2825#define IIO_PROTECT_OVRRD IIO_ILAPO /* IO protect override */
2933#define IIO_OUTWIDGET_ACCESS IIO_IOWA /* Outbound widget access */ 2826#define IIO_OUTWIDGET_ACCESS IIO_IOWA /* Outbound widget access */
2934#define IIO_INWIDGET_ACCESS IIO_IIWA /* Inbound widget access */ 2827#define IIO_INWIDGET_ACCESS IIO_IIWA /* Inbound widget access */
2935#define IIO_INDEV_ERR_MASK IIO_IIDEM /* Inbound device error mask */ 2828#define IIO_INDEV_ERR_MASK IIO_IIDEM /* Inbound device error mask */
2936#define IIO_LLP_CSR IIO_ILCSR /* LLP control and status */ 2829#define IIO_LLP_CSR IIO_ILCSR /* LLP control and status */
2937#define IIO_LLP_LOG IIO_ILLR /* LLP log */ 2830#define IIO_LLP_LOG IIO_ILLR /* LLP log */
2938#define IIO_XTALKCC_TOUT IIO_IXCC /* Xtalk credit count timeout*/ 2831#define IIO_XTALKCC_TOUT IIO_IXCC /* Xtalk credit count timeout */
2939#define IIO_XTALKTT_TOUT IIO_IXTT /* Xtalk tail timeout */ 2832#define IIO_XTALKTT_TOUT IIO_IXTT /* Xtalk tail timeout */
2940#define IIO_IO_ERR_CLR IIO_IECLR /* IO error clear */ 2833#define IIO_IO_ERR_CLR IIO_IECLR /* IO error clear */
2941#define IIO_IGFX_0 IIO_IGFX0 2834#define IIO_IGFX_0 IIO_IGFX0
2942#define IIO_IGFX_1 IIO_IGFX1 2835#define IIO_IGFX_1 IIO_IGFX1
2943#define IIO_IBCT_0 IIO_IBCT0 2836#define IIO_IBCT_0 IIO_IBCT0
@@ -2957,12 +2850,12 @@ typedef union ii_ippr_u {
2957#define IIO_PRTE_A(_x) (IIO_IPRTE0_A + (8 * (_x))) 2850#define IIO_PRTE_A(_x) (IIO_IPRTE0_A + (8 * (_x)))
2958#define IIO_PRTE_B(_x) (IIO_IPRTE0_B + (8 * (_x))) 2851#define IIO_PRTE_B(_x) (IIO_IPRTE0_B + (8 * (_x)))
2959#define IIO_NUM_PRTES 8 /* Total number of PRB table entries */ 2852#define IIO_NUM_PRTES 8 /* Total number of PRB table entries */
2960#define IIO_WIDPRTE_A(x) IIO_PRTE_A(((x) - 8)) /* widget ID to its PRTE num */ 2853#define IIO_WIDPRTE_A(x) IIO_PRTE_A(((x) - 8)) /* widget ID to its PRTE num */
2961#define IIO_WIDPRTE_B(x) IIO_PRTE_B(((x) - 8)) /* widget ID to its PRTE num */ 2854#define IIO_WIDPRTE_B(x) IIO_PRTE_B(((x) - 8)) /* widget ID to its PRTE num */
2962 2855
2963#define IIO_NUM_IPRBS (9) 2856#define IIO_NUM_IPRBS 9
2964 2857
2965#define IIO_LLP_CSR_IS_UP 0x00002000 2858#define IIO_LLP_CSR_IS_UP 0x00002000
2966#define IIO_LLP_CSR_LLP_STAT_MASK 0x00003000 2859#define IIO_LLP_CSR_LLP_STAT_MASK 0x00003000
2967#define IIO_LLP_CSR_LLP_STAT_SHFT 12 2860#define IIO_LLP_CSR_LLP_STAT_SHFT 12
2968 2861
@@ -2970,30 +2863,29 @@ typedef union ii_ippr_u {
2970#define IIO_LLP_SN_MAX 0xffff /* in ILLR SN_CNT, Max Sequence Number errors */ 2863#define IIO_LLP_SN_MAX 0xffff /* in ILLR SN_CNT, Max Sequence Number errors */
2971 2864
2972/* key to IIO_PROTECT_OVRRD */ 2865/* key to IIO_PROTECT_OVRRD */
2973#define IIO_PROTECT_OVRRD_KEY 0x53474972756c6573ull /* "SGIrules" */ 2866#define IIO_PROTECT_OVRRD_KEY 0x53474972756c6573ull /* "SGIrules" */
2974 2867
2975/* BTE register names */ 2868/* BTE register names */
2976#define IIO_BTE_STAT_0 IIO_IBLS_0 /* Also BTE length/status 0 */ 2869#define IIO_BTE_STAT_0 IIO_IBLS_0 /* Also BTE length/status 0 */
2977#define IIO_BTE_SRC_0 IIO_IBSA_0 /* Also BTE source address 0 */ 2870#define IIO_BTE_SRC_0 IIO_IBSA_0 /* Also BTE source address 0 */
2978#define IIO_BTE_DEST_0 IIO_IBDA_0 /* Also BTE dest. address 0 */ 2871#define IIO_BTE_DEST_0 IIO_IBDA_0 /* Also BTE dest. address 0 */
2979#define IIO_BTE_CTRL_0 IIO_IBCT_0 /* Also BTE control/terminate 0 */ 2872#define IIO_BTE_CTRL_0 IIO_IBCT_0 /* Also BTE control/terminate 0 */
2980#define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */ 2873#define IIO_BTE_NOTIFY_0 IIO_IBNA_0 /* Also BTE notification 0 */
2981#define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */ 2874#define IIO_BTE_INT_0 IIO_IBIA_0 /* Also BTE interrupt 0 */
2982#define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */ 2875#define IIO_BTE_OFF_0 0 /* Base offset from BTE 0 regs. */
2983#define IIO_BTE_OFF_1 (IIO_IBLS_1 - IIO_IBLS_0) /* Offset from base to BTE 1 */ 2876#define IIO_BTE_OFF_1 (IIO_IBLS_1 - IIO_IBLS_0) /* Offset from base to BTE 1 */
2984 2877
2985/* BTE register offsets from base */ 2878/* BTE register offsets from base */
2986#define BTEOFF_STAT 0 2879#define BTEOFF_STAT 0
2987#define BTEOFF_SRC (IIO_BTE_SRC_0 - IIO_BTE_STAT_0) 2880#define BTEOFF_SRC (IIO_BTE_SRC_0 - IIO_BTE_STAT_0)
2988#define BTEOFF_DEST (IIO_BTE_DEST_0 - IIO_BTE_STAT_0) 2881#define BTEOFF_DEST (IIO_BTE_DEST_0 - IIO_BTE_STAT_0)
2989#define BTEOFF_CTRL (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0) 2882#define BTEOFF_CTRL (IIO_BTE_CTRL_0 - IIO_BTE_STAT_0)
2990#define BTEOFF_NOTIFY (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0) 2883#define BTEOFF_NOTIFY (IIO_BTE_NOTIFY_0 - IIO_BTE_STAT_0)
2991#define BTEOFF_INT (IIO_BTE_INT_0 - IIO_BTE_STAT_0) 2884#define BTEOFF_INT (IIO_BTE_INT_0 - IIO_BTE_STAT_0)
2992
2993 2885
2994/* names used in shub diags */ 2886/* names used in shub diags */
2995#define IIO_BASE_BTE0 IIO_IBLS_0 2887#define IIO_BASE_BTE0 IIO_IBLS_0
2996#define IIO_BASE_BTE1 IIO_IBLS_1 2888#define IIO_BASE_BTE1 IIO_IBLS_1
2997 2889
2998/* 2890/*
2999 * Macro which takes the widget number, and returns the 2891 * Macro which takes the widget number, and returns the
@@ -3001,10 +2893,9 @@ typedef union ii_ippr_u {
3001 * value _x is expected to be a widget number in the range 2893 * value _x is expected to be a widget number in the range
3002 * 0, 8 - 0xF 2894 * 0, 8 - 0xF
3003 */ 2895 */
3004#define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \ 2896#define IIO_IOPRB(_x) (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \
3005 (_x) : \ 2897 (_x) : \
3006 (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) ) 2898 (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) )
3007
3008 2899
3009/* GFX Flow Control Node/Widget Register */ 2900/* GFX Flow Control Node/Widget Register */
3010#define IIO_IGFX_W_NUM_BITS 4 /* size of widget num field */ 2901#define IIO_IGFX_W_NUM_BITS 4 /* size of widget num field */
@@ -3025,7 +2916,6 @@ typedef union ii_ippr_u {
3025 (((node) & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) | \ 2916 (((node) & IIO_IGFX_N_NUM_MASK) << IIO_IGFX_N_NUM_SHIFT) | \
3026 (((cpu) & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT)) 2917 (((cpu) & IIO_IGFX_P_NUM_MASK) << IIO_IGFX_P_NUM_SHIFT))
3027 2918
3028
3029/* Scratch registers (all bits available) */ 2919/* Scratch registers (all bits available) */
3030#define IIO_SCRATCH_REG0 IIO_ISCR0 2920#define IIO_SCRATCH_REG0 IIO_ISCR0
3031#define IIO_SCRATCH_REG1 IIO_ISCR1 2921#define IIO_SCRATCH_REG1 IIO_ISCR1
@@ -3046,21 +2936,21 @@ typedef union ii_ippr_u {
3046#define IIO_SCRATCH_BIT1_0 0x0000000000000001UL 2936#define IIO_SCRATCH_BIT1_0 0x0000000000000001UL
3047#define IIO_SCRATCH_BIT1_1 0x0000000000000002UL 2937#define IIO_SCRATCH_BIT1_1 0x0000000000000002UL
3048/* IO Translation Table Entries */ 2938/* IO Translation Table Entries */
3049#define IIO_NUM_ITTES 7 /* ITTEs numbered 0..6 */ 2939#define IIO_NUM_ITTES 7 /* ITTEs numbered 0..6 */
3050 /* Hw manuals number them 1..7! */ 2940 /* Hw manuals number them 1..7! */
3051/* 2941/*
3052 * IIO_IMEM Register fields. 2942 * IIO_IMEM Register fields.
3053 */ 2943 */
3054#define IIO_IMEM_W0ESD 0x1UL /* Widget 0 shut down due to error */ 2944#define IIO_IMEM_W0ESD 0x1UL /* Widget 0 shut down due to error */
3055#define IIO_IMEM_B0ESD (1UL << 4) /* BTE 0 shut down due to error */ 2945#define IIO_IMEM_B0ESD (1UL << 4) /* BTE 0 shut down due to error */
3056#define IIO_IMEM_B1ESD (1UL << 8) /* BTE 1 Shut down due to error */ 2946#define IIO_IMEM_B1ESD (1UL << 8) /* BTE 1 Shut down due to error */
3057 2947
3058/* 2948/*
3059 * As a permanent workaround for a bug in the PI side of the shub, we've 2949 * As a permanent workaround for a bug in the PI side of the shub, we've
3060 * redefined big window 7 as small window 0. 2950 * redefined big window 7 as small window 0.
3061 XXX does this still apply for SN1?? 2951 XXX does this still apply for SN1??
3062 */ 2952 */
3063#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1) 2953#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1)
3064 2954
3065/* 2955/*
3066 * Use the top big window as a surrogate for the first small window 2956 * Use the top big window as a surrogate for the first small window
@@ -3071,11 +2961,11 @@ typedef union ii_ippr_u {
3071 2961
3072/* 2962/*
3073 * CRB manipulation macros 2963 * CRB manipulation macros
3074 * The CRB macros are slightly complicated, since there are up to 2964 * The CRB macros are slightly complicated, since there are up to
3075 * four registers associated with each CRB entry. 2965 * four registers associated with each CRB entry.
3076 */ 2966 */
3077#define IIO_NUM_CRBS 15 /* Number of CRBs */ 2967#define IIO_NUM_CRBS 15 /* Number of CRBs */
3078#define IIO_NUM_PC_CRBS 4 /* Number of partial cache CRBs */ 2968#define IIO_NUM_PC_CRBS 4 /* Number of partial cache CRBs */
3079#define IIO_ICRB_OFFSET 8 2969#define IIO_ICRB_OFFSET 8
3080#define IIO_ICRB_0 IIO_ICRB0_A 2970#define IIO_ICRB_0 IIO_ICRB0_A
3081#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */ 2971#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */
@@ -3083,43 +2973,43 @@ typedef union ii_ippr_u {
3083 #define IIO_FIRST_PC_ENTRY 12 2973 #define IIO_FIRST_PC_ENTRY 12
3084 */ 2974 */
3085 2975
3086#define IIO_ICRB_A(_x) ((u64)(IIO_ICRB_0 + (6 * IIO_ICRB_OFFSET * (_x)))) 2976#define IIO_ICRB_A(_x) ((u64)(IIO_ICRB_0 + (6 * IIO_ICRB_OFFSET * (_x))))
3087#define IIO_ICRB_B(_x) ((u64)((char *)IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET)) 2977#define IIO_ICRB_B(_x) ((u64)((char *)IIO_ICRB_A(_x) + 1*IIO_ICRB_OFFSET))
3088#define IIO_ICRB_C(_x) ((u64)((char *)IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET)) 2978#define IIO_ICRB_C(_x) ((u64)((char *)IIO_ICRB_A(_x) + 2*IIO_ICRB_OFFSET))
3089#define IIO_ICRB_D(_x) ((u64)((char *)IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET)) 2979#define IIO_ICRB_D(_x) ((u64)((char *)IIO_ICRB_A(_x) + 3*IIO_ICRB_OFFSET))
3090#define IIO_ICRB_E(_x) ((u64)((char *)IIO_ICRB_A(_x) + 4*IIO_ICRB_OFFSET)) 2980#define IIO_ICRB_E(_x) ((u64)((char *)IIO_ICRB_A(_x) + 4*IIO_ICRB_OFFSET))
3091 2981
3092#define TNUM_TO_WIDGET_DEV(_tnum) (_tnum & 0x7) 2982#define TNUM_TO_WIDGET_DEV(_tnum) (_tnum & 0x7)
3093 2983
3094/* 2984/*
3095 * values for "ecode" field 2985 * values for "ecode" field
3096 */ 2986 */
3097#define IIO_ICRB_ECODE_DERR 0 /* Directory error due to IIO access */ 2987#define IIO_ICRB_ECODE_DERR 0 /* Directory error due to IIO access */
3098#define IIO_ICRB_ECODE_PERR 1 /* Poison error on IO access */ 2988#define IIO_ICRB_ECODE_PERR 1 /* Poison error on IO access */
3099#define IIO_ICRB_ECODE_WERR 2 /* Write error by IIO access 2989#define IIO_ICRB_ECODE_WERR 2 /* Write error by IIO access
3100 * e.g. WINV to a Read only line. */ 2990 * e.g. WINV to a Read only line. */
3101#define IIO_ICRB_ECODE_AERR 3 /* Access error caused by IIO access */ 2991#define IIO_ICRB_ECODE_AERR 3 /* Access error caused by IIO access */
3102#define IIO_ICRB_ECODE_PWERR 4 /* Error on partial write */ 2992#define IIO_ICRB_ECODE_PWERR 4 /* Error on partial write */
3103#define IIO_ICRB_ECODE_PRERR 5 /* Error on partial read */ 2993#define IIO_ICRB_ECODE_PRERR 5 /* Error on partial read */
3104#define IIO_ICRB_ECODE_TOUT 6 /* CRB timeout before deallocating */ 2994#define IIO_ICRB_ECODE_TOUT 6 /* CRB timeout before deallocating */
3105#define IIO_ICRB_ECODE_XTERR 7 /* Incoming xtalk pkt had error bit */ 2995#define IIO_ICRB_ECODE_XTERR 7 /* Incoming xtalk pkt had error bit */
3106 2996
3107/* 2997/*
3108 * Values for field imsgtype 2998 * Values for field imsgtype
3109 */ 2999 */
3110#define IIO_ICRB_IMSGT_XTALK 0 /* Incoming Meessage from Xtalk */ 3000#define IIO_ICRB_IMSGT_XTALK 0 /* Incoming Meessage from Xtalk */
3111#define IIO_ICRB_IMSGT_BTE 1 /* Incoming message from BTE */ 3001#define IIO_ICRB_IMSGT_BTE 1 /* Incoming message from BTE */
3112#define IIO_ICRB_IMSGT_SN1NET 2 /* Incoming message from SN1 net */ 3002#define IIO_ICRB_IMSGT_SN1NET 2 /* Incoming message from SN1 net */
3113#define IIO_ICRB_IMSGT_CRB 3 /* Incoming message from CRB ??? */ 3003#define IIO_ICRB_IMSGT_CRB 3 /* Incoming message from CRB ??? */
3114 3004
3115/* 3005/*
3116 * values for field initiator. 3006 * values for field initiator.
3117 */ 3007 */
3118#define IIO_ICRB_INIT_XTALK 0 /* Message originated in xtalk */ 3008#define IIO_ICRB_INIT_XTALK 0 /* Message originated in xtalk */
3119#define IIO_ICRB_INIT_BTE0 0x1 /* Message originated in BTE 0 */ 3009#define IIO_ICRB_INIT_BTE0 0x1 /* Message originated in BTE 0 */
3120#define IIO_ICRB_INIT_SN1NET 0x2 /* Message originated in SN1net */ 3010#define IIO_ICRB_INIT_SN1NET 0x2 /* Message originated in SN1net */
3121#define IIO_ICRB_INIT_CRB 0x3 /* Message originated in CRB ? */ 3011#define IIO_ICRB_INIT_CRB 0x3 /* Message originated in CRB ? */
3122#define IIO_ICRB_INIT_BTE1 0x5 /* MEssage originated in BTE 1 */ 3012#define IIO_ICRB_INIT_BTE1 0x5 /* MEssage originated in BTE 1 */
3123 3013
3124/* 3014/*
3125 * Number of credits Hub widget has while sending req/response to 3015 * Number of credits Hub widget has while sending req/response to
@@ -3127,8 +3017,8 @@ typedef union ii_ippr_u {
3127 * Value of 3 is required by Xbow 1.1 3017 * Value of 3 is required by Xbow 1.1
3128 * We may be able to increase this to 4 with Xbow 1.2. 3018 * We may be able to increase this to 4 with Xbow 1.2.
3129 */ 3019 */
3130#define HUBII_XBOW_CREDIT 3 3020#define HUBII_XBOW_CREDIT 3
3131#define HUBII_XBOW_REV2_CREDIT 4 3021#define HUBII_XBOW_REV2_CREDIT 4
3132 3022
3133/* 3023/*
3134 * Number of credits that xtalk devices should use when communicating 3024 * Number of credits that xtalk devices should use when communicating
@@ -3159,28 +3049,28 @@ typedef union ii_ippr_u {
3159 */ 3049 */
3160 3050
3161#define IIO_ICMR_CRB_VLD_SHFT 20 3051#define IIO_ICMR_CRB_VLD_SHFT 20
3162#define IIO_ICMR_CRB_VLD_MASK (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT) 3052#define IIO_ICMR_CRB_VLD_MASK (0x7fffUL << IIO_ICMR_CRB_VLD_SHFT)
3163 3053
3164#define IIO_ICMR_FC_CNT_SHFT 16 3054#define IIO_ICMR_FC_CNT_SHFT 16
3165#define IIO_ICMR_FC_CNT_MASK (0xf << IIO_ICMR_FC_CNT_SHFT) 3055#define IIO_ICMR_FC_CNT_MASK (0xf << IIO_ICMR_FC_CNT_SHFT)
3166 3056
3167#define IIO_ICMR_C_CNT_SHFT 4 3057#define IIO_ICMR_C_CNT_SHFT 4
3168#define IIO_ICMR_C_CNT_MASK (0xf << IIO_ICMR_C_CNT_SHFT) 3058#define IIO_ICMR_C_CNT_MASK (0xf << IIO_ICMR_C_CNT_SHFT)
3169 3059
3170#define IIO_ICMR_PRECISE (1UL << 52) 3060#define IIO_ICMR_PRECISE (1UL << 52)
3171#define IIO_ICMR_CLR_RPPD (1UL << 13) 3061#define IIO_ICMR_CLR_RPPD (1UL << 13)
3172#define IIO_ICMR_CLR_RQPD (1UL << 12) 3062#define IIO_ICMR_CLR_RQPD (1UL << 12)
3173 3063
3174/* 3064/*
3175 * IIO PIO Deallocation register field masks : (IIO_IPDR) 3065 * IIO PIO Deallocation register field masks : (IIO_IPDR)
3176 XXX present but not needed in bedrock? See the manual. 3066 XXX present but not needed in bedrock? See the manual.
3177 */ 3067 */
3178#define IIO_IPDR_PND (1 << 4) 3068#define IIO_IPDR_PND (1 << 4)
3179 3069
3180/* 3070/*
3181 * IIO CRB deallocation register field masks: (IIO_ICDR) 3071 * IIO CRB deallocation register field masks: (IIO_ICDR)
3182 */ 3072 */
3183#define IIO_ICDR_PND (1 << 4) 3073#define IIO_ICDR_PND (1 << 4)
3184 3074
3185/* 3075/*
3186 * IO BTE Length/Status (IIO_IBLS) register bit field definitions 3076 * IO BTE Length/Status (IIO_IBLS) register bit field definitions
@@ -3223,35 +3113,35 @@ typedef union ii_ippr_u {
3223/* 3113/*
3224 * IO Error Clear register bit field definitions 3114 * IO Error Clear register bit field definitions
3225 */ 3115 */
3226#define IECLR_PI1_FWD_INT (1UL << 31) /* clear PI1_FORWARD_INT in iidsr */ 3116#define IECLR_PI1_FWD_INT (1UL << 31) /* clear PI1_FORWARD_INT in iidsr */
3227#define IECLR_PI0_FWD_INT (1UL << 30) /* clear PI0_FORWARD_INT in iidsr */ 3117#define IECLR_PI0_FWD_INT (1UL << 30) /* clear PI0_FORWARD_INT in iidsr */
3228#define IECLR_SPUR_RD_HDR (1UL << 29) /* clear valid bit in ixss reg */ 3118#define IECLR_SPUR_RD_HDR (1UL << 29) /* clear valid bit in ixss reg */
3229#define IECLR_BTE1 (1UL << 18) /* clear bte error 1 */ 3119#define IECLR_BTE1 (1UL << 18) /* clear bte error 1 */
3230#define IECLR_BTE0 (1UL << 17) /* clear bte error 0 */ 3120#define IECLR_BTE0 (1UL << 17) /* clear bte error 0 */
3231#define IECLR_CRAZY (1UL << 16) /* clear crazy bit in wstat reg */ 3121#define IECLR_CRAZY (1UL << 16) /* clear crazy bit in wstat reg */
3232#define IECLR_PRB_F (1UL << 15) /* clear err bit in PRB_F reg */ 3122#define IECLR_PRB_F (1UL << 15) /* clear err bit in PRB_F reg */
3233#define IECLR_PRB_E (1UL << 14) /* clear err bit in PRB_E reg */ 3123#define IECLR_PRB_E (1UL << 14) /* clear err bit in PRB_E reg */
3234#define IECLR_PRB_D (1UL << 13) /* clear err bit in PRB_D reg */ 3124#define IECLR_PRB_D (1UL << 13) /* clear err bit in PRB_D reg */
3235#define IECLR_PRB_C (1UL << 12) /* clear err bit in PRB_C reg */ 3125#define IECLR_PRB_C (1UL << 12) /* clear err bit in PRB_C reg */
3236#define IECLR_PRB_B (1UL << 11) /* clear err bit in PRB_B reg */ 3126#define IECLR_PRB_B (1UL << 11) /* clear err bit in PRB_B reg */
3237#define IECLR_PRB_A (1UL << 10) /* clear err bit in PRB_A reg */ 3127#define IECLR_PRB_A (1UL << 10) /* clear err bit in PRB_A reg */
3238#define IECLR_PRB_9 (1UL << 9) /* clear err bit in PRB_9 reg */ 3128#define IECLR_PRB_9 (1UL << 9) /* clear err bit in PRB_9 reg */
3239#define IECLR_PRB_8 (1UL << 8) /* clear err bit in PRB_8 reg */ 3129#define IECLR_PRB_8 (1UL << 8) /* clear err bit in PRB_8 reg */
3240#define IECLR_PRB_0 (1UL << 0) /* clear err bit in PRB_0 reg */ 3130#define IECLR_PRB_0 (1UL << 0) /* clear err bit in PRB_0 reg */
3241 3131
3242/* 3132/*
3243 * IIO CRB control register Fields: IIO_ICCR 3133 * IIO CRB control register Fields: IIO_ICCR
3244 */ 3134 */
3245#define IIO_ICCR_PENDING (0x10000) 3135#define IIO_ICCR_PENDING 0x10000
3246#define IIO_ICCR_CMD_MASK (0xFF) 3136#define IIO_ICCR_CMD_MASK 0xFF
3247#define IIO_ICCR_CMD_SHFT (7) 3137#define IIO_ICCR_CMD_SHFT 7
3248#define IIO_ICCR_CMD_NOP (0x0) /* No Op */ 3138#define IIO_ICCR_CMD_NOP 0x0 /* No Op */
3249#define IIO_ICCR_CMD_WAKE (0x100) /* Reactivate CRB entry and process */ 3139#define IIO_ICCR_CMD_WAKE 0x100 /* Reactivate CRB entry and process */
3250#define IIO_ICCR_CMD_TIMEOUT (0x200) /* Make CRB timeout & mark invalid */ 3140#define IIO_ICCR_CMD_TIMEOUT 0x200 /* Make CRB timeout & mark invalid */
3251#define IIO_ICCR_CMD_EJECT (0x400) /* Contents of entry written to memory 3141#define IIO_ICCR_CMD_EJECT 0x400 /* Contents of entry written to memory
3252 * via a WB 3142 * via a WB
3253 */ 3143 */
3254#define IIO_ICCR_CMD_FLUSH (0x800) 3144#define IIO_ICCR_CMD_FLUSH 0x800
3255 3145
3256/* 3146/*
3257 * 3147 *
@@ -3283,8 +3173,8 @@ typedef union ii_ippr_u {
3283 * Easy access macros for CRBs, all 5 registers (A-E) 3173 * Easy access macros for CRBs, all 5 registers (A-E)
3284 */ 3174 */
3285typedef ii_icrb0_a_u_t icrba_t; 3175typedef ii_icrb0_a_u_t icrba_t;
3286#define a_sidn ii_icrb0_a_fld_s.ia_sidn 3176#define a_sidn ii_icrb0_a_fld_s.ia_sidn
3287#define a_tnum ii_icrb0_a_fld_s.ia_tnum 3177#define a_tnum ii_icrb0_a_fld_s.ia_tnum
3288#define a_addr ii_icrb0_a_fld_s.ia_addr 3178#define a_addr ii_icrb0_a_fld_s.ia_addr
3289#define a_valid ii_icrb0_a_fld_s.ia_vld 3179#define a_valid ii_icrb0_a_fld_s.ia_vld
3290#define a_iow ii_icrb0_a_fld_s.ia_iow 3180#define a_iow ii_icrb0_a_fld_s.ia_iow
@@ -3324,14 +3214,13 @@ typedef ii_icrb0_c_u_t icrbc_t;
3324#define c_source ii_icrb0_c_fld_s.ic_source 3214#define c_source ii_icrb0_c_fld_s.ic_source
3325#define c_regvalue ii_icrb0_c_regval 3215#define c_regvalue ii_icrb0_c_regval
3326 3216
3327
3328typedef ii_icrb0_d_u_t icrbd_t; 3217typedef ii_icrb0_d_u_t icrbd_t;
3329#define d_sleep ii_icrb0_d_fld_s.id_sleep 3218#define d_sleep ii_icrb0_d_fld_s.id_sleep
3330#define d_pricnt ii_icrb0_d_fld_s.id_pr_cnt 3219#define d_pricnt ii_icrb0_d_fld_s.id_pr_cnt
3331#define d_pripsc ii_icrb0_d_fld_s.id_pr_psc 3220#define d_pripsc ii_icrb0_d_fld_s.id_pr_psc
3332#define d_bteop ii_icrb0_d_fld_s.id_bte_op 3221#define d_bteop ii_icrb0_d_fld_s.id_bte_op
3333#define d_bteaddr ii_icrb0_d_fld_s.id_pa_be /* ic_pa_be fld has 2 names*/ 3222#define d_bteaddr ii_icrb0_d_fld_s.id_pa_be /* ic_pa_be fld has 2 names */
3334#define d_benable ii_icrb0_d_fld_s.id_pa_be /* ic_pa_be fld has 2 names*/ 3223#define d_benable ii_icrb0_d_fld_s.id_pa_be /* ic_pa_be fld has 2 names */
3335#define d_regvalue ii_icrb0_d_regval 3224#define d_regvalue ii_icrb0_d_regval
3336 3225
3337typedef ii_icrb0_e_u_t icrbe_t; 3226typedef ii_icrb0_e_u_t icrbe_t;
@@ -3341,7 +3230,6 @@ typedef ii_icrb0_e_u_t icrbe_t;
3341#define icrbe_timeout ii_icrb0_e_fld_s.ie_timeout 3230#define icrbe_timeout ii_icrb0_e_fld_s.ie_timeout
3342#define e_regvalue ii_icrb0_e_regval 3231#define e_regvalue ii_icrb0_e_regval
3343 3232
3344
3345/* Number of widgets supported by shub */ 3233/* Number of widgets supported by shub */
3346#define HUB_NUM_WIDGET 9 3234#define HUB_NUM_WIDGET 9
3347#define HUB_WIDGET_ID_MIN 0x8 3235#define HUB_WIDGET_ID_MIN 0x8
@@ -3367,27 +3255,27 @@ typedef ii_icrb0_e_u_t icrbe_t;
3367 3255
3368#define LNK_STAT_WORKING 0x2 /* LLP is working */ 3256#define LNK_STAT_WORKING 0x2 /* LLP is working */
3369 3257
3370#define IIO_WSTAT_ECRAZY (1ULL << 32) /* Hub gone crazy */ 3258#define IIO_WSTAT_ECRAZY (1ULL << 32) /* Hub gone crazy */
3371#define IIO_WSTAT_TXRETRY (1ULL << 9) /* Hub Tx Retry timeout */ 3259#define IIO_WSTAT_TXRETRY (1ULL << 9) /* Hub Tx Retry timeout */
3372#define IIO_WSTAT_TXRETRY_MASK (0x7F) /* should be 0xFF?? */ 3260#define IIO_WSTAT_TXRETRY_MASK 0x7F /* should be 0xFF?? */
3373#define IIO_WSTAT_TXRETRY_SHFT (16) 3261#define IIO_WSTAT_TXRETRY_SHFT 16
3374#define IIO_WSTAT_TXRETRY_CNT(w) (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \ 3262#define IIO_WSTAT_TXRETRY_CNT(w) (((w) >> IIO_WSTAT_TXRETRY_SHFT) & \
3375 IIO_WSTAT_TXRETRY_MASK) 3263 IIO_WSTAT_TXRETRY_MASK)
3376 3264
3377/* Number of II perf. counters we can multiplex at once */ 3265/* Number of II perf. counters we can multiplex at once */
3378 3266
3379#define IO_PERF_SETS 32 3267#define IO_PERF_SETS 32
3380 3268
3381/* Bit for the widget in inbound access register */ 3269/* Bit for the widget in inbound access register */
3382#define IIO_IIWA_WIDGET(_w) ((uint64_t)(1ULL << _w)) 3270#define IIO_IIWA_WIDGET(_w) ((uint64_t)(1ULL << _w))
3383/* Bit for the widget in outbound access register */ 3271/* Bit for the widget in outbound access register */
3384#define IIO_IOWA_WIDGET(_w) ((uint64_t)(1ULL << _w)) 3272#define IIO_IOWA_WIDGET(_w) ((uint64_t)(1ULL << _w))
3385 3273
3386/* NOTE: The following define assumes that we are going to get 3274/* NOTE: The following define assumes that we are going to get
3387 * widget numbers from 8 thru F and the device numbers within 3275 * widget numbers from 8 thru F and the device numbers within
3388 * widget from 0 thru 7. 3276 * widget from 0 thru 7.
3389 */ 3277 */
3390#define IIO_IIDEM_WIDGETDEV_MASK(w, d) ((uint64_t)(1ULL << (8 * ((w) - 8) + (d)))) 3278#define IIO_IIDEM_WIDGETDEV_MASK(w, d) ((uint64_t)(1ULL << (8 * ((w) - 8) + (d))))
3391 3279
3392/* IO Interrupt Destination Register */ 3280/* IO Interrupt Destination Register */
3393#define IIO_IIDSR_SENT_SHIFT 28 3281#define IIO_IIDSR_SENT_SHIFT 28
@@ -3402,11 +3290,11 @@ typedef ii_icrb0_e_u_t icrbe_t;
3402#define IIO_IIDSR_LVL_MASK 0x000000ff 3290#define IIO_IIDSR_LVL_MASK 0x000000ff
3403 3291
3404/* Xtalk timeout threshhold register (IIO_IXTT) */ 3292/* Xtalk timeout threshhold register (IIO_IXTT) */
3405#define IXTT_RRSP_TO_SHFT 55 /* read response timeout */ 3293#define IXTT_RRSP_TO_SHFT 55 /* read response timeout */
3406#define IXTT_RRSP_TO_MASK (0x1FULL << IXTT_RRSP_TO_SHFT) 3294#define IXTT_RRSP_TO_MASK (0x1FULL << IXTT_RRSP_TO_SHFT)
3407#define IXTT_RRSP_PS_SHFT 32 /* read responsed TO prescalar */ 3295#define IXTT_RRSP_PS_SHFT 32 /* read responsed TO prescalar */
3408#define IXTT_RRSP_PS_MASK (0x7FFFFFULL << IXTT_RRSP_PS_SHFT) 3296#define IXTT_RRSP_PS_MASK (0x7FFFFFULL << IXTT_RRSP_PS_SHFT)
3409#define IXTT_TAIL_TO_SHFT 0 /* tail timeout counter threshold */ 3297#define IXTT_TAIL_TO_SHFT 0 /* tail timeout counter threshold */
3410#define IXTT_TAIL_TO_MASK (0x3FFFFFFULL << IXTT_TAIL_TO_SHFT) 3298#define IXTT_TAIL_TO_MASK (0x3FFFFFFULL << IXTT_TAIL_TO_SHFT)
3411 3299
3412/* 3300/*
@@ -3414,17 +3302,17 @@ typedef ii_icrb0_e_u_t icrbe_t;
3414 */ 3302 */
3415 3303
3416typedef union hubii_wcr_u { 3304typedef union hubii_wcr_u {
3417 uint64_t wcr_reg_value; 3305 uint64_t wcr_reg_value;
3418 struct { 3306 struct {
3419 uint64_t wcr_widget_id: 4, /* LLP crossbar credit */ 3307 uint64_t wcr_widget_id:4, /* LLP crossbar credit */
3420 wcr_tag_mode: 1, /* Tag mode */ 3308 wcr_tag_mode:1, /* Tag mode */
3421 wcr_rsvd1: 8, /* Reserved */ 3309 wcr_rsvd1:8, /* Reserved */
3422 wcr_xbar_crd: 3, /* LLP crossbar credit */ 3310 wcr_xbar_crd:3, /* LLP crossbar credit */
3423 wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */ 3311 wcr_f_bad_pkt:1, /* Force bad llp pkt enable */
3424 wcr_dir_con: 1, /* widget direct connect */ 3312 wcr_dir_con:1, /* widget direct connect */
3425 wcr_e_thresh: 5, /* elasticity threshold */ 3313 wcr_e_thresh:5, /* elasticity threshold */
3426 wcr_rsvd: 41; /* unused */ 3314 wcr_rsvd:41; /* unused */
3427 } wcr_fields_s; 3315 } wcr_fields_s;
3428} hubii_wcr_t; 3316} hubii_wcr_t;
3429 3317
3430#define iwcr_dir_con wcr_fields_s.wcr_dir_con 3318#define iwcr_dir_con wcr_fields_s.wcr_dir_con
@@ -3436,41 +3324,35 @@ performance registers */
3436 performed */ 3324 performed */
3437 3325
3438typedef union io_perf_sel { 3326typedef union io_perf_sel {
3439 uint64_t perf_sel_reg; 3327 uint64_t perf_sel_reg;
3440 struct { 3328 struct {
3441 uint64_t perf_ippr0 : 4, 3329 uint64_t perf_ippr0:4, perf_ippr1:4, perf_icct:8, perf_rsvd:48;
3442 perf_ippr1 : 4, 3330 } perf_sel_bits;
3443 perf_icct : 8,
3444 perf_rsvd : 48;
3445 } perf_sel_bits;
3446} io_perf_sel_t; 3331} io_perf_sel_t;
3447 3332
3448/* io_perf_cnt is to extract the count from the shub registers. Due to 3333/* io_perf_cnt is to extract the count from the shub registers. Due to
3449 hardware problems there is only one counter, not two. */ 3334 hardware problems there is only one counter, not two. */
3450 3335
3451typedef union io_perf_cnt { 3336typedef union io_perf_cnt {
3452 uint64_t perf_cnt; 3337 uint64_t perf_cnt;
3453 struct { 3338 struct {
3454 uint64_t perf_cnt : 20, 3339 uint64_t perf_cnt:20, perf_rsvd2:12, perf_rsvd1:32;
3455 perf_rsvd2 : 12, 3340 } perf_cnt_bits;
3456 perf_rsvd1 : 32;
3457 } perf_cnt_bits;
3458 3341
3459} io_perf_cnt_t; 3342} io_perf_cnt_t;
3460 3343
3461typedef union iprte_a { 3344typedef union iprte_a {
3462 uint64_t entry; 3345 uint64_t entry;
3463 struct { 3346 struct {
3464 uint64_t i_rsvd_1 : 3; 3347 uint64_t i_rsvd_1:3;
3465 uint64_t i_addr : 38; 3348 uint64_t i_addr:38;
3466 uint64_t i_init : 3; 3349 uint64_t i_init:3;
3467 uint64_t i_source : 8; 3350 uint64_t i_source:8;
3468 uint64_t i_rsvd : 2; 3351 uint64_t i_rsvd:2;
3469 uint64_t i_widget : 4; 3352 uint64_t i_widget:4;
3470 uint64_t i_to_cnt : 5; 3353 uint64_t i_to_cnt:5;
3471 uint64_t i_vld : 1; 3354 uint64_t i_vld:1;
3472 } iprte_fields; 3355 } iprte_fields;
3473} iprte_a_t; 3356} iprte_a_t;
3474 3357
3475#endif /* _ASM_IA64_SN_SHUBIO_H */ 3358#endif /* _ASM_IA64_SN_SHUBIO_H */
3476
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
index 685435af170d..20b300187669 100644
--- a/include/asm-ia64/sn/sn_cpuid.h
+++ b/include/asm-ia64/sn/sn_cpuid.h
@@ -4,7 +4,7 @@
4 * License. See the file "COPYING" in the main directory of this archive 4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 5 * for more details.
6 * 6 *
7 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved. 7 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
8 */ 8 */
9 9
10 10
@@ -92,24 +92,24 @@
92 * NOTE: on non-MP systems, only cpuid 0 exists 92 * NOTE: on non-MP systems, only cpuid 0 exists
93 */ 93 */
94 94
95extern short physical_node_map[]; /* indexed by nasid to get cnode */ 95extern short physical_node_map[]; /* indexed by nasid to get cnode */
96 96
97/* 97/*
98 * Macros for retrieving info about current cpu 98 * Macros for retrieving info about current cpu
99 */ 99 */
100#define get_nasid() (nodepda->phys_cpuid[smp_processor_id()].nasid) 100#define get_nasid() (sn_nodepda->phys_cpuid[smp_processor_id()].nasid)
101#define get_subnode() (nodepda->phys_cpuid[smp_processor_id()].subnode) 101#define get_subnode() (sn_nodepda->phys_cpuid[smp_processor_id()].subnode)
102#define get_slice() (nodepda->phys_cpuid[smp_processor_id()].slice) 102#define get_slice() (sn_nodepda->phys_cpuid[smp_processor_id()].slice)
103#define get_cnode() (nodepda->phys_cpuid[smp_processor_id()].cnode) 103#define get_cnode() (sn_nodepda->phys_cpuid[smp_processor_id()].cnode)
104#define get_sapicid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff) 104#define get_sapicid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
105 105
106/* 106/*
107 * Macros for retrieving info about an arbitrary cpu 107 * Macros for retrieving info about an arbitrary cpu
108 * cpuid - logical cpu id 108 * cpuid - logical cpu id
109 */ 109 */
110#define cpuid_to_nasid(cpuid) (nodepda->phys_cpuid[cpuid].nasid) 110#define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid)
111#define cpuid_to_subnode(cpuid) (nodepda->phys_cpuid[cpuid].subnode) 111#define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode)
112#define cpuid_to_slice(cpuid) (nodepda->phys_cpuid[cpuid].slice) 112#define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice)
113#define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)]) 113#define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)])
114 114
115 115
@@ -123,11 +123,8 @@ extern int nasid_slice_to_cpuid(int, int);
123 123
124/* 124/*
125 * cnodeid_to_nasid - convert a cnodeid to a NASID 125 * cnodeid_to_nasid - convert a cnodeid to a NASID
126 * Macro relies on pg_data for a node being on the node itself.
127 * Just extract the NASID from the pointer.
128 *
129 */ 126 */
130#define cnodeid_to_nasid(cnodeid) pda->cnodeid_to_nasid_table[cnodeid] 127#define cnodeid_to_nasid(cnodeid) (sn_cnodeid_to_nasid[cnodeid])
131 128
132/* 129/*
133 * nasid_to_cnodeid - convert a NASID to a cnodeid 130 * nasid_to_cnodeid - convert a NASID to a cnodeid
diff --git a/include/asm-ia64/sn/sn_fru.h b/include/asm-ia64/sn/sn_fru.h
deleted file mode 100644
index 8c21ac3f0156..000000000000
--- a/include/asm-ia64/sn/sn_fru.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992-1997,1999-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_SN_FRU_H
9#define _ASM_IA64_SN_SN_FRU_H
10
11#define MAX_DIMMS 8 /* max # of dimm banks */
12#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */
13
14typedef unsigned char confidence_t;
15
16typedef struct kf_mem_s {
17 confidence_t km_confidence; /* confidence level that the memory is bad
18 * is this necessary ?
19 */
20 confidence_t km_dimm[MAX_DIMMS];
21 /* confidence level that dimm[i] is bad
22 *I think this is the right number
23 */
24
25} kf_mem_t;
26
27typedef struct kf_cpu_s {
28 confidence_t kc_confidence; /* confidence level that cpu is bad */
29 confidence_t kc_icache; /* confidence level that instr. cache is bad */
30 confidence_t kc_dcache; /* confidence level that data cache is bad */
31 confidence_t kc_scache; /* confidence level that sec. cache is bad */
32 confidence_t kc_sysbus; /* confidence level that sysad/cmd/state bus is bad */
33} kf_cpu_t;
34
35
36typedef struct kf_pci_bus_s {
37 confidence_t kpb_belief; /* confidence level that the pci bus is bad */
38 confidence_t kpb_pcidev_belief[MAX_PCIDEV];
39 /* confidence level that the pci dev is bad */
40} kf_pci_bus_t;
41
42
43#endif /* _ASM_IA64_SN_SN_FRU_H */
44
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index 88c31b53dc09..56d74ca76b5d 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -8,7 +8,7 @@
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 * 10 *
11 * Copyright (c) 2000-2004 Silicon Graphics, Inc. All rights reserved. 11 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All rights reserved.
12 */ 12 */
13 13
14 14
@@ -35,8 +35,8 @@
35#define SN_SAL_PRINT_ERROR 0x02000012 35#define SN_SAL_PRINT_ERROR 0x02000012
36#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant 36#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant
37#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant 37#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant
38#define SN_SAL_GET_SN_INFO 0x0200001c
39#define SN_SAL_GET_SAPIC_INFO 0x0200001d 38#define SN_SAL_GET_SAPIC_INFO 0x0200001d
39#define SN_SAL_GET_SN_INFO 0x0200001e
40#define SN_SAL_CONSOLE_PUTC 0x02000021 40#define SN_SAL_CONSOLE_PUTC 0x02000021
41#define SN_SAL_CONSOLE_GETC 0x02000022 41#define SN_SAL_CONSOLE_GETC 0x02000022
42#define SN_SAL_CONSOLE_PUTS 0x02000023 42#define SN_SAL_CONSOLE_PUTS 0x02000023
@@ -64,6 +64,7 @@
64 64
65#define SN_SAL_SYSCTL_IOBRICK_PCI_OP 0x02000042 // reentrant 65#define SN_SAL_SYSCTL_IOBRICK_PCI_OP 0x02000042 // reentrant
66#define SN_SAL_IROUTER_OP 0x02000043 66#define SN_SAL_IROUTER_OP 0x02000043
67#define SN_SAL_SYSCTL_EVENT 0x02000044
67#define SN_SAL_IOIF_INTERRUPT 0x0200004a 68#define SN_SAL_IOIF_INTERRUPT 0x0200004a
68#define SN_SAL_HWPERF_OP 0x02000050 // lock 69#define SN_SAL_HWPERF_OP 0x02000050 // lock
69#define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051 70#define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051
@@ -76,7 +77,8 @@
76#define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058 77#define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058
77 78
78#define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060 79#define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060
79 80#define SN_SAL_BTE_RECOVER 0x02000061
81#define SN_SAL_IOIF_GET_PCI_TOPOLOGY 0x02000062
80 82
81/* 83/*
82 * Service-specific constants 84 * Service-specific constants
@@ -555,7 +557,8 @@ static inline u64
555ia64_sn_partition_serial_get(void) 557ia64_sn_partition_serial_get(void)
556{ 558{
557 struct ia64_sal_retval ret_stuff; 559 struct ia64_sal_retval ret_stuff;
558 SAL_CALL(ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0, 0, 0, 0, 0, 0, 0); 560 ia64_sal_oemcall_reentrant(&ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0,
561 0, 0, 0, 0, 0, 0);
559 if (ret_stuff.status != 0) 562 if (ret_stuff.status != 0)
560 return 0; 563 return 0;
561 return ret_stuff.v0; 564 return ret_stuff.v0;
@@ -563,11 +566,10 @@ ia64_sn_partition_serial_get(void)
563 566
564static inline u64 567static inline u64
565sn_partition_serial_number_val(void) { 568sn_partition_serial_number_val(void) {
566 if (sn_partition_serial_number) { 569 if (unlikely(sn_partition_serial_number == 0)) {
567 return(sn_partition_serial_number); 570 sn_partition_serial_number = ia64_sn_partition_serial_get();
568 } else {
569 return(sn_partition_serial_number = ia64_sn_partition_serial_get());
570 } 571 }
572 return sn_partition_serial_number;
571} 573}
572 574
573/* 575/*
@@ -578,8 +580,8 @@ static inline partid_t
578ia64_sn_sysctl_partition_get(nasid_t nasid) 580ia64_sn_sysctl_partition_get(nasid_t nasid)
579{ 581{
580 struct ia64_sal_retval ret_stuff; 582 struct ia64_sal_retval ret_stuff;
581 SAL_CALL(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid, 583 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid,
582 0, 0, 0, 0, 0, 0); 584 0, 0, 0, 0, 0, 0);
583 if (ret_stuff.status != 0) 585 if (ret_stuff.status != 0)
584 return INVALID_PARTID; 586 return INVALID_PARTID;
585 return ((partid_t)ret_stuff.v0); 587 return ((partid_t)ret_stuff.v0);
@@ -593,11 +595,38 @@ extern partid_t sn_partid;
593 595
594static inline partid_t 596static inline partid_t
595sn_local_partid(void) { 597sn_local_partid(void) {
596 if (sn_partid < 0) { 598 if (unlikely(sn_partid < 0)) {
597 return (sn_partid = ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id()))); 599 sn_partid = ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id()));
598 } else {
599 return sn_partid;
600 } 600 }
601 return sn_partid;
602}
603
604/*
605 * Returns the physical address of the partition's reserved page through
606 * an iterative number of calls.
607 *
608 * On first call, 'cookie' and 'len' should be set to 0, and 'addr'
609 * set to the nasid of the partition whose reserved page's address is
610 * being sought.
611 * On subsequent calls, pass the values, that were passed back on the
612 * previous call.
613 *
614 * While the return status equals SALRET_MORE_PASSES, keep calling
615 * this function after first copying 'len' bytes starting at 'addr'
616 * into 'buf'. Once the return status equals SALRET_OK, 'addr' will
617 * be the physical address of the partition's reserved page. If the
618 * return status equals neither of these, an error as occurred.
619 */
620static inline s64
621sn_partition_reserved_page_pa(u64 buf, u64 *cookie, u64 *addr, u64 *len)
622{
623 struct ia64_sal_retval rv;
624 ia64_sal_oemcall_reentrant(&rv, SN_SAL_GET_PARTITION_ADDR, *cookie,
625 *addr, buf, *len, 0, 0, 0);
626 *cookie = rv.v0;
627 *addr = rv.v1;
628 *len = rv.v2;
629 return rv.status;
601} 630}
602 631
603/* 632/*
@@ -619,8 +648,8 @@ static inline int
619sn_register_xp_addr_region(u64 paddr, u64 len, int operation) 648sn_register_xp_addr_region(u64 paddr, u64 len, int operation)
620{ 649{
621 struct ia64_sal_retval ret_stuff; 650 struct ia64_sal_retval ret_stuff;
622 SAL_CALL(ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len, (u64)operation, 651 ia64_sal_oemcall(&ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len,
623 0, 0, 0, 0); 652 (u64)operation, 0, 0, 0, 0);
624 return ret_stuff.status; 653 return ret_stuff.status;
625} 654}
626 655
@@ -644,8 +673,8 @@ sn_register_nofault_code(u64 start_addr, u64 end_addr, u64 return_addr,
644 } else { 673 } else {
645 call = SN_SAL_NO_FAULT_ZONE_PHYSICAL; 674 call = SN_SAL_NO_FAULT_ZONE_PHYSICAL;
646 } 675 }
647 SAL_CALL(ret_stuff, call, start_addr, end_addr, return_addr, (u64)1, 676 ia64_sal_oemcall(&ret_stuff, call, start_addr, end_addr, return_addr,
648 0, 0, 0); 677 (u64)1, 0, 0, 0);
649 return ret_stuff.status; 678 return ret_stuff.status;
650} 679}
651 680
@@ -666,8 +695,8 @@ static inline int
666sn_change_coherence(u64 *new_domain, u64 *old_domain) 695sn_change_coherence(u64 *new_domain, u64 *old_domain)
667{ 696{
668 struct ia64_sal_retval ret_stuff; 697 struct ia64_sal_retval ret_stuff;
669 SAL_CALL(ret_stuff, SN_SAL_COHERENCE, new_domain, old_domain, 0, 0, 698 ia64_sal_oemcall(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain,
670 0, 0, 0); 699 (u64)old_domain, 0, 0, 0, 0, 0);
671 return ret_stuff.status; 700 return ret_stuff.status;
672} 701}
673 702
@@ -686,8 +715,8 @@ sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
686 cnodeid = nasid_to_cnodeid(get_node_number(paddr)); 715 cnodeid = nasid_to_cnodeid(get_node_number(paddr));
687 // spin_lock(&NODEPDA(cnodeid)->bist_lock); 716 // spin_lock(&NODEPDA(cnodeid)->bist_lock);
688 local_irq_save(irq_flags); 717 local_irq_save(irq_flags);
689 SAL_CALL_NOLOCK(ret_stuff, SN_SAL_MEMPROTECT, paddr, len, nasid_array, 718 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
690 perms, 0, 0, 0); 719 (u64)nasid_array, perms, 0, 0, 0);
691 local_irq_restore(irq_flags); 720 local_irq_restore(irq_flags);
692 // spin_unlock(&NODEPDA(cnodeid)->bist_lock); 721 // spin_unlock(&NODEPDA(cnodeid)->bist_lock);
693 return ret_stuff.status; 722 return ret_stuff.status;
@@ -849,6 +878,19 @@ ia64_sn_irtr_intr_disable(nasid_t nasid, int subch, u64 intr)
849 return (int) rv.v0; 878 return (int) rv.v0;
850} 879}
851 880
881/*
882 * Set up a node as the point of contact for system controller
883 * environmental event delivery.
884 */
885static inline int
886ia64_sn_sysctl_event_init(nasid_t nasid)
887{
888 struct ia64_sal_retval rv;
889 SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_EVENT, (u64) nasid,
890 0, 0, 0, 0, 0, 0);
891 return (int) rv.v0;
892}
893
852/** 894/**
853 * ia64_sn_get_fit_compt - read a FIT entry from the PROM header 895 * ia64_sn_get_fit_compt - read a FIT entry from the PROM header
854 * @nasid: NASID of node to read 896 * @nasid: NASID of node to read
@@ -1012,4 +1054,29 @@ ia64_sn_hwperf_op(nasid_t nasid, u64 opcode, u64 a0, u64 a1, u64 a2,
1012 return (int) rv.status; 1054 return (int) rv.status;
1013} 1055}
1014 1056
1057static inline int
1058ia64_sn_ioif_get_pci_topology(u64 rack, u64 bay, u64 slot, u64 slab,
1059 u64 buf, u64 len)
1060{
1061 struct ia64_sal_retval rv;
1062 SAL_CALL_NOLOCK(rv, SN_SAL_IOIF_GET_PCI_TOPOLOGY,
1063 rack, bay, slot, slab, buf, len, 0);
1064 return (int) rv.status;
1065}
1066
1067/*
1068 * BTE error recovery is implemented in SAL
1069 */
1070static inline int
1071ia64_sn_bte_recovery(nasid_t nasid)
1072{
1073 struct ia64_sal_retval rv;
1074
1075 rv.status = 0;
1076 SAL_CALL_NOLOCK(rv, SN_SAL_BTE_RECOVER, 0, 0, 0, 0, 0, 0, 0);
1077 if (rv.status == SALRET_NOT_IMPLEMENTED)
1078 return 0;
1079 return (int) rv.status;
1080}
1081
1015#endif /* _ASM_IA64_SN_SN_SAL_H */ 1082#endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/include/asm-ia64/sn/sndrv.h b/include/asm-ia64/sn/sndrv.h
deleted file mode 100644
index aa00d42cde32..000000000000
--- a/include/asm-ia64/sn/sndrv.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2002-2004 Silicon Graphics, Inc. All Rights Reserved.
7 */
8
9#ifndef _ASM_IA64_SN_SNDRV_H
10#define _ASM_IA64_SN_SNDRV_H
11
12/* ioctl commands */
13#define SNDRV_GET_ROUTERINFO 1
14#define SNDRV_GET_INFOSIZE 2
15#define SNDRV_GET_HUBINFO 3
16#define SNDRV_GET_FLASHLOGSIZE 4
17#define SNDRV_SET_FLASHSYNC 5
18#define SNDRV_GET_FLASHLOGDATA 6
19#define SNDRV_GET_FLASHLOGALL 7
20
21#define SNDRV_SET_HISTOGRAM_TYPE 14
22
23#define SNDRV_ELSC_COMMAND 19
24#define SNDRV_CLEAR_LOG 20
25#define SNDRV_INIT_LOG 21
26#define SNDRV_GET_PIMM_PSC 22
27#define SNDRV_SET_PARTITION 23
28#define SNDRV_GET_PARTITION 24
29
30/* see synergy_perf_ioctl() */
31#define SNDRV_GET_SYNERGY_VERSION 30
32#define SNDRV_GET_SYNERGY_STATUS 31
33#define SNDRV_GET_SYNERGYINFO 32
34#define SNDRV_SYNERGY_APPEND 33
35#define SNDRV_SYNERGY_ENABLE 34
36#define SNDRV_SYNERGY_FREQ 35
37
38/* Devices */
39#define SNDRV_UKNOWN_DEVICE -1
40#define SNDRV_ROUTER_DEVICE 1
41#define SNDRV_HUB_DEVICE 2
42#define SNDRV_ELSC_NVRAM_DEVICE 3
43#define SNDRV_ELSC_CONTROLLER_DEVICE 4
44#define SNDRV_SYSCTL_SUBCH 5
45#define SNDRV_SYNERGY_DEVICE 6
46
47#endif /* _ASM_IA64_SN_SNDRV_H */
diff --git a/include/asm-ia64/sn/tioca.h b/include/asm-ia64/sn/tioca.h
new file mode 100644
index 000000000000..bc1aacfb9483
--- /dev/null
+++ b/include/asm-ia64/sn/tioca.h
@@ -0,0 +1,596 @@
1#ifndef _ASM_IA64_SN_TIO_TIOCA_H
2#define _ASM_IA64_SN_TIO_TIOCA_H
3
4/*
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (c) 2003-2005 Silicon Graphics, Inc. All rights reserved.
10 */
11
12
13#define TIOCA_PART_NUM 0xE020
14#define TIOCA_MFGR_NUM 0x24
15#define TIOCA_REV_A 0x1
16
17/*
18 * Register layout for TIO:CA. See below for bitmasks for each register.
19 */
20
21struct tioca {
22 uint64_t ca_id; /* 0x000000 */
23 uint64_t ca_control1; /* 0x000008 */
24 uint64_t ca_control2; /* 0x000010 */
25 uint64_t ca_status1; /* 0x000018 */
26 uint64_t ca_status2; /* 0x000020 */
27 uint64_t ca_gart_aperature; /* 0x000028 */
28 uint64_t ca_gfx_detach; /* 0x000030 */
29 uint64_t ca_inta_dest_addr; /* 0x000038 */
30 uint64_t ca_intb_dest_addr; /* 0x000040 */
31 uint64_t ca_err_int_dest_addr; /* 0x000048 */
32 uint64_t ca_int_status; /* 0x000050 */
33 uint64_t ca_int_status_alias; /* 0x000058 */
34 uint64_t ca_mult_error; /* 0x000060 */
35 uint64_t ca_mult_error_alias; /* 0x000068 */
36 uint64_t ca_first_error; /* 0x000070 */
37 uint64_t ca_int_mask; /* 0x000078 */
38 uint64_t ca_crm_pkterr_type; /* 0x000080 */
39 uint64_t ca_crm_pkterr_type_alias; /* 0x000088 */
40 uint64_t ca_crm_ct_error_detail_1; /* 0x000090 */
41 uint64_t ca_crm_ct_error_detail_2; /* 0x000098 */
42 uint64_t ca_crm_tnumto; /* 0x0000A0 */
43 uint64_t ca_gart_err; /* 0x0000A8 */
44 uint64_t ca_pcierr_type; /* 0x0000B0 */
45 uint64_t ca_pcierr_addr; /* 0x0000B8 */
46
47 uint64_t ca_pad_0000C0[3]; /* 0x0000{C0..D0} */
48
49 uint64_t ca_pci_rd_buf_flush; /* 0x0000D8 */
50 uint64_t ca_pci_dma_addr_extn; /* 0x0000E0 */
51 uint64_t ca_agp_dma_addr_extn; /* 0x0000E8 */
52 uint64_t ca_force_inta; /* 0x0000F0 */
53 uint64_t ca_force_intb; /* 0x0000F8 */
54 uint64_t ca_debug_vector_sel; /* 0x000100 */
55 uint64_t ca_debug_mux_core_sel; /* 0x000108 */
56 uint64_t ca_debug_mux_pci_sel; /* 0x000110 */
57 uint64_t ca_debug_domain_sel; /* 0x000118 */
58
59 uint64_t ca_pad_000120[28]; /* 0x0001{20..F8} */
60
61 uint64_t ca_gart_ptr_table; /* 0x200 */
62 uint64_t ca_gart_tlb_addr[8]; /* 0x2{08..40} */
63};
64
65/*
66 * Mask/shift definitions for TIO:CA registers. The convention here is
67 * to mainly use the names as they appear in the "TIO AEGIS Programmers'
68 * Reference" with a CA_ prefix added. Some exceptions were made to fix
69 * duplicate field names or to generalize fields that are common to
70 * different registers (ca_debug_mux_core_sel and ca_debug_mux_pci_sel for
71 * example).
72 *
73 * Fields consisting of a single bit have a single #define have a single
74 * macro declaration to mask the bit. Fields consisting of multiple bits
75 * have two declarations: one to mask the proper bits in a register, and
76 * a second with the suffix "_SHFT" to identify how far the mask needs to
77 * be shifted right to get its base value.
78 */
79
80/* ==== ca_control1 */
81#define CA_SYS_BIG_END (1ull << 0)
82#define CA_DMA_AGP_SWAP (1ull << 1)
83#define CA_DMA_PCI_SWAP (1ull << 2)
84#define CA_PIO_IO_SWAP (1ull << 3)
85#define CA_PIO_MEM_SWAP (1ull << 4)
86#define CA_GFX_WR_SWAP (1ull << 5)
87#define CA_AGP_FW_ENABLE (1ull << 6)
88#define CA_AGP_CAL_CYCLE (0x7ull << 7)
89#define CA_AGP_CAL_CYCLE_SHFT 7
90#define CA_AGP_CAL_PRSCL_BYP (1ull << 10)
91#define CA_AGP_INIT_CAL_ENB (1ull << 11)
92#define CA_INJ_ADDR_PERR (1ull << 12)
93#define CA_INJ_DATA_PERR (1ull << 13)
94 /* bits 15:14 unused */
95#define CA_PCIM_IO_NBE_AD (0x7ull << 16)
96#define CA_PCIM_IO_NBE_AD_SHFT 16
97#define CA_PCIM_FAST_BTB_ENB (1ull << 19)
98 /* bits 23:20 unused */
99#define CA_PIO_ADDR_OFFSET (0xffull << 24)
100#define CA_PIO_ADDR_OFFSET_SHFT 24
101 /* bits 35:32 unused */
102#define CA_AGPDMA_OP_COMBDELAY (0x1full << 36)
103#define CA_AGPDMA_OP_COMBDELAY_SHFT 36
104 /* bit 41 unused */
105#define CA_AGPDMA_OP_ENB_COMBDELAY (1ull << 42)
106#define CA_PCI_INT_LPCNT (0xffull << 44)
107#define CA_PCI_INT_LPCNT_SHFT 44
108 /* bits 63:52 unused */
109
110/* ==== ca_control2 */
111#define CA_AGP_LATENCY_TO (0xffull << 0)
112#define CA_AGP_LATENCY_TO_SHFT 0
113#define CA_PCI_LATENCY_TO (0xffull << 8)
114#define CA_PCI_LATENCY_TO_SHFT 8
115#define CA_PCI_MAX_RETRY (0x3ffull << 16)
116#define CA_PCI_MAX_RETRY_SHFT 16
117 /* bits 27:26 unused */
118#define CA_RT_INT_EN (0x3ull << 28)
119#define CA_RT_INT_EN_SHFT 28
120#define CA_MSI_INT_ENB (1ull << 30)
121#define CA_PCI_ARB_ERR_ENB (1ull << 31)
122#define CA_GART_MEM_PARAM (0x3ull << 32)
123#define CA_GART_MEM_PARAM_SHFT 32
124#define CA_GART_RD_PREFETCH_ENB (1ull << 34)
125#define CA_GART_WR_PREFETCH_ENB (1ull << 35)
126#define CA_GART_FLUSH_TLB (1ull << 36)
127 /* bits 39:37 unused */
128#define CA_CRM_TNUMTO_PERIOD (0x1fffull << 40)
129#define CA_CRM_TNUMTO_PERIOD_SHFT 40
130 /* bits 55:53 unused */
131#define CA_CRM_TNUMTO_ENB (1ull << 56)
132#define CA_CRM_PRESCALER_BYP (1ull << 57)
133 /* bits 59:58 unused */
134#define CA_CRM_MAX_CREDIT (0x7ull << 60)
135#define CA_CRM_MAX_CREDIT_SHFT 60
136 /* bit 63 unused */
137
138/* ==== ca_status1 */
139#define CA_CORELET_ID (0x3ull << 0)
140#define CA_CORELET_ID_SHFT 0
141#define CA_INTA_N (1ull << 2)
142#define CA_INTB_N (1ull << 3)
143#define CA_CRM_CREDIT_AVAIL (0x7ull << 4)
144#define CA_CRM_CREDIT_AVAIL_SHFT 4
145 /* bit 7 unused */
146#define CA_CRM_SPACE_AVAIL (0x7full << 8)
147#define CA_CRM_SPACE_AVAIL_SHFT 8
148 /* bit 15 unused */
149#define CA_GART_TLB_VAL (0xffull << 16)
150#define CA_GART_TLB_VAL_SHFT 16
151 /* bits 63:24 unused */
152
153/* ==== ca_status2 */
154#define CA_GFX_CREDIT_AVAIL (0xffull << 0)
155#define CA_GFX_CREDIT_AVAIL_SHFT 0
156#define CA_GFX_OPQ_AVAIL (0xffull << 8)
157#define CA_GFX_OPQ_AVAIL_SHFT 8
158#define CA_GFX_WRBUFF_AVAIL (0xffull << 16)
159#define CA_GFX_WRBUFF_AVAIL_SHFT 16
160#define CA_ADMA_OPQ_AVAIL (0xffull << 24)
161#define CA_ADMA_OPQ_AVAIL_SHFT 24
162#define CA_ADMA_WRBUFF_AVAIL (0xffull << 32)
163#define CA_ADMA_WRBUFF_AVAIL_SHFT 32
164#define CA_ADMA_RDBUFF_AVAIL (0x7full << 40)
165#define CA_ADMA_RDBUFF_AVAIL_SHFT 40
166#define CA_PCI_PIO_OP_STAT (1ull << 47)
167#define CA_PDMA_OPQ_AVAIL (0xfull << 48)
168#define CA_PDMA_OPQ_AVAIL_SHFT 48
169#define CA_PDMA_WRBUFF_AVAIL (0xfull << 52)
170#define CA_PDMA_WRBUFF_AVAIL_SHFT 52
171#define CA_PDMA_RDBUFF_AVAIL (0x3ull << 56)
172#define CA_PDMA_RDBUFF_AVAIL_SHFT 56
173 /* bits 63:58 unused */
174
175/* ==== ca_gart_aperature */
176#define CA_GART_AP_ENB_AGP (1ull << 0)
177#define CA_GART_PAGE_SIZE (1ull << 1)
178#define CA_GART_AP_ENB_PCI (1ull << 2)
179 /* bits 11:3 unused */
180#define CA_GART_AP_SIZE (0x3ffull << 12)
181#define CA_GART_AP_SIZE_SHFT 12
182#define CA_GART_AP_BASE (0x3ffffffffffull << 22)
183#define CA_GART_AP_BASE_SHFT 22
184
185/* ==== ca_inta_dest_addr
186 ==== ca_intb_dest_addr
187 ==== ca_err_int_dest_addr */
188 /* bits 2:0 unused */
189#define CA_INT_DEST_ADDR (0x7ffffffffffffull << 3)
190#define CA_INT_DEST_ADDR_SHFT 3
191 /* bits 55:54 unused */
192#define CA_INT_DEST_VECT (0xffull << 56)
193#define CA_INT_DEST_VECT_SHFT 56
194
195/* ==== ca_int_status */
196/* ==== ca_int_status_alias */
197/* ==== ca_mult_error */
198/* ==== ca_mult_error_alias */
199/* ==== ca_first_error */
200/* ==== ca_int_mask */
201#define CA_PCI_ERR (1ull << 0)
202 /* bits 3:1 unused */
203#define CA_GART_FETCH_ERR (1ull << 4)
204#define CA_GFX_WR_OVFLW (1ull << 5)
205#define CA_PIO_REQ_OVFLW (1ull << 6)
206#define CA_CRM_PKTERR (1ull << 7)
207#define CA_CRM_DVERR (1ull << 8)
208#define CA_TNUMTO (1ull << 9)
209#define CA_CXM_RSP_CRED_OVFLW (1ull << 10)
210#define CA_CXM_REQ_CRED_OVFLW (1ull << 11)
211#define CA_PIO_INVALID_ADDR (1ull << 12)
212#define CA_PCI_ARB_TO (1ull << 13)
213#define CA_AGP_REQ_OFLOW (1ull << 14)
214#define CA_SBA_TYPE1_ERR (1ull << 15)
215 /* bit 16 unused */
216#define CA_INTA (1ull << 17)
217#define CA_INTB (1ull << 18)
218#define CA_MULT_INTA (1ull << 19)
219#define CA_MULT_INTB (1ull << 20)
220#define CA_GFX_CREDIT_OVFLW (1ull << 21)
221 /* bits 63:22 unused */
222
223/* ==== ca_crm_pkterr_type */
224/* ==== ca_crm_pkterr_type_alias */
225#define CA_CRM_PKTERR_SBERR_HDR (1ull << 0)
226#define CA_CRM_PKTERR_DIDN (1ull << 1)
227#define CA_CRM_PKTERR_PACTYPE (1ull << 2)
228#define CA_CRM_PKTERR_INV_TNUM (1ull << 3)
229#define CA_CRM_PKTERR_ADDR_RNG (1ull << 4)
230#define CA_CRM_PKTERR_ADDR_ALGN (1ull << 5)
231#define CA_CRM_PKTERR_HDR_PARAM (1ull << 6)
232#define CA_CRM_PKTERR_CW_ERR (1ull << 7)
233#define CA_CRM_PKTERR_SBERR_NH (1ull << 8)
234#define CA_CRM_PKTERR_EARLY_TERM (1ull << 9)
235#define CA_CRM_PKTERR_EARLY_TAIL (1ull << 10)
236#define CA_CRM_PKTERR_MSSNG_TAIL (1ull << 11)
237#define CA_CRM_PKTERR_MSSNG_HDR (1ull << 12)
238 /* bits 15:13 unused */
239#define CA_FIRST_CRM_PKTERR_SBERR_HDR (1ull << 16)
240#define CA_FIRST_CRM_PKTERR_DIDN (1ull << 17)
241#define CA_FIRST_CRM_PKTERR_PACTYPE (1ull << 18)
242#define CA_FIRST_CRM_PKTERR_INV_TNUM (1ull << 19)
243#define CA_FIRST_CRM_PKTERR_ADDR_RNG (1ull << 20)
244#define CA_FIRST_CRM_PKTERR_ADDR_ALGN (1ull << 21)
245#define CA_FIRST_CRM_PKTERR_HDR_PARAM (1ull << 22)
246#define CA_FIRST_CRM_PKTERR_CW_ERR (1ull << 23)
247#define CA_FIRST_CRM_PKTERR_SBERR_NH (1ull << 24)
248#define CA_FIRST_CRM_PKTERR_EARLY_TERM (1ull << 25)
249#define CA_FIRST_CRM_PKTERR_EARLY_TAIL (1ull << 26)
250#define CA_FIRST_CRM_PKTERR_MSSNG_TAIL (1ull << 27)
251#define CA_FIRST_CRM_PKTERR_MSSNG_HDR (1ull << 28)
252 /* bits 63:29 unused */
253
254/* ==== ca_crm_ct_error_detail_1 */
255#define CA_PKT_TYPE (0xfull << 0)
256#define CA_PKT_TYPE_SHFT 0
257#define CA_SRC_ID (0x3ull << 4)
258#define CA_SRC_ID_SHFT 4
259#define CA_DATA_SZ (0x3ull << 6)
260#define CA_DATA_SZ_SHFT 6
261#define CA_TNUM (0xffull << 8)
262#define CA_TNUM_SHFT 8
263#define CA_DW_DATA_EN (0xffull << 16)
264#define CA_DW_DATA_EN_SHFT 16
265#define CA_GFX_CRED (0xffull << 24)
266#define CA_GFX_CRED_SHFT 24
267#define CA_MEM_RD_PARAM (0x3ull << 32)
268#define CA_MEM_RD_PARAM_SHFT 32
269#define CA_PIO_OP (1ull << 34)
270#define CA_CW_ERR (1ull << 35)
271 /* bits 62:36 unused */
272#define CA_VALID (1ull << 63)
273
274/* ==== ca_crm_ct_error_detail_2 */
275 /* bits 2:0 unused */
276#define CA_PKT_ADDR (0x1fffffffffffffull << 3)
277#define CA_PKT_ADDR_SHFT 3
278 /* bits 63:56 unused */
279
280/* ==== ca_crm_tnumto */
281#define CA_CRM_TNUMTO_VAL (0xffull << 0)
282#define CA_CRM_TNUMTO_VAL_SHFT 0
283#define CA_CRM_TNUMTO_WR (1ull << 8)
284 /* bits 63:9 unused */
285
286/* ==== ca_gart_err */
287#define CA_GART_ERR_SOURCE (0x3ull << 0)
288#define CA_GART_ERR_SOURCE_SHFT 0
289 /* bits 3:2 unused */
290#define CA_GART_ERR_ADDR (0xfffffffffull << 4)
291#define CA_GART_ERR_ADDR_SHFT 4
292 /* bits 63:40 unused */
293
294/* ==== ca_pcierr_type */
295#define CA_PCIERR_DATA (0xffffffffull << 0)
296#define CA_PCIERR_DATA_SHFT 0
297#define CA_PCIERR_ENB (0xfull << 32)
298#define CA_PCIERR_ENB_SHFT 32
299#define CA_PCIERR_CMD (0xfull << 36)
300#define CA_PCIERR_CMD_SHFT 36
301#define CA_PCIERR_A64 (1ull << 40)
302#define CA_PCIERR_SLV_SERR (1ull << 41)
303#define CA_PCIERR_SLV_WR_PERR (1ull << 42)
304#define CA_PCIERR_SLV_RD_PERR (1ull << 43)
305#define CA_PCIERR_MST_SERR (1ull << 44)
306#define CA_PCIERR_MST_WR_PERR (1ull << 45)
307#define CA_PCIERR_MST_RD_PERR (1ull << 46)
308#define CA_PCIERR_MST_MABT (1ull << 47)
309#define CA_PCIERR_MST_TABT (1ull << 48)
310#define CA_PCIERR_MST_RETRY_TOUT (1ull << 49)
311
312#define CA_PCIERR_TYPES \
313 (CA_PCIERR_A64|CA_PCIERR_SLV_SERR| \
314 CA_PCIERR_SLV_WR_PERR|CA_PCIERR_SLV_RD_PERR| \
315 CA_PCIERR_MST_SERR|CA_PCIERR_MST_WR_PERR|CA_PCIERR_MST_RD_PERR| \
316 CA_PCIERR_MST_MABT|CA_PCIERR_MST_TABT|CA_PCIERR_MST_RETRY_TOUT)
317
318 /* bits 63:50 unused */
319
320/* ==== ca_pci_dma_addr_extn */
321#define CA_UPPER_NODE_OFFSET (0x3full << 0)
322#define CA_UPPER_NODE_OFFSET_SHFT 0
323 /* bits 7:6 unused */
324#define CA_CHIPLET_ID (0x3ull << 8)
325#define CA_CHIPLET_ID_SHFT 8
326 /* bits 11:10 unused */
327#define CA_PCI_DMA_NODE_ID (0xffffull << 12)
328#define CA_PCI_DMA_NODE_ID_SHFT 12
329 /* bits 27:26 unused */
330#define CA_PCI_DMA_PIO_MEM_TYPE (1ull << 28)
331 /* bits 63:29 unused */
332
333
334/* ==== ca_agp_dma_addr_extn */
335 /* bits 19:0 unused */
336#define CA_AGP_DMA_NODE_ID (0xffffull << 20)
337#define CA_AGP_DMA_NODE_ID_SHFT 20
338 /* bits 27:26 unused */
339#define CA_AGP_DMA_PIO_MEM_TYPE (1ull << 28)
340 /* bits 63:29 unused */
341
342/* ==== ca_debug_vector_sel */
343#define CA_DEBUG_MN_VSEL (0xfull << 0)
344#define CA_DEBUG_MN_VSEL_SHFT 0
345#define CA_DEBUG_PP_VSEL (0xfull << 4)
346#define CA_DEBUG_PP_VSEL_SHFT 4
347#define CA_DEBUG_GW_VSEL (0xfull << 8)
348#define CA_DEBUG_GW_VSEL_SHFT 8
349#define CA_DEBUG_GT_VSEL (0xfull << 12)
350#define CA_DEBUG_GT_VSEL_SHFT 12
351#define CA_DEBUG_PD_VSEL (0xfull << 16)
352#define CA_DEBUG_PD_VSEL_SHFT 16
353#define CA_DEBUG_AD_VSEL (0xfull << 20)
354#define CA_DEBUG_AD_VSEL_SHFT 20
355#define CA_DEBUG_CX_VSEL (0xfull << 24)
356#define CA_DEBUG_CX_VSEL_SHFT 24
357#define CA_DEBUG_CR_VSEL (0xfull << 28)
358#define CA_DEBUG_CR_VSEL_SHFT 28
359#define CA_DEBUG_BA_VSEL (0xfull << 32)
360#define CA_DEBUG_BA_VSEL_SHFT 32
361#define CA_DEBUG_PE_VSEL (0xfull << 36)
362#define CA_DEBUG_PE_VSEL_SHFT 36
363#define CA_DEBUG_BO_VSEL (0xfull << 40)
364#define CA_DEBUG_BO_VSEL_SHFT 40
365#define CA_DEBUG_BI_VSEL (0xfull << 44)
366#define CA_DEBUG_BI_VSEL_SHFT 44
367#define CA_DEBUG_AS_VSEL (0xfull << 48)
368#define CA_DEBUG_AS_VSEL_SHFT 48
369#define CA_DEBUG_PS_VSEL (0xfull << 52)
370#define CA_DEBUG_PS_VSEL_SHFT 52
371#define CA_DEBUG_PM_VSEL (0xfull << 56)
372#define CA_DEBUG_PM_VSEL_SHFT 56
373 /* bits 63:60 unused */
374
375/* ==== ca_debug_mux_core_sel */
376/* ==== ca_debug_mux_pci_sel */
377#define CA_DEBUG_MSEL0 (0x7ull << 0)
378#define CA_DEBUG_MSEL0_SHFT 0
379 /* bit 3 unused */
380#define CA_DEBUG_NSEL0 (0x7ull << 4)
381#define CA_DEBUG_NSEL0_SHFT 4
382 /* bit 7 unused */
383#define CA_DEBUG_MSEL1 (0x7ull << 8)
384#define CA_DEBUG_MSEL1_SHFT 8
385 /* bit 11 unused */
386#define CA_DEBUG_NSEL1 (0x7ull << 12)
387#define CA_DEBUG_NSEL1_SHFT 12
388 /* bit 15 unused */
389#define CA_DEBUG_MSEL2 (0x7ull << 16)
390#define CA_DEBUG_MSEL2_SHFT 16
391 /* bit 19 unused */
392#define CA_DEBUG_NSEL2 (0x7ull << 20)
393#define CA_DEBUG_NSEL2_SHFT 20
394 /* bit 23 unused */
395#define CA_DEBUG_MSEL3 (0x7ull << 24)
396#define CA_DEBUG_MSEL3_SHFT 24
397 /* bit 27 unused */
398#define CA_DEBUG_NSEL3 (0x7ull << 28)
399#define CA_DEBUG_NSEL3_SHFT 28
400 /* bit 31 unused */
401#define CA_DEBUG_MSEL4 (0x7ull << 32)
402#define CA_DEBUG_MSEL4_SHFT 32
403 /* bit 35 unused */
404#define CA_DEBUG_NSEL4 (0x7ull << 36)
405#define CA_DEBUG_NSEL4_SHFT 36
406 /* bit 39 unused */
407#define CA_DEBUG_MSEL5 (0x7ull << 40)
408#define CA_DEBUG_MSEL5_SHFT 40
409 /* bit 43 unused */
410#define CA_DEBUG_NSEL5 (0x7ull << 44)
411#define CA_DEBUG_NSEL5_SHFT 44
412 /* bit 47 unused */
413#define CA_DEBUG_MSEL6 (0x7ull << 48)
414#define CA_DEBUG_MSEL6_SHFT 48
415 /* bit 51 unused */
416#define CA_DEBUG_NSEL6 (0x7ull << 52)
417#define CA_DEBUG_NSEL6_SHFT 52
418 /* bit 55 unused */
419#define CA_DEBUG_MSEL7 (0x7ull << 56)
420#define CA_DEBUG_MSEL7_SHFT 56
421 /* bit 59 unused */
422#define CA_DEBUG_NSEL7 (0x7ull << 60)
423#define CA_DEBUG_NSEL7_SHFT 60
424 /* bit 63 unused */
425
426
427/* ==== ca_debug_domain_sel */
428#define CA_DEBUG_DOMAIN_L (1ull << 0)
429#define CA_DEBUG_DOMAIN_H (1ull << 1)
430 /* bits 63:2 unused */
431
432/* ==== ca_gart_ptr_table */
433#define CA_GART_PTR_VAL (1ull << 0)
434 /* bits 11:1 unused */
435#define CA_GART_PTR_ADDR (0xfffffffffffull << 12)
436#define CA_GART_PTR_ADDR_SHFT 12
437 /* bits 63:56 unused */
438
439/* ==== ca_gart_tlb_addr[0-7] */
440#define CA_GART_TLB_ADDR (0xffffffffffffffull << 0)
441#define CA_GART_TLB_ADDR_SHFT 0
442 /* bits 62:56 unused */
443#define CA_GART_TLB_ENTRY_VAL (1ull << 63)
444
445/*
446 * PIO address space ranges for TIO:CA
447 */
448
449/* CA internal registers */
450#define CA_PIO_ADMIN 0x00000000
451#define CA_PIO_ADMIN_LEN 0x00010000
452
453/* GFX Write Buffer - Diagnostics */
454#define CA_PIO_GFX 0x00010000
455#define CA_PIO_GFX_LEN 0x00010000
456
457/* AGP DMA Write Buffer - Diagnostics */
458#define CA_PIO_AGP_DMAWRITE 0x00020000
459#define CA_PIO_AGP_DMAWRITE_LEN 0x00010000
460
461/* AGP DMA READ Buffer - Diagnostics */
462#define CA_PIO_AGP_DMAREAD 0x00030000
463#define CA_PIO_AGP_DMAREAD_LEN 0x00010000
464
465/* PCI Config Type 0 */
466#define CA_PIO_PCI_TYPE0_CONFIG 0x01000000
467#define CA_PIO_PCI_TYPE0_CONFIG_LEN 0x01000000
468
469/* PCI Config Type 1 */
470#define CA_PIO_PCI_TYPE1_CONFIG 0x02000000
471#define CA_PIO_PCI_TYPE1_CONFIG_LEN 0x01000000
472
473/* PCI I/O Cycles - mapped to PCI Address 0x00000000-0x04ffffff */
474#define CA_PIO_PCI_IO 0x03000000
475#define CA_PIO_PCI_IO_LEN 0x05000000
476
477/* PCI MEM Cycles - mapped to PCI with CA_PIO_ADDR_OFFSET of ca_control1 */
478/* use Fast Write if enabled and coretalk packet type is a GFX request */
479#define CA_PIO_PCI_MEM_OFFSET 0x08000000
480#define CA_PIO_PCI_MEM_OFFSET_LEN 0x08000000
481
482/* PCI MEM Cycles - mapped to PCI Address 0x00000000-0xbfffffff */
483/* use Fast Write if enabled and coretalk packet type is a GFX request */
484#define CA_PIO_PCI_MEM 0x40000000
485#define CA_PIO_PCI_MEM_LEN 0xc0000000
486
487/*
488 * DMA space
489 *
490 * The CA aperature (ie. bus address range) mapped by the GART is segmented into
491 * two parts. The lower portion of the aperature is used for mapping 32 bit
492 * PCI addresses which are managed by the dma interfaces in this file. The
493 * upper poprtion of the aperature is used for mapping 48 bit AGP addresses.
494 * The AGP portion of the aperature is managed by the agpgart_be.c driver
495 * in drivers/linux/agp. There are ca-specific hooks in that driver to
496 * manipulate the gart, but management of the AGP portion of the aperature
497 * is the responsibility of that driver.
498 *
499 * CA allows three main types of DMA mapping:
500 *
501 * PCI 64-bit Managed by this driver
502 * PCI 32-bit Managed by this driver
503 * AGP 48-bit Managed by hooks in the /dev/agpgart driver
504 *
505 * All of the above can optionally be remapped through the GART. The following
506 * table lists the combinations of addressing types and GART remapping that
507 * is currently supported by the driver (h/w supports all, s/w limits this):
508 *
509 * PCI64 PCI32 AGP48
510 * GART no yes yes
511 * Direct yes yes no
512 *
513 * GART remapping of PCI64 is not done because there is no need to. The
514 * 64 bit PCI address holds all of the information necessary to target any
515 * memory in the system.
516 *
517 * AGP48 is always mapped through the GART. Management of the AGP48 portion
518 * of the aperature is the responsibility of code in the agpgart_be driver.
519 *
520 * The non-64 bit bus address space will currently be partitioned like this:
521 *
522 * 0xffff_ffff_ffff +--------
523 * | AGP48 direct
524 * | Space managed by this driver
525 * CA_AGP_DIRECT_BASE +--------
526 * | AGP GART mapped (gfx aperature)
527 * | Space managed by /dev/agpgart driver
528 * | This range is exposed to the agpgart
529 * | driver as the "graphics aperature"
530 * CA_AGP_MAPPED_BASE +-----
531 * | PCI GART mapped
532 * | Space managed by this driver
533 * CA_PCI32_MAPPED_BASE +----
534 * | PCI32 direct
535 * | Space managed by this driver
536 * 0xC000_0000 +--------
537 * (CA_PCI32_DIRECT_BASE)
538 *
539 * The bus address range CA_PCI32_MAPPED_BASE through CA_AGP_DIRECT_BASE
540 * is what we call the CA aperature. Addresses falling in this range will
541 * be remapped using the GART.
542 *
543 * The bus address range CA_AGP_MAPPED_BASE through CA_AGP_DIRECT_BASE
544 * is what we call the graphics aperature. This is a subset of the CA
545 * aperature and is under the control of the agpgart_be driver.
546 *
547 * CA_PCI32_MAPPED_BASE, CA_AGP_MAPPED_BASE, and CA_AGP_DIRECT_BASE are
548 * somewhat arbitrary values. The known constraints on choosing these is:
549 *
550 * 1) CA_AGP_DIRECT_BASE-CA_PCI32_MAPPED_BASE+1 (the CA aperature size)
551 * must be one of the values supported by the ca_gart_aperature register.
552 * Currently valid values are: 4MB through 4096MB in powers of 2 increments
553 *
554 * 2) CA_AGP_DIRECT_BASE-CA_AGP_MAPPED_BASE+1 (the gfx aperature size)
555 * must be in MB units since that's what the agpgart driver assumes.
556 */
557
558/*
559 * Define Bus DMA ranges. These are configurable (see constraints above)
560 * and will probably need tuning based on experience.
561 */
562
563
564/*
565 * 11/24/03
566 * CA has an addressing glitch w.r.t. PCI direct 32 bit DMA that makes it
567 * generally unusable. The problem is that for PCI direct 32
568 * DMA's, all 32 bits of the bus address are used to form the lower 32 bits
569 * of the coretalk address, and coretalk bits 38:32 come from a register.
570 * Since only PCI bus addresses 0xC0000000-0xFFFFFFFF (1GB) are available
571 * for DMA (the rest is allocated to PIO), host node addresses need to be
572 * such that their lower 32 bits fall in the 0xC0000000-0xffffffff range
573 * as well. So there can be no PCI32 direct DMA below 3GB!! For this
574 * reason we set the CA_PCI32_DIRECT_SIZE to 0 which essentially makes
575 * tioca_dma_direct32() a noop but preserves the code flow should this issue
576 * be fixed in a respin.
577 *
578 * For now, all PCI32 DMA's must be mapped through the GART.
579 */
580
581#define CA_PCI32_DIRECT_BASE 0xC0000000UL /* BASE not configurable */
582#define CA_PCI32_DIRECT_SIZE 0x00000000UL /* 0 MB */
583
584#define CA_PCI32_MAPPED_BASE 0xC0000000UL
585#define CA_PCI32_MAPPED_SIZE 0x40000000UL /* 2GB */
586
587#define CA_AGP_MAPPED_BASE 0x80000000UL
588#define CA_AGP_MAPPED_SIZE 0x40000000UL /* 2GB */
589
590#define CA_AGP_DIRECT_BASE 0x40000000UL /* 2GB */
591#define CA_AGP_DIRECT_SIZE 0x40000000UL
592
593#define CA_APERATURE_BASE (CA_AGP_MAPPED_BASE)
594#define CA_APERATURE_SIZE (CA_AGP_MAPPED_SIZE+CA_PCI32_MAPPED_SIZE)
595
596#endif /* _ASM_IA64_SN_TIO_TIOCA_H */
diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h
new file mode 100644
index 000000000000..b6acc22ab239
--- /dev/null
+++ b/include/asm-ia64/sn/tioca_provider.h
@@ -0,0 +1,206 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2003-2005 Silicon Graphics, Inc. All rights reserved.
7 */
8
9#ifndef _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H
10#define _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H
11
12#include <asm/sn/tioca.h>
13
14/*
15 * WAR enables
16 * Defines for individual WARs. Each is a bitmask of applicable
17 * part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
18 * (3 << 1) == (rev A or rev B), etc
19 */
20
21#define TIOCA_WAR_ENABLED(pv, tioca_common) \
22 ((1 << tioca_common->ca_rev) & pv)
23
24 /* TIO:ICE:FRZ:Freezer loses a PIO data ucred on PIO RD RSP with CW error */
25#define PV907908 (1 << 1)
26 /* ATI config space problems after BIOS execution starts */
27#define PV908234 (1 << 1)
28 /* CA:AGPDMA write request data mismatch with ABC1CL merge */
29#define PV895469 (1 << 1)
30 /* TIO:CA TLB invalidate of written GART entries possibly not occuring in CA*/
31#define PV910244 (1 << 1)
32
33struct tioca_dmamap{
34 struct list_head cad_list; /* headed by ca_list */
35
36 dma_addr_t cad_dma_addr; /* Linux dma handle */
37 uint cad_gart_entry; /* start entry in ca_gart_pagemap */
38 uint cad_gart_size; /* #entries for this map */
39};
40
41/*
42 * Kernel only fields. Prom may look at this stuff for debugging only.
43 * Access this structure through the ca_kernel_private ptr.
44 */
45
46struct tioca_common ;
47
48struct tioca_kernel {
49 struct tioca_common *ca_common; /* tioca this belongs to */
50 struct list_head ca_list; /* list of all ca's */
51 struct list_head ca_dmamaps;
52 spinlock_t ca_lock; /* Kernel lock */
53 cnodeid_t ca_closest_node;
54 struct list_head *ca_devices; /* bus->devices */
55
56 /*
57 * General GART stuff
58 */
59 uint64_t ca_ap_size; /* size of aperature in bytes */
60 uint32_t ca_gart_entries; /* # uint64_t entries in gart */
61 uint32_t ca_ap_pagesize; /* aperature page size in bytes */
62 uint64_t ca_ap_bus_base; /* bus address of CA aperature */
63 uint64_t ca_gart_size; /* gart size in bytes */
64 uint64_t *ca_gart; /* gart table vaddr */
65 uint64_t ca_gart_coretalk_addr; /* gart coretalk addr */
66 uint8_t ca_gart_iscoherent; /* used in tioca_tlbflush */
67
68 /* PCI GART convenience values */
69 uint64_t ca_pciap_base; /* pci aperature bus base address */
70 uint64_t ca_pciap_size; /* pci aperature size (bytes) */
71 uint64_t ca_pcigart_base; /* gfx GART bus base address */
72 uint64_t *ca_pcigart; /* gfx GART vm address */
73 uint32_t ca_pcigart_entries;
74 uint32_t ca_pcigart_start; /* PCI start index in ca_gart */
75 void *ca_pcigart_pagemap;
76
77 /* AGP GART convenience values */
78 uint64_t ca_gfxap_base; /* gfx aperature bus base address */
79 uint64_t ca_gfxap_size; /* gfx aperature size (bytes) */
80 uint64_t ca_gfxgart_base; /* gfx GART bus base address */
81 uint64_t *ca_gfxgart; /* gfx GART vm address */
82 uint32_t ca_gfxgart_entries;
83 uint32_t ca_gfxgart_start; /* agpgart start index in ca_gart */
84};
85
86/*
87 * Common tioca info shared between kernel and prom
88 *
89 * DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES
90 * TO THE PROM VERSION.
91 */
92
93struct tioca_common {
94 struct pcibus_bussoft ca_common; /* common pciio header */
95
96 uint32_t ca_rev;
97 uint32_t ca_closest_nasid;
98
99 uint64_t ca_prom_private;
100 uint64_t ca_kernel_private;
101};
102
103/**
104 * tioca_paddr_to_gart - Convert an SGI coretalk address to a CA GART entry
105 * @paddr: page address to convert
106 *
107 * Convert a system [coretalk] address to a GART entry. GART entries are
108 * formed using the following:
109 *
110 * data = ( (1<<63) | ( (REMAP_NODE_ID << 40) | (MD_CHIPLET_ID << 38) |
111 * (REMAP_SYS_ADDR) ) >> 12 )
112 *
113 * DATA written to 1 GART TABLE Entry in system memory is remapped system
114 * addr for 1 page
115 *
116 * The data is for coretalk address format right shifted 12 bits with a
117 * valid bit.
118 *
119 * GART_TABLE_ENTRY [ 25:0 ] -- REMAP_SYS_ADDRESS[37:12].
120 * GART_TABLE_ENTRY [ 27:26 ] -- SHUB MD chiplet id.
121 * GART_TABLE_ENTRY [ 41:28 ] -- REMAP_NODE_ID.
122 * GART_TABLE_ENTRY [ 63 ] -- Valid Bit
123 */
124static inline u64
125tioca_paddr_to_gart(unsigned long paddr)
126{
127 /*
128 * We are assuming right now that paddr already has the correct
129 * format since the address from xtalk_dmaXXX should already have
130 * NODE_ID, CHIPLET_ID, and SYS_ADDR in the correct locations.
131 */
132
133 return ((paddr) >> 12) | (1UL << 63);
134}
135
136/**
137 * tioca_physpage_to_gart - Map a host physical page for SGI CA based DMA
138 * @page_addr: system page address to map
139 */
140
141static inline unsigned long
142tioca_physpage_to_gart(uint64_t page_addr)
143{
144 uint64_t coretalk_addr;
145
146 coretalk_addr = PHYS_TO_TIODMA(page_addr);
147 if (!coretalk_addr) {
148 return 0;
149 }
150
151 return tioca_paddr_to_gart(coretalk_addr);
152}
153
154/**
155 * tioca_tlbflush - invalidate cached SGI CA GART TLB entries
156 * @tioca_kernel: CA context
157 *
158 * Invalidate tlb entries for a given CA GART. Main complexity is to account
159 * for revA bug.
160 */
161static inline void
162tioca_tlbflush(struct tioca_kernel *tioca_kernel)
163{
164 volatile uint64_t tmp;
165 volatile struct tioca *ca_base;
166 struct tioca_common *tioca_common;
167
168 tioca_common = tioca_kernel->ca_common;
169 ca_base = (struct tioca *)tioca_common->ca_common.bs_base;
170
171 /*
172 * Explicit flushes not needed if GART is in cached mode
173 */
174 if (tioca_kernel->ca_gart_iscoherent) {
175 if (TIOCA_WAR_ENABLED(PV910244, tioca_common)) {
176 /*
177 * PV910244: RevA CA needs explicit flushes.
178 * Need to put GART into uncached mode before
179 * flushing otherwise the explicit flush is ignored.
180 *
181 * Alternate WAR would be to leave GART cached and
182 * touch every CL aligned GART entry.
183 */
184
185 ca_base->ca_control2 &= ~(CA_GART_MEM_PARAM);
186 ca_base->ca_control2 |= CA_GART_FLUSH_TLB;
187 ca_base->ca_control2 |=
188 (0x2ull << CA_GART_MEM_PARAM_SHFT);
189 tmp = ca_base->ca_control2;
190 }
191
192 return;
193 }
194
195 /*
196 * Gart in uncached mode ... need an explicit flush.
197 */
198
199 ca_base->ca_control2 |= CA_GART_FLUSH_TLB;
200 tmp = ca_base->ca_control2;
201}
202
203extern uint32_t tioca_gart_found;
204extern int tioca_init_provider(void);
205extern void tioca_fastwrite_enable(struct tioca_kernel *tioca_kern);
206#endif /* _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H */
diff --git a/include/asm-ia64/sn/tiocx.h b/include/asm-ia64/sn/tiocx.h
new file mode 100644
index 000000000000..c5447a504509
--- /dev/null
+++ b/include/asm-ia64/sn/tiocx.h
@@ -0,0 +1,71 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved.
7 */
8
9#ifndef _ASM_IA64_SN_TIO_TIOCX_H
10#define _ASM_IA64_SN_TIO_TIOCX_H
11
12#ifdef __KERNEL__
13
14struct cx_id_s {
15 unsigned int part_num;
16 unsigned int mfg_num;
17 int nasid;
18};
19
20struct cx_dev {
21 struct cx_id_s cx_id;
22 void *soft; /* driver specific */
23 struct hubdev_info *hubdev;
24 struct device dev;
25 struct cx_drv *driver;
26};
27
28struct cx_device_id {
29 unsigned int part_num;
30 unsigned int mfg_num;
31};
32
33struct cx_drv {
34 char *name;
35 const struct cx_device_id *id_table;
36 struct device_driver driver;
37 int (*probe) (struct cx_dev * dev, const struct cx_device_id * id);
38 int (*remove) (struct cx_dev * dev);
39};
40
41/* create DMA address by stripping AS bits */
42#define TIOCX_DMA_ADDR(a) (uint64_t)((uint64_t)(a) & 0xffffcfffffffffUL)
43
44#define TIOCX_TO_TIOCX_DMA_ADDR(a) (uint64_t)(((uint64_t)(a) & 0xfffffffff) | \
45 ((((uint64_t)(a)) & 0xffffc000000000UL) <<2))
46
47#define TIO_CE_ASIC_PARTNUM 0xce00
48#define TIOCX_CORELET 3
49
50/* These are taken from tio_mmr_as.h */
51#define TIO_ICE_FRZ_CFG TIO_MMR_ADDR_MOD(0x00000000b0008100UL)
52#define TIO_ICE_PMI_TX_CFG TIO_MMR_ADDR_MOD(0x00000000b000b100UL)
53#define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3 TIO_MMR_ADDR_MOD(0x00000000b000be18UL)
54#define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3_CREDIT_CNT_MASK 0x000000000000000fUL
55
56#define to_cx_dev(n) container_of(n, struct cx_dev, dev)
57#define to_cx_driver(drv) container_of(drv, struct cx_drv, driver)
58
59extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int);
60extern void tiocx_irq_free(struct sn_irq_info *);
61extern int cx_device_unregister(struct cx_dev *);
62extern int cx_device_register(nasid_t, int, int, struct hubdev_info *);
63extern int cx_driver_unregister(struct cx_drv *);
64extern int cx_driver_register(struct cx_drv *);
65extern uint64_t tiocx_dma_addr(uint64_t addr);
66extern uint64_t tiocx_swin_base(int nasid);
67extern void tiocx_mmr_store(int nasid, uint64_t offset, uint64_t value);
68extern uint64_t tiocx_mmr_load(int nasid, uint64_t offset);
69
70#endif // __KERNEL__
71#endif // _ASM_IA64_SN_TIO_TIOCX__
diff --git a/include/asm-ia64/sn/types.h b/include/asm-ia64/sn/types.h
index 586ed47cae9c..8e04ee211e59 100644
--- a/include/asm-ia64/sn/types.h
+++ b/include/asm-ia64/sn/types.h
@@ -16,7 +16,8 @@ typedef signed short nasid_t; /* node id in numa-as-id space */
16typedef signed char partid_t; /* partition ID type */ 16typedef signed char partid_t; /* partition ID type */
17typedef unsigned int moduleid_t; /* user-visible module number type */ 17typedef unsigned int moduleid_t; /* user-visible module number type */
18typedef unsigned int cmoduleid_t; /* kernel compact module id type */ 18typedef unsigned int cmoduleid_t; /* kernel compact module id type */
19typedef signed char slabid_t; 19typedef unsigned char slotid_t; /* slot (blade) within module */
20typedef unsigned char slabid_t; /* slab (asic) within slot */
20typedef u64 nic_t; 21typedef u64 nic_t;
21typedef unsigned long iopaddr_t; 22typedef unsigned long iopaddr_t;
22typedef unsigned long paddr_t; 23typedef unsigned long paddr_t;
diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h
new file mode 100644
index 000000000000..9902185c0288
--- /dev/null
+++ b/include/asm-ia64/sn/xp.h
@@ -0,0 +1,436 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2005 Silicon Graphics, Inc. All rights reserved.
7 */
8
9
10/*
11 * External Cross Partition (XP) structures and defines.
12 */
13
14
15#ifndef _ASM_IA64_SN_XP_H
16#define _ASM_IA64_SN_XP_H
17
18
19#include <linux/version.h>
20#include <linux/cache.h>
21#include <linux/hardirq.h>
22#include <asm/sn/types.h>
23#include <asm/sn/bte.h>
24
25
26#ifdef USE_DBUG_ON
27#define DBUG_ON(condition) BUG_ON(condition)
28#else
29#define DBUG_ON(condition)
30#endif
31
32
33/*
34 * Define the maximum number of logically defined partitions the system
35 * can support. It is constrained by the maximum number of hardware
36 * partitionable regions. The term 'region' in this context refers to the
37 * minimum number of nodes that can comprise an access protection grouping.
38 * The access protection is in regards to memory, IPI and IOI.
39 *
40 * The maximum number of hardware partitionable regions is equal to the
41 * maximum number of nodes in the entire system divided by the minimum number
42 * of nodes that comprise an access protection grouping.
43 */
44#define XP_MAX_PARTITIONS 64
45
46
47/*
48 * Define the number of u64s required to represent all the C-brick nasids
49 * as a bitmap. The cross-partition kernel modules deal only with
50 * C-brick nasids, thus the need for bitmaps which don't account for
51 * odd-numbered (non C-brick) nasids.
52 */
53#define XP_MAX_PHYSNODE_ID (MAX_PHYSNODE_ID / 2)
54#define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8)
55#define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64)
56
57
58/*
59 * Wrapper for bte_copy() that should it return a failure status will retry
60 * the bte_copy() once in the hope that the failure was due to a temporary
61 * aberration (i.e., the link going down temporarily).
62 *
63 * See bte_copy for definition of the input parameters.
64 *
65 * Note: xp_bte_copy() should never be called while holding a spinlock.
66 */
67static inline bte_result_t
68xp_bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
69{
70 bte_result_t ret;
71
72
73 ret = bte_copy(src, dest, len, mode, notification);
74
75 if (ret != BTE_SUCCESS) {
76 if (!in_interrupt()) {
77 cond_resched();
78 }
79 ret = bte_copy(src, dest, len, mode, notification);
80 }
81
82 return ret;
83}
84
85
86/*
87 * XPC establishes channel connections between the local partition and any
88 * other partition that is currently up. Over these channels, kernel-level
89 * `users' can communicate with their counterparts on the other partitions.
90 *
91 * The maxinum number of channels is limited to eight. For performance reasons,
92 * the internal cross partition structures require sixteen bytes per channel,
93 * and eight allows all of this interface-shared info to fit in one cache line.
94 *
95 * XPC_NCHANNELS reflects the total number of channels currently defined.
96 * If the need for additional channels arises, one can simply increase
97 * XPC_NCHANNELS accordingly. If the day should come where that number
98 * exceeds the MAXIMUM number of channels allowed (eight), then one will need
99 * to make changes to the XPC code to allow for this.
100 */
101#define XPC_MEM_CHANNEL 0 /* memory channel number */
102#define XPC_NET_CHANNEL 1 /* network channel number */
103
104#define XPC_NCHANNELS 2 /* #of defined channels */
105#define XPC_MAX_NCHANNELS 8 /* max #of channels allowed */
106
107#if XPC_NCHANNELS > XPC_MAX_NCHANNELS
108#error XPC_NCHANNELS exceeds MAXIMUM allowed.
109#endif
110
111
112/*
113 * The format of an XPC message is as follows:
114 *
115 * +-------+--------------------------------+
116 * | flags |////////////////////////////////|
117 * +-------+--------------------------------+
118 * | message # |
119 * +----------------------------------------+
120 * | payload (user-defined message) |
121 * | |
122 * :
123 * | |
124 * +----------------------------------------+
125 *
126 * The size of the payload is defined by the user via xpc_connect(). A user-
127 * defined message resides in the payload area.
128 *
129 * The user should have no dealings with the message header, but only the
130 * message's payload. When a message entry is allocated (via xpc_allocate())
131 * a pointer to the payload area is returned and not the actual beginning of
132 * the XPC message. The user then constructs a message in the payload area
133 * and passes that pointer as an argument on xpc_send() or xpc_send_notify().
134 *
135 * The size of a message entry (within a message queue) must be a cacheline
136 * sized multiple in order to facilitate the BTE transfer of messages from one
137 * message queue to another. A macro, XPC_MSG_SIZE(), is provided for the user
138 * that wants to fit as many msg entries as possible in a given memory size
139 * (e.g. a memory page).
140 */
141struct xpc_msg {
142 u8 flags; /* FOR XPC INTERNAL USE ONLY */
143 u8 reserved[7]; /* FOR XPC INTERNAL USE ONLY */
144 s64 number; /* FOR XPC INTERNAL USE ONLY */
145
146 u64 payload; /* user defined portion of message */
147};
148
149
150#define XPC_MSG_PAYLOAD_OFFSET (u64) (&((struct xpc_msg *)0)->payload)
151#define XPC_MSG_SIZE(_payload_size) \
152 L1_CACHE_ALIGN(XPC_MSG_PAYLOAD_OFFSET + (_payload_size))
153
154
155/*
156 * Define the return values and values passed to user's callout functions.
157 * (It is important to add new value codes at the end just preceding
158 * xpcUnknownReason, which must have the highest numerical value.)
159 */
160enum xpc_retval {
161 xpcSuccess = 0,
162
163 xpcNotConnected, /* 1: channel is not connected */
164 xpcConnected, /* 2: channel connected (opened) */
165 xpcRETIRED1, /* 3: (formerly xpcDisconnected) */
166
167 xpcMsgReceived, /* 4: message received */
168 xpcMsgDelivered, /* 5: message delivered and acknowledged */
169
170 xpcRETIRED2, /* 6: (formerly xpcTransferFailed) */
171
172 xpcNoWait, /* 7: operation would require wait */
173 xpcRetry, /* 8: retry operation */
174 xpcTimeout, /* 9: timeout in xpc_allocate_msg_wait() */
175 xpcInterrupted, /* 10: interrupted wait */
176
177 xpcUnequalMsgSizes, /* 11: message size disparity between sides */
178 xpcInvalidAddress, /* 12: invalid address */
179
180 xpcNoMemory, /* 13: no memory available for XPC structures */
181 xpcLackOfResources, /* 14: insufficient resources for operation */
182 xpcUnregistered, /* 15: channel is not registered */
183 xpcAlreadyRegistered, /* 16: channel is already registered */
184
185 xpcPartitionDown, /* 17: remote partition is down */
186 xpcNotLoaded, /* 18: XPC module is not loaded */
187 xpcUnloading, /* 19: this side is unloading XPC module */
188
189 xpcBadMagic, /* 20: XPC MAGIC string not found */
190
191 xpcReactivating, /* 21: remote partition was reactivated */
192
193 xpcUnregistering, /* 22: this side is unregistering channel */
194 xpcOtherUnregistering, /* 23: other side is unregistering channel */
195
196 xpcCloneKThread, /* 24: cloning kernel thread */
197 xpcCloneKThreadFailed, /* 25: cloning kernel thread failed */
198
199 xpcNoHeartbeat, /* 26: remote partition has no heartbeat */
200
201 xpcPioReadError, /* 27: PIO read error */
202 xpcPhysAddrRegFailed, /* 28: registration of phys addr range failed */
203
204 xpcBteDirectoryError, /* 29: maps to BTEFAIL_DIR */
205 xpcBtePoisonError, /* 30: maps to BTEFAIL_POISON */
206 xpcBteWriteError, /* 31: maps to BTEFAIL_WERR */
207 xpcBteAccessError, /* 32: maps to BTEFAIL_ACCESS */
208 xpcBtePWriteError, /* 33: maps to BTEFAIL_PWERR */
209 xpcBtePReadError, /* 34: maps to BTEFAIL_PRERR */
210 xpcBteTimeOutError, /* 35: maps to BTEFAIL_TOUT */
211 xpcBteXtalkError, /* 36: maps to BTEFAIL_XTERR */
212 xpcBteNotAvailable, /* 37: maps to BTEFAIL_NOTAVAIL */
213 xpcBteUnmappedError, /* 38: unmapped BTEFAIL_ error */
214
215 xpcBadVersion, /* 39: bad version number */
216 xpcVarsNotSet, /* 40: the XPC variables are not set up */
217 xpcNoRsvdPageAddr, /* 41: unable to get rsvd page's phys addr */
218 xpcInvalidPartid, /* 42: invalid partition ID */
219 xpcLocalPartid, /* 43: local partition ID */
220
221 xpcUnknownReason /* 44: unknown reason -- must be last in list */
222};
223
224
225/*
226 * Define the callout function types used by XPC to update the user on
227 * connection activity and state changes (via the user function registered by
228 * xpc_connect()) and to notify them of messages received and delivered (via
229 * the user function registered by xpc_send_notify()).
230 *
231 * The two function types are xpc_channel_func and xpc_notify_func and
232 * both share the following arguments, with the exception of "data", which
233 * only xpc_channel_func has.
234 *
235 * Arguments:
236 *
237 * reason - reason code. (See following table.)
238 * partid - partition ID associated with condition.
239 * ch_number - channel # associated with condition.
240 * data - pointer to optional data. (See following table.)
241 * key - pointer to optional user-defined value provided as the "key"
242 * argument to xpc_connect() or xpc_send_notify().
243 *
244 * In the following table the "Optional Data" column applies to callouts made
245 * to functions registered by xpc_connect(). A "NA" in that column indicates
246 * that this reason code can be passed to functions registered by
247 * xpc_send_notify() (i.e. they don't have data arguments).
248 *
249 * Also, the first three reason codes in the following table indicate
250 * success, whereas the others indicate failure. When a failure reason code
251 * is received, one can assume that the channel is not connected.
252 *
253 *
254 * Reason Code | Cause | Optional Data
255 * =====================+================================+=====================
256 * xpcConnected | connection has been established| max #of entries
257 * | to the specified partition on | allowed in message
258 * | the specified channel | queue
259 * ---------------------+--------------------------------+---------------------
260 * xpcMsgReceived | an XPC message arrived from | address of payload
261 * | the specified partition on the |
262 * | specified channel | [the user must call
263 * | | xpc_received() when
264 * | | finished with the
265 * | | payload]
266 * ---------------------+--------------------------------+---------------------
267 * xpcMsgDelivered | notification that the message | NA
268 * | was delivered to the intended |
269 * | recipient and that they have |
270 * | acknowledged its receipt by |
271 * | calling xpc_received() |
272 * =====================+================================+=====================
273 * xpcUnequalMsgSizes | can't connect to the specified | NULL
274 * | partition on the specified |
275 * | channel because of mismatched |
276 * | message sizes |
277 * ---------------------+--------------------------------+---------------------
278 * xpcNoMemory | insufficient memory avaiable | NULL
279 * | to allocate message queue |
280 * ---------------------+--------------------------------+---------------------
281 * xpcLackOfResources | lack of resources to create | NULL
282 * | the necessary kthreads to |
283 * | support the channel |
284 * ---------------------+--------------------------------+---------------------
285 * xpcUnregistering | this side's user has | NULL or NA
286 * | unregistered by calling |
287 * | xpc_disconnect() |
288 * ---------------------+--------------------------------+---------------------
289 * xpcOtherUnregistering| the other side's user has | NULL or NA
290 * | unregistered by calling |
291 * | xpc_disconnect() |
292 * ---------------------+--------------------------------+---------------------
293 * xpcNoHeartbeat | the other side's XPC is no | NULL or NA
294 * | longer heartbeating |
295 * | |
296 * ---------------------+--------------------------------+---------------------
297 * xpcUnloading | this side's XPC module is | NULL or NA
298 * | being unloaded |
299 * | |
300 * ---------------------+--------------------------------+---------------------
301 * xpcOtherUnloading | the other side's XPC module is | NULL or NA
302 * | is being unloaded |
303 * | |
304 * ---------------------+--------------------------------+---------------------
305 * xpcPioReadError | xp_nofault_PIOR() returned an | NULL or NA
306 * | error while sending an IPI |
307 * | |
308 * ---------------------+--------------------------------+---------------------
309 * xpcInvalidAddress | the address either received or | NULL or NA
310 * | sent by the specified partition|
311 * | is invalid |
312 * ---------------------+--------------------------------+---------------------
313 * xpcBteNotAvailable | attempt to pull data from the | NULL or NA
314 * xpcBtePoisonError | specified partition over the |
315 * xpcBteWriteError | specified channel via a |
316 * xpcBteAccessError | bte_copy() failed |
317 * xpcBteTimeOutError | |
318 * xpcBteXtalkError | |
319 * xpcBteDirectoryError | |
320 * xpcBteGenericError | |
321 * xpcBteUnmappedError | |
322 * ---------------------+--------------------------------+---------------------
323 * xpcUnknownReason | the specified channel to the | NULL or NA
324 * | specified partition was |
325 * | unavailable for unknown reasons|
326 * =====================+================================+=====================
327 */
328
329typedef void (*xpc_channel_func)(enum xpc_retval reason, partid_t partid,
330 int ch_number, void *data, void *key);
331
332typedef void (*xpc_notify_func)(enum xpc_retval reason, partid_t partid,
333 int ch_number, void *key);
334
335
336/*
337 * The following is a registration entry. There is a global array of these,
338 * one per channel. It is used to record the connection registration made
339 * by the users of XPC. As long as a registration entry exists, for any
340 * partition that comes up, XPC will attempt to establish a connection on
341 * that channel. Notification that a connection has been made will occur via
342 * the xpc_channel_func function.
343 *
344 * The 'func' field points to the function to call when aynchronous
345 * notification is required for such events as: a connection established/lost,
346 * or an incomming message received, or an error condition encountered. A
347 * non-NULL 'func' field indicates that there is an active registration for
348 * the channel.
349 */
350struct xpc_registration {
351 struct semaphore sema;
352 xpc_channel_func func; /* function to call */
353 void *key; /* pointer to user's key */
354 u16 nentries; /* #of msg entries in local msg queue */
355 u16 msg_size; /* message queue's message size */
356 u32 assigned_limit; /* limit on #of assigned kthreads */
357 u32 idle_limit; /* limit on #of idle kthreads */
358} ____cacheline_aligned;
359
360
361#define XPC_CHANNEL_REGISTERED(_c) (xpc_registrations[_c].func != NULL)
362
363
364/* the following are valid xpc_allocate() flags */
365#define XPC_WAIT 0 /* wait flag */
366#define XPC_NOWAIT 1 /* no wait flag */
367
368
369struct xpc_interface {
370 void (*connect)(int);
371 void (*disconnect)(int);
372 enum xpc_retval (*allocate)(partid_t, int, u32, void **);
373 enum xpc_retval (*send)(partid_t, int, void *);
374 enum xpc_retval (*send_notify)(partid_t, int, void *,
375 xpc_notify_func, void *);
376 void (*received)(partid_t, int, void *);
377 enum xpc_retval (*partid_to_nasids)(partid_t, void *);
378};
379
380
381extern struct xpc_interface xpc_interface;
382
383extern void xpc_set_interface(void (*)(int),
384 void (*)(int),
385 enum xpc_retval (*)(partid_t, int, u32, void **),
386 enum xpc_retval (*)(partid_t, int, void *),
387 enum xpc_retval (*)(partid_t, int, void *, xpc_notify_func,
388 void *),
389 void (*)(partid_t, int, void *),
390 enum xpc_retval (*)(partid_t, void *));
391extern void xpc_clear_interface(void);
392
393
394extern enum xpc_retval xpc_connect(int, xpc_channel_func, void *, u16,
395 u16, u32, u32);
396extern void xpc_disconnect(int);
397
398static inline enum xpc_retval
399xpc_allocate(partid_t partid, int ch_number, u32 flags, void **payload)
400{
401 return xpc_interface.allocate(partid, ch_number, flags, payload);
402}
403
404static inline enum xpc_retval
405xpc_send(partid_t partid, int ch_number, void *payload)
406{
407 return xpc_interface.send(partid, ch_number, payload);
408}
409
410static inline enum xpc_retval
411xpc_send_notify(partid_t partid, int ch_number, void *payload,
412 xpc_notify_func func, void *key)
413{
414 return xpc_interface.send_notify(partid, ch_number, payload, func, key);
415}
416
417static inline void
418xpc_received(partid_t partid, int ch_number, void *payload)
419{
420 return xpc_interface.received(partid, ch_number, payload);
421}
422
423static inline enum xpc_retval
424xpc_partid_to_nasids(partid_t partid, void *nasids)
425{
426 return xpc_interface.partid_to_nasids(partid, nasids);
427}
428
429
430extern u64 xp_nofault_PIOR_target;
431extern int xp_nofault_PIOR(void *);
432extern int xp_error_PIOR(void);
433
434
435#endif /* _ASM_IA64_SN_XP_H */
436
diff --git a/include/asm-m32r/signal.h b/include/asm-m32r/signal.h
index ce46eaea4494..95f69b191953 100644
--- a/include/asm-m32r/signal.h
+++ b/include/asm-m32r/signal.h
@@ -114,34 +114,7 @@ typedef unsigned long sigset_t;
114#define MINSIGSTKSZ 2048 114#define MINSIGSTKSZ 2048
115#define SIGSTKSZ 8192 115#define SIGSTKSZ 8192
116 116
117#ifdef __KERNEL__ 117#include <asm-generic/signal.h>
118
119/*
120 * These values of sa_flags are used only by the kernel as part of the
121 * irq handling routines.
122 *
123 * SA_INTERRUPT is also used by the irq handling routines.
124 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
125 */
126#define SA_PROBE SA_ONESHOT
127#define SA_SAMPLE_RANDOM SA_RESTART
128#define SA_SHIRQ 0x04000000
129#endif
130
131#define SIG_BLOCK 0 /* for blocking signals */
132#define SIG_UNBLOCK 1 /* for unblocking signals */
133#define SIG_SETMASK 2 /* for setting the signal mask */
134
135/* Type of a signal handler. */
136typedef void __signalfn_t(int);
137typedef __signalfn_t __user *__sighandler_t;
138
139typedef void __restorefn_t(void);
140typedef __restorefn_t __user *__sigrestore_t;
141
142#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
143#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
144#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
145 118
146#ifdef __KERNEL__ 119#ifdef __KERNEL__
147struct old_sigaction { 120struct old_sigaction {
diff --git a/include/asm-m68k/bug.h b/include/asm-m68k/bug.h
index 3e1d2266fa69..072ce274d537 100644
--- a/include/asm-m68k/bug.h
+++ b/include/asm-m68k/bug.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_BUG
6#ifdef CONFIG_DEBUG_BUGVERBOSE 7#ifdef CONFIG_DEBUG_BUGVERBOSE
7#ifndef CONFIG_SUN3 8#ifndef CONFIG_SUN3
8#define BUG() do { \ 9#define BUG() do { \
@@ -22,6 +23,8 @@
22#endif 23#endif
23 24
24#define HAVE_ARCH_BUG 25#define HAVE_ARCH_BUG
26#endif
27
25#include <asm-generic/bug.h> 28#include <asm-generic/bug.h>
26 29
27#endif 30#endif
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
index 6681bb6a5523..a0cdf9082372 100644
--- a/include/asm-m68k/signal.h
+++ b/include/asm-m68k/signal.h
@@ -105,42 +105,20 @@ typedef unsigned long sigset_t;
105#define MINSIGSTKSZ 2048 105#define MINSIGSTKSZ 2048
106#define SIGSTKSZ 8192 106#define SIGSTKSZ 8192
107 107
108#ifdef __KERNEL__ 108#include <asm-generic/signal.h>
109/*
110 * These values of sa_flags are used only by the kernel as part of the
111 * irq handling routines.
112 *
113 * SA_INTERRUPT is also used by the irq handling routines.
114 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
115 */
116#define SA_PROBE SA_ONESHOT
117#define SA_SAMPLE_RANDOM SA_RESTART
118#define SA_SHIRQ 0x04000000
119#endif
120
121#define SIG_BLOCK 0 /* for blocking signals */
122#define SIG_UNBLOCK 1 /* for unblocking signals */
123#define SIG_SETMASK 2 /* for setting the signal mask */
124
125/* Type of a signal handler. */
126typedef void (*__sighandler_t)(int);
127
128#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
129#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
130#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
131 109
132#ifdef __KERNEL__ 110#ifdef __KERNEL__
133struct old_sigaction { 111struct old_sigaction {
134 __sighandler_t sa_handler; 112 __sighandler_t sa_handler;
135 old_sigset_t sa_mask; 113 old_sigset_t sa_mask;
136 unsigned long sa_flags; 114 unsigned long sa_flags;
137 void (*sa_restorer)(void); 115 __sigrestore_t sa_restorer;
138}; 116};
139 117
140struct sigaction { 118struct sigaction {
141 __sighandler_t sa_handler; 119 __sighandler_t sa_handler;
142 unsigned long sa_flags; 120 unsigned long sa_flags;
143 void (*sa_restorer)(void); 121 __sigrestore_t sa_restorer;
144 sigset_t sa_mask; /* mask last for extensibility */ 122 sigset_t sa_mask; /* mask last for extensibility */
145}; 123};
146 124
diff --git a/include/asm-m68knommu/MC68328.h b/include/asm-m68knommu/MC68328.h
index 4f5a9845f5be..a337e56d09bf 100644
--- a/include/asm-m68knommu/MC68328.h
+++ b/include/asm-m68knommu/MC68328.h
@@ -993,7 +993,7 @@ typedef volatile struct {
993 volatile unsigned short int pad1; 993 volatile unsigned short int pad1;
994 volatile unsigned short int pad2; 994 volatile unsigned short int pad2;
995 volatile unsigned short int pad3; 995 volatile unsigned short int pad3;
996} m68328_uart __attribute__((packed)); 996} __attribute__((packed)) m68328_uart;
997 997
998 998
999/********** 999/**********
diff --git a/include/asm-m68knommu/MC68EZ328.h b/include/asm-m68knommu/MC68EZ328.h
index 801933da4c70..69b7f9139e5e 100644
--- a/include/asm-m68knommu/MC68EZ328.h
+++ b/include/asm-m68knommu/MC68EZ328.h
@@ -815,7 +815,7 @@ typedef volatile struct {
815 volatile unsigned short int nipr; 815 volatile unsigned short int nipr;
816 volatile unsigned short int pad1; 816 volatile unsigned short int pad1;
817 volatile unsigned short int pad2; 817 volatile unsigned short int pad2;
818} m68328_uart __attribute__((packed)); 818} __attribute__((packed)) m68328_uart;
819 819
820 820
821/********** 821/**********
diff --git a/include/asm-m68knommu/MC68VZ328.h b/include/asm-m68knommu/MC68VZ328.h
index df74322f37ed..2b9bf626a0a5 100644
--- a/include/asm-m68knommu/MC68VZ328.h
+++ b/include/asm-m68knommu/MC68VZ328.h
@@ -909,7 +909,7 @@ typedef struct {
909 volatile unsigned short int nipr; 909 volatile unsigned short int nipr;
910 volatile unsigned short int hmark; 910 volatile unsigned short int hmark;
911 volatile unsigned short int unused; 911 volatile unsigned short int unused;
912} m68328_uart __attribute__((packed)); 912} __attribute__((packed)) m68328_uart;
913 913
914 914
915 915
diff --git a/include/asm-m68knommu/signal.h b/include/asm-m68knommu/signal.h
index 486cbb0dc088..1d13187f6062 100644
--- a/include/asm-m68knommu/signal.h
+++ b/include/asm-m68knommu/signal.h
@@ -105,29 +105,7 @@ typedef unsigned long sigset_t;
105#define MINSIGSTKSZ 2048 105#define MINSIGSTKSZ 2048
106#define SIGSTKSZ 8192 106#define SIGSTKSZ 8192
107 107
108#ifdef __KERNEL__ 108#include <asm-generic/signal.h>
109/*
110 * These values of sa_flags are used only by the kernel as part of the
111 * irq handling routines.
112 *
113 * SA_INTERRUPT is also used by the irq handling routines.
114 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
115 */
116#define SA_PROBE SA_ONESHOT
117#define SA_SAMPLE_RANDOM SA_RESTART
118#define SA_SHIRQ 0x04000000
119#endif
120
121#define SIG_BLOCK 0 /* for blocking signals */
122#define SIG_UNBLOCK 1 /* for unblocking signals */
123#define SIG_SETMASK 2 /* for setting the signal mask */
124
125/* Type of a signal handler. */
126typedef void (*__sighandler_t)(int);
127
128#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
129#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
130#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
131 109
132#ifdef __KERNEL__ 110#ifdef __KERNEL__
133struct old_sigaction { 111struct old_sigaction {
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
index eb94bb96cfbc..3f594b440abc 100644
--- a/include/asm-mips/bug.h
+++ b/include/asm-mips/bug.h
@@ -3,12 +3,14 @@
3 3
4#include <asm/break.h> 4#include <asm/break.h>
5 5
6#ifdef CONFIG_BUG
7#define HAVE_ARCH_BUG
6#define BUG() \ 8#define BUG() \
7do { \ 9do { \
8 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \ 10 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \
9} while (0) 11} while (0)
12#endif
10 13
11#define HAVE_ARCH_BUG
12#include <asm-generic/bug.h> 14#include <asm-generic/bug.h>
13 15
14#endif 16#endif
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h
index 2b458f9538cd..3c0d840e4577 100644
--- a/include/asm-mips/errno.h
+++ b/include/asm-mips/errno.h
@@ -115,6 +115,10 @@
115#define EKEYREVOKED 163 /* Key has been revoked */ 115#define EKEYREVOKED 163 /* Key has been revoked */
116#define EKEYREJECTED 164 /* Key was rejected by service */ 116#define EKEYREJECTED 164 /* Key was rejected by service */
117 117
118/* for robust mutexes */
119#define EOWNERDEAD 165 /* Owner died */
120#define ENOTRECOVERABLE 166 /* State not recoverable */
121
118#define EDQUOT 1133 /* Quota exceeded */ 122#define EDQUOT 1133 /* Quota exceeded */
119 123
120#ifdef __KERNEL__ 124#ifdef __KERNEL__
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
index 8ddd3c99bcf7..a0e26e6c994d 100644
--- a/include/asm-mips/siginfo.h
+++ b/include/asm-mips/siginfo.h
@@ -11,8 +11,6 @@
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13 13
14#define SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int))
15#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE-SIGEV_HEAD_SIZE) / sizeof(int))
16#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ 14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
17 15
18#define HAVE_ARCH_SIGINFO_T 16#define HAVE_ARCH_SIGINFO_T
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
index 994987db61be..f2c470f1d369 100644
--- a/include/asm-mips/signal.h
+++ b/include/asm-mips/signal.h
@@ -98,34 +98,12 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
98#define MINSIGSTKSZ 2048 98#define MINSIGSTKSZ 2048
99#define SIGSTKSZ 8192 99#define SIGSTKSZ 8192
100 100
101#ifdef __KERNEL__
102
103/*
104 * These values of sa_flags are used only by the kernel as part of the
105 * irq handling routines.
106 *
107 * SA_INTERRUPT is also used by the irq handling routines.
108 * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
109 */
110#define SA_PROBE SA_ONESHOT
111#define SA_SAMPLE_RANDOM SA_RESTART
112#define SA_SHIRQ 0x02000000
113
114#endif /* __KERNEL__ */
115
116#define SIG_BLOCK 1 /* for blocking signals */ 101#define SIG_BLOCK 1 /* for blocking signals */
117#define SIG_UNBLOCK 2 /* for unblocking signals */ 102#define SIG_UNBLOCK 2 /* for unblocking signals */
118#define SIG_SETMASK 3 /* for setting the signal mask */ 103#define SIG_SETMASK 3 /* for setting the signal mask */
119#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: 104#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
120 set only the low 32 bit of the sigset. */ 105 set only the low 32 bit of the sigset. */
121 106#include <asm-generic/signal.h>
122/* Type of a signal handler. */
123typedef void (*__sighandler_t)(int);
124
125/* Fake signal functions */
126#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
127#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
128#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
129 107
130struct sigaction { 108struct sigaction {
131 unsigned int sa_flags; 109 unsigned int sa_flags;
diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h
index e72f6e2b4b9f..695588da41f8 100644
--- a/include/asm-parisc/bug.h
+++ b/include/asm-parisc/bug.h
@@ -1,12 +1,14 @@
1#ifndef _PARISC_BUG_H 1#ifndef _PARISC_BUG_H
2#define _PARISC_BUG_H 2#define _PARISC_BUG_H
3 3
4#ifdef CONFIG_BUG
4#define HAVE_ARCH_BUG 5#define HAVE_ARCH_BUG
5#define BUG() do { \ 6#define BUG() do { \
6 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 7 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
7 dump_stack(); \ 8 dump_stack(); \
8 panic("BUG!"); \ 9 panic("BUG!"); \
9} while (0) 10} while (0)
11#endif
10 12
11#include <asm-generic/bug.h> 13#include <asm-generic/bug.h>
12#endif 14#endif
diff --git a/include/asm-parisc/errno.h b/include/asm-parisc/errno.h
index a10f109770f1..08464c405471 100644
--- a/include/asm-parisc/errno.h
+++ b/include/asm-parisc/errno.h
@@ -115,5 +115,9 @@
115#define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ 115#define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */
116#define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */ 116#define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */
117 117
118/* for robust mutexes */
119#define EOWNERDEAD 254 /* Owner died */
120#define ENOTRECOVERABLE 255 /* State not recoverable */
121
118 122
119#endif 123#endif
diff --git a/include/asm-parisc/floppy.h b/include/asm-parisc/floppy.h
index 47f53df2cef5..ca3aed768cdc 100644
--- a/include/asm-parisc/floppy.h
+++ b/include/asm-parisc/floppy.h
@@ -235,7 +235,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
235 return 0; 235 return 0;
236} 236}
237 237
238struct fd_routine_l { 238static struct fd_routine_l {
239 int (*_request_dma)(unsigned int dmanr, const char * device_id); 239 int (*_request_dma)(unsigned int dmanr, const char * device_id);
240 void (*_free_dma)(unsigned int dmanr); 240 void (*_free_dma)(unsigned int dmanr);
241 int (*_get_dma_residue)(unsigned int dummy); 241 int (*_get_dma_residue)(unsigned int dummy);
diff --git a/include/asm-parisc/signal.h b/include/asm-parisc/signal.h
index 358f577c8eb8..25cb23ef7dd1 100644
--- a/include/asm-parisc/signal.h
+++ b/include/asm-parisc/signal.h
@@ -89,17 +89,6 @@
89#define _NSIG_BPW BITS_PER_LONG 89#define _NSIG_BPW BITS_PER_LONG
90#define _NSIG_WORDS (_NSIG / _NSIG_BPW) 90#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
91 91
92/*
93 * These values of sa_flags are used only by the kernel as part of the
94 * irq handling routines.
95 *
96 * SA_INTERRUPT is also used by the irq handling routines.
97 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
98 */
99#define SA_PROBE SA_ONESHOT
100#define SA_SAMPLE_RANDOM SA_RESTART
101#define SA_SHIRQ 0x04000000
102
103#endif /* __KERNEL__ */ 92#endif /* __KERNEL__ */
104 93
105#define SIG_BLOCK 0 /* for blocking signals */ 94#define SIG_BLOCK 0 /* for blocking signals */
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h
index 8a08423b7570..c1b5bdea53ee 100644
--- a/include/asm-parisc/uaccess.h
+++ b/include/asm-parisc/uaccess.h
@@ -24,7 +24,7 @@
24 24
25/* 25/*
26 * Note that since kernel addresses are in a separate address space on 26 * Note that since kernel addresses are in a separate address space on
27 * parisc, we don't need to do anything for access_ok() or verify_area(). 27 * parisc, we don't need to do anything for access_ok().
28 * We just let the page fault handler do the right thing. This also means 28 * We just let the page fault handler do the right thing. This also means
29 * that put_user is the same as __put_user, etc. 29 * that put_user is the same as __put_user, etc.
30 */ 30 */
diff --git a/include/asm-ppc/bug.h b/include/asm-ppc/bug.h
index e99c6cb9d618..8b34fd682b0d 100644
--- a/include/asm-ppc/bug.h
+++ b/include/asm-ppc/bug.h
@@ -14,6 +14,7 @@ struct bug_entry {
14 */ 14 */
15#define BUG_WARNING_TRAP 0x1000000 15#define BUG_WARNING_TRAP 0x1000000
16 16
17#ifdef CONFIG_BUG
17#define BUG() do { \ 18#define BUG() do { \
18 __asm__ __volatile__( \ 19 __asm__ __volatile__( \
19 "1: twi 31,0,0\n" \ 20 "1: twi 31,0,0\n" \
@@ -50,6 +51,8 @@ struct bug_entry {
50#define HAVE_ARCH_BUG 51#define HAVE_ARCH_BUG
51#define HAVE_ARCH_BUG_ON 52#define HAVE_ARCH_BUG_ON
52#define HAVE_ARCH_WARN_ON 53#define HAVE_ARCH_WARN_ON
54#endif
55
53#include <asm-generic/bug.h> 56#include <asm-generic/bug.h>
54 57
55#endif 58#endif
diff --git a/include/asm-ppc/hydra.h b/include/asm-ppc/hydra.h
index 1134431431da..833a8aff2a80 100644
--- a/include/asm-ppc/hydra.h
+++ b/include/asm-ppc/hydra.h
@@ -51,7 +51,7 @@ struct Hydra {
51 char OpenPIC[0x40000]; 51 char OpenPIC[0x40000];
52}; 52};
53 53
54extern volatile struct Hydra *Hydra; 54extern volatile struct Hydra __iomem *Hydra;
55 55
56 56
57 /* 57 /*
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h
index 78e9be619f14..ffa423456c2b 100644
--- a/include/asm-ppc/pci-bridge.h
+++ b/include/asm-ppc/pci-bridge.h
@@ -12,7 +12,7 @@ struct pci_controller;
12 * pci_io_base returns the memory address at which you can access 12 * pci_io_base returns the memory address at which you can access
13 * the I/O space for PCI bus number `bus' (or NULL on error). 13 * the I/O space for PCI bus number `bus' (or NULL on error).
14 */ 14 */
15extern void *pci_bus_io_base(unsigned int bus); 15extern void __iomem *pci_bus_io_base(unsigned int bus);
16extern unsigned long pci_bus_io_base_phys(unsigned int bus); 16extern unsigned long pci_bus_io_base_phys(unsigned int bus);
17extern unsigned long pci_bus_mem_base_phys(unsigned int bus); 17extern unsigned long pci_bus_mem_base_phys(unsigned int bus);
18 18
@@ -48,7 +48,7 @@ struct pci_controller {
48 int last_busno; 48 int last_busno;
49 int bus_offset; 49 int bus_offset;
50 50
51 void *io_base_virt; 51 void __iomem *io_base_virt;
52 unsigned long io_base_phys; 52 unsigned long io_base_phys;
53 53
54 /* Some machines (PReP) have a non 1:1 mapping of 54 /* Some machines (PReP) have a non 1:1 mapping of
diff --git a/include/asm-ppc/pmac_feature.h b/include/asm-ppc/pmac_feature.h
index 639b690ce6f7..8beb162873f4 100644
--- a/include/asm-ppc/pmac_feature.h
+++ b/include/asm-ppc/pmac_feature.h
@@ -316,6 +316,9 @@ extern void pmac_register_agp_pm(struct pci_dev *bridge,
316extern void pmac_suspend_agp_for_card(struct pci_dev *dev); 316extern void pmac_suspend_agp_for_card(struct pci_dev *dev);
317extern void pmac_resume_agp_for_card(struct pci_dev *dev); 317extern void pmac_resume_agp_for_card(struct pci_dev *dev);
318 318
319/* Used by the via-pmu driver for suspend/resume
320 */
321extern void pmac_tweak_clock_spreading(int enable);
319 322
320/* 323/*
321 * The part below is for use by macio_asic.c only, do not rely 324 * The part below is for use by macio_asic.c only, do not rely
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index e70c25f3c339..45c5e6f2b7ab 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -305,6 +305,7 @@ do { \
305#define ESR_PIL 0x08000000 /* Program Exception - Illegal */ 305#define ESR_PIL 0x08000000 /* Program Exception - Illegal */
306#define ESR_PPR 0x04000000 /* Program Exception - Priveleged */ 306#define ESR_PPR 0x04000000 /* Program Exception - Priveleged */
307#define ESR_PTR 0x02000000 /* Program Exception - Trap */ 307#define ESR_PTR 0x02000000 /* Program Exception - Trap */
308#define ESR_FP 0x01000000 /* Floating Point Operation */
308#define ESR_DST 0x00800000 /* Storage Exception - Data miss */ 309#define ESR_DST 0x00800000 /* Storage Exception - Data miss */
309#define ESR_DIZ 0x00400000 /* Storage Exception - Zone fault */ 310#define ESR_DIZ 0x00400000 /* Storage Exception - Zone fault */
310#define ESR_ST 0x00800000 /* Store Operation */ 311#define ESR_ST 0x00800000 /* Store Operation */
diff --git a/include/asm-ppc/sigcontext.h b/include/asm-ppc/sigcontext.h
index fc5e358c65f1..f82dcccdee1e 100644
--- a/include/asm-ppc/sigcontext.h
+++ b/include/asm-ppc/sigcontext.h
@@ -9,7 +9,7 @@ struct sigcontext {
9 int signal; 9 int signal;
10 unsigned long handler; 10 unsigned long handler;
11 unsigned long oldmask; 11 unsigned long oldmask;
12 struct pt_regs *regs; 12 struct pt_regs __user *regs;
13}; 13};
14 14
15#endif 15#endif
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index 8cc8b88d4edd..caf6ede3710f 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -99,34 +99,8 @@ typedef struct {
99 99
100#define MINSIGSTKSZ 2048 100#define MINSIGSTKSZ 2048
101#define SIGSTKSZ 8192 101#define SIGSTKSZ 8192
102#ifdef __KERNEL__
103
104/*
105 * These values of sa_flags are used only by the kernel as part of the
106 * irq handling routines.
107 *
108 * SA_INTERRUPT is also used by the irq handling routines.
109 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
110 */
111#define SA_PROBE SA_ONESHOT
112#define SA_SAMPLE_RANDOM SA_RESTART
113#define SA_SHIRQ 0x04000000
114#endif /* __KERNEL__ */
115
116#define SIG_BLOCK 0 /* for blocking signals */
117#define SIG_UNBLOCK 1 /* for unblocking signals */
118#define SIG_SETMASK 2 /* for setting the signal mask */
119
120/* Type of a signal handler. */
121typedef void __signalfn_t(int);
122typedef __signalfn_t __user *__sighandler_t;
123
124typedef void __restorefn_t(void);
125typedef __restorefn_t __user *__sigrestore_t;
126 102
127#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ 103#include <asm-generic/signal.h>
128#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
129#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
130 104
131struct old_sigaction { 105struct old_sigaction {
132 __sighandler_t sa_handler; 106 __sighandler_t sa_handler;
diff --git a/include/asm-ppc64/a.out.h b/include/asm-ppc64/a.out.h
index 802338efcb19..3871e252a6f1 100644
--- a/include/asm-ppc64/a.out.h
+++ b/include/asm-ppc64/a.out.h
@@ -1,8 +1,6 @@
1#ifndef __PPC64_A_OUT_H__ 1#ifndef __PPC64_A_OUT_H__
2#define __PPC64_A_OUT_H__ 2#define __PPC64_A_OUT_H__
3 3
4#include <asm/ppcdebug.h>
5
6/* 4/*
7 * c 2001 PPC 64 Team, IBM Corp 5 * c 2001 PPC 64 Team, IBM Corp
8 * 6 *
diff --git a/include/asm-ppc64/bug.h b/include/asm-ppc64/bug.h
index db31dd22233c..169868fa307d 100644
--- a/include/asm-ppc64/bug.h
+++ b/include/asm-ppc64/bug.h
@@ -26,6 +26,8 @@ struct bug_entry *find_bug(unsigned long bugaddr);
26 */ 26 */
27#define BUG_WARNING_TRAP 0x1000000 27#define BUG_WARNING_TRAP 0x1000000
28 28
29#ifdef CONFIG_BUG
30
29#define BUG() do { \ 31#define BUG() do { \
30 __asm__ __volatile__( \ 32 __asm__ __volatile__( \
31 "1: twi 31,0,0\n" \ 33 "1: twi 31,0,0\n" \
@@ -55,11 +57,12 @@ struct bug_entry *find_bug(unsigned long bugaddr);
55 "i" (__FILE__), "i" (__FUNCTION__)); \ 57 "i" (__FILE__), "i" (__FUNCTION__)); \
56} while (0) 58} while (0)
57 59
58#endif
59
60#define HAVE_ARCH_BUG 60#define HAVE_ARCH_BUG
61#define HAVE_ARCH_BUG_ON 61#define HAVE_ARCH_BUG_ON
62#define HAVE_ARCH_WARN_ON 62#define HAVE_ARCH_WARN_ON
63#endif
64#endif
65
63#include <asm-generic/bug.h> 66#include <asm-generic/bug.h>
64 67
65#endif 68#endif
diff --git a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h
index 8457d90244fb..6c42d61bedd1 100644
--- a/include/asm-ppc64/elf.h
+++ b/include/asm-ppc64/elf.h
@@ -229,9 +229,13 @@ do { \
229 229
230/* 230/*
231 * An executable for which elf_read_implies_exec() returns TRUE will 231 * An executable for which elf_read_implies_exec() returns TRUE will
232 * have the READ_IMPLIES_EXEC personality flag set automatically. 232 * have the READ_IMPLIES_EXEC personality flag set automatically. This
233 * is only required to work around bugs in old 32bit toolchains. Since
234 * the 64bit ABI has never had these issues dont enable the workaround
235 * even if we have an executable stack.
233 */ 236 */
234#define elf_read_implies_exec(ex, exec_stk) (exec_stk != EXSTACK_DISABLE_X) 237#define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \
238 (exec_stk != EXSTACK_DISABLE_X) : 0)
235 239
236#endif 240#endif
237 241
diff --git a/include/asm-ppc64/imalloc.h b/include/asm-ppc64/imalloc.h
new file mode 100644
index 000000000000..3a45e918bf16
--- /dev/null
+++ b/include/asm-ppc64/imalloc.h
@@ -0,0 +1,24 @@
1#ifndef _PPC64_IMALLOC_H
2#define _PPC64_IMALLOC_H
3
4/*
5 * Define the address range of the imalloc VM area.
6 */
7#define PHBS_IO_BASE IOREGIONBASE
8#define IMALLOC_BASE (IOREGIONBASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */
9#define IMALLOC_END (IOREGIONBASE + EADDR_MASK)
10
11
12/* imalloc region types */
13#define IM_REGION_UNUSED 0x1
14#define IM_REGION_SUBSET 0x2
15#define IM_REGION_EXISTS 0x4
16#define IM_REGION_OVERLAP 0x8
17#define IM_REGION_SUPERSET 0x10
18
19extern struct vm_struct * im_get_free_area(unsigned long size);
20extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
21 int region_type);
22unsigned long im_free(void *addr);
23
24#endif /* _PPC64_IMALLOC_H */
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index 188987e9d9d4..c78282a67d8e 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -15,19 +15,10 @@
15 15
16#include <linux/config.h> 16#include <linux/config.h>
17#include <asm/page.h> 17#include <asm/page.h>
18#include <linux/stringify.h>
19 18
20#ifndef __ASSEMBLY__ 19/*
21 20 * Segment table
22/* Time to allow for more things here */ 21 */
23typedef unsigned long mm_context_id_t;
24typedef struct {
25 mm_context_id_t id;
26#ifdef CONFIG_HUGETLB_PAGE
27 pgd_t *huge_pgdir;
28 u16 htlb_segs; /* bitmask */
29#endif
30} mm_context_t;
31 22
32#define STE_ESID_V 0x80 23#define STE_ESID_V 0x80
33#define STE_ESID_KS 0x20 24#define STE_ESID_KS 0x20
@@ -36,15 +27,48 @@ typedef struct {
36 27
37#define STE_VSID_SHIFT 12 28#define STE_VSID_SHIFT 12
38 29
39struct stab_entry { 30/* Location of cpu0's segment table */
40 unsigned long esid_data; 31#define STAB0_PAGE 0x9
41 unsigned long vsid_data; 32#define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT)
42}; 33#define STAB0_VIRT_ADDR (KERNELBASE+STAB0_PHYS_ADDR)
34
35/*
36 * SLB
37 */
43 38
44/* Hardware Page Table Entry */ 39#define SLB_NUM_BOLTED 3
40#define SLB_CACHE_ENTRIES 8
41
42/* Bits in the SLB ESID word */
43#define SLB_ESID_V ASM_CONST(0x0000000008000000) /* valid */
44
45/* Bits in the SLB VSID word */
46#define SLB_VSID_SHIFT 12
47#define SLB_VSID_KS ASM_CONST(0x0000000000000800)
48#define SLB_VSID_KP ASM_CONST(0x0000000000000400)
49#define SLB_VSID_N ASM_CONST(0x0000000000000200) /* no-execute */
50#define SLB_VSID_L ASM_CONST(0x0000000000000100) /* largepage 16M */
51#define SLB_VSID_C ASM_CONST(0x0000000000000080) /* class */
52
53#define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C)
54#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS)
55
56/*
57 * Hash table
58 */
45 59
46#define HPTES_PER_GROUP 8 60#define HPTES_PER_GROUP 8
47 61
62/* Values for PP (assumes Ks=0, Kp=1) */
63/* pp0 will always be 0 for linux */
64#define PP_RWXX 0 /* Supervisor read/write, User none */
65#define PP_RWRX 1 /* Supervisor read/write, User read */
66#define PP_RWRW 2 /* Supervisor read/write, User read/write */
67#define PP_RXRX 3 /* Supervisor read, User read */
68
69#ifndef __ASSEMBLY__
70
71/* Hardware Page Table Entry */
48typedef struct { 72typedef struct {
49 unsigned long avpn:57; /* vsid | api == avpn */ 73 unsigned long avpn:57; /* vsid | api == avpn */
50 unsigned long : 2; /* Software use */ 74 unsigned long : 2; /* Software use */
@@ -90,14 +114,6 @@ typedef struct {
90 } dw1; 114 } dw1;
91} HPTE; 115} HPTE;
92 116
93/* Values for PP (assumes Ks=0, Kp=1) */
94/* pp0 will always be 0 for linux */
95#define PP_RWXX 0 /* Supervisor read/write, User none */
96#define PP_RWRX 1 /* Supervisor read/write, User read */
97#define PP_RWRW 2 /* Supervisor read/write, User read/write */
98#define PP_RXRX 3 /* Supervisor read, User read */
99
100
101extern HPTE * htab_address; 117extern HPTE * htab_address;
102extern unsigned long htab_hash_mask; 118extern unsigned long htab_hash_mask;
103 119
@@ -174,31 +190,70 @@ extern int __hash_page(unsigned long ea, unsigned long access,
174 190
175extern void htab_finish_init(void); 191extern void htab_finish_init(void);
176 192
193extern void hpte_init_native(void);
194extern void hpte_init_lpar(void);
195extern void hpte_init_iSeries(void);
196
197extern long pSeries_lpar_hpte_insert(unsigned long hpte_group,
198 unsigned long va, unsigned long prpn,
199 int secondary, unsigned long hpteflags,
200 int bolted, int large);
201extern long native_hpte_insert(unsigned long hpte_group, unsigned long va,
202 unsigned long prpn, int secondary,
203 unsigned long hpteflags, int bolted, int large);
204
177#endif /* __ASSEMBLY__ */ 205#endif /* __ASSEMBLY__ */
178 206
179/* 207/*
180 * Location of cpu0's segment table 208 * VSID allocation
209 *
210 * We first generate a 36-bit "proto-VSID". For kernel addresses this
211 * is equal to the ESID, for user addresses it is:
212 * (context << 15) | (esid & 0x7fff)
213 *
214 * The two forms are distinguishable because the top bit is 0 for user
215 * addresses, whereas the top two bits are 1 for kernel addresses.
216 * Proto-VSIDs with the top two bits equal to 0b10 are reserved for
217 * now.
218 *
219 * The proto-VSIDs are then scrambled into real VSIDs with the
220 * multiplicative hash:
221 *
222 * VSID = (proto-VSID * VSID_MULTIPLIER) % VSID_MODULUS
223 * where VSID_MULTIPLIER = 268435399 = 0xFFFFFC7
224 * VSID_MODULUS = 2^36-1 = 0xFFFFFFFFF
225 *
226 * This scramble is only well defined for proto-VSIDs below
227 * 0xFFFFFFFFF, so both proto-VSID and actual VSID 0xFFFFFFFFF are
228 * reserved. VSID_MULTIPLIER is prime, so in particular it is
229 * co-prime to VSID_MODULUS, making this a 1:1 scrambling function.
230 * Because the modulus is 2^n-1 we can compute it efficiently without
231 * a divide or extra multiply (see below).
232 *
233 * This scheme has several advantages over older methods:
234 *
235 * - We have VSIDs allocated for every kernel address
236 * (i.e. everything above 0xC000000000000000), except the very top
237 * segment, which simplifies several things.
238 *
239 * - We allow for 15 significant bits of ESID and 20 bits of
240 * context for user addresses. i.e. 8T (43 bits) of address space for
241 * up to 1M contexts (although the page table structure and context
242 * allocation will need changes to take advantage of this).
243 *
244 * - The scramble function gives robust scattering in the hash
245 * table (at least based on some initial results). The previous
246 * method was more susceptible to pathological cases giving excessive
247 * hash collisions.
248 */
249/*
250 * WARNING - If you change these you must make sure the asm
251 * implementations in slb_allocate (slb_low.S), do_stab_bolted
252 * (head.S) and ASM_VSID_SCRAMBLE (below) are changed accordingly.
253 *
254 * You'll also need to change the precomputed VSID values in head.S
255 * which are used by the iSeries firmware.
181 */ 256 */
182#define STAB0_PAGE 0x9
183#define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT)
184#define STAB0_VIRT_ADDR (KERNELBASE+STAB0_PHYS_ADDR)
185
186#define SLB_NUM_BOLTED 3
187#define SLB_CACHE_ENTRIES 8
188
189/* Bits in the SLB ESID word */
190#define SLB_ESID_V 0x0000000008000000 /* entry is valid */
191
192/* Bits in the SLB VSID word */
193#define SLB_VSID_SHIFT 12
194#define SLB_VSID_KS 0x0000000000000800
195#define SLB_VSID_KP 0x0000000000000400
196#define SLB_VSID_N 0x0000000000000200 /* no-execute */
197#define SLB_VSID_L 0x0000000000000100 /* largepage (4M) */
198#define SLB_VSID_C 0x0000000000000080 /* class */
199
200#define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C)
201#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS)
202 257
203#define VSID_MULTIPLIER ASM_CONST(200730139) /* 28-bit prime */ 258#define VSID_MULTIPLIER ASM_CONST(200730139) /* 28-bit prime */
204#define VSID_BITS 36 259#define VSID_BITS 36
@@ -239,4 +294,50 @@ extern void htab_finish_init(void);
239 srdi rx,rx,VSID_BITS; /* extract 2^36 bit */ \ 294 srdi rx,rx,VSID_BITS; /* extract 2^36 bit */ \
240 add rt,rt,rx 295 add rt,rt,rx
241 296
297
298#ifndef __ASSEMBLY__
299
300typedef unsigned long mm_context_id_t;
301
302typedef struct {
303 mm_context_id_t id;
304#ifdef CONFIG_HUGETLB_PAGE
305 pgd_t *huge_pgdir;
306 u16 htlb_segs; /* bitmask */
307#endif
308} mm_context_t;
309
310
311static inline unsigned long vsid_scramble(unsigned long protovsid)
312{
313#if 0
314 /* The code below is equivalent to this function for arguments
315 * < 2^VSID_BITS, which is all this should ever be called
316 * with. However gcc is not clever enough to compute the
317 * modulus (2^n-1) without a second multiply. */
318 return ((protovsid * VSID_MULTIPLIER) % VSID_MODULUS);
319#else /* 1 */
320 unsigned long x;
321
322 x = protovsid * VSID_MULTIPLIER;
323 x = (x >> VSID_BITS) + (x & VSID_MODULUS);
324 return (x + ((x+1) >> VSID_BITS)) & VSID_MODULUS;
325#endif /* 1 */
326}
327
328/* This is only valid for addresses >= KERNELBASE */
329static inline unsigned long get_kernel_vsid(unsigned long ea)
330{
331 return vsid_scramble(ea >> SID_SHIFT);
332}
333
334/* This is only valid for user addresses (which are below 2^41) */
335static inline unsigned long get_vsid(unsigned long context, unsigned long ea)
336{
337 return vsid_scramble((context << USER_ESID_BITS)
338 | (ea >> SID_SHIFT));
339}
340
341#endif /* __ASSEMBLY */
342
242#endif /* _PPC64_MMU_H_ */ 343#endif /* _PPC64_MMU_H_ */
diff --git a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h
index c2e8e0466383..77a743402db4 100644
--- a/include/asm-ppc64/mmu_context.h
+++ b/include/asm-ppc64/mmu_context.h
@@ -84,86 +84,4 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
84 local_irq_restore(flags); 84 local_irq_restore(flags);
85} 85}
86 86
87/* VSID allocation
88 * ===============
89 *
90 * We first generate a 36-bit "proto-VSID". For kernel addresses this
91 * is equal to the ESID, for user addresses it is:
92 * (context << 15) | (esid & 0x7fff)
93 *
94 * The two forms are distinguishable because the top bit is 0 for user
95 * addresses, whereas the top two bits are 1 for kernel addresses.
96 * Proto-VSIDs with the top two bits equal to 0b10 are reserved for
97 * now.
98 *
99 * The proto-VSIDs are then scrambled into real VSIDs with the
100 * multiplicative hash:
101 *
102 * VSID = (proto-VSID * VSID_MULTIPLIER) % VSID_MODULUS
103 * where VSID_MULTIPLIER = 268435399 = 0xFFFFFC7
104 * VSID_MODULUS = 2^36-1 = 0xFFFFFFFFF
105 *
106 * This scramble is only well defined for proto-VSIDs below
107 * 0xFFFFFFFFF, so both proto-VSID and actual VSID 0xFFFFFFFFF are
108 * reserved. VSID_MULTIPLIER is prime, so in particular it is
109 * co-prime to VSID_MODULUS, making this a 1:1 scrambling function.
110 * Because the modulus is 2^n-1 we can compute it efficiently without
111 * a divide or extra multiply (see below).
112 *
113 * This scheme has several advantages over older methods:
114 *
115 * - We have VSIDs allocated for every kernel address
116 * (i.e. everything above 0xC000000000000000), except the very top
117 * segment, which simplifies several things.
118 *
119 * - We allow for 15 significant bits of ESID and 20 bits of
120 * context for user addresses. i.e. 8T (43 bits) of address space for
121 * up to 1M contexts (although the page table structure and context
122 * allocation will need changes to take advantage of this).
123 *
124 * - The scramble function gives robust scattering in the hash
125 * table (at least based on some initial results). The previous
126 * method was more susceptible to pathological cases giving excessive
127 * hash collisions.
128 */
129
130/*
131 * WARNING - If you change these you must make sure the asm
132 * implementations in slb_allocate(), do_stab_bolted and mmu.h
133 * (ASM_VSID_SCRAMBLE macro) are changed accordingly.
134 *
135 * You'll also need to change the precomputed VSID values in head.S
136 * which are used by the iSeries firmware.
137 */
138
139static inline unsigned long vsid_scramble(unsigned long protovsid)
140{
141#if 0
142 /* The code below is equivalent to this function for arguments
143 * < 2^VSID_BITS, which is all this should ever be called
144 * with. However gcc is not clever enough to compute the
145 * modulus (2^n-1) without a second multiply. */
146 return ((protovsid * VSID_MULTIPLIER) % VSID_MODULUS);
147#else /* 1 */
148 unsigned long x;
149
150 x = protovsid * VSID_MULTIPLIER;
151 x = (x >> VSID_BITS) + (x & VSID_MODULUS);
152 return (x + ((x+1) >> VSID_BITS)) & VSID_MODULUS;
153#endif /* 1 */
154}
155
156/* This is only valid for addresses >= KERNELBASE */
157static inline unsigned long get_kernel_vsid(unsigned long ea)
158{
159 return vsid_scramble(ea >> SID_SHIFT);
160}
161
162/* This is only valid for user addresses (which are below 2^41) */
163static inline unsigned long get_vsid(unsigned long context, unsigned long ea)
164{
165 return vsid_scramble((context << USER_ESID_BITS)
166 | (ea >> SID_SHIFT));
167}
168
169#endif /* __PPC64_MMU_CONTEXT_H */ 87#endif /* __PPC64_MMU_CONTEXT_H */
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index 20e0f19324e8..bcd21789d3b7 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -23,7 +23,6 @@
23#define PAGE_SHIFT 12 23#define PAGE_SHIFT 12
24#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) 24#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
25#define PAGE_MASK (~(PAGE_SIZE-1)) 25#define PAGE_MASK (~(PAGE_SIZE-1))
26#define PAGE_OFFSET_MASK (PAGE_SIZE-1)
27 26
28#define SID_SHIFT 28 27#define SID_SHIFT 28
29#define SID_MASK 0xfffffffffUL 28#define SID_MASK 0xfffffffffUL
@@ -85,9 +84,6 @@
85/* align addr on a size boundary - adjust address up if needed */ 84/* align addr on a size boundary - adjust address up if needed */
86#define _ALIGN(addr,size) _ALIGN_UP(addr,size) 85#define _ALIGN(addr,size) _ALIGN_UP(addr,size)
87 86
88/* to align the pointer to the (next) double word boundary */
89#define DOUBLEWORD_ALIGN(addr) _ALIGN(addr,sizeof(unsigned long))
90
91/* to align the pointer to the (next) page boundary */ 87/* to align the pointer to the (next) page boundary */
92#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) 88#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE)
93 89
@@ -100,7 +96,6 @@
100#define REGION_SIZE 4UL 96#define REGION_SIZE 4UL
101#define REGION_SHIFT 60UL 97#define REGION_SHIFT 60UL
102#define REGION_MASK (((1UL<<REGION_SIZE)-1UL)<<REGION_SHIFT) 98#define REGION_MASK (((1UL<<REGION_SIZE)-1UL)<<REGION_SHIFT)
103#define REGION_STRIDE (1UL << REGION_SHIFT)
104 99
105static __inline__ void clear_page(void *addr) 100static __inline__ void clear_page(void *addr)
106{ 101{
@@ -209,13 +204,13 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */
209#define VMALLOCBASE ASM_CONST(0xD000000000000000) 204#define VMALLOCBASE ASM_CONST(0xD000000000000000)
210#define IOREGIONBASE ASM_CONST(0xE000000000000000) 205#define IOREGIONBASE ASM_CONST(0xE000000000000000)
211 206
212#define IO_REGION_ID (IOREGIONBASE>>REGION_SHIFT) 207#define IO_REGION_ID (IOREGIONBASE >> REGION_SHIFT)
213#define VMALLOC_REGION_ID (VMALLOCBASE>>REGION_SHIFT) 208#define VMALLOC_REGION_ID (VMALLOCBASE >> REGION_SHIFT)
214#define KERNEL_REGION_ID (KERNELBASE>>REGION_SHIFT) 209#define KERNEL_REGION_ID (KERNELBASE >> REGION_SHIFT)
215#define USER_REGION_ID (0UL) 210#define USER_REGION_ID (0UL)
216#define REGION_ID(X) (((unsigned long)(X))>>REGION_SHIFT) 211#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT)
217 212
218#define __bpn_to_ba(x) ((((unsigned long)(x))<<PAGE_SHIFT) + KERNELBASE) 213#define __bpn_to_ba(x) ((((unsigned long)(x)) << PAGE_SHIFT) + KERNELBASE)
219#define __ba_to_bpn(x) ((((unsigned long)(x)) & ~REGION_MASK) >> PAGE_SHIFT) 214#define __ba_to_bpn(x) ((((unsigned long)(x)) & ~REGION_MASK) >> PAGE_SHIFT)
220 215
221#define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) 216#define __va(x) ((void *)((unsigned long)(x) + KERNELBASE))
@@ -252,10 +247,19 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */
252 247
253/* 248/*
254 * This is the default if a program doesn't have a PT_GNU_STACK 249 * This is the default if a program doesn't have a PT_GNU_STACK
255 * program header entry. 250 * program header entry. The PPC64 ELF ABI has a non executable stack
251 * stack by default, so in the absense of a PT_GNU_STACK program header
252 * we turn execute permission off.
256 */ 253 */
257#define VM_STACK_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 254#define VM_STACK_DEFAULT_FLAGS32 (VM_READ | VM_WRITE | VM_EXEC | \
258 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 255 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
256
257#define VM_STACK_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \
258 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
259
260#define VM_STACK_DEFAULT_FLAGS \
261 (test_thread_flag(TIF_32BIT) ? \
262 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
259 263
260#endif /* __KERNEL__ */ 264#endif /* __KERNEL__ */
261#endif /* _PPC64_PAGE_H */ 265#endif /* _PPC64_PAGE_H */
diff --git a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h
index 16232d740173..4fc4b739b380 100644
--- a/include/asm-ppc64/pgalloc.h
+++ b/include/asm-ppc64/pgalloc.h
@@ -27,7 +27,7 @@ pgd_free(pgd_t *pgd)
27 kmem_cache_free(zero_cache, pgd); 27 kmem_cache_free(zero_cache, pgd);
28} 28}
29 29
30#define pgd_populate(MM, PGD, PMD) pgd_set(PGD, PMD) 30#define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD)
31 31
32static inline pmd_t * 32static inline pmd_t *
33pmd_alloc_one(struct mm_struct *mm, unsigned long addr) 33pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
index a26120517c54..264c4f7993be 100644
--- a/include/asm-ppc64/pgtable.h
+++ b/include/asm-ppc64/pgtable.h
@@ -1,8 +1,6 @@
1#ifndef _PPC64_PGTABLE_H 1#ifndef _PPC64_PGTABLE_H
2#define _PPC64_PGTABLE_H 2#define _PPC64_PGTABLE_H
3 3
4#include <asm-generic/4level-fixup.h>
5
6/* 4/*
7 * This file contains the functions and defines necessary to modify and use 5 * This file contains the functions and defines necessary to modify and use
8 * the ppc64 hashed page table. 6 * the ppc64 hashed page table.
@@ -17,15 +15,7 @@
17#include <asm/tlbflush.h> 15#include <asm/tlbflush.h>
18#endif /* __ASSEMBLY__ */ 16#endif /* __ASSEMBLY__ */
19 17
20/* PMD_SHIFT determines what a second-level page table entry can map */ 18#include <asm-generic/pgtable-nopud.h>
21#define PMD_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3)
22#define PMD_SIZE (1UL << PMD_SHIFT)
23#define PMD_MASK (~(PMD_SIZE-1))
24
25/* PGDIR_SHIFT determines what a third-level page table entry can map */
26#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3) + (PAGE_SHIFT - 2))
27#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
28#define PGDIR_MASK (~(PGDIR_SIZE-1))
29 19
30/* 20/*
31 * Entries per page directory level. The PTE level must use a 64b record 21 * Entries per page directory level. The PTE level must use a 64b record
@@ -40,40 +30,30 @@
40#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) 30#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
41#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) 31#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
42 32
43#define USER_PTRS_PER_PGD (1024) 33/* PMD_SHIFT determines what a second-level page table entry can map */
44#define FIRST_USER_ADDRESS 0 34#define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE)
35#define PMD_SIZE (1UL << PMD_SHIFT)
36#define PMD_MASK (~(PMD_SIZE-1))
45 37
46#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ 38/* PGDIR_SHIFT determines what a third-level page table entry can map */
47 PGD_INDEX_SIZE + PAGE_SHIFT) 39#define PGDIR_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE)
40#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
41#define PGDIR_MASK (~(PGDIR_SIZE-1))
42
43#define FIRST_USER_ADDRESS 0
48 44
49/* 45/*
50 * Size of EA range mapped by our pagetables. 46 * Size of EA range mapped by our pagetables.
51 */ 47 */
52#define PGTABLE_EA_BITS 41 48#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
53#define PGTABLE_EA_MASK ((1UL<<PGTABLE_EA_BITS)-1) 49 PGD_INDEX_SIZE + PAGE_SHIFT)
50#define EADDR_MASK ((1UL << EADDR_SIZE) - 1)
54 51
55/* 52/*
56 * Define the address range of the vmalloc VM area. 53 * Define the address range of the vmalloc VM area.
57 */ 54 */
58#define VMALLOC_START (0xD000000000000000ul) 55#define VMALLOC_START (0xD000000000000000ul)
59#define VMALLOC_END (VMALLOC_START + PGTABLE_EA_MASK) 56#define VMALLOC_END (VMALLOC_START + EADDR_MASK)
60
61/*
62 * Define the address range of the imalloc VM area.
63 * (used for ioremap)
64 */
65#define IMALLOC_START (ioremap_bot)
66#define IMALLOC_VMADDR(x) ((unsigned long)(x))
67#define PHBS_IO_BASE (0xE000000000000000ul) /* Reserve 2 gigs for PHBs */
68#define IMALLOC_BASE (0xE000000080000000ul)
69#define IMALLOC_END (IMALLOC_BASE + PGTABLE_EA_MASK)
70
71/*
72 * Define the user address range
73 */
74#define USER_START (0UL)
75#define USER_END (USER_START + PGTABLE_EA_MASK)
76
77 57
78/* 58/*
79 * Bits in a linux-style PTE. These match the bits in the 59 * Bits in a linux-style PTE. These match the bits in the
@@ -168,10 +148,6 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
168/* shift to put page number into pte */ 148/* shift to put page number into pte */
169#define PTE_SHIFT (17) 149#define PTE_SHIFT (17)
170 150
171/* We allow 2^41 bytes of real memory, so we need 29 bits in the PMD
172 * to give the PTE page number. The bottom two bits are for flags. */
173#define PMD_TO_PTEPAGE_SHIFT (2)
174
175#ifdef CONFIG_HUGETLB_PAGE 151#ifdef CONFIG_HUGETLB_PAGE
176 152
177#ifndef __ASSEMBLY__ 153#ifndef __ASSEMBLY__
@@ -200,13 +176,14 @@ void hugetlb_mm_free_pgd(struct mm_struct *mm);
200 */ 176 */
201#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) 177#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
202 178
203#define pfn_pte(pfn,pgprot) \ 179static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
204({ \ 180{
205 pte_t pte; \ 181 pte_t pte;
206 pte_val(pte) = ((unsigned long)(pfn) << PTE_SHIFT) | \ 182
207 pgprot_val(pgprot); \ 183
208 pte; \ 184 pte_val(pte) = (pfn << PTE_SHIFT) | pgprot_val(pgprot);
209}) 185 return pte;
186}
210 187
211#define pte_modify(_pte, newprot) \ 188#define pte_modify(_pte, newprot) \
212 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))) 189 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
@@ -220,20 +197,20 @@ void hugetlb_mm_free_pgd(struct mm_struct *mm);
220#define pte_page(x) pfn_to_page(pte_pfn(x)) 197#define pte_page(x) pfn_to_page(pte_pfn(x))
221 198
222#define pmd_set(pmdp, ptep) \ 199#define pmd_set(pmdp, ptep) \
223 (pmd_val(*(pmdp)) = (__ba_to_bpn(ptep) << PMD_TO_PTEPAGE_SHIFT)) 200 (pmd_val(*(pmdp)) = __ba_to_bpn(ptep))
224#define pmd_none(pmd) (!pmd_val(pmd)) 201#define pmd_none(pmd) (!pmd_val(pmd))
225#define pmd_bad(pmd) (pmd_val(pmd) == 0) 202#define pmd_bad(pmd) (pmd_val(pmd) == 0)
226#define pmd_present(pmd) (pmd_val(pmd) != 0) 203#define pmd_present(pmd) (pmd_val(pmd) != 0)
227#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0) 204#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
228#define pmd_page_kernel(pmd) \ 205#define pmd_page_kernel(pmd) (__bpn_to_ba(pmd_val(pmd)))
229 (__bpn_to_ba(pmd_val(pmd) >> PMD_TO_PTEPAGE_SHIFT))
230#define pmd_page(pmd) virt_to_page(pmd_page_kernel(pmd)) 206#define pmd_page(pmd) virt_to_page(pmd_page_kernel(pmd))
231#define pgd_set(pgdp, pmdp) (pgd_val(*(pgdp)) = (__ba_to_bpn(pmdp))) 207
232#define pgd_none(pgd) (!pgd_val(pgd)) 208#define pud_set(pudp, pmdp) (pud_val(*(pudp)) = (__ba_to_bpn(pmdp)))
233#define pgd_bad(pgd) ((pgd_val(pgd)) == 0) 209#define pud_none(pud) (!pud_val(pud))
234#define pgd_present(pgd) (pgd_val(pgd) != 0UL) 210#define pud_bad(pud) ((pud_val(pud)) == 0UL)
235#define pgd_clear(pgdp) (pgd_val(*(pgdp)) = 0UL) 211#define pud_present(pud) (pud_val(pud) != 0UL)
236#define pgd_page(pgd) (__bpn_to_ba(pgd_val(pgd))) 212#define pud_clear(pudp) (pud_val(*(pudp)) = 0UL)
213#define pud_page(pud) (__bpn_to_ba(pud_val(pud)))
237 214
238/* 215/*
239 * Find an entry in a page-table-directory. We combine the address region 216 * Find an entry in a page-table-directory. We combine the address region
@@ -245,12 +222,13 @@ void hugetlb_mm_free_pgd(struct mm_struct *mm);
245#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) 222#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
246 223
247/* Find an entry in the second-level page table.. */ 224/* Find an entry in the second-level page table.. */
248#define pmd_offset(dir,addr) \ 225#define pmd_offset(pudp,addr) \
249 ((pmd_t *) pgd_page(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))) 226 ((pmd_t *) pud_page(*(pudp)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
250 227
251/* Find an entry in the third-level page table.. */ 228/* Find an entry in the third-level page table.. */
252#define pte_offset_kernel(dir,addr) \ 229#define pte_offset_kernel(dir,addr) \
253 ((pte_t *) pmd_page_kernel(*(dir)) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) 230 ((pte_t *) pmd_page_kernel(*(dir)) \
231 + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
254 232
255#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) 233#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
256#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr)) 234#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
@@ -264,8 +242,6 @@ void hugetlb_mm_free_pgd(struct mm_struct *mm);
264/* to find an entry in the ioremap page-table-directory */ 242/* to find an entry in the ioremap page-table-directory */
265#define pgd_offset_i(address) (ioremap_pgd + pgd_index(address)) 243#define pgd_offset_i(address) (ioremap_pgd + pgd_index(address))
266 244
267#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
268
269/* 245/*
270 * The following only work if pte_present() is true. 246 * The following only work if pte_present() is true.
271 * Undefined behaviour if not.. 247 * Undefined behaviour if not..
@@ -440,7 +416,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
440 pte_clear(mm, addr, ptep); 416 pte_clear(mm, addr, ptep);
441 flush_tlb_pending(); 417 flush_tlb_pending();
442 } 418 }
443 *ptep = __pte(pte_val(pte)) & ~_PAGE_HPTEFLAGS; 419 *ptep = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
444} 420}
445 421
446/* Set the dirty and/or accessed bits atomically in a linux PTE, this 422/* Set the dirty and/or accessed bits atomically in a linux PTE, this
@@ -485,18 +461,13 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
485 461
486extern unsigned long ioremap_bot, ioremap_base; 462extern unsigned long ioremap_bot, ioremap_base;
487 463
488#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
489#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
490
491#define pte_ERROR(e) \
492 printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
493#define pmd_ERROR(e) \ 464#define pmd_ERROR(e) \
494 printk("%s:%d: bad pmd %08x.\n", __FILE__, __LINE__, pmd_val(e)) 465 printk("%s:%d: bad pmd %08x.\n", __FILE__, __LINE__, pmd_val(e))
495#define pgd_ERROR(e) \ 466#define pgd_ERROR(e) \
496 printk("%s:%d: bad pgd %08x.\n", __FILE__, __LINE__, pgd_val(e)) 467 printk("%s:%d: bad pgd %08x.\n", __FILE__, __LINE__, pgd_val(e))
497 468
498extern pgd_t swapper_pg_dir[1024]; 469extern pgd_t swapper_pg_dir[];
499extern pgd_t ioremap_dir[1024]; 470extern pgd_t ioremap_dir[];
500 471
501extern void paging_init(void); 472extern void paging_init(void);
502 473
@@ -538,43 +509,11 @@ extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
538 */ 509 */
539#define kern_addr_valid(addr) (1) 510#define kern_addr_valid(addr) (1)
540 511
541#define io_remap_page_range(vma, vaddr, paddr, size, prot) \
542 remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
543
544#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 512#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
545 remap_pfn_range(vma, vaddr, pfn, size, prot) 513 remap_pfn_range(vma, vaddr, pfn, size, prot)
546 514
547#define MK_IOSPACE_PFN(space, pfn) (pfn)
548#define GET_IOSPACE(pfn) 0
549#define GET_PFN(pfn) (pfn)
550
551void pgtable_cache_init(void); 515void pgtable_cache_init(void);
552 516
553extern void hpte_init_native(void);
554extern void hpte_init_lpar(void);
555extern void hpte_init_iSeries(void);
556
557/* imalloc region types */
558#define IM_REGION_UNUSED 0x1
559#define IM_REGION_SUBSET 0x2
560#define IM_REGION_EXISTS 0x4
561#define IM_REGION_OVERLAP 0x8
562#define IM_REGION_SUPERSET 0x10
563
564extern struct vm_struct * im_get_free_area(unsigned long size);
565extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
566 int region_type);
567unsigned long im_free(void *addr);
568
569extern long pSeries_lpar_hpte_insert(unsigned long hpte_group,
570 unsigned long va, unsigned long prpn,
571 int secondary, unsigned long hpteflags,
572 int bolted, int large);
573
574extern long native_hpte_insert(unsigned long hpte_group, unsigned long va,
575 unsigned long prpn, int secondary,
576 unsigned long hpteflags, int bolted, int large);
577
578/* 517/*
579 * find_linux_pte returns the address of a linux pte for a given 518 * find_linux_pte returns the address of a linux pte for a given
580 * effective address and directory. If not found, it returns zero. 519 * effective address and directory. If not found, it returns zero.
@@ -582,19 +521,22 @@ extern long native_hpte_insert(unsigned long hpte_group, unsigned long va,
582static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea) 521static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
583{ 522{
584 pgd_t *pg; 523 pgd_t *pg;
524 pud_t *pu;
585 pmd_t *pm; 525 pmd_t *pm;
586 pte_t *pt = NULL; 526 pte_t *pt = NULL;
587 pte_t pte; 527 pte_t pte;
588 528
589 pg = pgdir + pgd_index(ea); 529 pg = pgdir + pgd_index(ea);
590 if (!pgd_none(*pg)) { 530 if (!pgd_none(*pg)) {
591 531 pu = pud_offset(pg, ea);
592 pm = pmd_offset(pg, ea); 532 if (!pud_none(*pu)) {
593 if (pmd_present(*pm)) { 533 pm = pmd_offset(pu, ea);
594 pt = pte_offset_kernel(pm, ea); 534 if (pmd_present(*pm)) {
595 pte = *pt; 535 pt = pte_offset_kernel(pm, ea);
596 if (!pte_present(pte)) 536 pte = *pt;
597 pt = NULL; 537 if (!pte_present(pte))
538 pt = NULL;
539 }
598 } 540 }
599 } 541 }
600 542
diff --git a/include/asm-ppc64/signal.h b/include/asm-ppc64/signal.h
index fe5401adb41b..432df7dd355d 100644
--- a/include/asm-ppc64/signal.h
+++ b/include/asm-ppc64/signal.h
@@ -96,47 +96,20 @@ typedef struct {
96 96
97#define MINSIGSTKSZ 2048 97#define MINSIGSTKSZ 2048
98#define SIGSTKSZ 8192 98#define SIGSTKSZ 8192
99#ifdef __KERNEL__
100 99
101/* 100#include <asm-generic/signal.h>
102 * These values of sa_flags are used only by the kernel as part of the
103 * irq handling routines.
104 *
105 * SA_INTERRUPT is also used by the irq handling routines.
106 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
107 */
108#define SA_PROBE SA_ONESHOT
109#define SA_SAMPLE_RANDOM SA_RESTART
110#define SA_SHIRQ 0x04000000
111#endif
112
113#define SIG_BLOCK 0 /* for blocking signals */
114#define SIG_UNBLOCK 1 /* for unblocking signals */
115#define SIG_SETMASK 2 /* for setting the signal mask */
116
117/* Type of a signal handler. */
118typedef void __sigfunction(int);
119typedef __sigfunction __user * __sighandler_t;
120
121/* Type of the restorer function */
122typedef void __sigrestorer(void);
123typedef __sigrestorer __user * __sigrestorer_t;
124
125#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
126#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
127#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
128 101
129struct old_sigaction { 102struct old_sigaction {
130 __sighandler_t sa_handler; 103 __sighandler_t sa_handler;
131 old_sigset_t sa_mask; 104 old_sigset_t sa_mask;
132 unsigned long sa_flags; 105 unsigned long sa_flags;
133 __sigrestorer_t sa_restorer; 106 __sigrestore_t sa_restorer;
134}; 107};
135 108
136struct sigaction { 109struct sigaction {
137 __sighandler_t sa_handler; 110 __sighandler_t sa_handler;
138 unsigned long sa_flags; 111 unsigned long sa_flags;
139 __sigrestorer_t sa_restorer; 112 __sigrestore_t sa_restorer;
140 sigset_t sa_mask; /* mask last for extensibility */ 113 sigset_t sa_mask; /* mask last for extensibility */
141}; 114};
142 115
diff --git a/include/asm-ppc64/spinlock.h b/include/asm-ppc64/spinlock.h
index a9b2a1162cf7..acd11564dd75 100644
--- a/include/asm-ppc64/spinlock.h
+++ b/include/asm-ppc64/spinlock.h
@@ -110,7 +110,7 @@ static void __inline__ _raw_spin_lock(spinlock_t *lock)
110 HMT_low(); 110 HMT_low();
111 if (SHARED_PROCESSOR) 111 if (SHARED_PROCESSOR)
112 __spin_yield(lock); 112 __spin_yield(lock);
113 } while (likely(lock->lock != 0)); 113 } while (unlikely(lock->lock != 0));
114 HMT_medium(); 114 HMT_medium();
115 } 115 }
116} 116}
@@ -128,7 +128,7 @@ static void __inline__ _raw_spin_lock_flags(spinlock_t *lock, unsigned long flag
128 HMT_low(); 128 HMT_low();
129 if (SHARED_PROCESSOR) 129 if (SHARED_PROCESSOR)
130 __spin_yield(lock); 130 __spin_yield(lock);
131 } while (likely(lock->lock != 0)); 131 } while (unlikely(lock->lock != 0));
132 HMT_medium(); 132 HMT_medium();
133 local_irq_restore(flags_dis); 133 local_irq_restore(flags_dis);
134 } 134 }
@@ -194,7 +194,7 @@ static void __inline__ _raw_read_lock(rwlock_t *rw)
194 HMT_low(); 194 HMT_low();
195 if (SHARED_PROCESSOR) 195 if (SHARED_PROCESSOR)
196 __rw_yield(rw); 196 __rw_yield(rw);
197 } while (likely(rw->lock < 0)); 197 } while (unlikely(rw->lock < 0));
198 HMT_medium(); 198 HMT_medium();
199 } 199 }
200} 200}
@@ -251,7 +251,7 @@ static void __inline__ _raw_write_lock(rwlock_t *rw)
251 HMT_low(); 251 HMT_low();
252 if (SHARED_PROCESSOR) 252 if (SHARED_PROCESSOR)
253 __rw_yield(rw); 253 __rw_yield(rw);
254 } while (likely(rw->lock != 0)); 254 } while (unlikely(rw->lock != 0));
255 HMT_medium(); 255 HMT_medium();
256 } 256 }
257} 257}
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h
index 0027da4364ac..fdec5e7a7af6 100644
--- a/include/asm-ppc64/xics.h
+++ b/include/asm-ppc64/xics.h
@@ -30,7 +30,4 @@ struct xics_ipi_struct {
30 30
31extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; 31extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
32 32
33extern unsigned int default_distrib_server;
34extern unsigned int interrupt_server_size;
35
36#endif /* _PPC64_KERNEL_XICS_H */ 33#endif /* _PPC64_KERNEL_XICS_H */
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h
index 2b8d6d4dffcf..a2e7430aafa6 100644
--- a/include/asm-s390/bug.h
+++ b/include/asm-s390/bug.h
@@ -3,12 +3,15 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5 5
6#ifdef CONFIG_BUG
6#define BUG() do { \ 7#define BUG() do { \
7 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 8 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
8 __asm__ __volatile__(".long 0"); \ 9 __asm__ __volatile__(".long 0"); \
9} while (0) 10} while (0)
10 11
11#define HAVE_ARCH_BUG 12#define HAVE_ARCH_BUG
13#endif
14
12#include <asm-generic/bug.h> 15#include <asm-generic/bug.h>
13 16
14#endif 17#endif
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h
index 1bfe2bd630b5..dae1dd4fb937 100644
--- a/include/asm-s390/cmb.h
+++ b/include/asm-s390/cmb.h
@@ -52,7 +52,7 @@ struct cmbdata {
52#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) 52#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata)
53 53
54#ifdef __KERNEL__ 54#ifdef __KERNEL__
55 55struct ccw_device;
56/** 56/**
57 * enable_cmf() - switch on the channel measurement for a specific device 57 * enable_cmf() - switch on the channel measurement for a specific device
58 * @cdev: The ccw device to be enabled 58 * @cdev: The ccw device to be enabled
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 28ef2354b1b2..6bbcdea42a86 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -43,7 +43,7 @@ struct __debug_entry{
43#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */ 43#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */
44#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */ 44#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */
45#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */ 45#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */
46#define DEBUG_MAX_PROCF_LEN 16 /* max length for a proc file name */ 46#define DEBUG_MAX_PROCF_LEN 64 /* max length for a proc file name */
47#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */ 47#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */
48 48
49#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */ 49#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 614e2a93c703..2be287b9df88 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -16,6 +16,8 @@
16#define PAGE_SHIFT 12 16#define PAGE_SHIFT 12
17#define PAGE_SIZE (1UL << PAGE_SHIFT) 17#define PAGE_SIZE (1UL << PAGE_SHIFT)
18#define PAGE_MASK (~(PAGE_SIZE-1)) 18#define PAGE_MASK (~(PAGE_SIZE-1))
19#define PAGE_DEFAULT_ACC 0
20#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
19 21
20#ifdef __KERNEL__ 22#ifdef __KERNEL__
21#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 88c272ca48bf..fb46e9090b50 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -245,7 +245,7 @@ static inline void enabled_wait(void)
245 psw_t wait_psw; 245 psw_t wait_psw;
246 246
247 wait_psw.mask = PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT | 247 wait_psw.mask = PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
248 PSW_MASK_MCHECK | PSW_MASK_WAIT; 248 PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY;
249#ifndef __s390x__ 249#ifndef __s390x__
250 asm volatile ( 250 asm volatile (
251 " basr %0,0\n" 251 " basr %0,0\n"
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 1dc80666e97e..4eff8f2e3bf1 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -185,6 +185,7 @@
185#include <linux/stddef.h> 185#include <linux/stddef.h>
186#include <linux/types.h> 186#include <linux/types.h>
187#include <asm/setup.h> 187#include <asm/setup.h>
188#include <asm/page.h>
188 189
189typedef union 190typedef union
190{ 191{
@@ -235,6 +236,7 @@ typedef struct
235#define PSW_ADDR_INSN 0x7FFFFFFFUL 236#define PSW_ADDR_INSN 0x7FFFFFFFUL
236 237
237#define PSW_BASE_BITS 0x00080000UL 238#define PSW_BASE_BITS 0x00080000UL
239#define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20)
238 240
239#define PSW_ASC_PRIMARY 0x00000000UL 241#define PSW_ASC_PRIMARY 0x00000000UL
240#define PSW_ASC_ACCREG 0x00004000UL 242#define PSW_ASC_ACCREG 0x00004000UL
@@ -260,6 +262,7 @@ typedef struct
260 262
261#define PSW_BASE_BITS 0x0000000180000000UL 263#define PSW_BASE_BITS 0x0000000180000000UL
262#define PSW_BASE32_BITS 0x0000000080000000UL 264#define PSW_BASE32_BITS 0x0000000080000000UL
265#define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52)
263 266
264#define PSW_ASC_PRIMARY 0x0000000000000000UL 267#define PSW_ASC_PRIMARY 0x0000000000000000UL
265#define PSW_ASC_ACCREG 0x0000400000000000UL 268#define PSW_ASC_ACCREG 0x0000400000000000UL
@@ -268,14 +271,15 @@ typedef struct
268 271
269#define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 272#define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
270 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ 273 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
271 PSW_MASK_PSTATE) 274 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
272 275
273#endif /* __s390x__ */ 276#endif /* __s390x__ */
274 277
275#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY) 278#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \
279 PSW_DEFAULT_KEY)
276#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 280#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
277 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ 281 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
278 PSW_MASK_PSTATE) 282 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
279 283
280/* This macro merges a NEW PSW mask specified by the user into 284/* This macro merges a NEW PSW mask specified by the user into
281 the currently active PSW mask CURRENT, modifying only those 285 the currently active PSW mask CURRENT, modifying only those
@@ -470,6 +474,12 @@ struct user_regs_struct
470extern void show_regs(struct pt_regs * regs); 474extern void show_regs(struct pt_regs * regs);
471#endif 475#endif
472 476
477static inline void
478psw_set_key(unsigned int key)
479{
480 asm volatile ( "spka 0(%0)" : : "d" (key) );
481}
482
473#endif /* __ASSEMBLY__ */ 483#endif /* __ASSEMBLY__ */
474 484
475#endif /* _S390_PTRACE_H */ 485#endif /* _S390_PTRACE_H */
diff --git a/include/asm-s390/siginfo.h b/include/asm-s390/siginfo.h
index 72303537b732..e0ff1ab054be 100644
--- a/include/asm-s390/siginfo.h
+++ b/include/asm-s390/siginfo.h
@@ -13,12 +13,6 @@
13#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 13#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
14#endif 14#endif
15 15
16#ifdef CONFIG_ARCH_S390X
17#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
18#else
19#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
20#endif
21
22#include <asm-generic/siginfo.h> 16#include <asm-generic/siginfo.h>
23 17
24#endif 18#endif
diff --git a/include/asm-s390/signal.h b/include/asm-s390/signal.h
index f273cdcd1cf6..3d6e11c6c1fd 100644
--- a/include/asm-s390/signal.h
+++ b/include/asm-s390/signal.h
@@ -117,30 +117,7 @@ typedef unsigned long sigset_t;
117#define MINSIGSTKSZ 2048 117#define MINSIGSTKSZ 2048
118#define SIGSTKSZ 8192 118#define SIGSTKSZ 8192
119 119
120#ifdef __KERNEL__ 120#include <asm-generic/signal.h>
121
122/*
123 * These values of sa_flags are used only by the kernel as part of the
124 * irq handling routines.
125 *
126 * SA_INTERRUPT is also used by the irq handling routines.
127 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
128 */
129#define SA_PROBE SA_ONESHOT
130#define SA_SAMPLE_RANDOM SA_RESTART
131#define SA_SHIRQ 0x04000000
132#endif
133
134#define SIG_BLOCK 0 /* for blocking signals */
135#define SIG_UNBLOCK 1 /* for unblocking signals */
136#define SIG_SETMASK 2 /* for setting the signal mask */
137
138/* Type of a signal handler. */
139typedef void (*__sighandler_t)(int);
140
141#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
142#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
143#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
144 121
145#ifdef __KERNEL__ 122#ifdef __KERNEL__
146struct old_sigaction { 123struct old_sigaction {
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
index 70172217140f..70508a360cd6 100644
--- a/include/asm-sh/bug.h
+++ b/include/asm-sh/bug.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_BUG
6/* 7/*
7 * Tell the user there is some problem. 8 * Tell the user there is some problem.
8 */ 9 */
@@ -12,6 +13,8 @@
12} while (0) 13} while (0)
13 14
14#define HAVE_ARCH_BUG 15#define HAVE_ARCH_BUG
16#endif
17
15#include <asm-generic/bug.h> 18#include <asm-generic/bug.h>
16 19
17#endif 20#endif
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
index 5113c7f8a739..5ebd0f24299e 100644
--- a/include/asm-sh/checksum.h
+++ b/include/asm-sh/checksum.h
@@ -42,7 +42,7 @@ asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsi
42 * passed in an incorrect kernel address to one of these functions. 42 * passed in an incorrect kernel address to one of these functions.
43 * 43 *
44 * If you use these functions directly please don't forget the 44 * If you use these functions directly please don't forget the
45 * verify_area(). 45 * access_ok().
46 */ 46 */
47static __inline__ 47static __inline__
48unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, 48unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst,
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h
index f030ca08052b..38d7a2942476 100644
--- a/include/asm-sh/floppy.h
+++ b/include/asm-sh/floppy.h
@@ -227,7 +227,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
227 return 0; 227 return 0;
228} 228}
229 229
230struct fd_routine_l { 230static struct fd_routine_l {
231 int (*_request_dma)(unsigned int dmanr, const char * device_id); 231 int (*_request_dma)(unsigned int dmanr, const char * device_id);
232 void (*_free_dma)(unsigned int dmanr); 232 void (*_free_dma)(unsigned int dmanr);
233 int (*_get_dma_residue)(unsigned int dummy); 233 int (*_get_dma_residue)(unsigned int dummy);
diff --git a/include/asm-sh/signal.h b/include/asm-sh/signal.h
index 0a7ff717c245..d6e8eb0e65c7 100644
--- a/include/asm-sh/signal.h
+++ b/include/asm-sh/signal.h
@@ -108,30 +108,7 @@ typedef unsigned long sigset_t;
108#define MINSIGSTKSZ 2048 108#define MINSIGSTKSZ 2048
109#define SIGSTKSZ 8192 109#define SIGSTKSZ 8192
110 110
111#ifdef __KERNEL__ 111#include <asm-generic/signal.h>
112
113/*
114 * These values of sa_flags are used only by the kernel as part of the
115 * irq handling routines.
116 *
117 * SA_INTERRUPT is also used by the irq handling routines.
118 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
119 */
120#define SA_PROBE SA_ONESHOT
121#define SA_SAMPLE_RANDOM SA_RESTART
122#define SA_SHIRQ 0x04000000
123#endif
124
125#define SIG_BLOCK 0 /* for blocking signals */
126#define SIG_UNBLOCK 1 /* for unblocking signals */
127#define SIG_SETMASK 2 /* for setting the signal mask */
128
129/* Type of a signal handler. */
130typedef void (*__sighandler_t)(int);
131
132#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
133#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
134#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
135 112
136#ifdef __KERNEL__ 113#ifdef __KERNEL__
137struct old_sigaction { 114struct old_sigaction {
diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h
index 3acd54d59566..5d659ec28e10 100644
--- a/include/asm-sh64/bug.h
+++ b/include/asm-sh64/bug.h
@@ -17,10 +17,6 @@
17 BUG(); \ 17 BUG(); \
18} while(0) 18} while(0)
19 19
20#define PAGE_BUG(page) do { \
21 BUG(); \
22} while (0)
23
24#define WARN_ON(condition) do { \ 20#define WARN_ON(condition) do { \
25 if (unlikely((condition)!=0)) { \ 21 if (unlikely((condition)!=0)) { \
26 printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ 22 printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
diff --git a/include/asm-sh64/checksum.h b/include/asm-sh64/checksum.h
index aa3911a99490..fd034e9ae6e3 100644
--- a/include/asm-sh64/checksum.h
+++ b/include/asm-sh64/checksum.h
@@ -34,7 +34,7 @@ asmlinkage unsigned int csum_partial(const unsigned char *buff, int len,
34 * passed in an incorrect kernel address to one of these functions. 34 * passed in an incorrect kernel address to one of these functions.
35 * 35 *
36 * If you use these functions directly please don't forget the 36 * If you use these functions directly please don't forget the
37 * verify_area(). 37 * access_ok().
38 */ 38 */
39 39
40 40
diff --git a/include/asm-sh64/signal.h b/include/asm-sh64/signal.h
index 77957e9b92d9..2400dc688a65 100644
--- a/include/asm-sh64/signal.h
+++ b/include/asm-sh64/signal.h
@@ -107,30 +107,7 @@ typedef struct {
107#define MINSIGSTKSZ 2048 107#define MINSIGSTKSZ 2048
108#define SIGSTKSZ THREAD_SIZE 108#define SIGSTKSZ THREAD_SIZE
109 109
110#ifdef __KERNEL__ 110#include <asm-generic/signal.h>
111
112/*
113 * These values of sa_flags are used only by the kernel as part of the
114 * irq handling routines.
115 *
116 * SA_INTERRUPT is also used by the irq handling routines.
117 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
118 */
119#define SA_PROBE SA_ONESHOT
120#define SA_SAMPLE_RANDOM SA_RESTART
121#define SA_SHIRQ 0x04000000
122#endif
123
124#define SIG_BLOCK 0 /* for blocking signals */
125#define SIG_UNBLOCK 1 /* for unblocking signals */
126#define SIG_SETMASK 2 /* for setting the signal mask */
127
128/* Type of a signal handler. */
129typedef void (*__sighandler_t)(int);
130
131#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
132#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
133#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
134 111
135#ifdef __KERNEL__ 112#ifdef __KERNEL__
136struct old_sigaction { 113struct old_sigaction {
diff --git a/include/asm-sparc/bug.h b/include/asm-sparc/bug.h
index 0d30a67d87a3..04151208189f 100644
--- a/include/asm-sparc/bug.h
+++ b/include/asm-sparc/bug.h
@@ -1,6 +1,7 @@
1#ifndef _SPARC_BUG_H 1#ifndef _SPARC_BUG_H
2#define _SPARC_BUG_H 2#define _SPARC_BUG_H
3 3
4#ifdef CONFIG_BUG
4/* Only use the inline asm until a gcc release that can handle __builtin_trap 5/* Only use the inline asm until a gcc release that can handle __builtin_trap
5 * -rob 2003-06-25 6 * -rob 2003-06-25
6 * 7 *
@@ -26,6 +27,8 @@ extern void do_BUG(const char *file, int line);
26#endif 27#endif
27 28
28#define HAVE_ARCH_BUG 29#define HAVE_ARCH_BUG
30#endif
31
29#include <asm-generic/bug.h> 32#include <asm-generic/bug.h>
30 33
31#endif 34#endif
diff --git a/include/asm-sparc/errno.h b/include/asm-sparc/errno.h
index 8c01c5f3b06d..ed41c8bac1fa 100644
--- a/include/asm-sparc/errno.h
+++ b/include/asm-sparc/errno.h
@@ -107,4 +107,8 @@
107#define EKEYREVOKED 130 /* Key has been revoked */ 107#define EKEYREVOKED 130 /* Key has been revoked */
108#define EKEYREJECTED 131 /* Key was rejected by service */ 108#define EKEYREJECTED 131 /* Key was rejected by service */
109 109
110/* for robust mutexes */
111#define EOWNERDEAD 132 /* Owner died */
112#define ENOTRECOVERABLE 133 /* State not recoverable */
113
110#endif 114#endif
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index 780ee7ff9dc3..caf926116506 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -227,7 +227,7 @@ static __inline__ void sun_fd_disable_dma(void)
227 doing_pdma = 0; 227 doing_pdma = 0;
228 if (pdma_base) { 228 if (pdma_base) {
229 mmu_unlockarea(pdma_base, pdma_areasize); 229 mmu_unlockarea(pdma_base, pdma_areasize);
230 pdma_base = 0; 230 pdma_base = NULL;
231 } 231 }
232} 232}
233 233
diff --git a/include/asm-sparc/mxcc.h b/include/asm-sparc/mxcc.h
index efe4e843122d..60ef9d6fe7bc 100644
--- a/include/asm-sparc/mxcc.h
+++ b/include/asm-sparc/mxcc.h
@@ -115,8 +115,8 @@ extern __inline__ unsigned long mxcc_get_creg(void)
115{ 115{
116 unsigned long mxcc_control; 116 unsigned long mxcc_control;
117 117
118 __asm__ __volatile__("set -1, %%g2\n\t" 118 __asm__ __volatile__("set 0xffffffff, %%g2\n\t"
119 "set -1, %%g3\n\t" 119 "set 0xffffffff, %%g3\n\t"
120 "stda %%g2, [%1] %2\n\t" 120 "stda %%g2, [%1] %2\n\t"
121 "lda [%3] %2, %0\n\t" : 121 "lda [%3] %2, %0\n\t" :
122 "=r" (mxcc_control) : 122 "=r" (mxcc_control) :
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index d8211cb6e6b4..aa9960ad0ca9 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -143,7 +143,6 @@ struct sigstack {
143#define SA_ONESHOT _SV_RESET 143#define SA_ONESHOT _SV_RESET
144#define SA_INTERRUPT 0x10u 144#define SA_INTERRUPT 0x10u
145#define SA_NOMASK 0x20u 145#define SA_NOMASK 0x20u
146#define SA_SHIRQ 0x40u
147#define SA_NOCLDWAIT 0x100u 146#define SA_NOCLDWAIT 0x100u
148#define SA_SIGINFO 0x200u 147#define SA_SIGINFO 0x200u
149 148
@@ -162,11 +161,6 @@ struct sigstack {
162 161
163#ifdef __KERNEL__ 162#ifdef __KERNEL__
164/* 163/*
165 * These values of sa_flags are used only by the kernel as part of the
166 * irq handling routines.
167 *
168 * SA_INTERRUPT is also used by the irq handling routines.
169 *
170 * DJHR 164 * DJHR
171 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this 165 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
172 * interrupt handler's irq structure should be statically allocated 166 * interrupt handler's irq structure should be statically allocated
@@ -177,21 +171,10 @@ struct sigstack {
177 * statically allocated data.. which is NOT GOOD. 171 * statically allocated data.. which is NOT GOOD.
178 * 172 *
179 */ 173 */
180#define SA_PROBE SA_ONESHOT
181#define SA_SAMPLE_RANDOM SA_RESTART
182#define SA_STATIC_ALLOC 0x80 174#define SA_STATIC_ALLOC 0x80
183#endif 175#endif
184 176
185/* Type of a signal handler. */ 177#include <asm-generic/signal.h>
186#ifdef __KERNEL__
187typedef void (*__sighandler_t)(int, int, struct sigcontext *, char *);
188#else
189typedef void (*__sighandler_t)(int);
190#endif
191
192#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
193#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
194#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
195 178
196#ifdef __KERNEL__ 179#ifdef __KERNEL__
197struct __new_sigaction { 180struct __new_sigaction {
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index 3f47889883b7..f461144067ee 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -18,7 +18,7 @@
18 18
19#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
20 20
21/* Sparc is not segmented, however we need to be able to fool verify_area() 21/* Sparc is not segmented, however we need to be able to fool access_ok()
22 * when doing system calls from kernel mode legitimately. 22 * when doing system calls from kernel mode legitimately.
23 * 23 *
24 * "For historical reasons, these macros are grossly misnamed." -Linus 24 * "For historical reasons, these macros are grossly misnamed." -Linus
diff --git a/include/asm-sparc64/bug.h b/include/asm-sparc64/bug.h
index 25c5b1dfe378..516bb27f3fc4 100644
--- a/include/asm-sparc64/bug.h
+++ b/include/asm-sparc64/bug.h
@@ -1,6 +1,7 @@
1#ifndef _SPARC64_BUG_H 1#ifndef _SPARC64_BUG_H
2#define _SPARC64_BUG_H 2#define _SPARC64_BUG_H
3 3
4#ifdef CONFIG_BUG
4#include <linux/compiler.h> 5#include <linux/compiler.h>
5 6
6#ifdef CONFIG_DEBUG_BUGVERBOSE 7#ifdef CONFIG_DEBUG_BUGVERBOSE
@@ -14,6 +15,8 @@ extern void do_BUG(const char *file, int line);
14#endif 15#endif
15 16
16#define HAVE_ARCH_BUG 17#define HAVE_ARCH_BUG
18#endif
19
17#include <asm-generic/bug.h> 20#include <asm-generic/bug.h>
18 21
19#endif 22#endif
diff --git a/include/asm-sparc64/errno.h b/include/asm-sparc64/errno.h
index cc98a73b55a7..ea3509ee1b0b 100644
--- a/include/asm-sparc64/errno.h
+++ b/include/asm-sparc64/errno.h
@@ -107,4 +107,8 @@
107#define EKEYREVOKED 130 /* Key has been revoked */ 107#define EKEYREVOKED 130 /* Key has been revoked */
108#define EKEYREJECTED 131 /* Key was rejected by service */ 108#define EKEYREJECTED 131 /* Key was rejected by service */
109 109
110/* for robust mutexes */
111#define EOWNERDEAD 132 /* Owner died */
112#define ENOTRECOVERABLE 133 /* State not recoverable */
113
110#endif /* !(_SPARC64_ERRNO_H) */ 114#endif /* !(_SPARC64_ERRNO_H) */
diff --git a/include/asm-sparc64/mostek.h b/include/asm-sparc64/mostek.h
index ccf2f5f82d7f..09b5aba6678a 100644
--- a/include/asm-sparc64/mostek.h
+++ b/include/asm-sparc64/mostek.h
@@ -38,7 +38,7 @@
38 * 38 *
39 * We now deal with physical addresses for I/O to the chip. -DaveM 39 * We now deal with physical addresses for I/O to the chip. -DaveM
40 */ 40 */
41static __inline__ u8 mostek_read(unsigned long addr) 41static __inline__ u8 mostek_read(void __iomem *addr)
42{ 42{
43 u8 ret; 43 u8 ret;
44 44
@@ -48,7 +48,7 @@ static __inline__ u8 mostek_read(unsigned long addr)
48 return ret; 48 return ret;
49} 49}
50 50
51static __inline__ void mostek_write(unsigned long addr, u8 val) 51static __inline__ void mostek_write(void __iomem *addr, u8 val)
52{ 52{
53 __asm__ __volatile__("stba %0, [%1] %2" 53 __asm__ __volatile__("stba %0, [%1] %2"
54 : /* no outputs */ 54 : /* no outputs */
@@ -67,7 +67,7 @@ static __inline__ void mostek_write(unsigned long addr, u8 val)
67#define MOSTEK_YEAR 0x07ffUL 67#define MOSTEK_YEAR 0x07ffUL
68 68
69extern spinlock_t mostek_lock; 69extern spinlock_t mostek_lock;
70extern unsigned long mstk48t02_regs; 70extern void __iomem *mstk48t02_regs;
71 71
72/* Control register values. */ 72/* Control register values. */
73#define MSTK_CREG_WRITE 0x80 /* Must set this before placing values. */ 73#define MSTK_CREG_WRITE 0x80 /* Must set this before placing values. */
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index ab88349ddadc..b7e635544cec 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -13,6 +13,12 @@
13 13
14#define PARPORT_PC_MAX_PORTS PARPORT_MAX 14#define PARPORT_PC_MAX_PORTS PARPORT_MAX
15 15
16/*
17 * While sparc64 doesn't have an ISA DMA API, we provide something that looks
18 * close enough to make parport_pc happy
19 */
20#define HAS_DMA
21
16static struct sparc_ebus_info { 22static struct sparc_ebus_info {
17 struct ebus_dma_info info; 23 struct ebus_dma_info info;
18 unsigned int addr; 24 unsigned int addr;
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 2c28e1f605b7..b9b1914aae63 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -122,17 +122,12 @@ static __inline__ void free_pmd_slow(pmd_t *pmd)
122#define pmd_populate(MM,PMD,PTE_PAGE) \ 122#define pmd_populate(MM,PMD,PTE_PAGE) \
123 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) 123 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE))
124 124
125extern pte_t *__pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address); 125extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address);
126
127static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
128{
129 return __pte_alloc_one_kernel(mm, address);
130}
131 126
132static inline struct page * 127static inline struct page *
133pte_alloc_one(struct mm_struct *mm, unsigned long addr) 128pte_alloc_one(struct mm_struct *mm, unsigned long addr)
134{ 129{
135 pte_t *pte = __pte_alloc_one_kernel(mm, addr); 130 pte_t *pte = pte_alloc_one_kernel(mm, addr);
136 131
137 if (pte) 132 if (pte)
138 return virt_to_page(pte); 133 return virt_to_page(pte);
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index af9bf175a223..ae2cd5b09a7c 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -416,6 +416,11 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
416 unsigned long pfn, 416 unsigned long pfn,
417 unsigned long size, pgprot_t prot); 417 unsigned long size, pgprot_t prot);
418 418
419/* Clear virtual and physical cachability, set side-effect bit. */
420#define pgprot_noncached(prot) \
421 (__pgprot((pgprot_val(prot) & ~(_PAGE_CP | _PAGE_CV)) | \
422 _PAGE_E))
423
419/* 424/*
420 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in 425 * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
421 * its high 4 bits. These macros/functions put it there or get it from there. 426 * its high 4 bits. These macros/functions put it there or get it from there.
diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
index 7160449e7cab..df17e47abc1c 100644
--- a/include/asm-sparc64/siginfo.h
+++ b/include/asm-sparc64/siginfo.h
@@ -3,8 +3,6 @@
3 3
4#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 4#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
5 5
6#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
7
8#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 6#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
9#define __ARCH_SI_TRAPNO 7#define __ARCH_SI_TRAPNO
10#define __ARCH_SI_BAND_T int 8#define __ARCH_SI_BAND_T int
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 6428e366c38c..becdf1bc5924 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -145,7 +145,6 @@ struct sigstack {
145#define SA_ONESHOT _SV_RESET 145#define SA_ONESHOT _SV_RESET
146#define SA_INTERRUPT 0x10u 146#define SA_INTERRUPT 0x10u
147#define SA_NOMASK 0x20u 147#define SA_NOMASK 0x20u
148#define SA_SHIRQ 0x40u
149#define SA_NOCLDWAIT 0x100u 148#define SA_NOCLDWAIT 0x100u
150#define SA_SIGINFO 0x200u 149#define SA_SIGINFO 0x200u
151 150
@@ -165,11 +164,6 @@ struct sigstack {
165 164
166#ifdef __KERNEL__ 165#ifdef __KERNEL__
167/* 166/*
168 * These values of sa_flags are used only by the kernel as part of the
169 * irq handling routines.
170 *
171 * SA_INTERRUPT is also used by the irq handling routines.
172 *
173 * DJHR 167 * DJHR
174 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this 168 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
175 * interrupt handler's irq structure should be statically allocated 169 * interrupt handler's irq structure should be statically allocated
@@ -180,26 +174,10 @@ struct sigstack {
180 * statically allocated data.. which is NOT GOOD. 174 * statically allocated data.. which is NOT GOOD.
181 * 175 *
182 */ 176 */
183#define SA_PROBE SA_ONESHOT
184#define SA_SAMPLE_RANDOM SA_RESTART
185#define SA_STATIC_ALLOC 0x80 177#define SA_STATIC_ALLOC 0x80
186#endif 178#endif
187 179
188/* Type of a signal handler. */ 180#include <asm-generic/signal.h>
189#ifdef __KERNEL__
190typedef void __signalfn_t(int);
191typedef __signalfn_t __user *__sighandler_t;
192
193typedef void __restorefn_t(void);
194typedef __restorefn_t __user *__sigrestore_t;
195#else
196typedef void (*__sighandler_t)(int);
197typedef void (*__sigrestore_t)(void);
198#endif
199
200#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
201#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
202#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
203 181
204struct __new_sigaction { 182struct __new_sigaction {
205 __sighandler_t sa_handler; 183 __sighandler_t sa_handler;
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index d1f91a4f24ae..db7581bdb531 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -44,7 +44,7 @@ typedef struct {
44 44
45#define spin_unlock_wait(lp) \ 45#define spin_unlock_wait(lp) \
46do { membar("#LoadLoad"); \ 46do { membar("#LoadLoad"); \
47} while(lp->lock) 47} while((lp)->lock)
48 48
49static inline void _raw_spin_lock(spinlock_t *lock) 49static inline void _raw_spin_lock(spinlock_t *lock)
50{ 50{
@@ -149,7 +149,7 @@ typedef struct {
149 unsigned int break_lock; 149 unsigned int break_lock;
150#endif 150#endif
151} rwlock_t; 151} rwlock_t;
152#define RW_LOCK_UNLOCKED {0,} 152#define RW_LOCK_UNLOCKED (rwlock_t) {0,}
153#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) 153#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
154 154
155static void inline __read_lock(rwlock_t *lock) 155static void inline __read_lock(rwlock_t *lock)
diff --git a/include/asm-um/arch-signal-i386.h b/include/asm-um/arch-signal-i386.h
index 99a9de4728da..e69de29bb2d1 100644
--- a/include/asm-um/arch-signal-i386.h
+++ b/include/asm-um/arch-signal-i386.h
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __UM_ARCH_SIGNAL_I386_H
7#define __UM_ARCH_SIGNAL_I386_H
8
9struct arch_signal_context {
10 unsigned long extrasigs[_NSIG_WORDS];
11};
12
13#endif
14
15/*
16 * Overrides for Emacs so that we follow Linus's tabbing style.
17 * Emacs will notice this stuff at the end of the file and automatically
18 * adjust the settings for this buffer only. This must remain at the end
19 * of the file.
20 * ---------------------------------------------------------------------------
21 * Local variables:
22 * c-file-style: "linux"
23 * End:
24 */
diff --git a/include/asm-um/archparam-i386.h b/include/asm-um/archparam-i386.h
index 6f78de5b621b..49e89b8d7e58 100644
--- a/include/asm-um/archparam-i386.h
+++ b/include/asm-um/archparam-i386.h
@@ -6,143 +6,6 @@
6#ifndef __UM_ARCHPARAM_I386_H 6#ifndef __UM_ARCHPARAM_I386_H
7#define __UM_ARCHPARAM_I386_H 7#define __UM_ARCHPARAM_I386_H
8 8
9/********* Bits for asm-um/elf.h ************/
10
11#include <asm/user.h>
12
13extern char * elf_aux_platform;
14#define ELF_PLATFORM (elf_aux_platform)
15
16#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
17
18typedef struct user_i387_struct elf_fpregset_t;
19typedef unsigned long elf_greg_t;
20
21#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
22typedef elf_greg_t elf_gregset_t[ELF_NGREG];
23
24#define ELF_DATA ELFDATA2LSB
25#define ELF_ARCH EM_386
26
27#define ELF_PLAT_INIT(regs, load_addr) do { \
28 PT_REGS_EBX(regs) = 0; \
29 PT_REGS_ECX(regs) = 0; \
30 PT_REGS_EDX(regs) = 0; \
31 PT_REGS_ESI(regs) = 0; \
32 PT_REGS_EDI(regs) = 0; \
33 PT_REGS_EBP(regs) = 0; \
34 PT_REGS_EAX(regs) = 0; \
35} while(0)
36
37/* Shamelessly stolen from include/asm-i386/elf.h */
38
39#define ELF_CORE_COPY_REGS(pr_reg, regs) do { \
40 pr_reg[0] = PT_REGS_EBX(regs); \
41 pr_reg[1] = PT_REGS_ECX(regs); \
42 pr_reg[2] = PT_REGS_EDX(regs); \
43 pr_reg[3] = PT_REGS_ESI(regs); \
44 pr_reg[4] = PT_REGS_EDI(regs); \
45 pr_reg[5] = PT_REGS_EBP(regs); \
46 pr_reg[6] = PT_REGS_EAX(regs); \
47 pr_reg[7] = PT_REGS_DS(regs); \
48 pr_reg[8] = PT_REGS_ES(regs); \
49 /* fake once used fs and gs selectors? */ \
50 pr_reg[9] = PT_REGS_DS(regs); \
51 pr_reg[10] = PT_REGS_DS(regs); \
52 pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \
53 pr_reg[12] = PT_REGS_IP(regs); \
54 pr_reg[13] = PT_REGS_CS(regs); \
55 pr_reg[14] = PT_REGS_EFLAGS(regs); \
56 pr_reg[15] = PT_REGS_SP(regs); \
57 pr_reg[16] = PT_REGS_SS(regs); \
58} while(0);
59
60
61extern unsigned long vsyscall_ehdr;
62extern unsigned long vsyscall_end;
63extern unsigned long __kernel_vsyscall;
64
65#define VSYSCALL_BASE vsyscall_ehdr
66#define VSYSCALL_END vsyscall_end
67
68/*
69 * This is the range that is readable by user mode, and things
70 * acting like user mode such as get_user_pages.
71 */
72#define FIXADDR_USER_START VSYSCALL_BASE
73#define FIXADDR_USER_END VSYSCALL_END
74
75/*
76 * Architecture-neutral AT_ values in 0-17, leave some room
77 * for more of them, start the x86-specific ones at 32.
78 */
79#define AT_SYSINFO 32
80#define AT_SYSINFO_EHDR 33
81
82#define ARCH_DLINFO \
83do { \
84 if ( vsyscall_ehdr ) { \
85 NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \
86 NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \
87 } \
88} while (0)
89
90/*
91 * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
92 * extra segments containing the vsyscall DSO contents. Dumping its
93 * contents makes post-mortem fully interpretable later without matching up
94 * the same kernel and hardware config to see what PC values meant.
95 * Dumping its extra ELF program headers includes all the other information
96 * a debugger needs to easily find how the vsyscall DSO was being used.
97 */
98#define ELF_CORE_EXTRA_PHDRS \
99 (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
100
101#define ELF_CORE_WRITE_EXTRA_PHDRS \
102if ( vsyscall_ehdr ) { \
103 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
104 const struct elf_phdr *const phdrp = \
105 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
106 int i; \
107 Elf32_Off ofs = 0; \
108 for (i = 0; i < ehdrp->e_phnum; ++i) { \
109 struct elf_phdr phdr = phdrp[i]; \
110 if (phdr.p_type == PT_LOAD) { \
111 ofs = phdr.p_offset = offset; \
112 offset += phdr.p_filesz; \
113 } \
114 else \
115 phdr.p_offset += ofs; \
116 phdr.p_paddr = 0; /* match other core phdrs */ \
117 DUMP_WRITE(&phdr, sizeof(phdr)); \
118 } \
119}
120#define ELF_CORE_WRITE_EXTRA_DATA \
121if ( vsyscall_ehdr ) { \
122 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
123 const struct elf_phdr *const phdrp = \
124 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
125 int i; \
126 for (i = 0; i < ehdrp->e_phnum; ++i) { \
127 if (phdrp[i].p_type == PT_LOAD) \
128 DUMP_WRITE((void *) phdrp[i].p_vaddr, \
129 phdrp[i].p_filesz); \
130 } \
131}
132
133#define R_386_NONE 0
134#define R_386_32 1
135#define R_386_PC32 2
136#define R_386_GOT32 3
137#define R_386_PLT32 4
138#define R_386_COPY 5
139#define R_386_GLOB_DAT 6
140#define R_386_JMP_SLOT 7
141#define R_386_RELATIVE 8
142#define R_386_GOTOFF 9
143#define R_386_GOTPC 10
144#define R_386_NUM 11
145
146/********* Nothing for asm-um/hardirq.h **********/ 9/********* Nothing for asm-um/hardirq.h **********/
147 10
148/********* Nothing for asm-um/hw_irq.h **********/ 11/********* Nothing for asm-um/hw_irq.h **********/
diff --git a/include/asm-um/archparam-ppc.h b/include/asm-um/archparam-ppc.h
index 0ebced92a762..172cd6ffacc4 100644
--- a/include/asm-um/archparam-ppc.h
+++ b/include/asm-um/archparam-ppc.h
@@ -1,26 +1,6 @@
1#ifndef __UM_ARCHPARAM_PPC_H 1#ifndef __UM_ARCHPARAM_PPC_H
2#define __UM_ARCHPARAM_PPC_H 2#define __UM_ARCHPARAM_PPC_H
3 3
4/********* Bits for asm-um/elf.h ************/
5
6#define ELF_PLATFORM (0)
7
8#define ELF_ET_DYN_BASE (0x08000000)
9
10/* the following stolen from asm-ppc/elf.h */
11#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
12#define ELF_NFPREG 33 /* includes fpscr */
13/* General registers */
14typedef unsigned long elf_greg_t;
15typedef elf_greg_t elf_gregset_t[ELF_NGREG];
16
17/* Floating point registers */
18typedef double elf_fpreg_t;
19typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
20
21#define ELF_DATA ELFDATA2MSB
22#define ELF_ARCH EM_PPC
23
24/********* Bits for asm-um/hw_irq.h **********/ 4/********* Bits for asm-um/hw_irq.h **********/
25 5
26struct hw_interrupt_type; 6struct hw_interrupt_type;
diff --git a/include/asm-um/archparam-x86_64.h b/include/asm-um/archparam-x86_64.h
index 96321c4892f1..270ed9586b68 100644
--- a/include/asm-um/archparam-x86_64.h
+++ b/include/asm-um/archparam-x86_64.h
@@ -7,42 +7,6 @@
7#ifndef __UM_ARCHPARAM_X86_64_H 7#ifndef __UM_ARCHPARAM_X86_64_H
8#define __UM_ARCHPARAM_X86_64_H 8#define __UM_ARCHPARAM_X86_64_H
9 9
10#include <asm/user.h>
11
12#define ELF_PLATFORM "x86_64"
13
14#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
15
16typedef unsigned long elf_greg_t;
17typedef struct { } elf_fpregset_t;
18
19#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
20typedef elf_greg_t elf_gregset_t[ELF_NGREG];
21
22#define ELF_DATA ELFDATA2LSB
23#define ELF_ARCH EM_X86_64
24
25#define ELF_PLAT_INIT(regs, load_addr) do { \
26 PT_REGS_RBX(regs) = 0; \
27 PT_REGS_RCX(regs) = 0; \
28 PT_REGS_RDX(regs) = 0; \
29 PT_REGS_RSI(regs) = 0; \
30 PT_REGS_RDI(regs) = 0; \
31 PT_REGS_RBP(regs) = 0; \
32 PT_REGS_RAX(regs) = 0; \
33 PT_REGS_R8(regs) = 0; \
34 PT_REGS_R9(regs) = 0; \
35 PT_REGS_R10(regs) = 0; \
36 PT_REGS_R11(regs) = 0; \
37 PT_REGS_R12(regs) = 0; \
38 PT_REGS_R13(regs) = 0; \
39 PT_REGS_R14(regs) = 0; \
40 PT_REGS_R15(regs) = 0; \
41} while (0)
42
43#ifdef TIF_IA32 /* XXX */
44 clear_thread_flag(TIF_IA32);
45#endif
46 10
47/* No user-accessible fixmap addresses, i.e. vsyscall */ 11/* No user-accessible fixmap addresses, i.e. vsyscall */
48#define FIXADDR_USER_START 0 12#define FIXADDR_USER_START 0
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index a3d6aab0e74d..1010153faaf9 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -8,11 +8,6 @@
8 _sdata = .; 8 _sdata = .;
9 PROVIDE (sdata = .); 9 PROVIDE (sdata = .);
10 10
11 . = ALIGN(16); /* Exception table */
12 __start___ex_table = .;
13 __ex_table : { *(__ex_table) }
14 __stop___ex_table = .;
15
16 RODATA 11 RODATA
17 12
18 .unprotected : { *(.unprotected) } 13 .unprotected : { *(.unprotected) }
@@ -20,6 +15,10 @@
20 PROVIDE (_unprotected_end = .); 15 PROVIDE (_unprotected_end = .);
21 16
22 . = ALIGN(4096); 17 . = ALIGN(4096);
18 __start___ex_table = .;
19 __ex_table : { *(__ex_table) }
20 __stop___ex_table = .;
21
23 __uml_setup_start = .; 22 __uml_setup_start = .;
24 .uml.setup.init : { *(.uml.setup.init) } 23 .uml.setup.init : { *(.uml.setup.init) }
25 __uml_setup_end = .; 24 __uml_setup_end = .;
diff --git a/include/asm-um/delay.h b/include/asm-um/delay.h
index 40695576ca60..0985bda66750 100644
--- a/include/asm-um/delay.h
+++ b/include/asm-um/delay.h
@@ -4,4 +4,6 @@
4#include "asm/arch/delay.h" 4#include "asm/arch/delay.h"
5#include "asm/archparam.h" 5#include "asm/archparam.h"
6 6
7#define MILLION 1000000
8
7#endif 9#endif
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h
new file mode 100644
index 000000000000..b72e23519e00
--- /dev/null
+++ b/include/asm-um/elf-i386.h
@@ -0,0 +1,169 @@
1/*
2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
5#ifndef __UM_ELF_I386_H
6#define __UM_ELF_I386_H
7
8#include "user.h"
9
10#define R_386_NONE 0
11#define R_386_32 1
12#define R_386_PC32 2
13#define R_386_GOT32 3
14#define R_386_PLT32 4
15#define R_386_COPY 5
16#define R_386_GLOB_DAT 6
17#define R_386_JMP_SLOT 7
18#define R_386_RELATIVE 8
19#define R_386_GOTOFF 9
20#define R_386_GOTPC 10
21#define R_386_NUM 11
22
23typedef unsigned long elf_greg_t;
24
25#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
26typedef elf_greg_t elf_gregset_t[ELF_NGREG];
27
28typedef struct user_i387_struct elf_fpregset_t;
29
30/*
31 * This is used to ensure we don't load something for the wrong architecture.
32 */
33#define elf_check_arch(x) \
34 (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))
35
36#define ELF_CLASS ELFCLASS32
37#define ELF_DATA ELFDATA2LSB
38#define ELF_ARCH EM_386
39
40#define ELF_PLAT_INIT(regs, load_addr) do { \
41 PT_REGS_EBX(regs) = 0; \
42 PT_REGS_ECX(regs) = 0; \
43 PT_REGS_EDX(regs) = 0; \
44 PT_REGS_ESI(regs) = 0; \
45 PT_REGS_EDI(regs) = 0; \
46 PT_REGS_EBP(regs) = 0; \
47 PT_REGS_EAX(regs) = 0; \
48} while(0)
49
50#define USE_ELF_CORE_DUMP
51#define ELF_EXEC_PAGESIZE 4096
52
53#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
54
55/* Shamelessly stolen from include/asm-i386/elf.h */
56
57#define ELF_CORE_COPY_REGS(pr_reg, regs) do { \
58 pr_reg[0] = PT_REGS_EBX(regs); \
59 pr_reg[1] = PT_REGS_ECX(regs); \
60 pr_reg[2] = PT_REGS_EDX(regs); \
61 pr_reg[3] = PT_REGS_ESI(regs); \
62 pr_reg[4] = PT_REGS_EDI(regs); \
63 pr_reg[5] = PT_REGS_EBP(regs); \
64 pr_reg[6] = PT_REGS_EAX(regs); \
65 pr_reg[7] = PT_REGS_DS(regs); \
66 pr_reg[8] = PT_REGS_ES(regs); \
67 /* fake once used fs and gs selectors? */ \
68 pr_reg[9] = PT_REGS_DS(regs); \
69 pr_reg[10] = PT_REGS_DS(regs); \
70 pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \
71 pr_reg[12] = PT_REGS_IP(regs); \
72 pr_reg[13] = PT_REGS_CS(regs); \
73 pr_reg[14] = PT_REGS_EFLAGS(regs); \
74 pr_reg[15] = PT_REGS_SP(regs); \
75 pr_reg[16] = PT_REGS_SS(regs); \
76} while(0);
77
78extern long elf_aux_hwcap;
79#define ELF_HWCAP (elf_aux_hwcap)
80
81extern char * elf_aux_platform;
82#define ELF_PLATFORM (elf_aux_platform)
83
84#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
85
86extern unsigned long vsyscall_ehdr;
87extern unsigned long vsyscall_end;
88extern unsigned long __kernel_vsyscall;
89
90#define VSYSCALL_BASE vsyscall_ehdr
91#define VSYSCALL_END vsyscall_end
92
93/*
94 * This is the range that is readable by user mode, and things
95 * acting like user mode such as get_user_pages.
96 */
97#define FIXADDR_USER_START VSYSCALL_BASE
98#define FIXADDR_USER_END VSYSCALL_END
99
100/*
101 * Architecture-neutral AT_ values in 0-17, leave some room
102 * for more of them, start the x86-specific ones at 32.
103 */
104#define AT_SYSINFO 32
105#define AT_SYSINFO_EHDR 33
106
107#define ARCH_DLINFO \
108do { \
109 if ( vsyscall_ehdr ) { \
110 NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \
111 NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \
112 } \
113} while (0)
114
115/*
116 * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
117 * extra segments containing the vsyscall DSO contents. Dumping its
118 * contents makes post-mortem fully interpretable later without matching up
119 * the same kernel and hardware config to see what PC values meant.
120 * Dumping its extra ELF program headers includes all the other information
121 * a debugger needs to easily find how the vsyscall DSO was being used.
122 */
123#define ELF_CORE_EXTRA_PHDRS \
124 (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
125
126#define ELF_CORE_WRITE_EXTRA_PHDRS \
127if ( vsyscall_ehdr ) { \
128 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
129 const struct elf_phdr *const phdrp = \
130 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
131 int i; \
132 Elf32_Off ofs = 0; \
133 for (i = 0; i < ehdrp->e_phnum; ++i) { \
134 struct elf_phdr phdr = phdrp[i]; \
135 if (phdr.p_type == PT_LOAD) { \
136 ofs = phdr.p_offset = offset; \
137 offset += phdr.p_filesz; \
138 } \
139 else \
140 phdr.p_offset += ofs; \
141 phdr.p_paddr = 0; /* match other core phdrs */ \
142 DUMP_WRITE(&phdr, sizeof(phdr)); \
143 } \
144}
145#define ELF_CORE_WRITE_EXTRA_DATA \
146if ( vsyscall_ehdr ) { \
147 const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
148 const struct elf_phdr *const phdrp = \
149 (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
150 int i; \
151 for (i = 0; i < ehdrp->e_phnum; ++i) { \
152 if (phdrp[i].p_type == PT_LOAD) \
153 DUMP_WRITE((void *) phdrp[i].p_vaddr, \
154 phdrp[i].p_filesz); \
155 } \
156}
157
158#endif
159
160/*
161 * Overrides for Emacs so that we follow Linus's tabbing style.
162 * Emacs will notice this stuff at the end of the file and automatically
163 * adjust the settings for this buffer only. This must remain at the end
164 * of the file.
165 * ---------------------------------------------------------------------------
166 * Local variables:
167 * c-file-style: "linux"
168 * End:
169 */
diff --git a/include/asm-um/elf-ppc.h b/include/asm-um/elf-ppc.h
new file mode 100644
index 000000000000..2998cf925042
--- /dev/null
+++ b/include/asm-um/elf-ppc.h
@@ -0,0 +1,54 @@
1#ifndef __UM_ELF_PPC_H
2#define __UM_ELF_PPC_H
3
4#include "linux/config.h"
5
6extern long elf_aux_hwcap;
7#define ELF_HWCAP (elf_aux_hwcap)
8
9#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
10
11#define ELF_EXEC_PAGESIZE 4096
12
13#define elf_check_arch(x) (1)
14
15#ifdef CONFIG_64_BIT
16#define ELF_CLASS ELFCLASS64
17#else
18#define ELF_CLASS ELFCLASS32
19#endif
20
21#define USE_ELF_CORE_DUMP
22
23#define R_386_NONE 0
24#define R_386_32 1
25#define R_386_PC32 2
26#define R_386_GOT32 3
27#define R_386_PLT32 4
28#define R_386_COPY 5
29#define R_386_GLOB_DAT 6
30#define R_386_JMP_SLOT 7
31#define R_386_RELATIVE 8
32#define R_386_GOTOFF 9
33#define R_386_GOTPC 10
34#define R_386_NUM 11
35
36#define ELF_PLATFORM (0)
37
38#define ELF_ET_DYN_BASE (0x08000000)
39
40/* the following stolen from asm-ppc/elf.h */
41#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
42#define ELF_NFPREG 33 /* includes fpscr */
43/* General registers */
44typedef unsigned long elf_greg_t;
45typedef elf_greg_t elf_gregset_t[ELF_NGREG];
46
47/* Floating point registers */
48typedef double elf_fpreg_t;
49typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
50
51#define ELF_DATA ELFDATA2MSB
52#define ELF_ARCH EM_PPC
53
54#endif
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
new file mode 100644
index 000000000000..19309d001aa0
--- /dev/null
+++ b/include/asm-um/elf-x86_64.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6#ifndef __UM_ELF_X86_64_H
7#define __UM_ELF_X86_64_H
8
9#include <asm/user.h>
10
11typedef unsigned long elf_greg_t;
12
13#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
14typedef elf_greg_t elf_gregset_t[ELF_NGREG];
15
16typedef struct { } elf_fpregset_t;
17
18/*
19 * This is used to ensure we don't load something for the wrong architecture.
20 */
21#define elf_check_arch(x) \
22 ((x)->e_machine == EM_X86_64)
23
24#define ELF_CLASS ELFCLASS64
25#define ELF_DATA ELFDATA2LSB
26#define ELF_ARCH EM_X86_64
27
28#define ELF_PLAT_INIT(regs, load_addr) do { \
29 PT_REGS_RBX(regs) = 0; \
30 PT_REGS_RCX(regs) = 0; \
31 PT_REGS_RDX(regs) = 0; \
32 PT_REGS_RSI(regs) = 0; \
33 PT_REGS_RDI(regs) = 0; \
34 PT_REGS_RBP(regs) = 0; \
35 PT_REGS_RAX(regs) = 0; \
36 PT_REGS_R8(regs) = 0; \
37 PT_REGS_R9(regs) = 0; \
38 PT_REGS_R10(regs) = 0; \
39 PT_REGS_R11(regs) = 0; \
40 PT_REGS_R12(regs) = 0; \
41 PT_REGS_R13(regs) = 0; \
42 PT_REGS_R14(regs) = 0; \
43 PT_REGS_R15(regs) = 0; \
44} while (0)
45
46#ifdef TIF_IA32 /* XXX */
47 clear_thread_flag(TIF_IA32); \
48#endif
49
50#define USE_ELF_CORE_DUMP
51#define ELF_EXEC_PAGESIZE 4096
52
53#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
54
55extern long elf_aux_hwcap;
56#define ELF_HWCAP (elf_aux_hwcap)
57
58#define ELF_PLATFORM "x86_64"
59
60#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
61
62#endif
63
64/*
65 * Overrides for Emacs so that we follow Linus's tabbing style.
66 * Emacs will notice this stuff at the end of the file and automatically
67 * adjust the settings for this buffer only. This must remain at the end
68 * of the file.
69 * ---------------------------------------------------------------------------
70 * Local variables:
71 * c-file-style: "linux"
72 * End:
73 */
diff --git a/include/asm-um/elf.h b/include/asm-um/elf.h
index b3a7258f9971..e69de29bb2d1 100644
--- a/include/asm-um/elf.h
+++ b/include/asm-um/elf.h
@@ -1,37 +0,0 @@
1#ifndef __UM_ELF_H
2#define __UM_ELF_H
3
4#include "linux/config.h"
5#include "asm/archparam.h"
6
7extern long elf_aux_hwcap;
8#define ELF_HWCAP (elf_aux_hwcap)
9
10#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
11
12#define ELF_EXEC_PAGESIZE 4096
13
14#define elf_check_arch(x) (1)
15
16#ifdef CONFIG_64_BIT
17#define ELF_CLASS ELFCLASS64
18#else
19#define ELF_CLASS ELFCLASS32
20#endif
21
22#define USE_ELF_CORE_DUMP
23
24#define R_386_NONE 0
25#define R_386_32 1
26#define R_386_PC32 2
27#define R_386_GOT32 3
28#define R_386_PLT32 4
29#define R_386_COPY 5
30#define R_386_GLOB_DAT 6
31#define R_386_JMP_SLOT 7
32#define R_386_RELATIVE 8
33#define R_386_GOTOFF 9
34#define R_386_GOTPC 10
35#define R_386_NUM 11
36
37#endif
diff --git a/include/asm-um/fixmap.h b/include/asm-um/fixmap.h
index 900f3fbb9fab..ae0ca3932d50 100644
--- a/include/asm-um/fixmap.h
+++ b/include/asm-um/fixmap.h
@@ -4,6 +4,7 @@
4#include <linux/config.h> 4#include <linux/config.h>
5#include <asm/kmap_types.h> 5#include <asm/kmap_types.h>
6#include <asm/archparam.h> 6#include <asm/archparam.h>
7#include <asm/elf.h>
7 8
8/* 9/*
9 * Here we define all the compile-time 'special' virtual 10 * Here we define all the compile-time 'special' virtual
diff --git a/include/asm-um/ipc.h b/include/asm-um/ipc.h
index e2ddc47f3e52..a46e3d9c2a3f 100644
--- a/include/asm-um/ipc.h
+++ b/include/asm-um/ipc.h
@@ -1,6 +1 @@
1#ifndef __UM_IPC_H #include <asm-generic/ipc.h>
2#define __UM_IPC_H
3
4#include "asm/arch/ipc.h"
5
6#endif
diff --git a/include/asm-um/linkage.h b/include/asm-um/linkage.h
index 27011652b015..7dfce37adc8b 100644
--- a/include/asm-um/linkage.h
+++ b/include/asm-um/linkage.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_LINKAGE_H 1#ifndef __ASM_UM_LINKAGE_H
2#define __ASM_LINKAGE_H 2#define __ASM_UM_LINKAGE_H
3 3
4#define FASTCALL(x) x __attribute__((regparm(3))) 4#include "asm/arch/linkage.h"
5#define fastcall __attribute__((regparm(3)))
6 5
7#endif 6#endif
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 3620a08dc9f3..504ea8e486b0 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -27,7 +27,7 @@ struct page;
27#define clear_user_page(page, vaddr, pg) clear_page(page) 27#define clear_user_page(page, vaddr, pg) clear_page(page)
28#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 28#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
29 29
30#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64_BIT) 30#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT)
31 31
32typedef struct { unsigned long pte_low, pte_high; } pte_t; 32typedef struct { unsigned long pte_low, pte_high; } pte_t;
33typedef struct { unsigned long long pmd; } pmd_t; 33typedef struct { unsigned long long pmd; } pmd_t;
@@ -45,6 +45,9 @@ typedef struct { unsigned long pgd; } pgd_t;
45 ({ (pte).pte_high = (phys) >> 32; \ 45 ({ (pte).pte_high = (phys) >> 32; \
46 (pte).pte_low = (phys) | pgprot_val(prot); }) 46 (pte).pte_low = (phys) | pgprot_val(prot); })
47 47
48#define pmd_val(x) ((x).pmd)
49#define __pmd(x) ((pmd_t) { (x) } )
50
48typedef unsigned long long pfn_t; 51typedef unsigned long long pfn_t;
49typedef unsigned long long phys_t; 52typedef unsigned long long phys_t;
50 53
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index bdbc3f97e20b..65e8bfc55fc4 100644
--- a/include/asm-um/pgtable-3level.h
+++ b/include/asm-um/pgtable-3level.h
@@ -145,11 +145,11 @@ static inline pmd_t pfn_pmd(pfn_t page_nr, pgprot_t pgprot)
145 */ 145 */
146#define PTE_FILE_MAX_BITS 32 146#define PTE_FILE_MAX_BITS 32
147 147
148#ifdef CONFIG_64_BIT 148#ifdef CONFIG_64BIT
149 149
150#define pte_to_pgoff(p) ((p).pte >> 32) 150#define pte_to_pgoff(p) ((p).pte >> 32)
151 151
152#define pgoff_to_pte(off) ((pte_t) { ((off) < 32) | _PAGE_FILE }) 152#define pgoff_to_pte(off) ((pte_t) { ((off) << 32) | _PAGE_FILE })
153 153
154#else 154#else
155 155
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 71f9c0c78c0c..510e513c7f88 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -106,7 +106,7 @@ extern unsigned long end_iomem;
106/* 106/*
107 * Define this if things work differently on an i386 and an i486: 107 * Define this if things work differently on an i386 and an i486:
108 * it will (on an i486) warn about kernel memory accesses that are 108 * it will (on an i486) warn about kernel memory accesses that are
109 * done without a 'verify_area(VERIFY_WRITE,..)' 109 * done without a 'access_ok(VERIFY_WRITE,..)'
110 */ 110 */
111#undef TEST_VERIFY_AREA 111#undef TEST_VERIFY_AREA
112 112
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 038ba6fc88b8..b2fc94fbc2d9 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -17,12 +17,13 @@ struct task_struct;
17struct mm_struct; 17struct mm_struct;
18 18
19struct thread_struct { 19struct thread_struct {
20 /* This flag is set to 1 before calling do_fork (and analyzed in
21 * copy_thread) to mark that we are begin called from userspace (fork /
22 * vfork / clone), and reset to 0 after. It is left to 0 when called
23 * from kernelspace (i.e. kernel_thread() or fork_idle(), as of 2.6.11). */
20 int forking; 24 int forking;
21 int nsyscalls; 25 int nsyscalls;
22 struct pt_regs regs; 26 struct pt_regs regs;
23 unsigned long cr2;
24 int err;
25 unsigned long trap_no;
26 int singlestep_syscall; 27 int singlestep_syscall;
27 void *fault_addr; 28 void *fault_addr;
28 void *fault_catcher; 29 void *fault_catcher;
@@ -70,8 +71,6 @@ struct thread_struct {
70 .forking = 0, \ 71 .forking = 0, \
71 .nsyscalls = 0, \ 72 .nsyscalls = 0, \
72 .regs = EMPTY_REGS, \ 73 .regs = EMPTY_REGS, \
73 .cr2 = 0, \
74 .err = 0, \
75 .fault_addr = NULL, \ 74 .fault_addr = NULL, \
76 .prev_sched = NULL, \ 75 .prev_sched = NULL, \
77 .temp_stack = 0, \ 76 .temp_stack = 0, \
@@ -89,7 +88,11 @@ extern struct task_struct *alloc_task_struct(void);
89extern void release_thread(struct task_struct *); 88extern void release_thread(struct task_struct *);
90extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 89extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
91extern void dump_thread(struct pt_regs *regs, struct user *u); 90extern void dump_thread(struct pt_regs *regs, struct user *u);
92extern void prepare_to_copy(struct task_struct *tsk); 91
92static inline void prepare_to_copy(struct task_struct *tsk)
93{
94}
95
93 96
94extern unsigned long thread_saved_pc(struct task_struct *t); 97extern unsigned long thread_saved_pc(struct task_struct *t);
95 98
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
index 2deb8f1adbf1..431bad3ae9d7 100644
--- a/include/asm-um/processor-i386.h
+++ b/include/asm-um/processor-i386.h
@@ -9,13 +9,18 @@
9extern int host_has_xmm; 9extern int host_has_xmm;
10extern int host_has_cmov; 10extern int host_has_cmov;
11 11
12/* include faultinfo structure */
13#include "sysdep/faultinfo.h"
14
12struct arch_thread { 15struct arch_thread {
13 unsigned long debugregs[8]; 16 unsigned long debugregs[8];
14 int debugregs_seq; 17 int debugregs_seq;
18 struct faultinfo faultinfo;
15}; 19};
16 20
17#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ 21#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
18 .debugregs_seq = 0 } 22 .debugregs_seq = 0, \
23 .faultinfo = { 0, 0, 0 } }
19 24
20#include "asm/arch/user.h" 25#include "asm/arch/user.h"
21 26
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index a1ae3a4cd938..0beb9a42ae05 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -7,9 +7,13 @@
7#ifndef __UM_PROCESSOR_X86_64_H 7#ifndef __UM_PROCESSOR_X86_64_H
8#define __UM_PROCESSOR_X86_64_H 8#define __UM_PROCESSOR_X86_64_H
9 9
10#include "asm/arch/user.h" 10/* include faultinfo structure */
11#include "sysdep/faultinfo.h"
11 12
12struct arch_thread { 13struct arch_thread {
14 unsigned long debugregs[8];
15 int debugregs_seq;
16 struct faultinfo faultinfo;
13}; 17};
14 18
15/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ 19/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
@@ -20,7 +24,11 @@ extern inline void rep_nop(void)
20 24
21#define cpu_relax() rep_nop() 25#define cpu_relax() rep_nop()
22 26
23#define INIT_ARCH_THREAD { } 27#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
28 .debugregs_seq = 0, \
29 .faultinfo = { 0, 0, 0 } }
30
31#include "asm/arch/user.h"
24 32
25#define current_text_addr() \ 33#define current_text_addr() \
26 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) 34 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index 9e47590ec293..04222f35c43e 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -6,6 +6,8 @@
6#ifndef __UM_PTRACE_I386_H 6#ifndef __UM_PTRACE_I386_H
7#define __UM_PTRACE_I386_H 7#define __UM_PTRACE_I386_H
8 8
9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10
9#include "sysdep/ptrace.h" 11#include "sysdep/ptrace.h"
10#include "asm/ptrace-generic.h" 12#include "asm/ptrace-generic.h"
11 13
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index c34be39b78b2..be51219a8ffe 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -14,6 +14,8 @@
14#include "asm/ptrace-generic.h" 14#include "asm/ptrace-generic.h"
15#undef signal_fault 15#undef signal_fault
16 16
17#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
18
17void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where); 19void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where);
18 20
19#define FS_BASE (21 * sizeof(unsigned long)) 21#define FS_BASE (21 * sizeof(unsigned long))
diff --git a/include/asm-um/setup.h b/include/asm-um/setup.h
index c85252e803c1..99f086301f4c 100644
--- a/include/asm-um/setup.h
+++ b/include/asm-um/setup.h
@@ -2,7 +2,8 @@
2#define SETUP_H_INCLUDED 2#define SETUP_H_INCLUDED
3 3
4/* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the 4/* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the
5 * command line, so this choice is ok.*/ 5 * command line, so this choice is ok.
6 */
6 7
7#define COMMAND_LINE_SIZE 4096 8#define COMMAND_LINE_SIZE 4096
8 9
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index bffb577bc54e..a10ea155907e 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -72,12 +72,14 @@ static inline struct thread_info *current_thread_info(void)
72 */ 72 */
73#define TIF_RESTART_BLOCK 4 73#define TIF_RESTART_BLOCK 4
74#define TIF_MEMDIE 5 74#define TIF_MEMDIE 5
75#define TIF_SYSCALL_AUDIT 6
75 76
76#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 77#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
77#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 78#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
78#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 79#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
79#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 80#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
80#define _TIF_RESTART_BLOCK (1 << TIF_RESTART_BLOCK) 81#define _TIF_MEMDIE (1 << TIF_MEMDIE)
82#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
81 83
82#endif 84#endif
83 85
diff --git a/include/asm-v850/bug.h b/include/asm-v850/bug.h
index c778916bf7f2..b0ed2d35f3e8 100644
--- a/include/asm-v850/bug.h
+++ b/include/asm-v850/bug.h
@@ -14,9 +14,12 @@
14#ifndef __V850_BUG_H__ 14#ifndef __V850_BUG_H__
15#define __V850_BUG_H__ 15#define __V850_BUG_H__
16 16
17#ifdef CONFIG_BUG
17extern void __bug (void) __attribute__ ((noreturn)); 18extern void __bug (void) __attribute__ ((noreturn));
18#define BUG() __bug() 19#define BUG() __bug()
19#define HAVE_ARCH_BUG 20#define HAVE_ARCH_BUG
21#endif
22
20#include <asm-generic/bug.h> 23#include <asm-generic/bug.h>
21 24
22#endif /* __V850_BUG_H__ */ 25#endif /* __V850_BUG_H__ */
diff --git a/include/asm-v850/signal.h b/include/asm-v850/signal.h
index 407db875899c..cb52caa69925 100644
--- a/include/asm-v850/signal.h
+++ b/include/asm-v850/signal.h
@@ -110,32 +110,7 @@ typedef unsigned long sigset_t;
110#define MINSIGSTKSZ 2048 110#define MINSIGSTKSZ 2048
111#define SIGSTKSZ 8192 111#define SIGSTKSZ 8192
112 112
113 113#include <asm-generic/signal.h>
114#ifdef __KERNEL__
115/*
116 * These values of sa_flags are used only by the kernel as part of the
117 * irq handling routines.
118 *
119 * SA_INTERRUPT is also used by the irq handling routines.
120 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
121 */
122#define SA_PROBE SA_ONESHOT
123#define SA_SAMPLE_RANDOM SA_RESTART
124#define SA_SHIRQ 0x04000000
125#endif /* __KERNEL__ */
126
127
128#define SIG_BLOCK 0 /* for blocking signals */
129#define SIG_UNBLOCK 1 /* for unblocking signals */
130#define SIG_SETMASK 2 /* for setting the signal mask */
131
132/* Type of a signal handler. */
133typedef void (*__sighandler_t)(int);
134
135#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
136#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
137#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
138
139 114
140#ifdef __KERNEL__ 115#ifdef __KERNEL__
141 116
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index c025cc3ef789..e4b1017b8b2b 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -99,7 +99,6 @@ extern void disable_APIC_timer(void);
99extern void enable_APIC_timer(void); 99extern void enable_APIC_timer(void);
100extern void clustered_apic_check(void); 100extern void clustered_apic_check(void);
101 101
102extern int check_nmi_watchdog(void);
103extern void nmi_watchdog_default(void); 102extern void nmi_watchdog_default(void);
104extern int setup_nmi_watchdog(char *); 103extern int setup_nmi_watchdog(char *);
105 104
diff --git a/include/asm-x86_64/bootsetup.h b/include/asm-x86_64/bootsetup.h
index b570a484dc50..b829f7b534be 100644
--- a/include/asm-x86_64/bootsetup.h
+++ b/include/asm-x86_64/bootsetup.h
@@ -2,7 +2,8 @@
2#ifndef _X86_64_BOOTSETUP_H 2#ifndef _X86_64_BOOTSETUP_H
3#define _X86_64_BOOTSETUP_H 1 3#define _X86_64_BOOTSETUP_H 1
4 4
5extern char x86_boot_params[2048]; 5#define BOOT_PARAM_SIZE 4096
6extern char x86_boot_params[BOOT_PARAM_SIZE];
6 7
7/* 8/*
8 * This is set up by the setup-routine at boot-time 9 * This is set up by the setup-routine at boot-time
diff --git a/include/asm-x86_64/bug.h b/include/asm-x86_64/bug.h
index 19aed6e78fec..bdbf66eab6ee 100644
--- a/include/asm-x86_64/bug.h
+++ b/include/asm-x86_64/bug.h
@@ -15,11 +15,13 @@ struct bug_frame {
15 unsigned short line; 15 unsigned short line;
16} __attribute__((packed)); 16} __attribute__((packed));
17 17
18#ifdef CONFIG_BUG
18#define HAVE_ARCH_BUG 19#define HAVE_ARCH_BUG
19#define BUG() \ 20#define BUG() \
20 asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \ 21 asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \
21 "i"(__LINE__), "i" (__stringify(__FILE__))) 22 "i"(__LINE__), "i" (__stringify(__FILE__)))
22void out_of_line_bug(void); 23void out_of_line_bug(void);
23#include <asm-generic/bug.h> 24#endif
24 25
26#include <asm-generic/bug.h>
25#endif 27#endif
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h
index e68ad97a6319..aea308c65709 100644
--- a/include/asm-x86_64/cpufeature.h
+++ b/include/asm-x86_64/cpufeature.h
@@ -7,7 +7,7 @@
7#ifndef __ASM_X8664_CPUFEATURE_H 7#ifndef __ASM_X8664_CPUFEATURE_H
8#define __ASM_X8664_CPUFEATURE_H 8#define __ASM_X8664_CPUFEATURE_H
9 9
10#define NCAPINTS 6 10#define NCAPINTS 7 /* N 32-bit words worth of info */
11 11
12/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */ 12/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */
13#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */ 13#define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */
@@ -74,9 +74,15 @@
74#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ 74#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
75#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ 75#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */
76 76
77/* More extended AMD flags: CPUID level 0x80000001, ecx, word 5 */ 77/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
78#define X86_FEATURE_LAHF_LM (5*32+ 0) /* LAHF/SAHF in long mode */ 78#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */
79#define X86_FEATURE_CMP_LEGACY (5*32+ 1) /* If yes HyperThreading not valid */ 79#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */
80#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */
81#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */
82
83/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */
84#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
85#define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */
80 86
81#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) 87#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
82#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) 88#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability)
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index 08f83a4b4f4a..8e94edf0b984 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -14,7 +14,7 @@
14#include <linux/mmzone.h> 14#include <linux/mmzone.h>
15 15
16#define E820MAP 0x2d0 /* our map */ 16#define E820MAP 0x2d0 /* our map */
17#define E820MAX 32 /* number of entries in E820MAP */ 17#define E820MAX 128 /* number of entries in E820MAP */
18#define E820NR 0x1e8 /* # entries in E820MAP */ 18#define E820NR 0x1e8 /* # entries in E820MAP */
19 19
20#define E820_RAM 1 20#define E820_RAM 1
diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h
index bca9b28a1a0a..af7ded63b517 100644
--- a/include/asm-x86_64/floppy.h
+++ b/include/asm-x86_64/floppy.h
@@ -223,7 +223,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
223 return 0; 223 return 0;
224} 224}
225 225
226struct fd_routine_l { 226static struct fd_routine_l {
227 int (*_request_dma)(unsigned int dmanr, const char * device_id); 227 int (*_request_dma)(unsigned int dmanr, const char * device_id);
228 void (*_free_dma)(unsigned int dmanr); 228 void (*_free_dma)(unsigned int dmanr);
229 int (*_get_dma_residue)(unsigned int dummy); 229 int (*_get_dma_residue)(unsigned int dummy);
diff --git a/include/asm-x86_64/siginfo.h b/include/asm-x86_64/siginfo.h
index 7bc15985f124..d09a1e6e7246 100644
--- a/include/asm-x86_64/siginfo.h
+++ b/include/asm-x86_64/siginfo.h
@@ -3,8 +3,6 @@
3 3
4#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 4#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
5 5
6#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
7
8#include <asm-generic/siginfo.h> 6#include <asm-generic/siginfo.h>
9 7
10#endif 8#endif
diff --git a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h
index 643a20d73765..fe9b96d94815 100644
--- a/include/asm-x86_64/signal.h
+++ b/include/asm-x86_64/signal.h
@@ -116,35 +116,9 @@ typedef unsigned long sigset_t;
116#define MINSIGSTKSZ 2048 116#define MINSIGSTKSZ 2048
117#define SIGSTKSZ 8192 117#define SIGSTKSZ 8192
118 118
119#ifdef __KERNEL__ 119#include <asm-generic/signal.h>
120
121/*
122 * These values of sa_flags are used only by the kernel as part of the
123 * irq handling routines.
124 *
125 * SA_INTERRUPT is also used by the irq handling routines.
126 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
127 */
128#define SA_PROBE SA_ONESHOT
129#define SA_SAMPLE_RANDOM SA_RESTART
130#define SA_SHIRQ 0x04000000
131#endif
132
133#define SIG_BLOCK 0 /* for blocking signals */
134#define SIG_UNBLOCK 1 /* for unblocking signals */
135#define SIG_SETMASK 2 /* for setting the signal mask */
136 120
137#ifndef __ASSEMBLY__ 121#ifndef __ASSEMBLY__
138/* Type of a signal handler. */
139typedef void __signalfn_t(int);
140typedef __signalfn_t __user *__sighandler_t;
141
142typedef void __restorefn_t(void);
143typedef __restorefn_t __user *__sigrestore_t;
144
145#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
146#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
147#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
148 122
149struct sigaction { 123struct sigaction {
150 __sighandler_t sa_handler; 124 __sighandler_t sa_handler;
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 3d65d240dc95..3c9af6fd4332 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -76,7 +76,7 @@ __SYSCALL(__NR_madvise, sys_madvise)
76#define __NR_shmget 29 76#define __NR_shmget 29
77__SYSCALL(__NR_shmget, sys_shmget) 77__SYSCALL(__NR_shmget, sys_shmget)
78#define __NR_shmat 30 78#define __NR_shmat 30
79__SYSCALL(__NR_shmat, wrap_sys_shmat) 79__SYSCALL(__NR_shmat, sys_shmat)
80#define __NR_shmctl 31 80#define __NR_shmctl 31
81__SYSCALL(__NR_shmctl, sys_shmctl) 81__SYSCALL(__NR_shmctl, sys_shmctl)
82 82
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 3628f7cfb178..19f04b049798 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -1,4 +1,4 @@
1/* audit.h -- Auditing support -*- linux-c -*- 1/* audit.h -- Auditing support
2 * 2 *
3 * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. 3 * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
4 * All Rights Reserved. 4 * All Rights Reserved.
@@ -24,6 +24,9 @@
24#ifndef _LINUX_AUDIT_H_ 24#ifndef _LINUX_AUDIT_H_
25#define _LINUX_AUDIT_H_ 25#define _LINUX_AUDIT_H_
26 26
27#include <linux/sched.h>
28#include <linux/elf.h>
29
27/* Request and reply types */ 30/* Request and reply types */
28#define AUDIT_GET 1000 /* Get status */ 31#define AUDIT_GET 1000 /* Get status */
29#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ 32#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
@@ -67,6 +70,7 @@
67#define AUDIT_FSGID 8 70#define AUDIT_FSGID 8
68#define AUDIT_LOGINUID 9 71#define AUDIT_LOGINUID 9
69#define AUDIT_PERS 10 72#define AUDIT_PERS 10
73#define AUDIT_ARCH 11
70 74
71 /* These are ONLY useful when checking 75 /* These are ONLY useful when checking
72 * at syscall exit time (AUDIT_AT_EXIT). */ 76 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -96,6 +100,38 @@
96#define AUDIT_FAIL_PRINTK 1 100#define AUDIT_FAIL_PRINTK 1
97#define AUDIT_FAIL_PANIC 2 101#define AUDIT_FAIL_PANIC 2
98 102
103/* distinguish syscall tables */
104#define __AUDIT_ARCH_64BIT 0x80000000
105#define __AUDIT_ARCH_LE 0x40000000
106#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
107#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
108#define AUDIT_ARCH_ARMEB (EM_ARM)
109#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
110#define AUDIT_ARCH_FRV (EM_FRV)
111#define AUDIT_ARCH_H8300 (EM_H8_300)
112#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
113#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
114#define AUDIT_ARCH_M32R (EM_M32R)
115#define AUDIT_ARCH_M68K (EM_68K)
116#define AUDIT_ARCH_MIPS (EM_MIPS)
117#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
118#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
119#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
120#define AUDIT_ARCH_PARISC (EM_PARISC)
121#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
122#define AUDIT_ARCH_PPC (EM_PPC)
123#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
124#define AUDIT_ARCH_S390 (EM_S390)
125#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
126#define AUDIT_ARCH_SH (EM_SH)
127#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
128#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
129#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
130#define AUDIT_ARCH_SPARC (EM_SPARC)
131#define AUDIT_ARCH_SPARC64 (EM_SPARC64|__AUDIT_ARCH_64BIT)
132#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE)
133#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
134
99#ifndef __KERNEL__ 135#ifndef __KERNEL__
100struct audit_message { 136struct audit_message {
101 struct nlmsghdr nlh; 137 struct nlmsghdr nlh;
@@ -129,32 +165,36 @@ struct audit_buffer;
129struct audit_context; 165struct audit_context;
130struct inode; 166struct inode;
131 167
168#define AUDITSC_INVALID 0
169#define AUDITSC_SUCCESS 1
170#define AUDITSC_FAILURE 2
171#define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS )
132#ifdef CONFIG_AUDITSYSCALL 172#ifdef CONFIG_AUDITSYSCALL
133/* These are defined in auditsc.c */ 173/* These are defined in auditsc.c */
134 /* Public API */ 174 /* Public API */
135extern int audit_alloc(struct task_struct *task); 175extern int audit_alloc(struct task_struct *task);
136extern void audit_free(struct task_struct *task); 176extern void audit_free(struct task_struct *task);
137extern void audit_syscall_entry(struct task_struct *task, 177extern void audit_syscall_entry(struct task_struct *task, int arch,
138 int major, unsigned long a0, unsigned long a1, 178 int major, unsigned long a0, unsigned long a1,
139 unsigned long a2, unsigned long a3); 179 unsigned long a2, unsigned long a3);
140extern void audit_syscall_exit(struct task_struct *task, int return_code); 180extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code);
141extern void audit_getname(const char *name); 181extern void audit_getname(const char *name);
142extern void audit_putname(const char *name); 182extern void audit_putname(const char *name);
143extern void audit_inode(const char *name, const struct inode *inode); 183extern void audit_inode(const char *name, const struct inode *inode);
144 184
145 /* Private API (for audit.c only) */ 185 /* Private API (for audit.c only) */
146extern int audit_receive_filter(int type, int pid, int uid, int seq, 186extern int audit_receive_filter(int type, int pid, int uid, int seq,
147 void *data); 187 void *data, uid_t loginuid);
148extern void audit_get_stamp(struct audit_context *ctx, 188extern void audit_get_stamp(struct audit_context *ctx,
149 struct timespec *t, int *serial); 189 struct timespec *t, unsigned int *serial);
150extern int audit_set_loginuid(struct audit_context *ctx, uid_t loginuid); 190extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
151extern uid_t audit_get_loginuid(struct audit_context *ctx); 191extern uid_t audit_get_loginuid(struct audit_context *ctx);
152extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); 192extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
153#else 193#else
154#define audit_alloc(t) ({ 0; }) 194#define audit_alloc(t) ({ 0; })
155#define audit_free(t) do { ; } while (0) 195#define audit_free(t) do { ; } while (0)
156#define audit_syscall_entry(t,a,b,c,d,e) do { ; } while (0) 196#define audit_syscall_entry(t,ta,a,b,c,d,e) do { ; } while (0)
157#define audit_syscall_exit(t,r) do { ; } while (0) 197#define audit_syscall_exit(t,f,r) do { ; } while (0)
158#define audit_getname(n) do { ; } while (0) 198#define audit_getname(n) do { ; } while (0)
159#define audit_putname(n) do { ; } while (0) 199#define audit_putname(n) do { ; } while (0)
160#define audit_inode(n,i) do { ; } while (0) 200#define audit_inode(n,i) do { ; } while (0)
@@ -174,11 +214,15 @@ extern void audit_log_format(struct audit_buffer *ab,
174 const char *fmt, ...) 214 const char *fmt, ...)
175 __attribute__((format(printf,2,3))); 215 __attribute__((format(printf,2,3)));
176extern void audit_log_end(struct audit_buffer *ab); 216extern void audit_log_end(struct audit_buffer *ab);
217extern void audit_log_hex(struct audit_buffer *ab,
218 const unsigned char *buf,
219 size_t len);
220extern void audit_log_untrustedstring(struct audit_buffer *ab,
221 const char *string);
177extern void audit_log_d_path(struct audit_buffer *ab, 222extern void audit_log_d_path(struct audit_buffer *ab,
178 const char *prefix, 223 const char *prefix,
179 struct dentry *dentry, 224 struct dentry *dentry,
180 struct vfsmount *vfsmnt); 225 struct vfsmount *vfsmnt);
181
182 /* Private API (for auditsc.c only) */ 226 /* Private API (for auditsc.c only) */
183extern void audit_send_reply(int pid, int seq, int type, 227extern void audit_send_reply(int pid, int seq, int type,
184 int done, int multi, 228 int done, int multi,
@@ -190,6 +234,8 @@ extern void audit_log_lost(const char *message);
190#define audit_log_vformat(b,f,a) do { ; } while (0) 234#define audit_log_vformat(b,f,a) do { ; } while (0)
191#define audit_log_format(b,f,...) do { ; } while (0) 235#define audit_log_format(b,f,...) do { ; } while (0)
192#define audit_log_end(b) do { ; } while (0) 236#define audit_log_end(b) do { ; } while (0)
237#define audit_log_hex(a,b,l) do { ; } while (0)
238#define audit_log_untrustedstring(a,s) do { ; } while (0)
193#define audit_log_d_path(b,p,d,v) do { ; } while (0) 239#define audit_log_d_path(b,p,d,v) do { ; } while (0)
194#endif 240#endif
195#endif 241#endif
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
index d1c7b0ec7c22..a1657fb99516 100644
--- a/include/linux/auto_fs4.h
+++ b/include/linux/auto_fs4.h
@@ -23,7 +23,7 @@
23#define AUTOFS_MIN_PROTO_VERSION 3 23#define AUTOFS_MIN_PROTO_VERSION 3
24#define AUTOFS_MAX_PROTO_VERSION 4 24#define AUTOFS_MAX_PROTO_VERSION 4
25 25
26#define AUTOFS_PROTO_SUBVERSION 5 26#define AUTOFS_PROTO_SUBVERSION 6
27 27
28/* Mask for expire behaviour */ 28/* Mask for expire behaviour */
29#define AUTOFS_EXP_IMMEDIATE 1 29#define AUTOFS_EXP_IMMEDIATE 1
diff --git a/include/linux/awe_voice.h b/include/linux/awe_voice.h
index da0e27de752c..4bf9f33048e2 100644
--- a/include/linux/awe_voice.h
+++ b/include/linux/awe_voice.h
@@ -29,9 +29,9 @@
29#define SAMPLE_TYPE_AWE32 0x20 29#define SAMPLE_TYPE_AWE32 0x20
30#endif 30#endif
31 31
32#ifndef _PATCHKEY 32#define _LINUX_PATCHKEY_H_INDIRECT
33#define _PATCHKEY(id) ((id<<8)|0xfd) 33#include <linux/patchkey.h>
34#endif 34#undef _LINUX_PATCHKEY_H_INDIRECT
35 35
36/*---------------------------------------------------------------- 36/*----------------------------------------------------------------
37 * patch information record 37 * patch information record
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 54f820832c73..7e736e201c46 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -77,7 +77,6 @@ extern int flush_old_exec(struct linux_binprm * bprm);
77extern int setup_arg_pages(struct linux_binprm * bprm, 77extern int setup_arg_pages(struct linux_binprm * bprm,
78 unsigned long stack_top, 78 unsigned long stack_top,
79 int executable_stack); 79 int executable_stack);
80extern int copy_strings(int argc,char __user * __user * argv,struct linux_binprm *bprm);
81extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); 80extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
82extern void compute_creds(struct linux_binprm *binprm); 81extern void compute_creds(struct linux_binprm *binprm);
83extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); 82extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
diff --git a/include/linux/compiler-gcc2.h b/include/linux/compiler-gcc2.h
index 5a359153ffd9..ebed17660c5f 100644
--- a/include/linux/compiler-gcc2.h
+++ b/include/linux/compiler-gcc2.h
@@ -22,3 +22,8 @@
22# define __attribute_pure__ __attribute__((pure)) 22# define __attribute_pure__ __attribute__((pure))
23# define __attribute_const__ __attribute__((__const__)) 23# define __attribute_const__ __attribute__((__const__))
24#endif 24#endif
25
26/* GCC 2.95.x/2.96 recognize __va_copy, but not va_copy. Actually later GCC's
27 * define both va_copy and __va_copy, but the latter may go away, so limit this
28 * to this header */
29#define va_copy __va_copy
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 487725cf0d0d..d7378215b851 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -90,6 +90,12 @@ extern void __chk_io_ptr(void __iomem *);
90# define __deprecated /* unimplemented */ 90# define __deprecated /* unimplemented */
91#endif 91#endif
92 92
93#ifdef MODULE
94#define __deprecated_for_modules __deprecated
95#else
96#define __deprecated_for_modules
97#endif
98
93#ifndef __must_check 99#ifndef __must_check
94#define __must_check 100#define __must_check
95#endif 101#endif
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 910eca35583d..f21af067d015 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -103,6 +103,7 @@ struct cpufreq_policy {
103#define CPUFREQ_PRECHANGE (0) 103#define CPUFREQ_PRECHANGE (0)
104#define CPUFREQ_POSTCHANGE (1) 104#define CPUFREQ_POSTCHANGE (1)
105#define CPUFREQ_RESUMECHANGE (8) 105#define CPUFREQ_RESUMECHANGE (8)
106#define CPUFREQ_SUSPENDCHANGE (9)
106 107
107struct cpufreq_freqs { 108struct cpufreq_freqs {
108 unsigned int cpu; /* cpu nr */ 109 unsigned int cpu; /* cpu nr */
@@ -200,6 +201,7 @@ struct cpufreq_driver {
200 201
201 /* optional */ 202 /* optional */
202 int (*exit) (struct cpufreq_policy *policy); 203 int (*exit) (struct cpufreq_policy *policy);
204 int (*suspend) (struct cpufreq_policy *policy, u32 state);
203 int (*resume) (struct cpufreq_policy *policy); 205 int (*resume) (struct cpufreq_policy *policy);
204 struct freq_attr **attr; 206 struct freq_attr **attr;
205}; 207};
@@ -211,7 +213,8 @@ struct cpufreq_driver {
211#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel 213#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel
212 * "constants" aren't affected by 214 * "constants" aren't affected by
213 * frequency transitions */ 215 * frequency transitions */
214 216#define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed
217 * mismatches */
215 218
216int cpufreq_register_driver(struct cpufreq_driver *driver_data); 219int cpufreq_register_driver(struct cpufreq_driver *driver_data);
217int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 220int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
diff --git a/include/linux/edd.h b/include/linux/edd.h
index c6e6747a401d..162512b886f7 100644
--- a/include/linux/edd.h
+++ b/include/linux/edd.h
@@ -32,7 +32,7 @@
32 32
33#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF 33#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
34 in boot_params - treat this as 1 byte */ 34 in boot_params - treat this as 1 byte */
35#define EDDBUF 0x600 /* addr of edd_info structs in boot_params */ 35#define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
36#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */ 36#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */
37#define EDDEXTSIZE 8 /* change these if you muck with the structures */ 37#define EDDEXTSIZE 8 /* change these if you muck with the structures */
38#define EDDPARMSIZE 74 38#define EDDPARMSIZE 74
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 396c48cbaeb1..220748b7abea 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)eth.h 1.0.4 05/13/93 8 * Version: @(#)eth.h 1.0.4 05/13/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * Relocated to include/linux where it belongs by Alan Cox 13 * Relocated to include/linux where it belongs by Alan Cox
diff --git a/include/linux/fb.h b/include/linux/fb.h
index b45d3e2d711a..b468bf496547 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -563,6 +563,9 @@ struct fb_ops {
563 int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green, 563 int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green,
564 unsigned blue, unsigned transp, struct fb_info *info); 564 unsigned blue, unsigned transp, struct fb_info *info);
565 565
566 /* set color registers in batch */
567 int (*fb_setcmap)(struct fb_cmap *cmap, struct fb_info *info);
568
566 /* blank display */ 569 /* blank display */
567 int (*fb_blank)(int blank, struct fb_info *info); 570 int (*fb_blank)(int blank, struct fb_info *info);
568 571
diff --git a/include/linux/fddidevice.h b/include/linux/fddidevice.h
index 2e5ee47f3e1e..002f6367697d 100644
--- a/include/linux/fddidevice.h
+++ b/include/linux/fddidevice.h
@@ -10,7 +10,7 @@
10 * Author: Lawrence V. Stefani, <stefani@lkg.dec.com> 10 * Author: Lawrence V. Stefani, <stefani@lkg.dec.com>
11 * 11 *
12 * fddidevice.h is based on previous trdevice.h work by 12 * fddidevice.h is based on previous trdevice.h work by
13 * Ross Biro, <bir7@leland.Stanford.Edu> 13 * Ross Biro
14 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 14 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
15 * Alan Cox, <gw4pts@gw4pts.ampr.org> 15 * Alan Cox, <gw4pts@gw4pts.ampr.org>
16 * 16 *
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5df687d940fa..0180102dace1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1053,83 +1053,87 @@ static inline void file_accessed(struct file *file)
1053int sync_inode(struct inode *inode, struct writeback_control *wbc); 1053int sync_inode(struct inode *inode, struct writeback_control *wbc);
1054 1054
1055/** 1055/**
1056 * &export_operations - for nfsd to communicate with file systems 1056 * struct export_operations - for nfsd to communicate with file systems
1057 * decode_fh: decode a file handle fragment and return a &struct dentry 1057 * @decode_fh: decode a file handle fragment and return a &struct dentry
1058 * encode_fh: encode a file handle fragment from a dentry 1058 * @encode_fh: encode a file handle fragment from a dentry
1059 * get_name: find the name for a given inode in a given directory 1059 * @get_name: find the name for a given inode in a given directory
1060 * get_parent: find the parent of a given directory 1060 * @get_parent: find the parent of a given directory
1061 * get_dentry: find a dentry for the inode given a file handle sub-fragment 1061 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
1062 * 1062 *
1063 * Description: 1063 * Description:
1064 * The export_operations structure provides a means for nfsd to communicate 1064 * The export_operations structure provides a means for nfsd to communicate
1065 * with a particular exported file system - particularly enabling nfsd and 1065 * with a particular exported file system - particularly enabling nfsd and
1066 * the filesystem to co-operate when dealing with file handles. 1066 * the filesystem to co-operate when dealing with file handles.
1067 * 1067 *
1068 * export_operations contains two basic operation for dealing with file handles, 1068 * export_operations contains two basic operation for dealing with file
1069 * decode_fh() and encode_fh(), and allows for some other operations to be defined 1069 * handles, decode_fh() and encode_fh(), and allows for some other
1070 * which standard helper routines use to get specific information from the 1070 * operations to be defined which standard helper routines use to get
1071 * filesystem. 1071 * specific information from the filesystem.
1072 * 1072 *
1073 * nfsd encodes information use to determine which filesystem a filehandle 1073 * nfsd encodes information use to determine which filesystem a filehandle
1074 * applies to in the initial part of the file handle. The remainder, termed a 1074 * applies to in the initial part of the file handle. The remainder, termed
1075 * file handle fragment, is controlled completely by the filesystem. 1075 * a file handle fragment, is controlled completely by the filesystem. The
1076 * The standard helper routines assume that this fragment will contain one or two 1076 * standard helper routines assume that this fragment will contain one or
1077 * sub-fragments, one which identifies the file, and one which may be used to 1077 * two sub-fragments, one which identifies the file, and one which may be
1078 * identify the (a) directory containing the file. 1078 * used to identify the (a) directory containing the file.
1079 * 1079 *
1080 * In some situations, nfsd needs to get a dentry which is connected into a 1080 * In some situations, nfsd needs to get a dentry which is connected into a
1081 * specific part of the file tree. To allow for this, it passes the function 1081 * specific part of the file tree. To allow for this, it passes the
1082 * acceptable() together with a @context which can be used to see if the dentry 1082 * function acceptable() together with a @context which can be used to see
1083 * is acceptable. As there can be multiple dentrys for a given file, the filesystem 1083 * if the dentry is acceptable. As there can be multiple dentrys for a
1084 * should check each one for acceptability before looking for the next. As soon 1084 * given file, the filesystem should check each one for acceptability before
1085 * as an acceptable one is found, it should be returned. 1085 * looking for the next. As soon as an acceptable one is found, it should
1086 * be returned.
1086 * 1087 *
1087 * decode_fh: 1088 * decode_fh:
1088 * @decode_fh is given a &struct super_block (@sb), a file handle fragment (@fh, @fh_len) 1089 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
1089 * and an acceptability testing function (@acceptable, @context). It should return 1090 * (@fh, @fh_len) and an acceptability testing function (@acceptable,
1090 * a &struct dentry which refers to the same file that the file handle fragment refers 1091 * @context). It should return a &struct dentry which refers to the same
1091 * to, and which passes the acceptability test. If it cannot, it should return 1092 * file that the file handle fragment refers to, and which passes the
1092 * a %NULL pointer if the file was found but no acceptable &dentries were available, or 1093 * acceptability test. If it cannot, it should return a %NULL pointer if
1093 * a %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or %ENOMEM). 1094 * the file was found but no acceptable &dentries were available, or a
1095 * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or
1096 * %ENOMEM).
1094 * 1097 *
1095 * encode_fh: 1098 * encode_fh:
1096 * @encode_fh should store in the file handle fragment @fh (using at most @max_len bytes) 1099 * @encode_fh should store in the file handle fragment @fh (using at most
1097 * information that can be used by @decode_fh to recover the file refered to by the 1100 * @max_len bytes) information that can be used by @decode_fh to recover the
1098 * &struct dentry @de. If the @connectable flag is set, the encode_fh() should store 1101 * file refered to by the &struct dentry @de. If the @connectable flag is
1099 * sufficient information so that a good attempt can be made to find not only 1102 * set, the encode_fh() should store sufficient information so that a good
1100 * the file but also it's place in the filesystem. This typically means storing 1103 * attempt can be made to find not only the file but also it's place in the
1101 * a reference to de->d_parent in the filehandle fragment. 1104 * filesystem. This typically means storing a reference to de->d_parent in
1102 * encode_fh() should return the number of bytes stored or a negative error code 1105 * the filehandle fragment. encode_fh() should return the number of bytes
1103 * such as %-ENOSPC 1106 * stored or a negative error code such as %-ENOSPC
1104 * 1107 *
1105 * get_name: 1108 * get_name:
1106 * @get_name should find a name for the given @child in the given @parent directory. 1109 * @get_name should find a name for the given @child in the given @parent
1107 * The name should be stored in the @name (with the understanding that it is already 1110 * directory. The name should be stored in the @name (with the
1108 * pointing to a a %NAME_MAX+1 sized buffer. get_name() should return %0 on success, 1111 * understanding that it is already pointing to a a %NAME_MAX+1 sized
1109 * a negative error code or error. 1112 * buffer. get_name() should return %0 on success, a negative error code
1110 * @get_name will be called without @parent->i_sem held. 1113 * or error. @get_name will be called without @parent->i_sem held.
1111 * 1114 *
1112 * get_parent: 1115 * get_parent:
1113 * @get_parent should find the parent directory for the given @child which is also 1116 * @get_parent should find the parent directory for the given @child which
1114 * a directory. In the event that it cannot be found, or storage space cannot be 1117 * is also a directory. In the event that it cannot be found, or storage
1115 * allocated, a %ERR_PTR should be returned. 1118 * space cannot be allocated, a %ERR_PTR should be returned.
1116 * 1119 *
1117 * get_dentry: 1120 * get_dentry:
1118 * Given a &super_block (@sb) and a pointer to a file-system specific inode identifier, 1121 * Given a &super_block (@sb) and a pointer to a file-system specific inode
1119 * possibly an inode number, (@inump) get_dentry() should find the identified inode and 1122 * identifier, possibly an inode number, (@inump) get_dentry() should find
1120 * return a dentry for that inode. 1123 * the identified inode and return a dentry for that inode. Any suitable
1121 * Any suitable dentry can be returned including, if necessary, a new dentry created 1124 * dentry can be returned including, if necessary, a new dentry created with
1122 * with d_alloc_root. The caller can then find any other extant dentrys by following the 1125 * d_alloc_root. The caller can then find any other extant dentrys by
1123 * d_alias links. If a new dentry was created using d_alloc_root, DCACHE_NFSD_DISCONNECTED 1126 * following the d_alias links. If a new dentry was created using
1124 * should be set, and the dentry should be d_rehash()ed. 1127 * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry
1128 * should be d_rehash()ed.
1125 * 1129 *
1126 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code can be returned. 1130 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code
1127 * The @inump will be whatever was passed to nfsd_find_fh_dentry() in either the 1131 * can be returned. The @inump will be whatever was passed to
1128 * @obj or @parent parameters. 1132 * nfsd_find_fh_dentry() in either the @obj or @parent parameters.
1129 * 1133 *
1130 * Locking rules: 1134 * Locking rules:
1131 * get_parent is called with child->d_inode->i_sem down 1135 * get_parent is called with child->d_inode->i_sem down
1132 * get_name is not (which is possibly inconsistent) 1136 * get_name is not (which is possibly inconsistent)
1133 */ 1137 */
1134 1138
1135struct export_operations { 1139struct export_operations {
@@ -1337,7 +1341,7 @@ extern int fs_may_remount_ro(struct super_block *);
1337 1341
1338extern int check_disk_change(struct block_device *); 1342extern int check_disk_change(struct block_device *);
1339extern int invalidate_inodes(struct super_block *); 1343extern int invalidate_inodes(struct super_block *);
1340extern int __invalidate_device(struct block_device *, int); 1344extern int __invalidate_device(struct block_device *);
1341extern int invalidate_partition(struct gendisk *, int); 1345extern int invalidate_partition(struct gendisk *, int);
1342unsigned long invalidate_mapping_pages(struct address_space *mapping, 1346unsigned long invalidate_mapping_pages(struct address_space *mapping,
1343 pgoff_t start, pgoff_t end); 1347 pgoff_t start, pgoff_t end);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 848a1baac079..af7407e8cfc5 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -38,14 +38,16 @@ struct vm_area_struct;
38#define __GFP_NO_GROW 0x2000u /* Slab internal usage */ 38#define __GFP_NO_GROW 0x2000u /* Slab internal usage */
39#define __GFP_COMP 0x4000u /* Add compound page metadata */ 39#define __GFP_COMP 0x4000u /* Add compound page metadata */
40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ 40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */
41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */
41 42
42#define __GFP_BITS_SHIFT 16 /* Room for 16 __GFP_FOO bits */ 43#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
43#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) 44#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
44 45
45/* if you forget to add the bitmask here kernel will crash, period */ 46/* if you forget to add the bitmask here kernel will crash, period */
46#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 47#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
47 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 48 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
48 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP) 49 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
50 __GFP_NOMEMALLOC)
49 51
50#define GFP_ATOMIC (__GFP_HIGH) 52#define GFP_ATOMIC (__GFP_HIGH)
51#define GFP_NOIO (__GFP_WAIT) 53#define GFP_NOIO (__GFP_WAIT)
diff --git a/include/linux/hippidevice.h b/include/linux/hippidevice.h
index 89b3a4a5b761..9debe6bbe5f0 100644
--- a/include/linux/hippidevice.h
+++ b/include/linux/hippidevice.h
@@ -10,7 +10,7 @@
10 * Author: Jes Sorensen, <Jes.Sorensen@cern.ch> 10 * Author: Jes Sorensen, <Jes.Sorensen@cern.ch>
11 * 11 *
12 * hippidevice.h is based on previous fddidevice.h work by 12 * hippidevice.h is based on previous fddidevice.h work by
13 * Ross Biro, <bir7@leland.Stanford.Edu> 13 * Ross Biro
14 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 14 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
15 * Alan Cox, <gw4pts@gw4pts.ampr.org> 15 * Alan Cox, <gw4pts@gw4pts.ampr.org>
16 * Lawrence V. Stefani, <stefani@lkg.dec.com> 16 * Lawrence V. Stefani, <stefani@lkg.dec.com>
diff --git a/include/linux/if.h b/include/linux/if.h
index 110282dbd3e0..d73a9d62f208 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -8,7 +8,7 @@
8 * Version: @(#)if.h 1.0.2 04/18/93 8 * Version: @(#)if.h 1.0.2 04/18/93
9 * 9 *
10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988 10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
11 * Ross Biro, <bir7@leland.Stanford.Edu> 11 * Ross Biro
12 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 12 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
13 * 13 *
14 * This program is free software; you can redistribute it and/or 14 * This program is free software; you can redistribute it and/or
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index bbf49bcd7705..0856548a2a08 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -9,7 +9,7 @@
9 * 9 *
10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
11 * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. 11 * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
12 * Ross Biro, <bir7@leland.Stanford.Edu> 12 * Ross Biro
13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
14 * Florian La Roche, 14 * Florian La Roche,
15 * Jonathan Layes <layes@loran.com> 15 * Jonathan Layes <layes@loran.com>
diff --git a/include/linux/if_ltalk.h b/include/linux/if_ltalk.h
index e75e832b7ff0..76525760ba48 100644
--- a/include/linux/if_ltalk.h
+++ b/include/linux/if_ltalk.h
@@ -6,7 +6,7 @@
6#define LTALK_ALEN 1 6#define LTALK_ALEN 1
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9extern void ltalk_setup(struct net_device *); 9extern struct net_device *alloc_ltalkdev(int sizeof_priv);
10#endif 10#endif
11 11
12#endif 12#endif
diff --git a/include/linux/input.h b/include/linux/input.h
index b70df8fe60e6..72731d7d189e 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -328,6 +328,11 @@ struct input_absinfo {
328#define KEY_BRIGHTNESSUP 225 328#define KEY_BRIGHTNESSUP 225
329#define KEY_MEDIA 226 329#define KEY_MEDIA 226
330 330
331#define KEY_SWITCHVIDEOMODE 227
332#define KEY_KBDILLUMTOGGLE 228
333#define KEY_KBDILLUMDOWN 229
334#define KEY_KBDILLUMUP 230
335
331#define KEY_UNKNOWN 240 336#define KEY_UNKNOWN 240
332 337
333#define BTN_MISC 0x100 338#define BTN_MISC 0x100
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h
index 099039d4b10d..47967878bfef 100644
--- a/include/linux/iso_fs.h
+++ b/include/linux/iso_fs.h
@@ -1,4 +1,3 @@
1
2#ifndef _ISOFS_FS_H 1#ifndef _ISOFS_FS_H
3#define _ISOFS_FS_H 2#define _ISOFS_FS_H
4 3
@@ -163,150 +162,4 @@ struct iso_directory_record {
163 162
164#define ISOFS_SUPER_MAGIC 0x9660 163#define ISOFS_SUPER_MAGIC 0x9660
165 164
166#ifdef __KERNEL__
167/* Number conversion inlines, named after the section in ISO 9660
168 they correspond to. */
169
170#include <asm/byteorder.h>
171#include <asm/unaligned.h>
172#include <linux/iso_fs_i.h>
173#include <linux/iso_fs_sb.h>
174
175static inline struct isofs_sb_info *ISOFS_SB(struct super_block *sb)
176{
177 return sb->s_fs_info;
178}
179
180static inline struct iso_inode_info *ISOFS_I(struct inode *inode)
181{
182 return container_of(inode, struct iso_inode_info, vfs_inode);
183}
184
185static inline int isonum_711(char *p)
186{
187 return *(u8 *)p;
188}
189static inline int isonum_712(char *p)
190{
191 return *(s8 *)p;
192}
193static inline unsigned int isonum_721(char *p)
194{
195 return le16_to_cpu(get_unaligned((__le16 *)p));
196}
197static inline unsigned int isonum_722(char *p)
198{
199 return be16_to_cpu(get_unaligned((__le16 *)p));
200}
201static inline unsigned int isonum_723(char *p)
202{
203 /* Ignore bigendian datum due to broken mastering programs */
204 return le16_to_cpu(get_unaligned((__le16 *)p));
205}
206static inline unsigned int isonum_731(char *p)
207{
208 return le32_to_cpu(get_unaligned((__le32 *)p));
209}
210static inline unsigned int isonum_732(char *p)
211{
212 return be32_to_cpu(get_unaligned((__le32 *)p));
213}
214static inline unsigned int isonum_733(char *p)
215{
216 /* Ignore bigendian datum due to broken mastering programs */
217 return le32_to_cpu(get_unaligned((__le32 *)p));
218}
219extern int iso_date(char *, int);
220
221struct inode; /* To make gcc happy */
222
223extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
224extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
225extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *);
226
227int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *);
228int get_acorn_filename(struct iso_directory_record *, char *, struct inode *);
229
230extern struct dentry *isofs_lookup(struct inode *, struct dentry *, struct nameidata *);
231extern struct buffer_head *isofs_bread(struct inode *, sector_t);
232extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long);
233
234extern struct inode *isofs_iget(struct super_block *sb,
235 unsigned long block,
236 unsigned long offset);
237
238/* Because the inode number is no longer relevant to finding the
239 * underlying meta-data for an inode, we are free to choose a more
240 * convenient 32-bit number as the inode number. The inode numbering
241 * scheme was recommended by Sergey Vlasov and Eric Lammerts. */
242static inline unsigned long isofs_get_ino(unsigned long block,
243 unsigned long offset,
244 unsigned long bufbits)
245{
246 return (block << (bufbits - 5)) | (offset >> 5);
247}
248
249/* Every directory can have many redundant directory entries scattered
250 * throughout the directory tree. First there is the directory entry
251 * with the name of the directory stored in the parent directory.
252 * Then, there is the "." directory entry stored in the directory
253 * itself. Finally, there are possibly many ".." directory entries
254 * stored in all the subdirectories.
255 *
256 * In order for the NFS get_parent() method to work and for the
257 * general consistency of the dcache, we need to make sure the
258 * "i_iget5_block" and "i_iget5_offset" all point to exactly one of
259 * the many redundant entries for each directory. We normalize the
260 * block and offset by always making them point to the "." directory.
261 *
262 * Notice that we do not use the entry for the directory with the name
263 * that is located in the parent directory. Even though choosing this
264 * first directory is more natural, it is much easier to find the "."
265 * entry in the NFS get_parent() method because it is implicitly
266 * encoded in the "extent + ext_attr_length" fields of _all_ the
267 * redundant entries for the directory. Thus, it can always be
268 * reached regardless of which directory entry you have in hand.
269 *
270 * This works because the "." entry is simply the first directory
271 * record when you start reading the file that holds all the directory
272 * records, and this file starts at "extent + ext_attr_length" blocks.
273 * Because the "." entry is always the first entry listed in the
274 * directories file, the normalized "offset" value is always 0.
275 *
276 * You should pass the directory entry in "de". On return, "block"
277 * and "offset" will hold normalized values. Only directories are
278 * affected making it safe to call even for non-directory file
279 * types. */
280static inline void
281isofs_normalize_block_and_offset(struct iso_directory_record* de,
282 unsigned long *block,
283 unsigned long *offset)
284{
285 /* Only directories are normalized. */
286 if (de->flags[0] & 2) {
287 *offset = 0;
288 *block = (unsigned long)isonum_733(de->extent)
289 + (unsigned long)isonum_711(de->ext_attr_length);
290 }
291}
292
293extern struct inode_operations isofs_dir_inode_operations;
294extern struct file_operations isofs_dir_operations;
295extern struct address_space_operations isofs_symlink_aops;
296extern struct export_operations isofs_export_ops;
297
298/* The following macros are used to check for memory leaks. */
299#ifdef LEAK_CHECK
300#define free_s leak_check_free_s
301#define malloc leak_check_malloc
302#define sb_bread leak_check_bread
303#define brelse leak_check_brelse
304extern void * leak_check_malloc(unsigned int size);
305extern void leak_check_free_s(void * obj, int size);
306extern struct buffer_head * leak_check_bread(struct super_block *sb, int block);
307extern void leak_check_brelse(struct buffer_head * bh);
308#endif /* LEAK_CHECK */
309
310#endif /* __KERNEL__ */
311
312#endif 165#endif
diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h
deleted file mode 100644
index 59065e939eaa..000000000000
--- a/include/linux/iso_fs_i.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef _ISO_FS_I
2#define _ISO_FS_I
3
4#include <linux/fs.h>
5
6enum isofs_file_format {
7 isofs_file_normal = 0,
8 isofs_file_sparse = 1,
9 isofs_file_compressed = 2,
10};
11
12/*
13 * iso fs inode data in memory
14 */
15struct iso_inode_info {
16 unsigned long i_iget5_block;
17 unsigned long i_iget5_offset;
18 unsigned int i_first_extent;
19 unsigned char i_file_format;
20 unsigned char i_format_parm[3];
21 unsigned long i_next_section_block;
22 unsigned long i_next_section_offset;
23 off_t i_section_size;
24 struct inode vfs_inode;
25};
26
27#endif
diff --git a/include/linux/iso_fs_sb.h b/include/linux/iso_fs_sb.h
deleted file mode 100644
index 043b97b55b8d..000000000000
--- a/include/linux/iso_fs_sb.h
+++ /dev/null
@@ -1,34 +0,0 @@
1#ifndef _ISOFS_FS_SB
2#define _ISOFS_FS_SB
3
4/*
5 * iso9660 super-block data in memory
6 */
7struct isofs_sb_info {
8 unsigned long s_ninodes;
9 unsigned long s_nzones;
10 unsigned long s_firstdatazone;
11 unsigned long s_log_zone_size;
12 unsigned long s_max_size;
13
14 unsigned char s_high_sierra; /* A simple flag */
15 unsigned char s_mapping;
16 int s_rock_offset; /* offset of SUSP fields within SU area */
17 unsigned char s_rock;
18 unsigned char s_joliet_level;
19 unsigned char s_utf8;
20 unsigned char s_cruft; /* Broken disks with high
21 byte of length containing
22 junk */
23 unsigned char s_unhide;
24 unsigned char s_nosuid;
25 unsigned char s_nodev;
26 unsigned char s_nocompress;
27
28 mode_t s_mode;
29 gid_t s_gid;
30 uid_t s_uid;
31 struct nls_table *s_nls_iocharset; /* Native language support table */
32};
33
34#endif
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
index 88121166d715..fd1756d3a47e 100644
--- a/include/linux/ixjuser.h
+++ b/include/linux/ixjuser.h
@@ -42,8 +42,6 @@
42 * 42 *
43 *****************************************************************************/ 43 *****************************************************************************/
44 44
45static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 4.1 2001/08/05 00:17:37 craigs Exp $";
46
47#include <linux/telephony.h> 45#include <linux/telephony.h>
48 46
49 47
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7c1cba4a5278..e25b97062ce1 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -115,10 +115,19 @@ extern int __kernel_text_address(unsigned long addr);
115extern int kernel_text_address(unsigned long addr); 115extern int kernel_text_address(unsigned long addr);
116extern int session_of_pgrp(int pgrp); 116extern int session_of_pgrp(int pgrp);
117 117
118#ifdef CONFIG_PRINTK
118asmlinkage int vprintk(const char *fmt, va_list args) 119asmlinkage int vprintk(const char *fmt, va_list args)
119 __attribute__ ((format (printf, 1, 0))); 120 __attribute__ ((format (printf, 1, 0)));
120asmlinkage int printk(const char * fmt, ...) 121asmlinkage int printk(const char * fmt, ...)
121 __attribute__ ((format (printf, 1, 2))); 122 __attribute__ ((format (printf, 1, 2)));
123#else
124static inline int vprintk(const char *s, va_list args)
125 __attribute__ ((format (printf, 1, 0)));
126static inline int vprintk(const char *s, va_list args) { return 0; }
127static inline int printk(const char *s, ...)
128 __attribute__ ((format (printf, 1, 2)));
129static inline int printk(const char *s, ...) { return 0; }
130#endif
122 131
123unsigned long int_sqrt(unsigned long); 132unsigned long int_sqrt(unsigned long);
124 133
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index f20c163de4f5..99ddba5a4e00 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -43,6 +43,9 @@ typedef int (*kprobe_fault_handler_t) (struct kprobe *, struct pt_regs *,
43struct kprobe { 43struct kprobe {
44 struct hlist_node hlist; 44 struct hlist_node hlist;
45 45
46 /* list of kprobes for multi-handler support */
47 struct list_head list;
48
46 /* location of the probe point */ 49 /* location of the probe point */
47 kprobe_opcode_t *addr; 50 kprobe_opcode_t *addr;
48 51
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c74a74ca401d..17518fe0b311 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -637,9 +637,9 @@ extern unsigned long do_mremap(unsigned long addr,
637 * These functions are passed a count `nr_to_scan' and a gfpmask. They should 637 * These functions are passed a count `nr_to_scan' and a gfpmask. They should
638 * scan `nr_to_scan' objects, attempting to free them. 638 * scan `nr_to_scan' objects, attempting to free them.
639 * 639 *
640 * The callback must the number of objects which remain in the cache. 640 * The callback must return the number of objects which remain in the cache.
641 * 641 *
642 * The callback will be passes nr_to_scan == 0 when the VM is querying the 642 * The callback will be passed nr_to_scan == 0 when the VM is querying the
643 * cache size, so a fastpath for that case is appropriate. 643 * cache size, so a fastpath for that case is appropriate.
644 */ 644 */
645typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); 645typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask);
@@ -726,6 +726,7 @@ extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
726extern struct vm_area_struct *copy_vma(struct vm_area_struct **, 726extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
727 unsigned long addr, unsigned long len, pgoff_t pgoff); 727 unsigned long addr, unsigned long len, pgoff_t pgoff);
728extern void exit_mmap(struct mm_struct *); 728extern void exit_mmap(struct mm_struct *);
729extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
729 730
730extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 731extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
731 732
diff --git a/include/linux/mpage.h b/include/linux/mpage.h
index dea1b0083661..3ca880463c47 100644
--- a/include/linux/mpage.h
+++ b/include/linux/mpage.h
@@ -20,9 +20,6 @@ int mpage_writepages(struct address_space *mapping,
20 struct writeback_control *wbc, get_block_t get_block); 20 struct writeback_control *wbc, get_block_t get_block);
21int mpage_writepage(struct page *page, get_block_t *get_block, 21int mpage_writepage(struct page *page, get_block_t *get_block,
22 struct writeback_control *wbc); 22 struct writeback_control *wbc);
23int __mpage_writepages(struct address_space *mapping,
24 struct writeback_control *wbc, get_block_t get_block,
25 writepage_t writepage);
26 23
27static inline int 24static inline int
28generic_writepages(struct address_space *mapping, struct writeback_control *wbc) 25generic_writepages(struct address_space *mapping, struct writeback_control *wbc)
diff --git a/include/linux/net.h b/include/linux/net.h
index 7823b3482506..6d997ff3f103 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -7,7 +7,7 @@
7 * Version: @(#)net.h 1.0.3 05/25/93 7 * Version: @(#)net.h 1.0.3 05/25/93
8 * 8 *
9 * Authors: Orest Zborowski, <obz@Kodak.COM> 9 * Authors: Orest Zborowski, <obz@Kodak.COM>
10 * Ross Biro, <bir7@leland.Stanford.Edu> 10 * Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
@@ -64,19 +64,19 @@ typedef enum {
64#define SOCK_PASSCRED 3 64#define SOCK_PASSCRED 3
65 65
66#ifndef ARCH_HAS_SOCKET_TYPES 66#ifndef ARCH_HAS_SOCKET_TYPES
67/** sock_type - Socket types 67/**
68 * 68 * enum sock_type - Socket types
69 * @SOCK_STREAM: stream (connection) socket
70 * @SOCK_DGRAM: datagram (conn.less) socket
71 * @SOCK_RAW: raw socket
72 * @SOCK_RDM: reliably-delivered message
73 * @SOCK_SEQPACKET: sequential packet socket
74 * @SOCK_PACKET: linux specific way of getting packets at the dev level.
75 * For writing rarp and other similar things on the user level.
76 *
69 * When adding some new socket type please 77 * When adding some new socket type please
70 * grep ARCH_HAS_SOCKET_TYPE include/asm-* /socket.h, at least MIPS 78 * grep ARCH_HAS_SOCKET_TYPE include/asm-* /socket.h, at least MIPS
71 * overrides this enum for binary compat reasons. 79 * overrides this enum for binary compat reasons.
72 *
73 * @SOCK_STREAM - stream (connection) socket
74 * @SOCK_DGRAM - datagram (conn.less) socket
75 * @SOCK_RAW - raw socket
76 * @SOCK_RDM - reliably-delivered message
77 * @SOCK_SEQPACKET - sequential packet socket
78 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
79 * For writing rarp and other similar things on the user level.
80 */ 80 */
81enum sock_type { 81enum sock_type {
82 SOCK_STREAM = 1, 82 SOCK_STREAM = 1,
@@ -93,15 +93,15 @@ enum sock_type {
93 93
94/** 94/**
95 * struct socket - general BSD socket 95 * struct socket - general BSD socket
96 * @state - socket state (%SS_CONNECTED, etc) 96 * @state: socket state (%SS_CONNECTED, etc)
97 * @flags - socket flags (%SOCK_ASYNC_NOSPACE, etc) 97 * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc)
98 * @ops - protocol specific socket operations 98 * @ops: protocol specific socket operations
99 * @fasync_list - Asynchronous wake up list 99 * @fasync_list: Asynchronous wake up list
100 * @file - File back pointer for gc 100 * @file: File back pointer for gc
101 * @sk - internal networking protocol agnostic socket representation 101 * @sk: internal networking protocol agnostic socket representation
102 * @wait - wait queue for several uses 102 * @wait: wait queue for several uses
103 * @type - socket type (%SOCK_STREAM, etc) 103 * @type: socket type (%SOCK_STREAM, etc)
104 * @passcred - credentials (used only in Unix Sockets (aka PF_LOCAL)) 104 * @passcred: credentials (used only in Unix Sockets (aka PF_LOCAL))
105 */ 105 */
106struct socket { 106struct socket {
107 socket_state state; 107 socket_state state;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8d775be67833..ac11d73be4ce 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)dev.h 1.0.10 08/12/93 8 * Version: @(#)dev.h 1.0.10 08/12/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Corey Minyard <wf-rch!minyard@relay.EU.net> 12 * Corey Minyard <wf-rch!minyard@relay.EU.net>
13 * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov> 13 * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index c9bacf9b2431..9e5750079e09 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -62,6 +62,9 @@ enum nf_ip_hook_priorities {
62 NF_IP_PRI_FILTER = 0, 62 NF_IP_PRI_FILTER = 0,
63 NF_IP_PRI_NAT_SRC = 100, 63 NF_IP_PRI_NAT_SRC = 100,
64 NF_IP_PRI_SELINUX_LAST = 225, 64 NF_IP_PRI_SELINUX_LAST = 225,
65 NF_IP_PRI_CONNTRACK_HELPER = INT_MAX - 2,
66 NF_IP_PRI_NAT_SEQ_ADJUST = INT_MAX - 1,
67 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
65 NF_IP_PRI_LAST = INT_MAX, 68 NF_IP_PRI_LAST = INT_MAX,
66}; 69};
67 70
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f731abdc1a29..b2738ac8bc99 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -110,6 +110,7 @@ struct netlink_skb_parms
110 __u32 dst_pid; 110 __u32 dst_pid;
111 __u32 dst_groups; 111 __u32 dst_groups;
112 kernel_cap_t eff_cap; 112 kernel_cap_t eff_cap;
113 __u32 loginuid; /* Login (audit) uid */
113}; 114};
114 115
115#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) 116#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6b74fcf5bb63..39ab8c6b5652 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -131,6 +131,7 @@ struct page_state {
131 unsigned long allocstall; /* direct reclaim calls */ 131 unsigned long allocstall; /* direct reclaim calls */
132 132
133 unsigned long pgrotated; /* pages rotated to tail of the LRU */ 133 unsigned long pgrotated; /* pages rotated to tail of the LRU */
134 unsigned long nr_bounce; /* pages for bounce buffers */
134}; 135};
135 136
136extern void get_page_state(struct page_state *ret); 137extern void get_page_state(struct page_state *ret);
diff --git a/include/linux/patchkey.h b/include/linux/patchkey.h
new file mode 100644
index 000000000000..d974a6e92372
--- /dev/null
+++ b/include/linux/patchkey.h
@@ -0,0 +1,45 @@
1/*
2 * <linux/patchkey.h> -- definition of _PATCHKEY macro
3 *
4 * Copyright (C) 2005 Stuart Brady
5 *
6 * This exists because awe_voice.h defined its own _PATCHKEY and it wasn't
7 * clear whether removing this would break anything in userspace.
8 *
9 * Do not include this file directly. Please use <sys/soundcard.h> instead.
10 * For kernel code, use <linux/soundcard.h>
11 */
12
13#ifndef _LINUX_PATCHKEY_H_INDIRECT
14#error "patchkey.h included directly"
15#endif
16
17#ifndef _LINUX_PATCHKEY_H
18#define _LINUX_PATCHKEY_H
19
20/* Endian macros. */
21#ifdef __KERNEL__
22# include <asm/byteorder.h>
23#else
24# include <endian.h>
25#endif
26
27#if defined(__KERNEL__)
28# if defined(__BIG_ENDIAN)
29# define _PATCHKEY(id) (0xfd00|id)
30# elif defined(__LITTLE_ENDIAN)
31# define _PATCHKEY(id) ((id<<8)|0x00fd)
32# else
33# error "could not determine byte order"
34# endif
35#elif defined(__BYTE_ORDER)
36# if __BYTE_ORDER == __BIG_ENDIAN
37# define _PATCHKEY(id) (0xfd00|id)
38# elif __BYTE_ORDER == __LITTLE_ENDIAN
39# define _PATCHKEY(id) ((id<<8)|0x00fd)
40# else
41# error "could not determine byte order"
42# endif
43#endif
44
45#endif /* _LINUX_PATCHKEY_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3c89148ae28a..b5238bd18830 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -671,6 +671,7 @@ struct pci_driver {
671 int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ 671 int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */
672 int (*resume) (struct pci_dev *dev); /* Device woken up */ 672 int (*resume) (struct pci_dev *dev); /* Device woken up */
673 int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ 673 int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
674 void (*shutdown) (struct pci_dev *dev);
674 675
675 struct device_driver driver; 676 struct device_driver driver;
676 struct pci_dynids dynids; 677 struct pci_dynids dynids;
@@ -810,7 +811,6 @@ void pci_set_master(struct pci_dev *dev);
810int pci_set_mwi(struct pci_dev *dev); 811int pci_set_mwi(struct pci_dev *dev);
811void pci_clear_mwi(struct pci_dev *dev); 812void pci_clear_mwi(struct pci_dev *dev);
812int pci_set_dma_mask(struct pci_dev *dev, u64 mask); 813int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
813int pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask);
814int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 814int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
815int pci_assign_resource(struct pci_dev *dev, int i); 815int pci_assign_resource(struct pci_dev *dev, int i);
816 816
@@ -941,7 +941,6 @@ static inline void pci_set_master(struct pci_dev *dev) { }
941static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } 941static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
942static inline void pci_disable_device(struct pci_dev *dev) { } 942static inline void pci_disable_device(struct pci_dev *dev) { }
943static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } 943static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; }
944static inline int pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; }
945static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} 944static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;}
946static inline int pci_register_driver(struct pci_driver *drv) { return 0;} 945static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
947static inline void pci_unregister_driver(struct pci_driver *drv) { } 946static inline void pci_unregister_driver(struct pci_driver *drv) { }
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f1f75fde8cd4..ae27792b5aa4 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -854,6 +854,7 @@
854#define PCI_DEVICE_ID_MYLEX_DAC960_LA 0x0020 854#define PCI_DEVICE_ID_MYLEX_DAC960_LA 0x0020
855#define PCI_DEVICE_ID_MYLEX_DAC960_LP 0x0050 855#define PCI_DEVICE_ID_MYLEX_DAC960_LP 0x0050
856#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 856#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
857#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
857 858
858#define PCI_VENDOR_ID_PICOP 0x1066 859#define PCI_VENDOR_ID_PICOP 0x1066
859#define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001 860#define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001
@@ -2062,6 +2063,7 @@
2062#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 2063#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182
2063 2064
2064#define PCI_VENDOR_ID_BROADCOM 0x14e4 2065#define PCI_VENDOR_ID_BROADCOM 0x14e4
2066#define PCI_DEVICE_ID_TIGON3_5752 0x1600
2065#define PCI_DEVICE_ID_TIGON3_5700 0x1644 2067#define PCI_DEVICE_ID_TIGON3_5700 0x1644
2066#define PCI_DEVICE_ID_TIGON3_5701 0x1645 2068#define PCI_DEVICE_ID_TIGON3_5701 0x1645
2067#define PCI_DEVICE_ID_TIGON3_5702 0x1646 2069#define PCI_DEVICE_ID_TIGON3_5702 0x1646
@@ -2414,6 +2416,8 @@
2414#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 2416#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
2415#define PCI_DEVICE_ID_INTEL_ICH7_2 0x27c0 2417#define PCI_DEVICE_ID_INTEL_ICH7_2 0x27c0
2416#define PCI_DEVICE_ID_INTEL_ICH7_3 0x27c1 2418#define PCI_DEVICE_ID_INTEL_ICH7_3 0x27c1
2419#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
2420#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
2417#define PCI_DEVICE_ID_INTEL_ICH7_5 0x27c4 2421#define PCI_DEVICE_ID_INTEL_ICH7_5 0x27c4
2418#define PCI_DEVICE_ID_INTEL_ICH7_6 0x27c5 2422#define PCI_DEVICE_ID_INTEL_ICH7_6 0x27c5
2419#define PCI_DEVICE_ID_INTEL_ICH7_7 0x27c8 2423#define PCI_DEVICE_ID_INTEL_ICH7_7 0x27c8
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 4d747433916b..fd276adf0fd5 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -157,9 +157,9 @@ static inline int rcu_pending(int cpu)
157/** 157/**
158 * rcu_read_lock - mark the beginning of an RCU read-side critical section. 158 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
159 * 159 *
160 * When synchronize_kernel() is invoked on one CPU while other CPUs 160 * When synchronize_rcu() is invoked on one CPU while other CPUs
161 * are within RCU read-side critical sections, then the 161 * are within RCU read-side critical sections, then the
162 * synchronize_kernel() is guaranteed to block until after all the other 162 * synchronize_rcu() is guaranteed to block until after all the other
163 * CPUs exit their critical sections. Similarly, if call_rcu() is invoked 163 * CPUs exit their critical sections. Similarly, if call_rcu() is invoked
164 * on one CPU while other CPUs are within RCU read-side critical 164 * on one CPU while other CPUs are within RCU read-side critical
165 * sections, invocation of the corresponding RCU callback is deferred 165 * sections, invocation of the corresponding RCU callback is deferred
@@ -256,6 +256,21 @@ static inline int rcu_pending(int cpu)
256 (p) = (v); \ 256 (p) = (v); \
257 }) 257 })
258 258
259/**
260 * synchronize_sched - block until all CPUs have exited any non-preemptive
261 * kernel code sequences.
262 *
263 * This means that all preempt_disable code sequences, including NMI and
264 * hardware-interrupt handlers, in progress on entry will have completed
265 * before this primitive returns. However, this does not guarantee that
266 * softirq handlers will have completed, since in some kernels
267 *
268 * This primitive provides the guarantees made by the (deprecated)
269 * synchronize_kernel() API. In contrast, synchronize_rcu() only
270 * guarantees that rcu_read_lock() sections will have completed.
271 */
272#define synchronize_sched() synchronize_rcu()
273
259extern void rcu_init(void); 274extern void rcu_init(void);
260extern void rcu_check_callbacks(int cpu, int user); 275extern void rcu_check_callbacks(int cpu, int user);
261extern void rcu_restart_cpu(int cpu); 276extern void rcu_restart_cpu(int cpu);
@@ -265,7 +280,9 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
265 void (*func)(struct rcu_head *head))); 280 void (*func)(struct rcu_head *head)));
266extern void FASTCALL(call_rcu_bh(struct rcu_head *head, 281extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
267 void (*func)(struct rcu_head *head))); 282 void (*func)(struct rcu_head *head)));
268extern void synchronize_kernel(void); 283extern __deprecated_for_modules void synchronize_kernel(void);
284extern void synchronize_rcu(void);
285void synchronize_idle(void);
269 286
270#endif /* __KERNEL__ */ 287#endif /* __KERNEL__ */
271#endif /* __LINUX_RCUPDATE_H */ 288#endif /* __LINUX_RCUPDATE_H */
diff --git a/include/linux/reboot_fixups.h b/include/linux/reboot_fixups.h
new file mode 100644
index 000000000000..480ea2d489d8
--- /dev/null
+++ b/include/linux/reboot_fixups.h
@@ -0,0 +1,10 @@
1#ifndef _LINUX_REBOOT_FIXUPS_H
2#define _LINUX_REBOOT_FIXUPS_H
3
4#ifdef CONFIG_X86_REBOOTFIXUPS
5extern void mach_reboot_fixups(void);
6#else
7#define mach_reboot_fixups() ((void)(0))
8#endif
9
10#endif /* _LINUX_REBOOT_FIXUPS_H */
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index a57e973af0bd..2aef9c3f5ce8 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -5,18 +5,18 @@
5#define REISERFS_ACL_VERSION 0x0001 5#define REISERFS_ACL_VERSION 0x0001
6 6
7typedef struct { 7typedef struct {
8 __u16 e_tag; 8 __le16 e_tag;
9 __u16 e_perm; 9 __le16 e_perm;
10 __u32 e_id; 10 __le32 e_id;
11} reiserfs_acl_entry; 11} reiserfs_acl_entry;
12 12
13typedef struct { 13typedef struct {
14 __u16 e_tag; 14 __le16 e_tag;
15 __u16 e_perm; 15 __le16 e_perm;
16} reiserfs_acl_entry_short; 16} reiserfs_acl_entry_short;
17 17
18typedef struct { 18typedef struct {
19 __u32 a_version; 19 __le32 a_version;
20} reiserfs_acl_header; 20} reiserfs_acl_header;
21 21
22static inline size_t reiserfs_acl_size(int count) 22static inline size_t reiserfs_acl_size(int count)
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index bccff8b17dc4..32148625fc2f 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -114,47 +114,47 @@ if( !( cond ) ) \
114 114
115 115
116struct journal_params { 116struct journal_params {
117 __u32 jp_journal_1st_block; /* where does journal start from on its 117 __le32 jp_journal_1st_block; /* where does journal start from on its
118 * device */ 118 * device */
119 __u32 jp_journal_dev; /* journal device st_rdev */ 119 __le32 jp_journal_dev; /* journal device st_rdev */
120 __u32 jp_journal_size; /* size of the journal */ 120 __le32 jp_journal_size; /* size of the journal */
121 __u32 jp_journal_trans_max; /* max number of blocks in a transaction. */ 121 __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */
122 __u32 jp_journal_magic; /* random value made on fs creation (this 122 __le32 jp_journal_magic; /* random value made on fs creation (this
123 * was sb_journal_block_count) */ 123 * was sb_journal_block_count) */
124 __u32 jp_journal_max_batch; /* max number of blocks to batch into a 124 __le32 jp_journal_max_batch; /* max number of blocks to batch into a
125 * trans */ 125 * trans */
126 __u32 jp_journal_max_commit_age; /* in seconds, how old can an async 126 __le32 jp_journal_max_commit_age; /* in seconds, how old can an async
127 * commit be */ 127 * commit be */
128 __u32 jp_journal_max_trans_age; /* in seconds, how old can a transaction 128 __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction
129 * be */ 129 * be */
130}; 130};
131 131
132/* this is the super from 3.5.X, where X >= 10 */ 132/* this is the super from 3.5.X, where X >= 10 */
133struct reiserfs_super_block_v1 133struct reiserfs_super_block_v1
134{ 134{
135 __u32 s_block_count; /* blocks count */ 135 __le32 s_block_count; /* blocks count */
136 __u32 s_free_blocks; /* free blocks count */ 136 __le32 s_free_blocks; /* free blocks count */
137 __u32 s_root_block; /* root block number */ 137 __le32 s_root_block; /* root block number */
138 struct journal_params s_journal; 138 struct journal_params s_journal;
139 __u16 s_blocksize; /* block size */ 139 __le16 s_blocksize; /* block size */
140 __u16 s_oid_maxsize; /* max size of object id array, see 140 __le16 s_oid_maxsize; /* max size of object id array, see
141 * get_objectid() commentary */ 141 * get_objectid() commentary */
142 __u16 s_oid_cursize; /* current size of object id array */ 142 __le16 s_oid_cursize; /* current size of object id array */
143 __u16 s_umount_state; /* this is set to 1 when filesystem was 143 __le16 s_umount_state; /* this is set to 1 when filesystem was
144 * umounted, to 2 - when not */ 144 * umounted, to 2 - when not */
145 char s_magic[10]; /* reiserfs magic string indicates that 145 char s_magic[10]; /* reiserfs magic string indicates that
146 * file system is reiserfs: 146 * file system is reiserfs:
147 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */ 147 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */
148 __u16 s_fs_state; /* it is set to used by fsck to mark which 148 __le16 s_fs_state; /* it is set to used by fsck to mark which
149 * phase of rebuilding is done */ 149 * phase of rebuilding is done */
150 __u32 s_hash_function_code; /* indicate, what hash function is being use 150 __le32 s_hash_function_code; /* indicate, what hash function is being use
151 * to sort names in a directory*/ 151 * to sort names in a directory*/
152 __u16 s_tree_height; /* height of disk tree */ 152 __le16 s_tree_height; /* height of disk tree */
153 __u16 s_bmap_nr; /* amount of bitmap blocks needed to address 153 __le16 s_bmap_nr; /* amount of bitmap blocks needed to address
154 * each block of file system */ 154 * each block of file system */
155 __u16 s_version; /* this field is only reliable on filesystem 155 __le16 s_version; /* this field is only reliable on filesystem
156 * with non-standard journal */ 156 * with non-standard journal */
157 __u16 s_reserved_for_journal; /* size in blocks of journal area on main 157 __le16 s_reserved_for_journal; /* size in blocks of journal area on main
158 * device, we need to keep after 158 * device, we need to keep after
159 * making fs with non-standard journal */ 159 * making fs with non-standard journal */
160} __attribute__ ((__packed__)); 160} __attribute__ ((__packed__));
@@ -165,8 +165,8 @@ struct reiserfs_super_block_v1
165struct reiserfs_super_block 165struct reiserfs_super_block
166{ 166{
167 struct reiserfs_super_block_v1 s_v1; 167 struct reiserfs_super_block_v1 s_v1;
168 __u32 s_inode_generation; 168 __le32 s_inode_generation;
169 __u32 s_flags; /* Right now used only by inode-attributes, if enabled */ 169 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */
170 unsigned char s_uuid[16]; /* filesystem unique identifier */ 170 unsigned char s_uuid[16]; /* filesystem unique identifier */
171 unsigned char s_label[16]; /* filesystem volume label */ 171 unsigned char s_label[16]; /* filesystem volume label */
172 char s_unused[88] ; /* zero filled by mkreiserfs and 172 char s_unused[88] ; /* zero filled by mkreiserfs and
@@ -225,7 +225,7 @@ struct reiserfs_super_block
225#define SB_ONDISK_JOURNAL_DEVICE(s) \ 225#define SB_ONDISK_JOURNAL_DEVICE(s) \
226 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_dev)) 226 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_dev))
227#define SB_ONDISK_RESERVED_FOR_JOURNAL(s) \ 227#define SB_ONDISK_RESERVED_FOR_JOURNAL(s) \
228 le32_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_reserved_for_journal)) 228 le16_to_cpu ((SB_V1_DISK_SUPER_BLOCK(s)->s_reserved_for_journal))
229 229
230#define is_block_in_log_or_reserved_area(s, block) \ 230#define is_block_in_log_or_reserved_area(s, block) \
231 block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \ 231 block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \
@@ -269,7 +269,7 @@ int is_reiserfs_jr (struct reiserfs_super_block * rs);
269#define QUOTA_EXCEEDED -6 269#define QUOTA_EXCEEDED -6
270 270
271typedef __u32 b_blocknr_t; 271typedef __u32 b_blocknr_t;
272typedef __u32 unp_t; 272typedef __le32 unp_t;
273 273
274struct unfm_nodeinfo { 274struct unfm_nodeinfo {
275 unp_t unfm_nodenum; 275 unp_t unfm_nodenum;
@@ -376,78 +376,57 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
376// directories use this key as well as old files 376// directories use this key as well as old files
377// 377//
378struct offset_v1 { 378struct offset_v1 {
379 __u32 k_offset; 379 __le32 k_offset;
380 __u32 k_uniqueness; 380 __le32 k_uniqueness;
381} __attribute__ ((__packed__)); 381} __attribute__ ((__packed__));
382 382
383struct offset_v2 { 383struct offset_v2 {
384#ifdef __LITTLE_ENDIAN 384 __le64 v;
385 /* little endian version */
386 __u64 k_offset:60;
387 __u64 k_type: 4;
388#else
389 /* big endian version */
390 __u64 k_type: 4;
391 __u64 k_offset:60;
392#endif
393} __attribute__ ((__packed__)); 385} __attribute__ ((__packed__));
394 386
395#ifndef __LITTLE_ENDIAN
396typedef union {
397 struct offset_v2 offset_v2;
398 __u64 linear;
399} __attribute__ ((__packed__)) offset_v2_esafe_overlay;
400
401static inline __u16 offset_v2_k_type( const struct offset_v2 *v2 ) 387static inline __u16 offset_v2_k_type( const struct offset_v2 *v2 )
402{ 388{
403 offset_v2_esafe_overlay tmp = *(const offset_v2_esafe_overlay *)v2; 389 __u8 type = le64_to_cpu(v2->v) >> 60;
404 tmp.linear = le64_to_cpu( tmp.linear ); 390 return (type <= TYPE_MAXTYPE)?type:TYPE_ANY;
405 return (tmp.offset_v2.k_type <= TYPE_MAXTYPE)?tmp.offset_v2.k_type:TYPE_ANY;
406} 391}
407 392
408static inline void set_offset_v2_k_type( struct offset_v2 *v2, int type ) 393static inline void set_offset_v2_k_type( struct offset_v2 *v2, int type )
409{ 394{
410 offset_v2_esafe_overlay *tmp = (offset_v2_esafe_overlay *)v2; 395 v2->v = (v2->v & cpu_to_le64(~0ULL>>4)) | cpu_to_le64((__u64)type<<60);
411 tmp->linear = le64_to_cpu(tmp->linear);
412 tmp->offset_v2.k_type = type;
413 tmp->linear = cpu_to_le64(tmp->linear);
414} 396}
415 397
416static inline loff_t offset_v2_k_offset( const struct offset_v2 *v2 ) 398static inline loff_t offset_v2_k_offset( const struct offset_v2 *v2 )
417{ 399{
418 offset_v2_esafe_overlay tmp = *(const offset_v2_esafe_overlay *)v2; 400 return le64_to_cpu(v2->v) & (~0ULL>>4);
419 tmp.linear = le64_to_cpu( tmp.linear );
420 return tmp.offset_v2.k_offset;
421} 401}
422 402
423static inline void set_offset_v2_k_offset( struct offset_v2 *v2, loff_t offset ){ 403static inline void set_offset_v2_k_offset( struct offset_v2 *v2, loff_t offset ){
424 offset_v2_esafe_overlay *tmp = (offset_v2_esafe_overlay *)v2; 404 offset &= (~0ULL>>4);
425 tmp->linear = le64_to_cpu(tmp->linear); 405 v2->v = (v2->v & cpu_to_le64(15ULL<<60)) | cpu_to_le64(offset);
426 tmp->offset_v2.k_offset = offset;
427 tmp->linear = cpu_to_le64(tmp->linear);
428} 406}
429#else
430# define offset_v2_k_type(v2) ((v2)->k_type)
431# define set_offset_v2_k_type(v2,val) (offset_v2_k_type(v2) = (val))
432# define offset_v2_k_offset(v2) ((v2)->k_offset)
433# define set_offset_v2_k_offset(v2,val) (offset_v2_k_offset(v2) = (val))
434#endif
435 407
436/* Key of an item determines its location in the S+tree, and 408/* Key of an item determines its location in the S+tree, and
437 is composed of 4 components */ 409 is composed of 4 components */
438struct reiserfs_key { 410struct reiserfs_key {
439 __u32 k_dir_id; /* packing locality: by default parent 411 __le32 k_dir_id; /* packing locality: by default parent
440 directory object id */ 412 directory object id */
441 __u32 k_objectid; /* object identifier */ 413 __le32 k_objectid; /* object identifier */
442 union { 414 union {
443 struct offset_v1 k_offset_v1; 415 struct offset_v1 k_offset_v1;
444 struct offset_v2 k_offset_v2; 416 struct offset_v2 k_offset_v2;
445 } __attribute__ ((__packed__)) u; 417 } __attribute__ ((__packed__)) u;
446} __attribute__ ((__packed__)); 418} __attribute__ ((__packed__));
447 419
420struct in_core_key {
421 __u32 k_dir_id; /* packing locality: by default parent
422 directory object id */
423 __u32 k_objectid; /* object identifier */
424 __u64 k_offset;
425 __u8 k_type;
426};
448 427
449struct cpu_key { 428struct cpu_key {
450 struct reiserfs_key on_disk_key; 429 struct in_core_key on_disk_key;
451 int version; 430 int version;
452 int key_length; /* 3 in all cases but direct2indirect and 431 int key_length; /* 3 in all cases but direct2indirect and
453 indirect2direct conversion */ 432 indirect2direct conversion */
@@ -508,15 +487,15 @@ struct item_head
508 item. Note that the key, not this field, is used to 487 item. Note that the key, not this field, is used to
509 determine the item type, and thus which field this 488 determine the item type, and thus which field this
510 union contains. */ 489 union contains. */
511 __u16 ih_free_space_reserved; 490 __le16 ih_free_space_reserved;
512 /* Iff this is a directory item, this field equals the 491 /* Iff this is a directory item, this field equals the
513 number of directory entries in the directory item. */ 492 number of directory entries in the directory item. */
514 __u16 ih_entry_count; 493 __le16 ih_entry_count;
515 } __attribute__ ((__packed__)) u; 494 } __attribute__ ((__packed__)) u;
516 __u16 ih_item_len; /* total size of the item body */ 495 __le16 ih_item_len; /* total size of the item body */
517 __u16 ih_item_location; /* an offset to the item body 496 __le16 ih_item_location; /* an offset to the item body
518 * within the block */ 497 * within the block */
519 __u16 ih_version; /* 0 for all old items, 2 for new 498 __le16 ih_version; /* 0 for all old items, 2 for new
520 ones. Highest bit is set by fsck 499 ones. Highest bit is set by fsck
521 temporary, cleaned after all 500 temporary, cleaned after all
522 done */ 501 done */
@@ -670,43 +649,29 @@ static inline void set_le_ih_k_type (struct item_head * ih, int type)
670// 649//
671static inline loff_t cpu_key_k_offset (const struct cpu_key * key) 650static inline loff_t cpu_key_k_offset (const struct cpu_key * key)
672{ 651{
673 return (key->version == KEY_FORMAT_3_5) ? 652 return key->on_disk_key.k_offset;
674 key->on_disk_key.u.k_offset_v1.k_offset :
675 key->on_disk_key.u.k_offset_v2.k_offset;
676} 653}
677 654
678static inline loff_t cpu_key_k_type (const struct cpu_key * key) 655static inline loff_t cpu_key_k_type (const struct cpu_key * key)
679{ 656{
680 return (key->version == KEY_FORMAT_3_5) ? 657 return key->on_disk_key.k_type;
681 uniqueness2type (key->on_disk_key.u.k_offset_v1.k_uniqueness) :
682 key->on_disk_key.u.k_offset_v2.k_type;
683} 658}
684 659
685static inline void set_cpu_key_k_offset (struct cpu_key * key, loff_t offset) 660static inline void set_cpu_key_k_offset (struct cpu_key * key, loff_t offset)
686{ 661{
687 (key->version == KEY_FORMAT_3_5) ? 662 key->on_disk_key.k_offset = offset;
688 (key->on_disk_key.u.k_offset_v1.k_offset = offset) :
689 (key->on_disk_key.u.k_offset_v2.k_offset = offset);
690} 663}
691 664
692
693static inline void set_cpu_key_k_type (struct cpu_key * key, int type) 665static inline void set_cpu_key_k_type (struct cpu_key * key, int type)
694{ 666{
695 (key->version == KEY_FORMAT_3_5) ? 667 key->on_disk_key.k_type = type;
696 (key->on_disk_key.u.k_offset_v1.k_uniqueness = type2uniqueness (type)):
697 (key->on_disk_key.u.k_offset_v2.k_type = type);
698} 668}
699 669
700
701static inline void cpu_key_k_offset_dec (struct cpu_key * key) 670static inline void cpu_key_k_offset_dec (struct cpu_key * key)
702{ 671{
703 if (key->version == KEY_FORMAT_3_5) 672 key->on_disk_key.k_offset --;
704 key->on_disk_key.u.k_offset_v1.k_offset --;
705 else
706 key->on_disk_key.u.k_offset_v2.k_offset --;
707} 673}
708 674
709
710#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY) 675#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY)
711#define is_direct_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRECT) 676#define is_direct_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRECT)
712#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT) 677#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT)
@@ -752,10 +717,10 @@ extern struct reiserfs_key root_key;
752/* Header of a disk block. More precisely, header of a formatted leaf 717/* Header of a disk block. More precisely, header of a formatted leaf
753 or internal node, and not the header of an unformatted node. */ 718 or internal node, and not the header of an unformatted node. */
754struct block_head { 719struct block_head {
755 __u16 blk_level; /* Level of a block in the tree. */ 720 __le16 blk_level; /* Level of a block in the tree. */
756 __u16 blk_nr_item; /* Number of keys/items in a block. */ 721 __le16 blk_nr_item; /* Number of keys/items in a block. */
757 __u16 blk_free_space; /* Block free space in bytes. */ 722 __le16 blk_free_space; /* Block free space in bytes. */
758 __u16 blk_reserved; 723 __le16 blk_reserved;
759 /* dump this in v4/planA */ 724 /* dump this in v4/planA */
760 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */ 725 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */
761}; 726};
@@ -819,19 +784,19 @@ struct block_head {
819// 784//
820struct stat_data_v1 785struct stat_data_v1
821{ 786{
822 __u16 sd_mode; /* file type, permissions */ 787 __le16 sd_mode; /* file type, permissions */
823 __u16 sd_nlink; /* number of hard links */ 788 __le16 sd_nlink; /* number of hard links */
824 __u16 sd_uid; /* owner */ 789 __le16 sd_uid; /* owner */
825 __u16 sd_gid; /* group */ 790 __le16 sd_gid; /* group */
826 __u32 sd_size; /* file size */ 791 __le32 sd_size; /* file size */
827 __u32 sd_atime; /* time of last access */ 792 __le32 sd_atime; /* time of last access */
828 __u32 sd_mtime; /* time file was last modified */ 793 __le32 sd_mtime; /* time file was last modified */
829 __u32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 794 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
830 union { 795 union {
831 __u32 sd_rdev; 796 __le32 sd_rdev;
832 __u32 sd_blocks; /* number of blocks file uses */ 797 __le32 sd_blocks; /* number of blocks file uses */
833 } __attribute__ ((__packed__)) u; 798 } __attribute__ ((__packed__)) u;
834 __u32 sd_first_direct_byte; /* first byte of file which is stored 799 __le32 sd_first_direct_byte; /* first byte of file which is stored
835 in a direct item: except that if it 800 in a direct item: except that if it
836 equals 1 it is a symlink and if it 801 equals 1 it is a symlink and if it
837 equals ~(__u32)0 there is no 802 equals ~(__u32)0 there is no
@@ -897,20 +862,20 @@ struct stat_data_v1
897/* Stat Data on disk (reiserfs version of UFS disk inode minus the 862/* Stat Data on disk (reiserfs version of UFS disk inode minus the
898 address blocks) */ 863 address blocks) */
899struct stat_data { 864struct stat_data {
900 __u16 sd_mode; /* file type, permissions */ 865 __le16 sd_mode; /* file type, permissions */
901 __u16 sd_attrs; /* persistent inode flags */ 866 __le16 sd_attrs; /* persistent inode flags */
902 __u32 sd_nlink; /* number of hard links */ 867 __le32 sd_nlink; /* number of hard links */
903 __u64 sd_size; /* file size */ 868 __le64 sd_size; /* file size */
904 __u32 sd_uid; /* owner */ 869 __le32 sd_uid; /* owner */
905 __u32 sd_gid; /* group */ 870 __le32 sd_gid; /* group */
906 __u32 sd_atime; /* time of last access */ 871 __le32 sd_atime; /* time of last access */
907 __u32 sd_mtime; /* time file was last modified */ 872 __le32 sd_mtime; /* time file was last modified */
908 __u32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 873 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
909 __u32 sd_blocks; 874 __le32 sd_blocks;
910 union { 875 union {
911 __u32 sd_rdev; 876 __le32 sd_rdev;
912 __u32 sd_generation; 877 __le32 sd_generation;
913 //__u32 sd_first_direct_byte; 878 //__le32 sd_first_direct_byte;
914 /* first byte of file which is stored in a 879 /* first byte of file which is stored in a
915 direct item: except that if it equals 1 880 direct item: except that if it equals 1
916 it is a symlink and if it equals 881 it is a symlink and if it equals
@@ -993,12 +958,12 @@ struct stat_data {
993 958
994struct reiserfs_de_head 959struct reiserfs_de_head
995{ 960{
996 __u32 deh_offset; /* third component of the directory entry key */ 961 __le32 deh_offset; /* third component of the directory entry key */
997 __u32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced 962 __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced
998 by directory entry */ 963 by directory entry */
999 __u32 deh_objectid; /* objectid of the object, that is referenced by directory entry */ 964 __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */
1000 __u16 deh_location; /* offset of name in the whole item */ 965 __le16 deh_location; /* offset of name in the whole item */
1001 __u16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether 966 __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
1002 entry is hidden (unlinked) */ 967 entry is hidden (unlinked) */
1003} __attribute__ ((__packed__)); 968} __attribute__ ((__packed__));
1004#define DEH_SIZE sizeof(struct reiserfs_de_head) 969#define DEH_SIZE sizeof(struct reiserfs_de_head)
@@ -1058,10 +1023,10 @@ struct reiserfs_de_head
1058#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 1023#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1059#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 1024#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1060 1025
1061extern void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid, 1026extern void make_empty_dir_item_v1 (char * body, __le32 dirid, __le32 objid,
1062 __u32 par_dirid, __u32 par_objid); 1027 __le32 par_dirid, __le32 par_objid);
1063extern void make_empty_dir_item (char * body, __u32 dirid, __u32 objid, 1028extern void make_empty_dir_item (char * body, __le32 dirid, __le32 objid,
1064 __u32 par_dirid, __u32 par_objid); 1029 __le32 par_dirid, __le32 par_objid);
1065 1030
1066/* array of the entry headers */ 1031/* array of the entry headers */
1067 /* get item body */ 1032 /* get item body */
@@ -1160,9 +1125,9 @@ struct reiserfs_dir_entry
1160/* Disk child pointer: The pointer from an internal node of the tree 1125/* Disk child pointer: The pointer from an internal node of the tree
1161 to a node that is on disk. */ 1126 to a node that is on disk. */
1162struct disk_child { 1127struct disk_child {
1163 __u32 dc_block_number; /* Disk child's block number. */ 1128 __le32 dc_block_number; /* Disk child's block number. */
1164 __u16 dc_size; /* Disk child's used space. */ 1129 __le16 dc_size; /* Disk child's used space. */
1165 __u16 dc_reserved; 1130 __le16 dc_reserved;
1166}; 1131};
1167 1132
1168#define DC_SIZE (sizeof(struct disk_child)) 1133#define DC_SIZE (sizeof(struct disk_child))
@@ -1476,7 +1441,7 @@ struct tree_balance
1476 int fs_gen; /* saved value of `reiserfs_generation' counter 1441 int fs_gen; /* saved value of `reiserfs_generation' counter
1477 see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */ 1442 see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */
1478#ifdef DISPLACE_NEW_PACKING_LOCALITIES 1443#ifdef DISPLACE_NEW_PACKING_LOCALITIES
1479 struct reiserfs_key key; /* key pointer, to pass to block allocator or 1444 struct in_core_key key; /* key pointer, to pass to block allocator or
1480 another low-level subsystem */ 1445 another low-level subsystem */
1481#endif 1446#endif
1482} ; 1447} ;
@@ -1630,10 +1595,10 @@ struct reiserfs_iget_args {
1630 1595
1631/* first block written in a commit. */ 1596/* first block written in a commit. */
1632struct reiserfs_journal_desc { 1597struct reiserfs_journal_desc {
1633 __u32 j_trans_id ; /* id of commit */ 1598 __le32 j_trans_id ; /* id of commit */
1634 __u32 j_len ; /* length of commit. len +1 is the commit block */ 1599 __le32 j_len ; /* length of commit. len +1 is the commit block */
1635 __u32 j_mount_id ; /* mount id of this trans*/ 1600 __le32 j_mount_id ; /* mount id of this trans*/
1636 __u32 j_realblock[1] ; /* real locations for each block */ 1601 __le32 j_realblock[1] ; /* real locations for each block */
1637} ; 1602} ;
1638 1603
1639#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id) 1604#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id)
@@ -1646,9 +1611,9 @@ struct reiserfs_journal_desc {
1646 1611
1647/* last block written in a commit */ 1612/* last block written in a commit */
1648struct reiserfs_journal_commit { 1613struct reiserfs_journal_commit {
1649 __u32 j_trans_id ; /* must match j_trans_id from the desc block */ 1614 __le32 j_trans_id ; /* must match j_trans_id from the desc block */
1650 __u32 j_len ; /* ditto */ 1615 __le32 j_len ; /* ditto */
1651 __u32 j_realblock[1] ; /* real locations for each block */ 1616 __le32 j_realblock[1] ; /* real locations for each block */
1652} ; 1617} ;
1653 1618
1654#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id) 1619#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id)
@@ -1663,9 +1628,9 @@ struct reiserfs_journal_commit {
1663** and this transaction does not need to be replayed. 1628** and this transaction does not need to be replayed.
1664*/ 1629*/
1665struct reiserfs_journal_header { 1630struct reiserfs_journal_header {
1666 __u32 j_last_flush_trans_id ; /* id of last fully flushed transaction */ 1631 __le32 j_last_flush_trans_id ; /* id of last fully flushed transaction */
1667 __u32 j_first_unflushed_offset ; /* offset in the log of where to start replay after a crash */ 1632 __le32 j_first_unflushed_offset ; /* offset in the log of where to start replay after a crash */
1668 __u32 j_mount_id ; 1633 __le32 j_mount_id ;
1669 /* 12 */ struct journal_params jh_journal; 1634 /* 12 */ struct journal_params jh_journal;
1670} ; 1635} ;
1671 1636
@@ -2117,7 +2082,7 @@ struct buffer_head * get_FEB (struct tree_balance *);
2117 struct __reiserfs_blocknr_hint { 2082 struct __reiserfs_blocknr_hint {
2118 struct inode * inode; /* inode passed to allocator, if we allocate unf. nodes */ 2083 struct inode * inode; /* inode passed to allocator, if we allocate unf. nodes */
2119 long block; /* file offset, in blocks */ 2084 long block; /* file offset, in blocks */
2120 struct reiserfs_key key; 2085 struct in_core_key key;
2121 struct path * path; /* search path, used by allocator to deternine search_start by 2086 struct path * path; /* search path, used by allocator to deternine search_start by
2122 * various ways */ 2087 * various ways */
2123 struct reiserfs_transaction_handle * th; /* transaction handle is needed to log super blocks and 2088 struct reiserfs_transaction_handle * th; /* transaction handle is needed to log super blocks and
@@ -2144,7 +2109,7 @@ void reiserfs_init_alloc_options (struct super_block *s);
2144 * to use for a new object underneat it. The locality is returned 2109 * to use for a new object underneat it. The locality is returned
2145 * in disk byte order (le). 2110 * in disk byte order (le).
2146 */ 2111 */
2147u32 reiserfs_choose_packing(struct inode *dir); 2112__le32 reiserfs_choose_packing(struct inode *dir);
2148 2113
2149int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value); 2114int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value);
2150void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted); 2115void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted);
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 1eaa48eca811..9244c5748820 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -10,8 +10,8 @@
10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ 10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
11 11
12struct reiserfs_xattr_header { 12struct reiserfs_xattr_header {
13 __u32 h_magic; /* magic number for identification */ 13 __le32 h_magic; /* magic number for identification */
14 __u32 h_hash; /* hash of the value */ 14 __le32 h_hash; /* hash of the value */
15}; 15};
16 16
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 32e52769a00b..91ac97c20777 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -89,10 +89,14 @@ enum {
89 RTM_GETANYCAST = 62, 89 RTM_GETANYCAST = 62,
90#define RTM_GETANYCAST RTM_GETANYCAST 90#define RTM_GETANYCAST RTM_GETANYCAST
91 91
92 RTM_MAX, 92 __RTM_MAX,
93#define RTM_MAX RTM_MAX 93#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
94}; 94};
95 95
96#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
97#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
98#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
99
96/* 100/*
97 Generic structure for encapsulation of optional route information. 101 Generic structure for encapsulation of optional route information.
98 It is reminiscent of sockaddr, but with sa_family replaced 102 It is reminiscent of sockaddr, but with sa_family replaced
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1cced971232c..4dbb109022f3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -578,7 +578,7 @@ struct task_struct {
578 unsigned long flags; /* per process flags, defined below */ 578 unsigned long flags; /* per process flags, defined below */
579 unsigned long ptrace; 579 unsigned long ptrace;
580 580
581 int lock_depth; /* Lock depth */ 581 int lock_depth; /* BKL lock depth */
582 582
583 int prio, static_prio; 583 int prio, static_prio;
584 struct list_head run_list; 584 struct list_head run_list;
@@ -661,7 +661,10 @@ struct task_struct {
661 struct key *thread_keyring; /* keyring private to this thread */ 661 struct key *thread_keyring; /* keyring private to this thread */
662#endif 662#endif
663 int oomkilladj; /* OOM kill score adjustment (bit shift). */ 663 int oomkilladj; /* OOM kill score adjustment (bit shift). */
664 char comm[TASK_COMM_LEN]; 664 char comm[TASK_COMM_LEN]; /* executable name excluding path
665 - access with [gs]et_task_comm (which lock
666 it with task_lock())
667 - initialized normally by flush_old_exec */
665/* file system info */ 668/* file system info */
666 int link_count, total_link_count; 669 int link_count, total_link_count;
667/* ipc stuff */ 670/* ipc stuff */
@@ -845,6 +848,7 @@ extern void sched_idle_next(void);
845extern void set_user_nice(task_t *p, long nice); 848extern void set_user_nice(task_t *p, long nice);
846extern int task_prio(const task_t *p); 849extern int task_prio(const task_t *p);
847extern int task_nice(const task_t *p); 850extern int task_nice(const task_t *p);
851extern int can_nice(const task_t *p, const int nice);
848extern int task_curr(const task_t *p); 852extern int task_curr(const task_t *p);
849extern int idle_cpu(int cpu); 853extern int idle_cpu(int cpu);
850extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); 854extern int sched_setscheduler(struct task_struct *, int, struct sched_param *);
@@ -1011,7 +1015,6 @@ extern int copy_thread(int, unsigned long, unsigned long, unsigned long, struct
1011extern void flush_thread(void); 1015extern void flush_thread(void);
1012extern void exit_thread(void); 1016extern void exit_thread(void);
1013 1017
1014extern void exit_mm(struct task_struct *);
1015extern void exit_files(struct task_struct *); 1018extern void exit_files(struct task_struct *);
1016extern void exit_signal(struct task_struct *); 1019extern void exit_signal(struct task_struct *);
1017extern void __exit_signal(struct task_struct *); 1020extern void __exit_signal(struct task_struct *);
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 99c97ad026c8..0a98f5ec5cae 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -9,6 +9,17 @@
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10 10
11/* 11/*
12 * These values of sa_flags are used only by the kernel as part of the
13 * irq handling routines.
14 *
15 * SA_INTERRUPT is also used by the irq handling routines.
16 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
17 */
18#define SA_PROBE SA_ONESHOT
19#define SA_SAMPLE_RANDOM SA_RESTART
20#define SA_SHIRQ 0x04000000
21
22/*
12 * Real Time signals may be queued. 23 * Real Time signals may be queued.
13 */ 24 */
14 25
@@ -209,6 +220,12 @@ static inline void init_sigpending(struct sigpending *sig)
209 INIT_LIST_HEAD(&sig->list); 220 INIT_LIST_HEAD(&sig->list);
210} 221}
211 222
223/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */
224static inline int valid_signal(unsigned long sig)
225{
226 return sig <= _NSIG ? 1 : 0;
227}
228
212extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); 229extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p);
213extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); 230extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
214extern long do_sigpending(void __user *, unsigned long); 231extern long do_sigpending(void __user *, unsigned long);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 22b701819619..cc04f5cd2286 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -167,13 +167,14 @@ struct skb_shared_info {
167 * @h: Transport layer header 167 * @h: Transport layer header
168 * @nh: Network layer header 168 * @nh: Network layer header
169 * @mac: Link layer header 169 * @mac: Link layer header
170 * @dst: FIXME: Describe this field 170 * @dst: destination entry
171 * @sp: the security path, used for xfrm
171 * @cb: Control buffer. Free for use by every layer. Put private vars here 172 * @cb: Control buffer. Free for use by every layer. Put private vars here
172 * @len: Length of actual data 173 * @len: Length of actual data
173 * @data_len: Data length 174 * @data_len: Data length
174 * @mac_len: Length of link layer header 175 * @mac_len: Length of link layer header
175 * @csum: Checksum 176 * @csum: Checksum
176 * @__unused: Dead field, may be reused 177 * @local_df: allow local fragmentation
177 * @cloned: Head may be cloned (check refcnt to be sure) 178 * @cloned: Head may be cloned (check refcnt to be sure)
178 * @nohdr: Payload reference only, must not modify header 179 * @nohdr: Payload reference only, must not modify header
179 * @pkt_type: Packet class 180 * @pkt_type: Packet class
@@ -968,6 +969,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
968 kfree_skb(skb); 969 kfree_skb(skb);
969} 970}
970 971
972#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB
971/** 973/**
972 * __dev_alloc_skb - allocate an skbuff for sending 974 * __dev_alloc_skb - allocate an skbuff for sending
973 * @length: length to allocate 975 * @length: length to allocate
@@ -980,7 +982,6 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
980 * 982 *
981 * %NULL is returned in there is no free memory. 983 * %NULL is returned in there is no free memory.
982 */ 984 */
983#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB
984static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 985static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
985 int gfp_mask) 986 int gfp_mask)
986{ 987{
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 3e3c3ab8ff94..7d66385ae750 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -62,16 +62,9 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo
62extern int kmem_cache_destroy(kmem_cache_t *); 62extern int kmem_cache_destroy(kmem_cache_t *);
63extern int kmem_cache_shrink(kmem_cache_t *); 63extern int kmem_cache_shrink(kmem_cache_t *);
64extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); 64extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast);
65#ifdef CONFIG_NUMA
66extern void *kmem_cache_alloc_node(kmem_cache_t *, int);
67#else
68static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int node)
69{
70 return kmem_cache_alloc(cachep, GFP_KERNEL);
71}
72#endif
73extern void kmem_cache_free(kmem_cache_t *, void *); 65extern void kmem_cache_free(kmem_cache_t *, void *);
74extern unsigned int kmem_cache_size(kmem_cache_t *); 66extern unsigned int kmem_cache_size(kmem_cache_t *);
67extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags);
75 68
76/* Size description struct for general caches. */ 69/* Size description struct for general caches. */
77struct cache_sizes { 70struct cache_sizes {
@@ -109,6 +102,20 @@ extern void *kcalloc(size_t, size_t, unsigned int __nocast);
109extern void kfree(const void *); 102extern void kfree(const void *);
110extern unsigned int ksize(const void *); 103extern unsigned int ksize(const void *);
111 104
105#ifdef CONFIG_NUMA
106extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node);
107extern void *kmalloc_node(size_t size, int flags, int node);
108#else
109static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node)
110{
111 return kmem_cache_alloc(cachep, flags);
112}
113static inline void *kmalloc_node(size_t size, int flags, int node)
114{
115 return kmalloc(size, flags);
116}
117#endif
118
112extern int FASTCALL(kmem_cache_reap(int)); 119extern int FASTCALL(kmem_cache_reap(int));
113extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr)); 120extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr));
114 121
diff --git a/include/linux/sockios.h b/include/linux/sockios.h
index 5eb33205cc04..e6b9d1d36ea2 100644
--- a/include/linux/sockios.h
+++ b/include/linux/sockios.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)sockios.h 1.0.2 03/09/93 8 * Version: @(#)sockios.h 1.0.2 03/09/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h
index 28d2d1881978..523d069c862c 100644
--- a/include/linux/soundcard.h
+++ b/include/linux/soundcard.h
@@ -39,6 +39,13 @@
39/* In Linux we need to be prepared for cross compiling */ 39/* In Linux we need to be prepared for cross compiling */
40#include <linux/ioctl.h> 40#include <linux/ioctl.h>
41 41
42/* Endian macros. */
43#ifdef __KERNEL__
44# include <asm/byteorder.h>
45#else
46# include <endian.h>
47#endif
48
42/* 49/*
43 * Supported card ID numbers (Should be somewhere else?) 50 * Supported card ID numbers (Should be somewhere else?)
44 */ 51 */
@@ -179,13 +186,26 @@ typedef struct seq_event_rec {
179 * Some big endian/little endian handling macros 186 * Some big endian/little endian handling macros
180 */ 187 */
181 188
182#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__sparc__) || defined(HPPA) || defined(PPC) || defined(__mc68000__) 189#define _LINUX_PATCHKEY_H_INDIRECT
183/* Big endian machines */ 190#include <linux/patchkey.h>
184# define _PATCHKEY(id) (0xfd00|id) 191#undef _LINUX_PATCHKEY_H_INDIRECT
185# define AFMT_S16_NE AFMT_S16_BE 192
186#else 193#if defined(__KERNEL__)
187# define _PATCHKEY(id) ((id<<8)|0xfd) 194# if defined(__BIG_ENDIAN)
188# define AFMT_S16_NE AFMT_S16_LE 195# define AFMT_S16_NE AFMT_S16_BE
196# elif defined(__LITTLE_ENDIAN)
197# define AFMT_S16_NE AFMT_S16_LE
198# else
199# error "could not determine byte order"
200# endif
201#elif defined(__BYTE_ORDER)
202# if __BYTE_ORDER == __BIG_ENDIAN
203# define AFMT_S16_NE AFMT_S16_BE
204# elif __BYTE_ORDER == __LITTLE_ENDIAN
205# define AFMT_S16_NE AFMT_S16_LE
206# else
207# error "could not determine byte order"
208# endif
189#endif 209#endif
190 210
191/* 211/*
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 757cd9be7743..c39f6f72cbbc 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -456,8 +456,7 @@ asmlinkage long sys_semctl(int semid, int semnum, int cmd, union semun arg);
456asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops, 456asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
457 unsigned nsops, 457 unsigned nsops,
458 const struct timespec __user *timeout); 458 const struct timespec __user *timeout);
459asmlinkage long sys_shmat(int shmid, char __user *shmaddr, 459asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
460 int shmflg, unsigned long __user *addr);
461asmlinkage long sys_shmget(key_t key, size_t size, int flag); 460asmlinkage long sys_shmget(key_t key, size_t size, int flag);
462asmlinkage long sys_shmdt(char __user *shmaddr); 461asmlinkage long sys_shmdt(char __user *shmaddr);
463asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); 462asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 358d52b0c445..772998147e3e 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -643,6 +643,7 @@ enum {
643 NET_SCTP_MAX_BURST = 12, 643 NET_SCTP_MAX_BURST = 12,
644 NET_SCTP_ADDIP_ENABLE = 13, 644 NET_SCTP_ADDIP_ENABLE = 13,
645 NET_SCTP_PRSCTP_ENABLE = 14, 645 NET_SCTP_PRSCTP_ENABLE = 14,
646 NET_SCTP_SNDBUF_POLICY = 15,
646}; 647};
647 648
648/* /proc/sys/net/bridge */ 649/* /proc/sys/net/bridge */
diff --git a/include/linux/tc_act/tc_defact.h b/include/linux/tc_act/tc_defact.h
new file mode 100644
index 000000000000..964f473af0f0
--- /dev/null
+++ b/include/linux/tc_act/tc_defact.h
@@ -0,0 +1,21 @@
1#ifndef __LINUX_TC_DEF_H
2#define __LINUX_TC_DEF_H
3
4#include <linux/pkt_cls.h>
5
6struct tc_defact
7{
8 tc_gen;
9};
10
11enum
12{
13 TCA_DEF_UNSPEC,
14 TCA_DEF_TM,
15 TCA_DEF_PARMS,
16 TCA_DEF_DATA,
17 __TCA_DEF_MAX
18};
19#define TCA_DEF_MAX (__TCA_DEF_MAX - 1)
20
21#endif
diff --git a/include/linux/trdevice.h b/include/linux/trdevice.h
index aaa1f337edcb..99e02ef54c47 100644
--- a/include/linux/trdevice.h
+++ b/include/linux/trdevice.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)eth.h 1.0.4 05/13/93 8 * Version: @(#)eth.h 1.0.4 05/13/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * Relocated to include/linux where it belongs by Alan Cox 13 * Relocated to include/linux where it belongs by Alan Cox
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index f0df02ae68a4..fd2ef742a9fd 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -140,8 +140,11 @@ enum {
140 XFRM_MSG_FLUSHPOLICY, 140 XFRM_MSG_FLUSHPOLICY,
141#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY 141#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
142 142
143 XFRM_MSG_MAX 143 __XFRM_MSG_MAX
144}; 144};
145#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
146
147#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
145 148
146struct xfrm_user_tmpl { 149struct xfrm_user_tmpl {
147 struct xfrm_id id; 150 struct xfrm_id id;
diff --git a/include/net/act_generic.h b/include/net/act_generic.h
new file mode 100644
index 000000000000..95b120781c14
--- /dev/null
+++ b/include/net/act_generic.h
@@ -0,0 +1,142 @@
1/*
2 * include/net/act_generic.h
3 *
4*/
5#ifndef ACT_GENERIC_H
6#define ACT_GENERIC_H
7static inline int tcf_defact_release(struct tcf_defact *p, int bind)
8{
9 int ret = 0;
10 if (p) {
11 if (bind) {
12 p->bindcnt--;
13 }
14 p->refcnt--;
15 if (p->bindcnt <= 0 && p->refcnt <= 0) {
16 kfree(p->defdata);
17 tcf_hash_destroy(p);
18 ret = 1;
19 }
20 }
21 return ret;
22}
23
24static inline int
25alloc_defdata(struct tcf_defact *p, u32 datalen, void *defdata)
26{
27 p->defdata = kmalloc(datalen, GFP_KERNEL);
28 if (p->defdata == NULL)
29 return -ENOMEM;
30 p->datalen = datalen;
31 memcpy(p->defdata, defdata, datalen);
32 return 0;
33}
34
35static inline int
36realloc_defdata(struct tcf_defact *p, u32 datalen, void *defdata)
37{
38 /* safer to be just brute force for now */
39 kfree(p->defdata);
40 return alloc_defdata(p, datalen, defdata);
41}
42
43static inline int
44tcf_defact_init(struct rtattr *rta, struct rtattr *est,
45 struct tc_action *a, int ovr, int bind)
46{
47 struct rtattr *tb[TCA_DEF_MAX];
48 struct tc_defact *parm;
49 struct tcf_defact *p;
50 void *defdata;
51 u32 datalen = 0;
52 int ret = 0;
53
54 if (rta == NULL || rtattr_parse_nested(tb, TCA_DEF_MAX, rta) < 0)
55 return -EINVAL;
56
57 if (tb[TCA_DEF_PARMS - 1] == NULL ||
58 RTA_PAYLOAD(tb[TCA_DEF_PARMS - 1]) < sizeof(*parm))
59 return -EINVAL;
60
61 parm = RTA_DATA(tb[TCA_DEF_PARMS - 1]);
62 defdata = RTA_DATA(tb[TCA_DEF_DATA - 1]);
63 if (defdata == NULL)
64 return -EINVAL;
65
66 datalen = RTA_PAYLOAD(tb[TCA_DEF_DATA - 1]);
67 if (datalen <= 0)
68 return -EINVAL;
69
70 p = tcf_hash_check(parm->index, a, ovr, bind);
71 if (p == NULL) {
72 p = tcf_hash_create(parm->index, est, a, sizeof(*p), ovr, bind);
73 if (p == NULL)
74 return -ENOMEM;
75
76 ret = alloc_defdata(p, datalen, defdata);
77 if (ret < 0) {
78 kfree(p);
79 return ret;
80 }
81 ret = ACT_P_CREATED;
82 } else {
83 if (!ovr) {
84 tcf_defact_release(p, bind);
85 return -EEXIST;
86 }
87 realloc_defdata(p, datalen, defdata);
88 }
89
90 spin_lock_bh(&p->lock);
91 p->action = parm->action;
92 spin_unlock_bh(&p->lock);
93 if (ret == ACT_P_CREATED)
94 tcf_hash_insert(p);
95 return ret;
96}
97
98static inline int tcf_defact_cleanup(struct tc_action *a, int bind)
99{
100 struct tcf_defact *p = PRIV(a, defact);
101
102 if (p != NULL)
103 return tcf_defact_release(p, bind);
104 return 0;
105}
106
107static inline int
108tcf_defact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
109{
110 unsigned char *b = skb->tail;
111 struct tc_defact opt;
112 struct tcf_defact *p = PRIV(a, defact);
113 struct tcf_t t;
114
115 opt.index = p->index;
116 opt.refcnt = p->refcnt - ref;
117 opt.bindcnt = p->bindcnt - bind;
118 opt.action = p->action;
119 RTA_PUT(skb, TCA_DEF_PARMS, sizeof(opt), &opt);
120 RTA_PUT(skb, TCA_DEF_DATA, p->datalen, p->defdata);
121 t.install = jiffies_to_clock_t(jiffies - p->tm.install);
122 t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse);
123 t.expires = jiffies_to_clock_t(p->tm.expires);
124 RTA_PUT(skb, TCA_DEF_TM, sizeof(t), &t);
125 return skb->len;
126
127rtattr_failure:
128 skb_trim(skb, b - skb->data);
129 return -1;
130}
131
132#define tca_use_default_ops \
133 .dump = tcf_defact_dump, \
134 .cleanup = tcf_defact_cleanup, \
135 .init = tcf_defact_init, \
136 .walk = tcf_generic_walker, \
137
138#define tca_use_default_defines(name) \
139 static u32 idx_gen; \
140 static struct tcf_defact *tcf_##name_ht[MY_TAB_SIZE]; \
141 static DEFINE_RWLOCK(##name_lock);
142#endif /* _NET_ACT_GENERIC_H */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 7af9a13cb9be..a0ed93672176 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -17,6 +17,8 @@
17 17
18#define IPV6_MAX_ADDRESSES 16 18#define IPV6_MAX_ADDRESSES 16
19 19
20#include <linux/in6.h>
21
20struct prefix_info { 22struct prefix_info {
21 __u8 type; 23 __u8 type;
22 __u8 length; 24 __u8 length;
@@ -43,9 +45,9 @@ struct prefix_info {
43 45
44#ifdef __KERNEL__ 46#ifdef __KERNEL__
45 47
46#include <linux/in6.h>
47#include <linux/netdevice.h> 48#include <linux/netdevice.h>
48#include <net/if_inet6.h> 49#include <net/if_inet6.h>
50#include <net/ipv6.h>
49 51
50#define IN6_ADDR_HSIZE 16 52#define IN6_ADDR_HSIZE 16
51 53
diff --git a/include/net/ax25.h b/include/net/ax25.h
index fb95ecb6fe03..9e6368a54547 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -220,6 +220,14 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25)
220 } 220 }
221} 221}
222 222
223static inline unsigned short ax25_type_trans(struct sk_buff *skb, struct net_device *dev)
224{
225 skb->dev = dev;
226 skb->pkt_type = PACKET_HOST;
227 skb->mac.raw = skb->data;
228 return htons(ETH_P_AX25);
229}
230
223/* af_ax25.c */ 231/* af_ax25.c */
224extern struct hlist_head ax25_list; 232extern struct hlist_head ax25_list;
225extern spinlock_t ax25_list_lock; 233extern spinlock_t ax25_list_lock;
@@ -305,7 +313,7 @@ extern ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_addr
305extern void ax25_output(ax25_cb *, int, struct sk_buff *); 313extern void ax25_output(ax25_cb *, int, struct sk_buff *);
306extern void ax25_kick(ax25_cb *); 314extern void ax25_kick(ax25_cb *);
307extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int); 315extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int);
308extern void ax25_queue_xmit(struct sk_buff *); 316extern void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev);
309extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); 317extern int ax25_check_iframes_acked(ax25_cb *, unsigned short);
310 318
311/* ax25_route.c */ 319/* ax25_route.c */
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 3fc192478aa2..e5ef0d15fb45 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)icmp.h 1.0.4 05/13/93 8 * Version: @(#)icmp.h 1.0.4 05/13/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
diff --git a/include/net/ip.h b/include/net/ip.h
index b4db1375da2c..3f63992eb712 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)ip.h 1.0.2 05/07/93 8 * Version: @(#)ip.h 1.0.2 05/07/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Alan Cox, <gw4pts@gw4pts.ampr.org> 12 * Alan Cox, <gw4pts@gw4pts.ampr.org>
13 * 13 *
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 87c45cbfbaf6..771b47e30f86 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -416,7 +416,7 @@ extern void ipv6_push_frag_opts(struct sk_buff *skb,
416 u8 *proto); 416 u8 *proto);
417 417
418extern int ipv6_skip_exthdr(const struct sk_buff *, int start, 418extern int ipv6_skip_exthdr(const struct sk_buff *, int start,
419 u8 *nexthdrp, int len); 419 u8 *nexthdrp);
420 420
421extern int ipv6_ext_hdr(u8 nexthdr); 421extern int ipv6_ext_hdr(u8 nexthdr);
422 422
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 87496e3aa330..fcb05a387dbe 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -140,7 +140,7 @@ psched_tod_diff(int delta_sec, int bound)
140 if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1) 140 if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1)
141 return bound; 141 return bound;
142 delta = delta_sec * 1000000; 142 delta = delta_sec * 1000000;
143 if (delta > bound) 143 if (delta > bound || delta < 0)
144 delta = bound; 144 delta = bound;
145 return delta; 145 return delta;
146} 146}
@@ -156,7 +156,9 @@ psched_tod_diff(int delta_sec, int bound)
156 __delta += 1000000; \ 156 __delta += 1000000; \
157 case 1: \ 157 case 1: \
158 __delta += 1000000; \ 158 __delta += 1000000; \
159 case 0: ; \ 159 case 0: \
160 if (__delta > bound || __delta < 0) \
161 __delta = bound; \
160 } \ 162 } \
161 __delta; \ 163 __delta; \
162}) 164})
diff --git a/include/net/route.h b/include/net/route.h
index 22da7579d5de..efe92b239ef1 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)route.h 1.0.4 05/27/93 8 * Version: @(#)route.h 1.0.4 05/27/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Fixes: 12 * Fixes:
13 * Alan Cox : Reformatted. Added ip_rt_local() 13 * Alan Cox : Reformatted. Added ip_rt_local()
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 5576db56324d..f4fcee104707 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -407,32 +407,38 @@ sctp_vtag_verify(const struct sctp_chunk *chunk,
407 return 0; 407 return 0;
408} 408}
409 409
410/* Check VTAG of the packet matches the sender's own tag OR its peer's 410/* Check VTAG of the packet matches the sender's own tag and the T bit is
411 * tag and the T bit is set in the Chunk Flags. 411 * not set, OR its peer's tag and the T bit is set in the Chunk Flags.
412 */ 412 */
413static inline int 413static inline int
414sctp_vtag_verify_either(const struct sctp_chunk *chunk, 414sctp_vtag_verify_either(const struct sctp_chunk *chunk,
415 const struct sctp_association *asoc) 415 const struct sctp_association *asoc)
416{ 416{
417 /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 417 /* RFC 2960 Section 8.5.1, sctpimpguide Section 2.41
418 * 418 *
419 * B) The receiver of a ABORT shall accept the packet if the 419 * B) The receiver of a ABORT MUST accept the packet
420 * Verification Tag field of the packet matches its own tag OR it 420 * if the Verification Tag field of the packet matches its own tag
421 * is set to its peer's tag and the T bit is set in the Chunk 421 * and the T bit is not set
422 * Flags. Otherwise, the receiver MUST silently discard the packet 422 * OR
423 * and take no further action. 423 * it is set to its peer's tag and the T bit is set in the Chunk
424 * 424 * Flags.
425 * (C) The receiver of a SHUTDOWN COMPLETE shall accept the 425 * Otherwise, the receiver MUST silently discard the packet
426 * packet if the Verification Tag field of the packet 426 * and take no further action.
427 * matches its own tag OR it is set to its peer's tag and
428 * the T bit is set in the Chunk Flags. Otherwise, the
429 * receiver MUST silently discard the packet and take no
430 * further action....
431 * 427 *
428 * C) The receiver of a SHUTDOWN COMPLETE shall accept the packet
429 * if the Verification Tag field of the packet matches its own tag
430 * and the T bit is not set
431 * OR
432 * it is set to its peer's tag and the T bit is set in the Chunk
433 * Flags.
434 * Otherwise, the receiver MUST silently discard the packet
435 * and take no further action. An endpoint MUST ignore the
436 * SHUTDOWN COMPLETE if it is not in the SHUTDOWN-ACK-SENT state.
432 */ 437 */
433 if ((ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) || 438 if ((!sctp_test_T_bit(chunk) &&
434 (sctp_test_T_bit(chunk) && (ntohl(chunk->sctp_hdr->vtag) 439 (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) ||
435 == asoc->c.peer_vtag))) { 440 (sctp_test_T_bit(chunk) &&
441 (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) {
436 return 1; 442 return 1;
437 } 443 }
438 444
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7e64cf6bda1e..6c24d9cd3d66 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -154,6 +154,13 @@ extern struct sctp_globals {
154 int max_retrans_path; 154 int max_retrans_path;
155 int max_retrans_init; 155 int max_retrans_init;
156 156
157 /*
158 * Policy for preforming sctp/socket accounting
159 * 0 - do socket level accounting, all assocs share sk_sndbuf
160 * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes
161 */
162 int sndbuf_policy;
163
157 /* HB.interval - 30 seconds */ 164 /* HB.interval - 30 seconds */
158 int hb_interval; 165 int hb_interval;
159 166
@@ -207,6 +214,7 @@ extern struct sctp_globals {
207#define sctp_valid_cookie_life (sctp_globals.valid_cookie_life) 214#define sctp_valid_cookie_life (sctp_globals.valid_cookie_life)
208#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable) 215#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable)
209#define sctp_max_retrans_association (sctp_globals.max_retrans_association) 216#define sctp_max_retrans_association (sctp_globals.max_retrans_association)
217#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
210#define sctp_max_retrans_path (sctp_globals.max_retrans_path) 218#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
211#define sctp_max_retrans_init (sctp_globals.max_retrans_init) 219#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
212#define sctp_hb_interval (sctp_globals.hb_interval) 220#define sctp_hb_interval (sctp_globals.hb_interval)
@@ -1212,7 +1220,8 @@ struct sctp_endpoint {
1212 /* Default timeouts. */ 1220 /* Default timeouts. */
1213 int timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1221 int timeouts[SCTP_NUM_TIMEOUT_TYPES];
1214 1222
1215 /* Various thresholds. */ 1223 /* sendbuf acct. policy. */
1224 __u32 sndbuf_policy;
1216 1225
1217 /* Name for debugging output... */ 1226 /* Name for debugging output... */
1218 char *debug_name; 1227 char *debug_name;
diff --git a/include/net/sock.h b/include/net/sock.h
index be81cabd0da3..a9ef3a6a13f3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)sock.h 1.0.4 05/13/93 8 * Version: @(#)sock.h 1.0.4 05/13/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Corey Minyard <wf-rch!minyard@relay.EU.net> 12 * Corey Minyard <wf-rch!minyard@relay.EU.net>
13 * Florian La Roche <flla@stud.uni-sb.de> 13 * Florian La Roche <flla@stud.uni-sb.de>
@@ -90,17 +90,17 @@ do { spin_lock_init(&((__sk)->sk_lock.slock)); \
90struct sock; 90struct sock;
91 91
92/** 92/**
93 * struct sock_common - minimal network layer representation of sockets 93 * struct sock_common - minimal network layer representation of sockets
94 * @skc_family - network address family 94 * @skc_family: network address family
95 * @skc_state - Connection state 95 * @skc_state: Connection state
96 * @skc_reuse - %SO_REUSEADDR setting 96 * @skc_reuse: %SO_REUSEADDR setting
97 * @skc_bound_dev_if - bound device index if != 0 97 * @skc_bound_dev_if: bound device index if != 0
98 * @skc_node - main hash linkage for various protocol lookup tables 98 * @skc_node: main hash linkage for various protocol lookup tables
99 * @skc_bind_node - bind hash linkage for various protocol lookup tables 99 * @skc_bind_node: bind hash linkage for various protocol lookup tables
100 * @skc_refcnt - reference count 100 * @skc_refcnt: reference count
101 * 101 *
102 * This is the minimal network layer representation of sockets, the header 102 * This is the minimal network layer representation of sockets, the header
103 * for struct sock and struct tcp_tw_bucket. 103 * for struct sock and struct tcp_tw_bucket.
104 */ 104 */
105struct sock_common { 105struct sock_common {
106 unsigned short skc_family; 106 unsigned short skc_family;
@@ -114,60 +114,62 @@ struct sock_common {
114 114
115/** 115/**
116 * struct sock - network layer representation of sockets 116 * struct sock - network layer representation of sockets
117 * @__sk_common - shared layout with tcp_tw_bucket 117 * @__sk_common: shared layout with tcp_tw_bucket
118 * @sk_shutdown - mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN 118 * @sk_shutdown: mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN
119 * @sk_userlocks - %SO_SNDBUF and %SO_RCVBUF settings 119 * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings
120 * @sk_lock - synchronizer 120 * @sk_lock: synchronizer
121 * @sk_rcvbuf - size of receive buffer in bytes 121 * @sk_rcvbuf: size of receive buffer in bytes
122 * @sk_sleep - sock wait queue 122 * @sk_sleep: sock wait queue
123 * @sk_dst_cache - destination cache 123 * @sk_dst_cache: destination cache
124 * @sk_dst_lock - destination cache lock 124 * @sk_dst_lock: destination cache lock
125 * @sk_policy - flow policy 125 * @sk_policy: flow policy
126 * @sk_rmem_alloc - receive queue bytes committed 126 * @sk_rmem_alloc: receive queue bytes committed
127 * @sk_receive_queue - incoming packets 127 * @sk_receive_queue: incoming packets
128 * @sk_wmem_alloc - transmit queue bytes committed 128 * @sk_wmem_alloc: transmit queue bytes committed
129 * @sk_write_queue - Packet sending queue 129 * @sk_write_queue: Packet sending queue
130 * @sk_omem_alloc - "o" is "option" or "other" 130 * @sk_omem_alloc: "o" is "option" or "other"
131 * @sk_wmem_queued - persistent queue size 131 * @sk_wmem_queued: persistent queue size
132 * @sk_forward_alloc - space allocated forward 132 * @sk_forward_alloc: space allocated forward
133 * @sk_allocation - allocation mode 133 * @sk_allocation: allocation mode
134 * @sk_sndbuf - size of send buffer in bytes 134 * @sk_sndbuf: size of send buffer in bytes
135 * @sk_flags - %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings 135 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings
136 * @sk_no_check - %SO_NO_CHECK setting, wether or not checkup packets 136 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
137 * @sk_route_caps - route capabilities (e.g. %NETIF_F_TSO) 137 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
138 * @sk_lingertime - %SO_LINGER l_linger setting 138 * @sk_lingertime: %SO_LINGER l_linger setting
139 * @sk_hashent - hash entry in several tables (e.g. tcp_ehash) 139 * @sk_hashent: hash entry in several tables (e.g. tcp_ehash)
140 * @sk_backlog - always used with the per-socket spinlock held 140 * @sk_backlog: always used with the per-socket spinlock held
141 * @sk_callback_lock - used with the callbacks in the end of this struct 141 * @sk_callback_lock: used with the callbacks in the end of this struct
142 * @sk_error_queue - rarely used 142 * @sk_error_queue: rarely used
143 * @sk_prot - protocol handlers inside a network family 143 * @sk_prot: protocol handlers inside a network family
144 * @sk_err - last error 144 * @sk_prot_creator: sk_prot of original sock creator (see ipv6_setsockopt, IPV6_ADDRFORM for instance)
145 * @sk_err_soft - errors that don't cause failure but are the cause of a persistent failure not just 'timed out' 145 * @sk_err: last error
146 * @sk_ack_backlog - current listen backlog 146 * @sk_err_soft: errors that don't cause failure but are the cause of a persistent failure not just 'timed out'
147 * @sk_max_ack_backlog - listen backlog set in listen() 147 * @sk_ack_backlog: current listen backlog
148 * @sk_priority - %SO_PRIORITY setting 148 * @sk_max_ack_backlog: listen backlog set in listen()
149 * @sk_type - socket type (%SOCK_STREAM, etc) 149 * @sk_priority: %SO_PRIORITY setting
150 * @sk_protocol - which protocol this socket belongs in this network family 150 * @sk_type: socket type (%SOCK_STREAM, etc)
151 * @sk_peercred - %SO_PEERCRED setting 151 * @sk_protocol: which protocol this socket belongs in this network family
152 * @sk_rcvlowat - %SO_RCVLOWAT setting 152 * @sk_peercred: %SO_PEERCRED setting
153 * @sk_rcvtimeo - %SO_RCVTIMEO setting 153 * @sk_rcvlowat: %SO_RCVLOWAT setting
154 * @sk_sndtimeo - %SO_SNDTIMEO setting 154 * @sk_rcvtimeo: %SO_RCVTIMEO setting
155 * @sk_filter - socket filtering instructions 155 * @sk_sndtimeo: %SO_SNDTIMEO setting
156 * @sk_protinfo - private area, net family specific, when not using slab 156 * @sk_filter: socket filtering instructions
157 * @sk_timer - sock cleanup timer 157 * @sk_protinfo: private area, net family specific, when not using slab
158 * @sk_stamp - time stamp of last packet received 158 * @sk_timer: sock cleanup timer
159 * @sk_socket - Identd and reporting IO signals 159 * @sk_stamp: time stamp of last packet received
160 * @sk_user_data - RPC layer private data 160 * @sk_socket: Identd and reporting IO signals
161 * @sk_sndmsg_page - cached page for sendmsg 161 * @sk_user_data: RPC layer private data
162 * @sk_sndmsg_off - cached offset for sendmsg 162 * @sk_sndmsg_page: cached page for sendmsg
163 * @sk_send_head - front of stuff to transmit 163 * @sk_sndmsg_off: cached offset for sendmsg
164 * @sk_write_pending - a write to stream socket waits to start 164 * @sk_send_head: front of stuff to transmit
165 * @sk_state_change - callback to indicate change in the state of the sock 165 * @sk_security: used by security modules
166 * @sk_data_ready - callback to indicate there is data to be processed 166 * @sk_write_pending: a write to stream socket waits to start
167 * @sk_write_space - callback to indicate there is bf sending space available 167 * @sk_state_change: callback to indicate change in the state of the sock
168 * @sk_error_report - callback to indicate errors (e.g. %MSG_ERRQUEUE) 168 * @sk_data_ready: callback to indicate there is data to be processed
169 * @sk_backlog_rcv - callback to process the backlog 169 * @sk_write_space: callback to indicate there is bf sending space available
170 * @sk_destruct - called at sock freeing time, i.e. when all refcnt == 0 170 * @sk_error_report: callback to indicate errors (e.g. %MSG_ERRQUEUE)
171 * @sk_backlog_rcv: callback to process the backlog
172 * @sk_destruct: called at sock freeing time, i.e. when all refcnt == 0
171 */ 173 */
172struct sock { 174struct sock {
173 /* 175 /*
@@ -217,6 +219,7 @@ struct sock {
217 } sk_backlog; 219 } sk_backlog;
218 struct sk_buff_head sk_error_queue; 220 struct sk_buff_head sk_error_queue;
219 struct proto *sk_prot; 221 struct proto *sk_prot;
222 struct proto *sk_prot_creator;
220 rwlock_t sk_callback_lock; 223 rwlock_t sk_callback_lock;
221 int sk_err, 224 int sk_err,
222 sk_err_soft; 225 sk_err_soft;
@@ -1223,8 +1226,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
1223 1226
1224/** 1227/**
1225 * sk_eat_skb - Release a skb if it is no longer needed 1228 * sk_eat_skb - Release a skb if it is no longer needed
1226 * @sk - socket to eat this skb from 1229 * @sk: socket to eat this skb from
1227 * @skb - socket buffer to eat 1230 * @skb: socket buffer to eat
1228 * 1231 *
1229 * This routine must be called with interrupts disabled or with the socket 1232 * This routine must be called with interrupts disabled or with the socket
1230 * locked so that the sk_buff queue operation is ok. 1233 * locked so that the sk_buff queue operation is ok.
diff --git a/include/net/tc_act/tc_defact.h b/include/net/tc_act/tc_defact.h
new file mode 100644
index 000000000000..463aa671f95d
--- /dev/null
+++ b/include/net/tc_act/tc_defact.h
@@ -0,0 +1,13 @@
1#ifndef __NET_TC_DEF_H
2#define __NET_TC_DEF_H
3
4#include <net/act_api.h>
5
6struct tcf_defact
7{
8 tca_gen(defact);
9 u32 datalen;
10 void *defdata;
11};
12
13#endif
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 503810a70e21..e71f8ba3e101 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)tcp.h 1.0.5 05/23/93 8 * Version: @(#)tcp.h 1.0.5 05/23/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
@@ -1417,19 +1417,20 @@ tcp_nagle_check(const struct tcp_sock *tp, const struct sk_buff *skb,
1417 tcp_minshall_check(tp)))); 1417 tcp_minshall_check(tp))));
1418} 1418}
1419 1419
1420extern void tcp_set_skb_tso_segs(struct sk_buff *, unsigned int); 1420extern void tcp_set_skb_tso_segs(struct sock *, struct sk_buff *);
1421 1421
1422/* This checks if the data bearing packet SKB (usually sk->sk_send_head) 1422/* This checks if the data bearing packet SKB (usually sk->sk_send_head)
1423 * should be put on the wire right now. 1423 * should be put on the wire right now.
1424 */ 1424 */
1425static __inline__ int tcp_snd_test(const struct tcp_sock *tp, 1425static __inline__ int tcp_snd_test(struct sock *sk,
1426 struct sk_buff *skb, 1426 struct sk_buff *skb,
1427 unsigned cur_mss, int nonagle) 1427 unsigned cur_mss, int nonagle)
1428{ 1428{
1429 struct tcp_sock *tp = tcp_sk(sk);
1429 int pkts = tcp_skb_pcount(skb); 1430 int pkts = tcp_skb_pcount(skb);
1430 1431
1431 if (!pkts) { 1432 if (!pkts) {
1432 tcp_set_skb_tso_segs(skb, tp->mss_cache_std); 1433 tcp_set_skb_tso_segs(sk, skb);
1433 pkts = tcp_skb_pcount(skb); 1434 pkts = tcp_skb_pcount(skb);
1434 } 1435 }
1435 1436
@@ -1490,7 +1491,7 @@ static __inline__ void __tcp_push_pending_frames(struct sock *sk,
1490 if (skb) { 1491 if (skb) {
1491 if (!tcp_skb_is_last(sk, skb)) 1492 if (!tcp_skb_is_last(sk, skb))
1492 nonagle = TCP_NAGLE_PUSH; 1493 nonagle = TCP_NAGLE_PUSH;
1493 if (!tcp_snd_test(tp, skb, cur_mss, nonagle) || 1494 if (!tcp_snd_test(sk, skb, cur_mss, nonagle) ||
1494 tcp_write_xmit(sk, nonagle)) 1495 tcp_write_xmit(sk, nonagle))
1495 tcp_check_probe_timer(sk, tp); 1496 tcp_check_probe_timer(sk, tp);
1496 } 1497 }
@@ -1508,7 +1509,7 @@ static __inline__ int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp)
1508 struct sk_buff *skb = sk->sk_send_head; 1509 struct sk_buff *skb = sk->sk_send_head;
1509 1510
1510 return (skb && 1511 return (skb &&
1511 tcp_snd_test(tp, skb, tcp_current_mss(sk, 1), 1512 tcp_snd_test(sk, skb, tcp_current_mss(sk, 1),
1512 tcp_skb_is_last(sk, skb) ? TCP_NAGLE_PUSH : tp->nonagle)); 1513 tcp_skb_is_last(sk, skb) ? TCP_NAGLE_PUSH : tp->nonagle));
1513} 1514}
1514 1515
diff --git a/include/net/udp.h b/include/net/udp.h
index c496d10101db..ac229b761dbc 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * Version: @(#)udp.h 1.0.2 05/07/93 8 * Version: @(#)udp.h 1.0.2 05/07/93
9 * 9 *
10 * Authors: Ross Biro, <bir7@leland.Stanford.Edu> 10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * 12 *
13 * Fixes: 13 * Fixes:
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 73e9a8ca3d3b..e142a256d5dc 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1,6 +1,7 @@
1#ifndef _NET_XFRM_H 1#ifndef _NET_XFRM_H
2#define _NET_XFRM_H 2#define _NET_XFRM_H
3 3
4#include <linux/compiler.h>
4#include <linux/xfrm.h> 5#include <linux/xfrm.h>
5#include <linux/spinlock.h> 6#include <linux/spinlock.h>
6#include <linux/list.h> 7#include <linux/list.h>
@@ -516,6 +517,15 @@ struct xfrm_dst
516 u32 child_mtu_cached; 517 u32 child_mtu_cached;
517}; 518};
518 519
520static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
521{
522 dst_release(xdst->route);
523 if (likely(xdst->u.dst.xfrm))
524 xfrm_state_put(xdst->u.dst.xfrm);
525}
526
527extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
528
519/* Decapsulation state, used by the input to store data during 529/* Decapsulation state, used by the input to store data during
520 * decapsulation procedure, to be used later (during the policy 530 * decapsulation procedure, to be used later (during the policy
521 * check 531 * check
diff --git a/include/video/edid.h b/include/video/edid.h
index abc1b489c0db..b913f196131d 100644
--- a/include/video/edid.h
+++ b/include/video/edid.h
@@ -4,9 +4,6 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h> 6#include <linux/config.h>
7#ifdef CONFIG_PPC_OF
8#include <linux/pci.h>
9#endif
10 7
11#ifdef CONFIG_X86 8#ifdef CONFIG_X86
12struct edid_info { 9struct edid_info {
@@ -14,14 +11,8 @@ struct edid_info {
14}; 11};
15 12
16extern struct edid_info edid_info; 13extern struct edid_info edid_info;
17extern char *get_EDID_from_BIOS(void *);
18
19#endif /* CONFIG_X86 */ 14#endif /* CONFIG_X86 */
20 15
21#ifdef CONFIG_PPC_OF
22extern char *get_EDID_from_OF(struct pci_dev *pdev);
23#endif
24
25#endif /* __KERNEL__ */ 16#endif /* __KERNEL__ */
26 17
27#endif /* __linux_video_edid_h__ */ 18#endif /* __linux_video_edid_h__ */
diff --git a/include/video/tdfx.h b/include/video/tdfx.h
index a896e4442060..04237676b17c 100644
--- a/include/video/tdfx.h
+++ b/include/video/tdfx.h
@@ -99,6 +99,8 @@
99#define MISCINIT1_2DBLOCK_DIS BIT(15) 99#define MISCINIT1_2DBLOCK_DIS BIT(15)
100#define DRAMINIT0_SGRAM_NUM BIT(26) 100#define DRAMINIT0_SGRAM_NUM BIT(26)
101#define DRAMINIT0_SGRAM_TYPE BIT(27) 101#define DRAMINIT0_SGRAM_TYPE BIT(27)
102#define DRAMINIT0_SGRAM_TYPE_MASK (BIT(27)|BIT(28)|BIT(29))
103#define DRAMINIT0_SGRAM_TYPE_SHIFT 27
102#define DRAMINIT1_MEM_SDRAM BIT(30) 104#define DRAMINIT1_MEM_SDRAM BIT(30)
103#define VGAINIT0_VGA_DISABLE BIT(0) 105#define VGAINIT0_VGA_DISABLE BIT(0)
104#define VGAINIT0_EXT_TIMING BIT(1) 106#define VGAINIT0_EXT_TIMING BIT(1)