aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig3
-rw-r--r--arch/alpha/kernel/asm-offsets.c6
-rw-r--r--arch/alpha/kernel/pci.c4
-rw-r--r--arch/arm/Kconfig15
-rw-r--r--arch/arm/kernel/asm-offsets.c8
-rw-r--r--arch/arm/kernel/atags.c2
-rw-r--r--arch/arm/kernel/ecard.c56
-rw-r--r--arch/arm/mach-davinci/clock.c6
-rw-r--r--arch/arm/mm/iomap.c4
-rw-r--r--arch/avr32/kernel/asm-offsets.c9
-rw-r--r--arch/avr32/mm/tlb.c6
-rw-r--r--arch/blackfin/kernel/asm-offsets.c3
-rw-r--r--arch/blackfin/kernel/signal.c2
-rw-r--r--arch/cris/kernel/profile.c4
-rw-r--r--arch/frv/kernel/asm-offsets.c9
-rw-r--r--arch/frv/kernel/signal.c4
-rw-r--r--arch/frv/kernel/traps.c7
-rw-r--r--arch/frv/mb93090-mb00/pci-iomap.c4
-rw-r--r--arch/frv/mm/unaligned.c217
-rw-r--r--arch/h8300/kernel/asm-offsets.c6
-rw-r--r--arch/ia64/Kconfig6
-rw-r--r--arch/ia64/hp/common/hwsw_iommu.c61
-rw-r--r--arch/ia64/hp/common/sba_iommu.c70
-rw-r--r--arch/ia64/kernel/asm-offsets.c7
-rw-r--r--arch/ia64/kernel/perfmon.c6
-rw-r--r--arch/ia64/kernel/salinfo.c10
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c5
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_proc_fs.c29
-rw-r--r--arch/ia64/sn/pci/pci_dma.c81
-rw-r--r--arch/m68k/kernel/asm-offsets.c4
-rw-r--r--arch/m68k/mac/iop.c85
-rw-r--r--arch/m68knommu/kernel/asm-offsets.c6
-rw-r--r--arch/mips/basler/excite/excite_procfs.c30
-rw-r--r--arch/mips/kernel/asm-offsets.c478
-rw-r--r--arch/mips/lib/iomap-pci.c4
-rw-r--r--arch/mips/pmc-sierra/yosemite/setup.c3
-rw-r--r--arch/mn10300/kernel/asm-offsets.c9
-rw-r--r--arch/mn10300/unit-asb2305/pci-iomap.c4
-rw-r--r--arch/parisc/kernel/asm-offsets.c6
-rw-r--r--arch/parisc/kernel/pci-dma.c7
-rw-r--r--arch/parisc/lib/iomap.c4
-rw-r--r--arch/powerpc/kernel/asm-offsets.c6
-rw-r--r--arch/powerpc/kernel/lparcfg.c6
-rw-r--r--arch/powerpc/kernel/proc_ppc64.c5
-rw-r--r--arch/powerpc/kernel/rtas-proc.c45
-rw-r--r--arch/powerpc/kernel/rtas_flash.c13
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c3
-rw-r--r--arch/powerpc/platforms/cell/spufs/sputrace.c3
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c8
-rw-r--r--arch/powerpc/platforms/iseries/mf.c6
-rw-r--r--arch/powerpc/platforms/iseries/proc.c8
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c7
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c10
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c7
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c7
-rw-r--r--arch/ppc/kernel/asm-offsets.c7
-rw-r--r--arch/ppc/kernel/pci.c4
-rw-r--r--arch/ppc/platforms/sbc82xx.c2
-rw-r--r--arch/s390/kernel/asm-offsets.c54
-rw-r--r--arch/s390/kernel/irq.c2
-rw-r--r--arch/sh/drivers/pci/pci.c4
-rw-r--r--arch/sh/kernel/asm-offsets.c7
-rw-r--r--arch/sh/kernel/irq.c2
-rw-r--r--arch/sparc/kernel/asm-offsets.c6
-rw-r--r--arch/sparc/lib/iomap.c4
-rw-r--r--arch/sparc64/lib/iomap.c4
-rw-r--r--arch/um/kernel/exitcode.c2
-rw-r--r--arch/um/kernel/process.c2
-rw-r--r--arch/um/kernel/time.c3
-rw-r--r--arch/v850/kernel/asm-offsets.c7
-rw-r--r--arch/v850/kernel/rte_mb_a_pci.c4
-rw-r--r--arch/x86/Kconfig23
-rw-r--r--arch/x86/boot/edd.c10
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/asm-offsets_32.c9
-rw-r--r--arch/x86/kernel/asm-offsets_64.c9
-rw-r--r--arch/x86/kernel/cpu/mtrr/if.c2
-rw-r--r--arch/x86/kernel/irq_32.c2
-rw-r--r--arch/x86/kernel/olpc.c260
-rw-r--r--arch/x86/kernel/time_32.c1
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S6
-rw-r--r--arch/x86/pci/Makefile_321
-rw-r--r--arch/x86/pci/init.c3
-rw-r--r--arch/x86/pci/olpc.c313
-rw-r--r--arch/x86/pci/pci.h1
-rw-r--r--arch/x86/vdso/vdso.S10
-rw-r--r--arch/xtensa/kernel/asm-offsets.c3
87 files changed, 1165 insertions, 1028 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 694c9af520bb..3ea332b009e5 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -36,3 +36,6 @@ config HAVE_KPROBES
36 36
37config HAVE_KRETPROBES 37config HAVE_KRETPROBES
38 def_bool n 38 def_bool n
39
40config HAVE_DMA_ATTRS
41 def_bool n
diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c
index 6c56c754a0b5..4b18cd94d59d 100644
--- a/arch/alpha/kernel/asm-offsets.c
+++ b/arch/alpha/kernel/asm-offsets.c
@@ -8,13 +8,9 @@
8#include <linux/stddef.h> 8#include <linux/stddef.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/ptrace.h> 10#include <linux/ptrace.h>
11#include <linux/kbuild.h>
11#include <asm/io.h> 12#include <asm/io.h>
12 13
13#define DEFINE(sym, val) \
14 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
15
16#define BLANK() asm volatile("\n->" : : )
17
18void foo(void) 14void foo(void)
19{ 15{
20 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 16 DEFINE(TI_TASK, offsetof(struct thread_info, task));
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index baf57563b14c..36ab22a7ea12 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -514,8 +514,8 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
514 514
515void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 515void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
516{ 516{
517 unsigned long start = pci_resource_start(dev, bar); 517 resource_size_t start = pci_resource_start(dev, bar);
518 unsigned long len = pci_resource_len(dev, bar); 518 resource_size_t len = pci_resource_len(dev, bar);
519 unsigned long flags = pci_resource_flags(dev, bar); 519 unsigned long flags = pci_resource_flags(dev, bar);
520 520
521 if (!len || !start) 521 if (!len || !start)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d8d253285a94..b786e68914d4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -8,6 +8,7 @@ mainmenu "Linux Kernel Configuration"
8config ARM 8config ARM
9 bool 9 bool
10 default y 10 default y
11 select HAVE_IDE
11 select RTC_LIB 12 select RTC_LIB
12 select SYS_SUPPORTS_APM_EMULATION 13 select SYS_SUPPORTS_APM_EMULATION
13 select HAVE_OPROFILE 14 select HAVE_OPROFILE
@@ -223,7 +224,6 @@ config ARCH_CLPS7500
223 select TIMER_ACORN 224 select TIMER_ACORN
224 select ISA 225 select ISA
225 select NO_IOPORT 226 select NO_IOPORT
226 select HAVE_IDE
227 help 227 help
228 Support for the Cirrus Logic PS7500FE system-on-a-chip. 228 Support for the Cirrus Logic PS7500FE system-on-a-chip.
229 229
@@ -236,7 +236,6 @@ config ARCH_CO285
236 bool "Co-EBSA285" 236 bool "Co-EBSA285"
237 select FOOTBRIDGE 237 select FOOTBRIDGE
238 select FOOTBRIDGE_ADDIN 238 select FOOTBRIDGE_ADDIN
239 select HAVE_IDE
240 help 239 help
241 Support for Intel's EBSA285 companion chip. 240 Support for Intel's EBSA285 companion chip.
242 241
@@ -262,7 +261,6 @@ config ARCH_EP93XX
262config ARCH_FOOTBRIDGE 261config ARCH_FOOTBRIDGE
263 bool "FootBridge" 262 bool "FootBridge"
264 select FOOTBRIDGE 263 select FOOTBRIDGE
265 select HAVE_IDE
266 help 264 help
267 Support for systems based on the DC21285 companion chip 265 Support for systems based on the DC21285 companion chip
268 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 266 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
@@ -301,7 +299,6 @@ config ARCH_IOP32X
301 depends on MMU 299 depends on MMU
302 select PLAT_IOP 300 select PLAT_IOP
303 select PCI 301 select PCI
304 select HAVE_IDE
305 help 302 help
306 Support for Intel's 80219 and IOP32X (XScale) family of 303 Support for Intel's 80219 and IOP32X (XScale) family of
307 processors. 304 processors.
@@ -311,14 +308,12 @@ config ARCH_IOP33X
311 depends on MMU 308 depends on MMU
312 select PLAT_IOP 309 select PLAT_IOP
313 select PCI 310 select PCI
314 select HAVE_IDE
315 help 311 help
316 Support for Intel's IOP33X (XScale) family of processors. 312 Support for Intel's IOP33X (XScale) family of processors.
317 313
318config ARCH_IXP23XX 314config ARCH_IXP23XX
319 bool "IXP23XX-based" 315 bool "IXP23XX-based"
320 depends on MMU 316 depends on MMU
321 select HAVE_IDE
322 select PCI 317 select PCI
323 help 318 help
324 Support for Intel's IXP23xx (XScale) family of processors. 319 Support for Intel's IXP23xx (XScale) family of processors.
@@ -336,14 +331,12 @@ config ARCH_IXP4XX
336 select GENERIC_GPIO 331 select GENERIC_GPIO
337 select GENERIC_TIME 332 select GENERIC_TIME
338 select GENERIC_CLOCKEVENTS 333 select GENERIC_CLOCKEVENTS
339 select HAVE_IDE
340 help 334 help
341 Support for Intel's IXP4XX (XScale) family of processors. 335 Support for Intel's IXP4XX (XScale) family of processors.
342 336
343config ARCH_L7200 337config ARCH_L7200
344 bool "LinkUp-L7200" 338 bool "LinkUp-L7200"
345 select FIQ 339 select FIQ
346 select HAVE_IDE
347 help 340 help
348 Say Y here if you intend to run this kernel on a LinkUp Systems 341 Say Y here if you intend to run this kernel on a LinkUp Systems
349 L7200 Software Development Board which uses an ARM720T processor. 342 L7200 Software Development Board which uses an ARM720T processor.
@@ -400,7 +393,6 @@ config ARCH_PXA
400 depends on MMU 393 depends on MMU
401 select ARCH_MTD_XIP 394 select ARCH_MTD_XIP
402 select GENERIC_GPIO 395 select GENERIC_GPIO
403 select HAVE_IDE
404 select HAVE_GPIO_LIB 396 select HAVE_GPIO_LIB
405 select GENERIC_TIME 397 select GENERIC_TIME
406 select GENERIC_CLOCKEVENTS 398 select GENERIC_CLOCKEVENTS
@@ -416,7 +408,6 @@ config ARCH_RPC
416 select ARCH_MAY_HAVE_PC_FDC 408 select ARCH_MAY_HAVE_PC_FDC
417 select ISA_DMA_API 409 select ISA_DMA_API
418 select NO_IOPORT 410 select NO_IOPORT
419 select HAVE_IDE
420 help 411 help
421 On the Acorn Risc-PC, Linux can support the internal IDE disk and 412 On the Acorn Risc-PC, Linux can support the internal IDE disk and
422 CD-ROM interface, serial and parallel port, and the floppy drive. 413 CD-ROM interface, serial and parallel port, and the floppy drive.
@@ -432,7 +423,6 @@ config ARCH_SA1100
432 select GENERIC_TIME 423 select GENERIC_TIME
433 select GENERIC_CLOCKEVENTS 424 select GENERIC_CLOCKEVENTS
434 select TICK_ONESHOT 425 select TICK_ONESHOT
435 select HAVE_IDE
436 select HAVE_GPIO_LIB 426 select HAVE_GPIO_LIB
437 help 427 help
438 Support for StrongARM 11x0 based boards. 428 Support for StrongARM 11x0 based boards.
@@ -440,7 +430,6 @@ config ARCH_SA1100
440config ARCH_S3C2410 430config ARCH_S3C2410
441 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443" 431 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
442 select GENERIC_GPIO 432 select GENERIC_GPIO
443 select HAVE_IDE
444 help 433 help
445 Samsung S3C2410X CPU based systems, such as the Simtec Electronics 434 Samsung S3C2410X CPU based systems, such as the Simtec Electronics
446 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or 435 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@ -448,7 +437,6 @@ config ARCH_S3C2410
448 437
449config ARCH_SHARK 438config ARCH_SHARK
450 bool "Shark" 439 bool "Shark"
451 select HAVE_IDE
452 select ISA 440 select ISA
453 select ISA_DMA 441 select ISA_DMA
454 select PCI 442 select PCI
@@ -458,7 +446,6 @@ config ARCH_SHARK
458 446
459config ARCH_LH7A40X 447config ARCH_LH7A40X
460 bool "Sharp LH7A40X" 448 bool "Sharp LH7A40X"
461 select HAVE_IDE
462 help 449 help
463 Say Y here for systems based on one of the Sharp LH7A40X 450 Say Y here for systems based on one of the Sharp LH7A40X
464 System on a Chip processors. These CPUs include an ARM922T 451 System on a Chip processors. These CPUs include an ARM922T
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 0a0d2479274b..4a881258bb17 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -16,6 +16,7 @@
16#include <asm/thread_info.h> 16#include <asm/thread_info.h>
17#include <asm/memory.h> 17#include <asm/memory.h>
18#include <asm/procinfo.h> 18#include <asm/procinfo.h>
19#include <linux/kbuild.h>
19 20
20/* 21/*
21 * Make sure that the compiler and target are compatible. 22 * Make sure that the compiler and target are compatible.
@@ -35,13 +36,6 @@
35#error Known good compilers: 3.3 36#error Known good compilers: 3.3
36#endif 37#endif
37 38
38/* Use marker if you need to separate the values later */
39
40#define DEFINE(sym, val) \
41 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
42
43#define BLANK() asm volatile("\n->" : : )
44
45int main(void) 39int main(void)
46{ 40{
47 DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); 41 DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
diff --git a/arch/arm/kernel/atags.c b/arch/arm/kernel/atags.c
index e2e934c38080..64c420805e6f 100644
--- a/arch/arm/kernel/atags.c
+++ b/arch/arm/kernel/atags.c
@@ -35,7 +35,7 @@ create_proc_entries(void)
35{ 35{
36 struct proc_dir_entry* tags_entry; 36 struct proc_dir_entry* tags_entry;
37 37
38 tags_entry = create_proc_read_entry("atags", 0400, &proc_root, read_buffer, &tags_buffer); 38 tags_entry = create_proc_read_entry("atags", 0400, NULL, read_buffer, &tags_buffer);
39 if (!tags_entry) 39 if (!tags_entry)
40 return -ENOMEM; 40 return -ENOMEM;
41 41
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index f56d48c451ea..a53c0aba5c14 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -37,6 +37,7 @@
37#include <linux/mm.h> 37#include <linux/mm.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/proc_fs.h> 39#include <linux/proc_fs.h>
40#include <linux/seq_file.h>
40#include <linux/device.h> 41#include <linux/device.h>
41#include <linux/init.h> 42#include <linux/init.h>
42#include <linux/mutex.h> 43#include <linux/mutex.h>
@@ -723,17 +724,14 @@ unsigned int __ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed)
723 return address; 724 return address;
724} 725}
725 726
726static int ecard_prints(char *buffer, ecard_t *ec) 727static int ecard_prints(struct seq_file *m, ecard_t *ec)
727{ 728{
728 char *start = buffer; 729 seq_printf(m, " %d: %s ", ec->slot_no, ec->easi ? "EASI" : " ");
729
730 buffer += sprintf(buffer, " %d: %s ", ec->slot_no,
731 ec->easi ? "EASI" : " ");
732 730
733 if (ec->cid.id == 0) { 731 if (ec->cid.id == 0) {
734 struct in_chunk_dir incd; 732 struct in_chunk_dir incd;
735 733
736 buffer += sprintf(buffer, "[%04X:%04X] ", 734 seq_printf(m, "[%04X:%04X] ",
737 ec->cid.manufacturer, ec->cid.product); 735 ec->cid.manufacturer, ec->cid.product);
738 736
739 if (!ec->card_desc && ec->cid.cd && 737 if (!ec->card_desc && ec->cid.cd &&
@@ -744,43 +742,43 @@ static int ecard_prints(char *buffer, ecard_t *ec)
744 strcpy((char *)ec->card_desc, incd.d.string); 742 strcpy((char *)ec->card_desc, incd.d.string);
745 } 743 }
746 744
747 buffer += sprintf(buffer, "%s\n", ec->card_desc ? ec->card_desc : "*unknown*"); 745 seq_printf(m, "%s\n", ec->card_desc ? ec->card_desc : "*unknown*");
748 } else 746 } else
749 buffer += sprintf(buffer, "Simple card %d\n", ec->cid.id); 747 seq_printf(m, "Simple card %d\n", ec->cid.id);
750 748
751 return buffer - start; 749 return 0;
752} 750}
753 751
754static int get_ecard_dev_info(char *buf, char **start, off_t pos, int count) 752static int ecard_devices_proc_show(struct seq_file *m, void *v)
755{ 753{
756 ecard_t *ec = cards; 754 ecard_t *ec = cards;
757 off_t at = 0; 755
758 int len, cnt; 756 while (ec) {
759 757 ecard_prints(m, ec);
760 cnt = 0;
761 while (ec && count > cnt) {
762 len = ecard_prints(buf, ec);
763 at += len;
764 if (at >= pos) {
765 if (!*start) {
766 *start = buf + (pos - (at - len));
767 cnt = at - pos;
768 } else
769 cnt += len;
770 buf += len;
771 }
772 ec = ec->next; 758 ec = ec->next;
773 } 759 }
774 return (count > cnt) ? cnt : count; 760 return 0;
775} 761}
776 762
763static int ecard_devices_proc_open(struct inode *inode, struct file *file)
764{
765 return single_open(file, ecard_devices_proc_show, NULL);
766}
767
768static const struct file_operations bus_ecard_proc_fops = {
769 .owner = THIS_MODULE,
770 .open = ecard_devices_proc_open,
771 .read = seq_read,
772 .llseek = seq_lseek,
773 .release = single_release,
774};
775
777static struct proc_dir_entry *proc_bus_ecard_dir = NULL; 776static struct proc_dir_entry *proc_bus_ecard_dir = NULL;
778 777
779static void ecard_proc_init(void) 778static void ecard_proc_init(void)
780{ 779{
781 proc_bus_ecard_dir = proc_mkdir("ecard", proc_bus); 780 proc_bus_ecard_dir = proc_mkdir("bus/ecard", NULL);
782 create_proc_info_entry("devices", 0, proc_bus_ecard_dir, 781 proc_create("devices", 0, proc_bus_ecard_dir, &bus_ecard_proc_fops);
783 get_ecard_dev_info);
784} 782}
785 783
786#define ec_set_resource(ec,nr,st,sz) \ 784#define ec_set_resource(ec,nr,st,sz) \
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 4143828a9684..c6b94f60e0b2 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -311,11 +311,7 @@ static const struct file_operations proc_davinci_ck_operations = {
311 311
312static int __init davinci_ck_proc_init(void) 312static int __init davinci_ck_proc_init(void)
313{ 313{
314 struct proc_dir_entry *entry; 314 proc_create("davinci_clocks", 0, NULL, &proc_davinci_ck_operations);
315
316 entry = create_proc_entry("davinci_clocks", 0, NULL);
317 if (entry)
318 entry->proc_fops = &proc_davinci_ck_operations;
319 return 0; 315 return 0;
320 316
321} 317}
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c
index 62066f3020c8..7429f8c01015 100644
--- a/arch/arm/mm/iomap.c
+++ b/arch/arm/mm/iomap.c
@@ -26,8 +26,8 @@ EXPORT_SYMBOL(ioport_unmap);
26#ifdef CONFIG_PCI 26#ifdef CONFIG_PCI
27void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 27void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
28{ 28{
29 unsigned long start = pci_resource_start(dev, bar); 29 resource_size_t start = pci_resource_start(dev, bar);
30 unsigned long len = pci_resource_len(dev, bar); 30 resource_size_t len = pci_resource_len(dev, bar);
31 unsigned long flags = pci_resource_flags(dev, bar); 31 unsigned long flags = pci_resource_flags(dev, bar);
32 32
33 if (!len || !start) 33 if (!len || !start)
diff --git a/arch/avr32/kernel/asm-offsets.c b/arch/avr32/kernel/asm-offsets.c
index 078cd33f467b..e4796c67a831 100644
--- a/arch/avr32/kernel/asm-offsets.c
+++ b/arch/avr32/kernel/asm-offsets.c
@@ -5,14 +5,7 @@
5 */ 5 */
6 6
7#include <linux/thread_info.h> 7#include <linux/thread_info.h>
8 8#include <linux/kbuild.h>
9#define DEFINE(sym, val) \
10 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
11
12#define BLANK() asm volatile("\n->" : : )
13
14#define OFFSET(sym, str, mem) \
15 DEFINE(sym, offsetof(struct str, mem));
16 9
17void foo(void) 10void foo(void)
18{ 11{
diff --git a/arch/avr32/mm/tlb.c b/arch/avr32/mm/tlb.c
index b835257a8fa3..cd12edbea9f2 100644
--- a/arch/avr32/mm/tlb.c
+++ b/arch/avr32/mm/tlb.c
@@ -369,11 +369,7 @@ static const struct file_operations proc_tlb_operations = {
369 369
370static int __init proctlb_init(void) 370static int __init proctlb_init(void)
371{ 371{
372 struct proc_dir_entry *entry; 372 proc_create("tlb", 0, NULL, &proc_tlb_operations);
373
374 entry = create_proc_entry("tlb", 0, NULL);
375 if (entry)
376 entry->proc_fops = &proc_tlb_operations;
377 return 0; 373 return 0;
378} 374}
379late_initcall(proctlb_init); 375late_initcall(proctlb_init);
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
index b56b2741cdea..721f15f3cebf 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -34,8 +34,7 @@
34#include <linux/hardirq.h> 34#include <linux/hardirq.h>
35#include <linux/irq.h> 35#include <linux/irq.h>
36#include <linux/thread_info.h> 36#include <linux/thread_info.h>
37 37#include <linux/kbuild.h>
38#define DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
39 38
40int main(void) 39int main(void)
41{ 40{
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index d1fa24401dc6..cb9d883d493c 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -212,7 +212,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
212 212
213 /* Set up registers for signal handler */ 213 /* Set up registers for signal handler */
214 wrusp((unsigned long)frame); 214 wrusp((unsigned long)frame);
215 if (get_personality & FDPIC_FUNCPTRS) { 215 if (current->personality & FDPIC_FUNCPTRS) {
216 struct fdpic_func_descriptor __user *funcptr = 216 struct fdpic_func_descriptor __user *funcptr =
217 (struct fdpic_func_descriptor *) ka->sa.sa_handler; 217 (struct fdpic_func_descriptor *) ka->sa.sa_handler;
218 __get_user(regs->pc, &funcptr->text); 218 __get_user(regs->pc, &funcptr->text);
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c
index aad0a9e5991a..44f7b4f79476 100644
--- a/arch/cris/kernel/profile.c
+++ b/arch/cris/kernel/profile.c
@@ -75,9 +75,9 @@ __init init_cris_profile(void)
75 75
76 sample_buffer_pos = sample_buffer; 76 sample_buffer_pos = sample_buffer;
77 77
78 entry = create_proc_entry("system_profile", S_IWUSR | S_IRUGO, NULL); 78 entry = proc_create("system_profile", S_IWUSR | S_IRUGO, NULL,
79 &cris_proc_profile_operations);
79 if (entry) { 80 if (entry) {
80 entry->proc_fops = &cris_proc_profile_operations;
81 entry->size = SAMPLE_BUFFER_SIZE; 81 entry->size = SAMPLE_BUFFER_SIZE;
82 } 82 }
83 prof_running = 1; 83 prof_running = 1;
diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c
index fbb19fc1af40..9de96843a278 100644
--- a/arch/frv/kernel/asm-offsets.c
+++ b/arch/frv/kernel/asm-offsets.c
@@ -7,15 +7,13 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/signal.h> 8#include <linux/signal.h>
9#include <linux/personality.h> 9#include <linux/personality.h>
10#include <linux/kbuild.h>
10#include <asm/registers.h> 11#include <asm/registers.h>
11#include <asm/ucontext.h> 12#include <asm/ucontext.h>
12#include <asm/processor.h> 13#include <asm/processor.h>
13#include <asm/thread_info.h> 14#include <asm/thread_info.h>
14#include <asm/gdb-stub.h> 15#include <asm/gdb-stub.h>
15 16
16#define DEFINE(sym, val) \
17 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
18
19#define DEF_PTREG(sym, reg) \ 17#define DEF_PTREG(sym, reg) \
20 asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \ 18 asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \
21 : : "i" (offsetof(struct pt_regs, reg))) 19 : : "i" (offsetof(struct pt_regs, reg)))
@@ -32,11 +30,6 @@
32 asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \ 30 asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \
33 : : "i" (offsetof(struct frv_frame0, reg))) 31 : : "i" (offsetof(struct frv_frame0, reg)))
34 32
35#define BLANK() asm volatile("\n->" : : )
36
37#define OFFSET(sym, str, mem) \
38 DEFINE(sym, offsetof(struct str, mem));
39
40void foo(void) 33void foo(void)
41{ 34{
42 /* offsets into the thread_info structure */ 35 /* offsets into the thread_info structure */
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index d64bcaff54cd..3bdb368292a8 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -297,7 +297,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set)
297 __frame->lr = (unsigned long) &frame->retcode; 297 __frame->lr = (unsigned long) &frame->retcode;
298 __frame->gr8 = sig; 298 __frame->gr8 = sig;
299 299
300 if (get_personality & FDPIC_FUNCPTRS) { 300 if (current->personality & FDPIC_FUNCPTRS) {
301 struct fdpic_func_descriptor __user *funcptr = 301 struct fdpic_func_descriptor __user *funcptr =
302 (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; 302 (struct fdpic_func_descriptor __user *) ka->sa.sa_handler;
303 __get_user(__frame->pc, &funcptr->text); 303 __get_user(__frame->pc, &funcptr->text);
@@ -396,7 +396,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
396 __frame->gr8 = sig; 396 __frame->gr8 = sig;
397 __frame->gr9 = (unsigned long) &frame->info; 397 __frame->gr9 = (unsigned long) &frame->info;
398 398
399 if (get_personality & FDPIC_FUNCPTRS) { 399 if (current->personality & FDPIC_FUNCPTRS) {
400 struct fdpic_func_descriptor __user *funcptr = 400 struct fdpic_func_descriptor __user *funcptr =
401 (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; 401 (struct fdpic_func_descriptor __user *) ka->sa.sa_handler;
402 __get_user(__frame->pc, &funcptr->text); 402 __get_user(__frame->pc, &funcptr->text);
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index a40df80b2ebd..1d2dfe67d442 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -362,11 +362,8 @@ asmlinkage void memory_access_exception(unsigned long esr0,
362#ifdef CONFIG_MMU 362#ifdef CONFIG_MMU
363 unsigned long fixup; 363 unsigned long fixup;
364 364
365 if ((esr0 & ESRx_EC) == ESRx_EC_DATA_ACCESS) 365 fixup = search_exception_table(__frame->pc);
366 if (handle_misalignment(esr0, ear0, epcr0) == 0) 366 if (fixup) {
367 return;
368
369 if ((fixup = search_exception_table(__frame->pc)) != 0) {
370 __frame->pc = fixup; 367 __frame->pc = fixup;
371 return; 368 return;
372 } 369 }
diff --git a/arch/frv/mb93090-mb00/pci-iomap.c b/arch/frv/mb93090-mb00/pci-iomap.c
index 068fa04bd527..35f6df28351e 100644
--- a/arch/frv/mb93090-mb00/pci-iomap.c
+++ b/arch/frv/mb93090-mb00/pci-iomap.c
@@ -13,8 +13,8 @@
13 13
14void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 14void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
15{ 15{
16 unsigned long start = pci_resource_start(dev, bar); 16 resource_size_t start = pci_resource_start(dev, bar);
17 unsigned long len = pci_resource_len(dev, bar); 17 resource_size_t len = pci_resource_len(dev, bar);
18 unsigned long flags = pci_resource_flags(dev, bar); 18 unsigned long flags = pci_resource_flags(dev, bar);
19 19
20 if (!len || !start) 20 if (!len || !start)
diff --git a/arch/frv/mm/unaligned.c b/arch/frv/mm/unaligned.c
deleted file mode 100644
index 8f0375fc15a8..000000000000
--- a/arch/frv/mm/unaligned.c
+++ /dev/null
@@ -1,217 +0,0 @@
1/* unaligned.c: unalignment fixup handler for CPUs on which it is supported (FR451 only)
2 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/sched.h>
13#include <linux/signal.h>
14#include <linux/kernel.h>
15#include <linux/mm.h>
16#include <linux/types.h>
17#include <linux/user.h>
18#include <linux/string.h>
19#include <linux/linkage.h>
20#include <linux/init.h>
21
22#include <asm/setup.h>
23#include <asm/system.h>
24#include <asm/uaccess.h>
25
26#if 0
27#define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ )
28#else
29#define kdebug(fmt, ...) do {} while(0)
30#endif
31
32#define _MA_SIGNED 0x01
33#define _MA_HALF 0x02
34#define _MA_WORD 0x04
35#define _MA_DWORD 0x08
36#define _MA_SZ_MASK 0x0e
37#define _MA_LOAD 0x10
38#define _MA_STORE 0x20
39#define _MA_UPDATE 0x40
40#define _MA_IMM 0x80
41
42#define _MA_LDxU _MA_LOAD | _MA_UPDATE
43#define _MA_LDxI _MA_LOAD | _MA_IMM
44#define _MA_STxU _MA_STORE | _MA_UPDATE
45#define _MA_STxI _MA_STORE | _MA_IMM
46
47static const uint8_t tbl_LDGRk_reg[0x40] = {
48 [0x02] = _MA_LOAD | _MA_HALF | _MA_SIGNED, /* LDSH @(GRi,GRj),GRk */
49 [0x03] = _MA_LOAD | _MA_HALF, /* LDUH @(GRi,GRj),GRk */
50 [0x04] = _MA_LOAD | _MA_WORD, /* LD @(GRi,GRj),GRk */
51 [0x05] = _MA_LOAD | _MA_DWORD, /* LDD @(GRi,GRj),GRk */
52 [0x12] = _MA_LDxU | _MA_HALF | _MA_SIGNED, /* LDSHU @(GRi,GRj),GRk */
53 [0x13] = _MA_LDxU | _MA_HALF, /* LDUHU @(GRi,GRj),GRk */
54 [0x14] = _MA_LDxU | _MA_WORD, /* LDU @(GRi,GRj),GRk */
55 [0x15] = _MA_LDxU | _MA_DWORD, /* LDDU @(GRi,GRj),GRk */
56};
57
58static const uint8_t tbl_STGRk_reg[0x40] = {
59 [0x01] = _MA_STORE | _MA_HALF, /* STH @(GRi,GRj),GRk */
60 [0x02] = _MA_STORE | _MA_WORD, /* ST @(GRi,GRj),GRk */
61 [0x03] = _MA_STORE | _MA_DWORD, /* STD @(GRi,GRj),GRk */
62 [0x11] = _MA_STxU | _MA_HALF, /* STHU @(GRi,GRj),GRk */
63 [0x12] = _MA_STxU | _MA_WORD, /* STU @(GRi,GRj),GRk */
64 [0x13] = _MA_STxU | _MA_DWORD, /* STDU @(GRi,GRj),GRk */
65};
66
67static const uint8_t tbl_LDSTGRk_imm[0x80] = {
68 [0x31] = _MA_LDxI | _MA_HALF | _MA_SIGNED, /* LDSHI @(GRi,d12),GRk */
69 [0x32] = _MA_LDxI | _MA_WORD, /* LDI @(GRi,d12),GRk */
70 [0x33] = _MA_LDxI | _MA_DWORD, /* LDDI @(GRi,d12),GRk */
71 [0x36] = _MA_LDxI | _MA_HALF, /* LDUHI @(GRi,d12),GRk */
72 [0x51] = _MA_STxI | _MA_HALF, /* STHI @(GRi,d12),GRk */
73 [0x52] = _MA_STxI | _MA_WORD, /* STI @(GRi,d12),GRk */
74 [0x53] = _MA_STxI | _MA_DWORD, /* STDI @(GRi,d12),GRk */
75};
76
77
78/*****************************************************************************/
79/*
80 * see if we can handle the exception by fixing up a misaligned memory access
81 */
82int handle_misalignment(unsigned long esr0, unsigned long ear0, unsigned long epcr0)
83{
84 unsigned long insn, addr, *greg;
85 int GRi, GRj, GRk, D12, op;
86
87 union {
88 uint64_t _64;
89 uint32_t _32[2];
90 uint16_t _16;
91 uint8_t _8[8];
92 } x;
93
94 if (!(esr0 & ESR0_EAV) || !(epcr0 & EPCR0_V) || !(ear0 & 7))
95 return -EAGAIN;
96
97 epcr0 &= EPCR0_PC;
98
99 if (__frame->pc != epcr0) {
100 kdebug("MISALIGN: Execution not halted on excepting instruction\n");
101 BUG();
102 }
103
104 if (__get_user(insn, (unsigned long *) epcr0) < 0)
105 return -EFAULT;
106
107 /* determine the instruction type first */
108 switch ((insn >> 18) & 0x7f) {
109 case 0x2:
110 /* LDx @(GRi,GRj),GRk */
111 op = tbl_LDGRk_reg[(insn >> 6) & 0x3f];
112 break;
113
114 case 0x3:
115 /* STx GRk,@(GRi,GRj) */
116 op = tbl_STGRk_reg[(insn >> 6) & 0x3f];
117 break;
118
119 default:
120 op = tbl_LDSTGRk_imm[(insn >> 18) & 0x7f];
121 break;
122 }
123
124 if (!op)
125 return -EAGAIN;
126
127 kdebug("MISALIGN: pc=%08lx insn=%08lx ad=%08lx op=%02x\n", epcr0, insn, ear0, op);
128
129 memset(&x, 0xba, 8);
130
131 /* validate the instruction parameters */
132 greg = (unsigned long *) &__frame->tbr;
133
134 GRi = (insn >> 12) & 0x3f;
135 GRk = (insn >> 25) & 0x3f;
136
137 if (GRi > 31 || GRk > 31)
138 return -ENOENT;
139
140 if (op & _MA_DWORD && GRk & 1)
141 return -EINVAL;
142
143 if (op & _MA_IMM) {
144 D12 = insn & 0xfff;
145 asm ("slli %0,#20,%0 ! srai %0,#20,%0" : "=r"(D12) : "0"(D12)); /* sign extend */
146 addr = (GRi ? greg[GRi] : 0) + D12;
147 }
148 else {
149 GRj = (insn >> 0) & 0x3f;
150 if (GRj > 31)
151 return -ENOENT;
152 addr = (GRi ? greg[GRi] : 0) + (GRj ? greg[GRj] : 0);
153 }
154
155 if (addr != ear0) {
156 kdebug("MISALIGN: Calculated addr (%08lx) does not match EAR0 (%08lx)\n",
157 addr, ear0);
158 return -EFAULT;
159 }
160
161 /* check the address is okay */
162 if (user_mode(__frame) && ___range_ok(ear0, 8) < 0)
163 return -EFAULT;
164
165 /* perform the memory op */
166 if (op & _MA_STORE) {
167 /* perform a store */
168 x._32[0] = 0;
169 if (GRk != 0) {
170 if (op & _MA_HALF) {
171 x._16 = greg[GRk];
172 }
173 else {
174 x._32[0] = greg[GRk];
175 }
176 }
177 if (op & _MA_DWORD)
178 x._32[1] = greg[GRk + 1];
179
180 kdebug("MISALIGN: Store GR%d { %08x:%08x } -> %08lx (%dB)\n",
181 GRk, x._32[1], x._32[0], addr, op & _MA_SZ_MASK);
182
183 if (__memcpy_user((void *) addr, &x, op & _MA_SZ_MASK) != 0)
184 return -EFAULT;
185 }
186 else {
187 /* perform a load */
188 if (__memcpy_user(&x, (void *) addr, op & _MA_SZ_MASK) != 0)
189 return -EFAULT;
190
191 if (op & _MA_HALF) {
192 if (op & _MA_SIGNED)
193 asm ("slli %0,#16,%0 ! srai %0,#16,%0"
194 : "=r"(x._32[0]) : "0"(x._16));
195 else
196 asm ("sethi #0,%0"
197 : "=r"(x._32[0]) : "0"(x._16));
198 }
199
200 kdebug("MISALIGN: Load %08lx (%dB) -> GR%d, { %08x:%08x }\n",
201 addr, op & _MA_SZ_MASK, GRk, x._32[1], x._32[0]);
202
203 if (GRk != 0)
204 greg[GRk] = x._32[0];
205 if (op & _MA_DWORD)
206 greg[GRk + 1] = x._32[1];
207 }
208
209 /* update the base pointer if required */
210 if (op & _MA_UPDATE)
211 greg[GRi] = addr;
212
213 /* well... we've done that insn */
214 __frame->pc = __frame->pc + 4;
215
216 return 0;
217} /* end handle_misalignment() */
diff --git a/arch/h8300/kernel/asm-offsets.c b/arch/h8300/kernel/asm-offsets.c
index fc30b4fd0914..2042552e0871 100644
--- a/arch/h8300/kernel/asm-offsets.c
+++ b/arch/h8300/kernel/asm-offsets.c
@@ -13,15 +13,11 @@
13#include <linux/kernel_stat.h> 13#include <linux/kernel_stat.h>
14#include <linux/ptrace.h> 14#include <linux/ptrace.h>
15#include <linux/hardirq.h> 15#include <linux/hardirq.h>
16#include <linux/kbuild.h>
16#include <asm/bootinfo.h> 17#include <asm/bootinfo.h>
17#include <asm/irq.h> 18#include <asm/irq.h>
18#include <asm/ptrace.h> 19#include <asm/ptrace.h>
19 20
20#define DEFINE(sym, val) \
21 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
22
23#define BLANK() asm volatile("\n->" : : )
24
25int main(void) 21int main(void)
26{ 22{
27 /* offsets into the task struct */ 23 /* offsets into the task struct */
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 3aa6c821449a..0df5f6f75edf 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -19,6 +19,7 @@ config IA64
19 select HAVE_OPROFILE 19 select HAVE_OPROFILE
20 select HAVE_KPROBES 20 select HAVE_KPROBES
21 select HAVE_KRETPROBES 21 select HAVE_KRETPROBES
22 select HAVE_DMA_ATTRS
22 select HAVE_KVM 23 select HAVE_KVM
23 default y 24 default y
24 help 25 help
@@ -47,6 +48,9 @@ config MMU
47config SWIOTLB 48config SWIOTLB
48 bool 49 bool
49 50
51config IOMMU_HELPER
52 bool
53
50config GENERIC_LOCKBREAK 54config GENERIC_LOCKBREAK
51 bool 55 bool
52 default y 56 default y
@@ -615,7 +619,7 @@ config IRQ_PER_CPU
615 default y 619 default y
616 620
617config IOMMU_HELPER 621config IOMMU_HELPER
618 def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC) 622 def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
619 623
620source "arch/ia64/hp/sim/Kconfig" 624source "arch/ia64/hp/sim/Kconfig"
621 625
diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c
index 8f6bcfe1dada..1c44ec2a1d58 100644
--- a/arch/ia64/hp/common/hwsw_iommu.c
+++ b/arch/ia64/hp/common/hwsw_iommu.c
@@ -20,10 +20,10 @@
20extern int swiotlb_late_init_with_default_size (size_t size); 20extern int swiotlb_late_init_with_default_size (size_t size);
21extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; 21extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent;
22extern ia64_mv_dma_free_coherent swiotlb_free_coherent; 22extern ia64_mv_dma_free_coherent swiotlb_free_coherent;
23extern ia64_mv_dma_map_single swiotlb_map_single; 23extern ia64_mv_dma_map_single_attrs swiotlb_map_single_attrs;
24extern ia64_mv_dma_unmap_single swiotlb_unmap_single; 24extern ia64_mv_dma_unmap_single_attrs swiotlb_unmap_single_attrs;
25extern ia64_mv_dma_map_sg swiotlb_map_sg; 25extern ia64_mv_dma_map_sg_attrs swiotlb_map_sg_attrs;
26extern ia64_mv_dma_unmap_sg swiotlb_unmap_sg; 26extern ia64_mv_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs;
27extern ia64_mv_dma_supported swiotlb_dma_supported; 27extern ia64_mv_dma_supported swiotlb_dma_supported;
28extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error; 28extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error;
29 29
@@ -31,19 +31,19 @@ extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error;
31 31
32extern ia64_mv_dma_alloc_coherent sba_alloc_coherent; 32extern ia64_mv_dma_alloc_coherent sba_alloc_coherent;
33extern ia64_mv_dma_free_coherent sba_free_coherent; 33extern ia64_mv_dma_free_coherent sba_free_coherent;
34extern ia64_mv_dma_map_single sba_map_single; 34extern ia64_mv_dma_map_single_attrs sba_map_single_attrs;
35extern ia64_mv_dma_unmap_single sba_unmap_single; 35extern ia64_mv_dma_unmap_single_attrs sba_unmap_single_attrs;
36extern ia64_mv_dma_map_sg sba_map_sg; 36extern ia64_mv_dma_map_sg_attrs sba_map_sg_attrs;
37extern ia64_mv_dma_unmap_sg sba_unmap_sg; 37extern ia64_mv_dma_unmap_sg_attrs sba_unmap_sg_attrs;
38extern ia64_mv_dma_supported sba_dma_supported; 38extern ia64_mv_dma_supported sba_dma_supported;
39extern ia64_mv_dma_mapping_error sba_dma_mapping_error; 39extern ia64_mv_dma_mapping_error sba_dma_mapping_error;
40 40
41#define hwiommu_alloc_coherent sba_alloc_coherent 41#define hwiommu_alloc_coherent sba_alloc_coherent
42#define hwiommu_free_coherent sba_free_coherent 42#define hwiommu_free_coherent sba_free_coherent
43#define hwiommu_map_single sba_map_single 43#define hwiommu_map_single_attrs sba_map_single_attrs
44#define hwiommu_unmap_single sba_unmap_single 44#define hwiommu_unmap_single_attrs sba_unmap_single_attrs
45#define hwiommu_map_sg sba_map_sg 45#define hwiommu_map_sg_attrs sba_map_sg_attrs
46#define hwiommu_unmap_sg sba_unmap_sg 46#define hwiommu_unmap_sg_attrs sba_unmap_sg_attrs
47#define hwiommu_dma_supported sba_dma_supported 47#define hwiommu_dma_supported sba_dma_supported
48#define hwiommu_dma_mapping_error sba_dma_mapping_error 48#define hwiommu_dma_mapping_error sba_dma_mapping_error
49#define hwiommu_sync_single_for_cpu machvec_dma_sync_single 49#define hwiommu_sync_single_for_cpu machvec_dma_sync_single
@@ -98,41 +98,48 @@ hwsw_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma
98} 98}
99 99
100dma_addr_t 100dma_addr_t
101hwsw_map_single (struct device *dev, void *addr, size_t size, int dir) 101hwsw_map_single_attrs(struct device *dev, void *addr, size_t size, int dir,
102 struct dma_attrs *attrs)
102{ 103{
103 if (use_swiotlb(dev)) 104 if (use_swiotlb(dev))
104 return swiotlb_map_single(dev, addr, size, dir); 105 return swiotlb_map_single_attrs(dev, addr, size, dir, attrs);
105 else 106 else
106 return hwiommu_map_single(dev, addr, size, dir); 107 return hwiommu_map_single_attrs(dev, addr, size, dir, attrs);
107} 108}
109EXPORT_SYMBOL(hwsw_map_single_attrs);
108 110
109void 111void
110hwsw_unmap_single (struct device *dev, dma_addr_t iova, size_t size, int dir) 112hwsw_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
113 int dir, struct dma_attrs *attrs)
111{ 114{
112 if (use_swiotlb(dev)) 115 if (use_swiotlb(dev))
113 return swiotlb_unmap_single(dev, iova, size, dir); 116 return swiotlb_unmap_single_attrs(dev, iova, size, dir, attrs);
114 else 117 else
115 return hwiommu_unmap_single(dev, iova, size, dir); 118 return hwiommu_unmap_single_attrs(dev, iova, size, dir, attrs);
116} 119}
117 120EXPORT_SYMBOL(hwsw_unmap_single_attrs);
118 121
119int 122int
120hwsw_map_sg (struct device *dev, struct scatterlist *sglist, int nents, int dir) 123hwsw_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
124 int dir, struct dma_attrs *attrs)
121{ 125{
122 if (use_swiotlb(dev)) 126 if (use_swiotlb(dev))
123 return swiotlb_map_sg(dev, sglist, nents, dir); 127 return swiotlb_map_sg_attrs(dev, sglist, nents, dir, attrs);
124 else 128 else
125 return hwiommu_map_sg(dev, sglist, nents, dir); 129 return hwiommu_map_sg_attrs(dev, sglist, nents, dir, attrs);
126} 130}
131EXPORT_SYMBOL(hwsw_map_sg_attrs);
127 132
128void 133void
129hwsw_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, int dir) 134hwsw_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
135 int dir, struct dma_attrs *attrs)
130{ 136{
131 if (use_swiotlb(dev)) 137 if (use_swiotlb(dev))
132 return swiotlb_unmap_sg(dev, sglist, nents, dir); 138 return swiotlb_unmap_sg_attrs(dev, sglist, nents, dir, attrs);
133 else 139 else
134 return hwiommu_unmap_sg(dev, sglist, nents, dir); 140 return hwiommu_unmap_sg_attrs(dev, sglist, nents, dir, attrs);
135} 141}
142EXPORT_SYMBOL(hwsw_unmap_sg_attrs);
136 143
137void 144void
138hwsw_sync_single_for_cpu (struct device *dev, dma_addr_t addr, size_t size, int dir) 145hwsw_sync_single_for_cpu (struct device *dev, dma_addr_t addr, size_t size, int dir)
@@ -185,10 +192,6 @@ hwsw_dma_mapping_error (dma_addr_t dma_addr)
185} 192}
186 193
187EXPORT_SYMBOL(hwsw_dma_mapping_error); 194EXPORT_SYMBOL(hwsw_dma_mapping_error);
188EXPORT_SYMBOL(hwsw_map_single);
189EXPORT_SYMBOL(hwsw_unmap_single);
190EXPORT_SYMBOL(hwsw_map_sg);
191EXPORT_SYMBOL(hwsw_unmap_sg);
192EXPORT_SYMBOL(hwsw_dma_supported); 195EXPORT_SYMBOL(hwsw_dma_supported);
193EXPORT_SYMBOL(hwsw_alloc_coherent); 196EXPORT_SYMBOL(hwsw_alloc_coherent);
194EXPORT_SYMBOL(hwsw_free_coherent); 197EXPORT_SYMBOL(hwsw_free_coherent);
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 9409de5c9441..34421aed1e2a 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -899,16 +899,18 @@ sba_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
899} 899}
900 900
901/** 901/**
902 * sba_map_single - map one buffer and return IOVA for DMA 902 * sba_map_single_attrs - map one buffer and return IOVA for DMA
903 * @dev: instance of PCI owned by the driver that's asking. 903 * @dev: instance of PCI owned by the driver that's asking.
904 * @addr: driver buffer to map. 904 * @addr: driver buffer to map.
905 * @size: number of bytes to map in driver buffer. 905 * @size: number of bytes to map in driver buffer.
906 * @dir: R/W or both. 906 * @dir: R/W or both.
907 * @attrs: optional dma attributes
907 * 908 *
908 * See Documentation/DMA-mapping.txt 909 * See Documentation/DMA-mapping.txt
909 */ 910 */
910dma_addr_t 911dma_addr_t
911sba_map_single(struct device *dev, void *addr, size_t size, int dir) 912sba_map_single_attrs(struct device *dev, void *addr, size_t size, int dir,
913 struct dma_attrs *attrs)
912{ 914{
913 struct ioc *ioc; 915 struct ioc *ioc;
914 dma_addr_t iovp; 916 dma_addr_t iovp;
@@ -932,7 +934,8 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir)
932 ** Device is bit capable of DMA'ing to the buffer... 934 ** Device is bit capable of DMA'ing to the buffer...
933 ** just return the PCI address of ptr 935 ** just return the PCI address of ptr
934 */ 936 */
935 DBG_BYPASS("sba_map_single() bypass mask/addr: 0x%lx/0x%lx\n", 937 DBG_BYPASS("sba_map_single_attrs() bypass mask/addr: "
938 "0x%lx/0x%lx\n",
936 to_pci_dev(dev)->dma_mask, pci_addr); 939 to_pci_dev(dev)->dma_mask, pci_addr);
937 return pci_addr; 940 return pci_addr;
938 } 941 }
@@ -953,7 +956,7 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir)
953 956
954#ifdef ASSERT_PDIR_SANITY 957#ifdef ASSERT_PDIR_SANITY
955 spin_lock_irqsave(&ioc->res_lock, flags); 958 spin_lock_irqsave(&ioc->res_lock, flags);
956 if (sba_check_pdir(ioc,"Check before sba_map_single()")) 959 if (sba_check_pdir(ioc,"Check before sba_map_single_attrs()"))
957 panic("Sanity check failed"); 960 panic("Sanity check failed");
958 spin_unlock_irqrestore(&ioc->res_lock, flags); 961 spin_unlock_irqrestore(&ioc->res_lock, flags);
959#endif 962#endif
@@ -982,11 +985,12 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir)
982 /* form complete address */ 985 /* form complete address */
983#ifdef ASSERT_PDIR_SANITY 986#ifdef ASSERT_PDIR_SANITY
984 spin_lock_irqsave(&ioc->res_lock, flags); 987 spin_lock_irqsave(&ioc->res_lock, flags);
985 sba_check_pdir(ioc,"Check after sba_map_single()"); 988 sba_check_pdir(ioc,"Check after sba_map_single_attrs()");
986 spin_unlock_irqrestore(&ioc->res_lock, flags); 989 spin_unlock_irqrestore(&ioc->res_lock, flags);
987#endif 990#endif
988 return SBA_IOVA(ioc, iovp, offset); 991 return SBA_IOVA(ioc, iovp, offset);
989} 992}
993EXPORT_SYMBOL(sba_map_single_attrs);
990 994
991#ifdef ENABLE_MARK_CLEAN 995#ifdef ENABLE_MARK_CLEAN
992static SBA_INLINE void 996static SBA_INLINE void
@@ -1013,15 +1017,17 @@ sba_mark_clean(struct ioc *ioc, dma_addr_t iova, size_t size)
1013#endif 1017#endif
1014 1018
1015/** 1019/**
1016 * sba_unmap_single - unmap one IOVA and free resources 1020 * sba_unmap_single_attrs - unmap one IOVA and free resources
1017 * @dev: instance of PCI owned by the driver that's asking. 1021 * @dev: instance of PCI owned by the driver that's asking.
1018 * @iova: IOVA of driver buffer previously mapped. 1022 * @iova: IOVA of driver buffer previously mapped.
1019 * @size: number of bytes mapped in driver buffer. 1023 * @size: number of bytes mapped in driver buffer.
1020 * @dir: R/W or both. 1024 * @dir: R/W or both.
1025 * @attrs: optional dma attributes
1021 * 1026 *
1022 * See Documentation/DMA-mapping.txt 1027 * See Documentation/DMA-mapping.txt
1023 */ 1028 */
1024void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir) 1029void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
1030 int dir, struct dma_attrs *attrs)
1025{ 1031{
1026 struct ioc *ioc; 1032 struct ioc *ioc;
1027#if DELAYED_RESOURCE_CNT > 0 1033#if DELAYED_RESOURCE_CNT > 0
@@ -1038,7 +1044,8 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir)
1038 /* 1044 /*
1039 ** Address does not fall w/in IOVA, must be bypassing 1045 ** Address does not fall w/in IOVA, must be bypassing
1040 */ 1046 */
1041 DBG_BYPASS("sba_unmap_single() bypass addr: 0x%lx\n", iova); 1047 DBG_BYPASS("sba_unmap_single_atttrs() bypass addr: 0x%lx\n",
1048 iova);
1042 1049
1043#ifdef ENABLE_MARK_CLEAN 1050#ifdef ENABLE_MARK_CLEAN
1044 if (dir == DMA_FROM_DEVICE) { 1051 if (dir == DMA_FROM_DEVICE) {
@@ -1087,7 +1094,7 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir)
1087 spin_unlock_irqrestore(&ioc->res_lock, flags); 1094 spin_unlock_irqrestore(&ioc->res_lock, flags);
1088#endif /* DELAYED_RESOURCE_CNT == 0 */ 1095#endif /* DELAYED_RESOURCE_CNT == 0 */
1089} 1096}
1090 1097EXPORT_SYMBOL(sba_unmap_single_attrs);
1091 1098
1092/** 1099/**
1093 * sba_alloc_coherent - allocate/map shared mem for DMA 1100 * sba_alloc_coherent - allocate/map shared mem for DMA
@@ -1144,7 +1151,8 @@ sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp
1144 * If device can't bypass or bypass is disabled, pass the 32bit fake 1151 * If device can't bypass or bypass is disabled, pass the 32bit fake
1145 * device to map single to get an iova mapping. 1152 * device to map single to get an iova mapping.
1146 */ 1153 */
1147 *dma_handle = sba_map_single(&ioc->sac_only_dev->dev, addr, size, 0); 1154 *dma_handle = sba_map_single_attrs(&ioc->sac_only_dev->dev, addr,
1155 size, 0, NULL);
1148 1156
1149 return addr; 1157 return addr;
1150} 1158}
@@ -1161,7 +1169,7 @@ sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp
1161 */ 1169 */
1162void sba_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) 1170void sba_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
1163{ 1171{
1164 sba_unmap_single(dev, dma_handle, size, 0); 1172 sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL);
1165 free_pages((unsigned long) vaddr, get_order(size)); 1173 free_pages((unsigned long) vaddr, get_order(size));
1166} 1174}
1167 1175
@@ -1410,10 +1418,12 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev,
1410 * @sglist: array of buffer/length pairs 1418 * @sglist: array of buffer/length pairs
1411 * @nents: number of entries in list 1419 * @nents: number of entries in list
1412 * @dir: R/W or both. 1420 * @dir: R/W or both.
1421 * @attrs: optional dma attributes
1413 * 1422 *
1414 * See Documentation/DMA-mapping.txt 1423 * See Documentation/DMA-mapping.txt
1415 */ 1424 */
1416int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int dir) 1425int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
1426 int dir, struct dma_attrs *attrs)
1417{ 1427{
1418 struct ioc *ioc; 1428 struct ioc *ioc;
1419 int coalesced, filled = 0; 1429 int coalesced, filled = 0;
@@ -1441,16 +1451,16 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
1441 /* Fast path single entry scatterlists. */ 1451 /* Fast path single entry scatterlists. */
1442 if (nents == 1) { 1452 if (nents == 1) {
1443 sglist->dma_length = sglist->length; 1453 sglist->dma_length = sglist->length;
1444 sglist->dma_address = sba_map_single(dev, sba_sg_address(sglist), sglist->length, dir); 1454 sglist->dma_address = sba_map_single_attrs(dev, sba_sg_address(sglist), sglist->length, dir, attrs);
1445 return 1; 1455 return 1;
1446 } 1456 }
1447 1457
1448#ifdef ASSERT_PDIR_SANITY 1458#ifdef ASSERT_PDIR_SANITY
1449 spin_lock_irqsave(&ioc->res_lock, flags); 1459 spin_lock_irqsave(&ioc->res_lock, flags);
1450 if (sba_check_pdir(ioc,"Check before sba_map_sg()")) 1460 if (sba_check_pdir(ioc,"Check before sba_map_sg_attrs()"))
1451 { 1461 {
1452 sba_dump_sg(ioc, sglist, nents); 1462 sba_dump_sg(ioc, sglist, nents);
1453 panic("Check before sba_map_sg()"); 1463 panic("Check before sba_map_sg_attrs()");
1454 } 1464 }
1455 spin_unlock_irqrestore(&ioc->res_lock, flags); 1465 spin_unlock_irqrestore(&ioc->res_lock, flags);
1456#endif 1466#endif
@@ -1479,10 +1489,10 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
1479 1489
1480#ifdef ASSERT_PDIR_SANITY 1490#ifdef ASSERT_PDIR_SANITY
1481 spin_lock_irqsave(&ioc->res_lock, flags); 1491 spin_lock_irqsave(&ioc->res_lock, flags);
1482 if (sba_check_pdir(ioc,"Check after sba_map_sg()")) 1492 if (sba_check_pdir(ioc,"Check after sba_map_sg_attrs()"))
1483 { 1493 {
1484 sba_dump_sg(ioc, sglist, nents); 1494 sba_dump_sg(ioc, sglist, nents);
1485 panic("Check after sba_map_sg()\n"); 1495 panic("Check after sba_map_sg_attrs()\n");
1486 } 1496 }
1487 spin_unlock_irqrestore(&ioc->res_lock, flags); 1497 spin_unlock_irqrestore(&ioc->res_lock, flags);
1488#endif 1498#endif
@@ -1492,18 +1502,20 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
1492 1502
1493 return filled; 1503 return filled;
1494} 1504}
1495 1505EXPORT_SYMBOL(sba_map_sg_attrs);
1496 1506
1497/** 1507/**
1498 * sba_unmap_sg - unmap Scatter/Gather list 1508 * sba_unmap_sg_attrs - unmap Scatter/Gather list
1499 * @dev: instance of PCI owned by the driver that's asking. 1509 * @dev: instance of PCI owned by the driver that's asking.
1500 * @sglist: array of buffer/length pairs 1510 * @sglist: array of buffer/length pairs
1501 * @nents: number of entries in list 1511 * @nents: number of entries in list
1502 * @dir: R/W or both. 1512 * @dir: R/W or both.
1513 * @attrs: optional dma attributes
1503 * 1514 *
1504 * See Documentation/DMA-mapping.txt 1515 * See Documentation/DMA-mapping.txt
1505 */ 1516 */
1506void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, int dir) 1517void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
1518 int nents, int dir, struct dma_attrs *attrs)
1507{ 1519{
1508#ifdef ASSERT_PDIR_SANITY 1520#ifdef ASSERT_PDIR_SANITY
1509 struct ioc *ioc; 1521 struct ioc *ioc;
@@ -1518,13 +1530,14 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
1518 ASSERT(ioc); 1530 ASSERT(ioc);
1519 1531
1520 spin_lock_irqsave(&ioc->res_lock, flags); 1532 spin_lock_irqsave(&ioc->res_lock, flags);
1521 sba_check_pdir(ioc,"Check before sba_unmap_sg()"); 1533 sba_check_pdir(ioc,"Check before sba_unmap_sg_attrs()");
1522 spin_unlock_irqrestore(&ioc->res_lock, flags); 1534 spin_unlock_irqrestore(&ioc->res_lock, flags);
1523#endif 1535#endif
1524 1536
1525 while (nents && sglist->dma_length) { 1537 while (nents && sglist->dma_length) {
1526 1538
1527 sba_unmap_single(dev, sglist->dma_address, sglist->dma_length, dir); 1539 sba_unmap_single_attrs(dev, sglist->dma_address,
1540 sglist->dma_length, dir, attrs);
1528 sglist = sg_next(sglist); 1541 sglist = sg_next(sglist);
1529 nents--; 1542 nents--;
1530 } 1543 }
@@ -1533,11 +1546,12 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
1533 1546
1534#ifdef ASSERT_PDIR_SANITY 1547#ifdef ASSERT_PDIR_SANITY
1535 spin_lock_irqsave(&ioc->res_lock, flags); 1548 spin_lock_irqsave(&ioc->res_lock, flags);
1536 sba_check_pdir(ioc,"Check after sba_unmap_sg()"); 1549 sba_check_pdir(ioc,"Check after sba_unmap_sg_attrs()");
1537 spin_unlock_irqrestore(&ioc->res_lock, flags); 1550 spin_unlock_irqrestore(&ioc->res_lock, flags);
1538#endif 1551#endif
1539 1552
1540} 1553}
1554EXPORT_SYMBOL(sba_unmap_sg_attrs);
1541 1555
1542/************************************************************** 1556/**************************************************************
1543* 1557*
@@ -1918,15 +1932,13 @@ static const struct file_operations ioc_fops = {
1918static void __init 1932static void __init
1919ioc_proc_init(void) 1933ioc_proc_init(void)
1920{ 1934{
1921 struct proc_dir_entry *dir, *entry; 1935 struct proc_dir_entry *dir;
1922 1936
1923 dir = proc_mkdir("bus/mckinley", NULL); 1937 dir = proc_mkdir("bus/mckinley", NULL);
1924 if (!dir) 1938 if (!dir)
1925 return; 1939 return;
1926 1940
1927 entry = create_proc_entry(ioc_list->name, 0, dir); 1941 proc_create(ioc_list->name, 0, dir, &ioc_fops);
1928 if (entry)
1929 entry->proc_fops = &ioc_fops;
1930} 1942}
1931#endif 1943#endif
1932 1944
@@ -2166,10 +2178,6 @@ sba_page_override(char *str)
2166__setup("sbapagesize=",sba_page_override); 2178__setup("sbapagesize=",sba_page_override);
2167 2179
2168EXPORT_SYMBOL(sba_dma_mapping_error); 2180EXPORT_SYMBOL(sba_dma_mapping_error);
2169EXPORT_SYMBOL(sba_map_single);
2170EXPORT_SYMBOL(sba_unmap_single);
2171EXPORT_SYMBOL(sba_map_sg);
2172EXPORT_SYMBOL(sba_unmap_sg);
2173EXPORT_SYMBOL(sba_dma_supported); 2181EXPORT_SYMBOL(sba_dma_supported);
2174EXPORT_SYMBOL(sba_alloc_coherent); 2182EXPORT_SYMBOL(sba_alloc_coherent);
2175EXPORT_SYMBOL(sba_free_coherent); 2183EXPORT_SYMBOL(sba_free_coherent);
diff --git a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c
index 230a6f92367f..c64a55af9b95 100644
--- a/arch/ia64/kernel/asm-offsets.c
+++ b/arch/ia64/kernel/asm-offsets.c
@@ -9,7 +9,7 @@
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/pid.h> 10#include <linux/pid.h>
11#include <linux/clocksource.h> 11#include <linux/clocksource.h>
12 12#include <linux/kbuild.h>
13#include <asm-ia64/processor.h> 13#include <asm-ia64/processor.h>
14#include <asm-ia64/ptrace.h> 14#include <asm-ia64/ptrace.h>
15#include <asm-ia64/siginfo.h> 15#include <asm-ia64/siginfo.h>
@@ -19,11 +19,6 @@
19#include "../kernel/sigframe.h" 19#include "../kernel/sigframe.h"
20#include "../kernel/fsyscall_gtod_data.h" 20#include "../kernel/fsyscall_gtod_data.h"
21 21
22#define DEFINE(sym, val) \
23 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
24
25#define BLANK() asm volatile("\n->" : : )
26
27void foo(void) 22void foo(void)
28{ 23{
29 DEFINE(IA64_TASK_SIZE, sizeof (struct task_struct)); 24 DEFINE(IA64_TASK_SIZE, sizeof (struct task_struct));
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index c8e403752a0c..7fbb51e10bbe 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -6695,16 +6695,12 @@ pfm_init(void)
6695 /* 6695 /*
6696 * create /proc/perfmon (mostly for debugging purposes) 6696 * create /proc/perfmon (mostly for debugging purposes)
6697 */ 6697 */
6698 perfmon_dir = create_proc_entry("perfmon", S_IRUGO, NULL); 6698 perfmon_dir = proc_create("perfmon", S_IRUGO, NULL, &pfm_proc_fops);
6699 if (perfmon_dir == NULL) { 6699 if (perfmon_dir == NULL) {
6700 printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n"); 6700 printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n");
6701 pmu_conf = NULL; 6701 pmu_conf = NULL;
6702 return -1; 6702 return -1;
6703 } 6703 }
6704 /*
6705 * install customized file operations for /proc/perfmon entry
6706 */
6707 perfmon_dir->proc_fops = &pfm_proc_fops;
6708 6704
6709 /* 6705 /*
6710 * create /proc/sys/kernel/perfmon (for debugging purposes) 6706 * create /proc/sys/kernel/perfmon (for debugging purposes)
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index b11bb50a197a..ecb9eb78d687 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -648,18 +648,16 @@ salinfo_init(void)
648 if (!dir) 648 if (!dir)
649 continue; 649 continue;
650 650
651 entry = create_proc_entry("event", S_IRUSR, dir); 651 entry = proc_create_data("event", S_IRUSR, dir,
652 &salinfo_event_fops, data);
652 if (!entry) 653 if (!entry)
653 continue; 654 continue;
654 entry->data = data;
655 entry->proc_fops = &salinfo_event_fops;
656 *sdir++ = entry; 655 *sdir++ = entry;
657 656
658 entry = create_proc_entry("data", S_IRUSR | S_IWUSR, dir); 657 entry = proc_create_data("data", S_IRUSR | S_IWUSR, dir,
658 &salinfo_data_fops, data);
659 if (!entry) 659 if (!entry)
660 continue; 660 continue;
661 entry->data = data;
662 entry->proc_fops = &salinfo_data_fops;
663 *sdir++ = entry; 661 *sdir++ = entry;
664 662
665 /* we missed any events before now */ 663 /* we missed any events before now */
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index dfc6bf1c7b41..49d3120415eb 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -550,11 +550,12 @@ static int __init sn2_ptc_init(void)
550 if (!ia64_platform_is("sn2")) 550 if (!ia64_platform_is("sn2"))
551 return 0; 551 return 0;
552 552
553 if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { 553 proc_sn2_ptc = proc_create(PTC_BASENAME, 0444,
554 NULL, &proc_sn2_ptc_operations);
555 if (!&proc_sn2_ptc_operations) {
554 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); 556 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
555 return -EINVAL; 557 return -EINVAL;
556 } 558 }
557 proc_sn2_ptc->proc_fops = &proc_sn2_ptc_operations;
558 spin_lock_init(&sn2_global_ptc_lock); 559 spin_lock_init(&sn2_global_ptc_lock);
559 return 0; 560 return 0;
560} 561}
diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
index 62b3e9a496ac..2526e5c783a4 100644
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
@@ -139,30 +139,21 @@ static const struct file_operations proc_sn_topo_fops = {
139void register_sn_procfs(void) 139void register_sn_procfs(void)
140{ 140{
141 static struct proc_dir_entry *sgi_proc_dir = NULL; 141 static struct proc_dir_entry *sgi_proc_dir = NULL;
142 struct proc_dir_entry *pde;
143 142
144 BUG_ON(sgi_proc_dir != NULL); 143 BUG_ON(sgi_proc_dir != NULL);
145 if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL))) 144 if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL)))
146 return; 145 return;
147 146
148 pde = create_proc_entry("partition_id", 0444, sgi_proc_dir); 147 proc_create("partition_id", 0444, sgi_proc_dir,
149 if (pde) 148 &proc_partition_id_fops);
150 pde->proc_fops = &proc_partition_id_fops; 149 proc_create("system_serial_number", 0444, sgi_proc_dir,
151 pde = create_proc_entry("system_serial_number", 0444, sgi_proc_dir); 150 &proc_system_sn_fops);
152 if (pde) 151 proc_create("licenseID", 0444, sgi_proc_dir, &proc_license_id_fops);
153 pde->proc_fops = &proc_system_sn_fops; 152 proc_create("sn_force_interrupt", 0644, sgi_proc_dir,
154 pde = create_proc_entry("licenseID", 0444, sgi_proc_dir); 153 &proc_sn_force_intr_fops);
155 if (pde) 154 proc_create("coherence_id", 0444, sgi_proc_dir,
156 pde->proc_fops = &proc_license_id_fops; 155 &proc_coherence_id_fops);
157 pde = create_proc_entry("sn_force_interrupt", 0644, sgi_proc_dir); 156 proc_create("sn_topology", 0444, sgi_proc_dir, &proc_sn_topo_fops);
158 if (pde)
159 pde->proc_fops = &proc_sn_force_intr_fops;
160 pde = create_proc_entry("coherence_id", 0444, sgi_proc_dir);
161 if (pde)
162 pde->proc_fops = &proc_coherence_id_fops;
163 pde = create_proc_entry("sn_topology", 0444, sgi_proc_dir);
164 if (pde)
165 pde->proc_fops = &proc_sn_topo_fops;
166} 157}
167 158
168#endif /* CONFIG_PROC_FS */ 159#endif /* CONFIG_PROC_FS */
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 18b94b792d54..52175af299a0 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/dma-attrs.h>
13#include <asm/dma.h> 14#include <asm/dma.h>
14#include <asm/sn/intr.h> 15#include <asm/sn/intr.h>
15#include <asm/sn/pcibus_provider_defs.h> 16#include <asm/sn/pcibus_provider_defs.h>
@@ -149,11 +150,12 @@ void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
149EXPORT_SYMBOL(sn_dma_free_coherent); 150EXPORT_SYMBOL(sn_dma_free_coherent);
150 151
151/** 152/**
152 * sn_dma_map_single - map a single page for DMA 153 * sn_dma_map_single_attrs - map a single page for DMA
153 * @dev: device to map for 154 * @dev: device to map for
154 * @cpu_addr: kernel virtual address of the region to map 155 * @cpu_addr: kernel virtual address of the region to map
155 * @size: size of the region 156 * @size: size of the region
156 * @direction: DMA direction 157 * @direction: DMA direction
158 * @attrs: optional dma attributes
157 * 159 *
158 * Map the region pointed to by @cpu_addr for DMA and return the 160 * Map the region pointed to by @cpu_addr for DMA and return the
159 * DMA address. 161 * DMA address.
@@ -163,42 +165,59 @@ EXPORT_SYMBOL(sn_dma_free_coherent);
163 * no way of saving the dmamap handle from the alloc to later free 165 * no way of saving the dmamap handle from the alloc to later free
164 * (which is pretty much unacceptable). 166 * (which is pretty much unacceptable).
165 * 167 *
168 * mappings with the DMA_ATTR_WRITE_BARRIER get mapped with
169 * dma_map_consistent() so that writes force a flush of pending DMA.
170 * (See "SGI Altix Architecture Considerations for Linux Device Drivers",
171 * Document Number: 007-4763-001)
172 *
166 * TODO: simplify our interface; 173 * TODO: simplify our interface;
167 * figure out how to save dmamap handle so can use two step. 174 * figure out how to save dmamap handle so can use two step.
168 */ 175 */
169dma_addr_t sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, 176dma_addr_t sn_dma_map_single_attrs(struct device *dev, void *cpu_addr,
170 int direction) 177 size_t size, int direction,
178 struct dma_attrs *attrs)
171{ 179{
172 dma_addr_t dma_addr; 180 dma_addr_t dma_addr;
173 unsigned long phys_addr; 181 unsigned long phys_addr;
174 struct pci_dev *pdev = to_pci_dev(dev); 182 struct pci_dev *pdev = to_pci_dev(dev);
175 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 183 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
184 int dmabarr;
185
186 dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);
176 187
177 BUG_ON(dev->bus != &pci_bus_type); 188 BUG_ON(dev->bus != &pci_bus_type);
178 189
179 phys_addr = __pa(cpu_addr); 190 phys_addr = __pa(cpu_addr);
180 dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); 191 if (dmabarr)
192 dma_addr = provider->dma_map_consistent(pdev, phys_addr,
193 size, SN_DMA_ADDR_PHYS);
194 else
195 dma_addr = provider->dma_map(pdev, phys_addr, size,
196 SN_DMA_ADDR_PHYS);
197
181 if (!dma_addr) { 198 if (!dma_addr) {
182 printk(KERN_ERR "%s: out of ATEs\n", __func__); 199 printk(KERN_ERR "%s: out of ATEs\n", __func__);
183 return 0; 200 return 0;
184 } 201 }
185 return dma_addr; 202 return dma_addr;
186} 203}
187EXPORT_SYMBOL(sn_dma_map_single); 204EXPORT_SYMBOL(sn_dma_map_single_attrs);
188 205
189/** 206/**
190 * sn_dma_unmap_single - unamp a DMA mapped page 207 * sn_dma_unmap_single_attrs - unamp a DMA mapped page
191 * @dev: device to sync 208 * @dev: device to sync
192 * @dma_addr: DMA address to sync 209 * @dma_addr: DMA address to sync
193 * @size: size of region 210 * @size: size of region
194 * @direction: DMA direction 211 * @direction: DMA direction
212 * @attrs: optional dma attributes
195 * 213 *
196 * This routine is supposed to sync the DMA region specified 214 * This routine is supposed to sync the DMA region specified
197 * by @dma_handle into the coherence domain. On SN, we're always cache 215 * by @dma_handle into the coherence domain. On SN, we're always cache
198 * coherent, so we just need to free any ATEs associated with this mapping. 216 * coherent, so we just need to free any ATEs associated with this mapping.
199 */ 217 */
200void sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 218void sn_dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr,
201 int direction) 219 size_t size, int direction,
220 struct dma_attrs *attrs)
202{ 221{
203 struct pci_dev *pdev = to_pci_dev(dev); 222 struct pci_dev *pdev = to_pci_dev(dev);
204 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 223 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
@@ -207,19 +226,21 @@ void sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
207 226
208 provider->dma_unmap(pdev, dma_addr, direction); 227 provider->dma_unmap(pdev, dma_addr, direction);
209} 228}
210EXPORT_SYMBOL(sn_dma_unmap_single); 229EXPORT_SYMBOL(sn_dma_unmap_single_attrs);
211 230
212/** 231/**
213 * sn_dma_unmap_sg - unmap a DMA scatterlist 232 * sn_dma_unmap_sg_attrs - unmap a DMA scatterlist
214 * @dev: device to unmap 233 * @dev: device to unmap
215 * @sg: scatterlist to unmap 234 * @sg: scatterlist to unmap
216 * @nhwentries: number of scatterlist entries 235 * @nhwentries: number of scatterlist entries
217 * @direction: DMA direction 236 * @direction: DMA direction
237 * @attrs: optional dma attributes
218 * 238 *
219 * Unmap a set of streaming mode DMA translations. 239 * Unmap a set of streaming mode DMA translations.
220 */ 240 */
221void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sgl, 241void sn_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl,
222 int nhwentries, int direction) 242 int nhwentries, int direction,
243 struct dma_attrs *attrs)
223{ 244{
224 int i; 245 int i;
225 struct pci_dev *pdev = to_pci_dev(dev); 246 struct pci_dev *pdev = to_pci_dev(dev);
@@ -234,25 +255,34 @@ void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
234 sg->dma_length = 0; 255 sg->dma_length = 0;
235 } 256 }
236} 257}
237EXPORT_SYMBOL(sn_dma_unmap_sg); 258EXPORT_SYMBOL(sn_dma_unmap_sg_attrs);
238 259
239/** 260/**
240 * sn_dma_map_sg - map a scatterlist for DMA 261 * sn_dma_map_sg_attrs - map a scatterlist for DMA
241 * @dev: device to map for 262 * @dev: device to map for
242 * @sg: scatterlist to map 263 * @sg: scatterlist to map
243 * @nhwentries: number of entries 264 * @nhwentries: number of entries
244 * @direction: direction of the DMA transaction 265 * @direction: direction of the DMA transaction
266 * @attrs: optional dma attributes
267 *
268 * mappings with the DMA_ATTR_WRITE_BARRIER get mapped with
269 * dma_map_consistent() so that writes force a flush of pending DMA.
270 * (See "SGI Altix Architecture Considerations for Linux Device Drivers",
271 * Document Number: 007-4763-001)
245 * 272 *
246 * Maps each entry of @sg for DMA. 273 * Maps each entry of @sg for DMA.
247 */ 274 */
248int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries, 275int sn_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
249 int direction) 276 int nhwentries, int direction, struct dma_attrs *attrs)
250{ 277{
251 unsigned long phys_addr; 278 unsigned long phys_addr;
252 struct scatterlist *saved_sg = sgl, *sg; 279 struct scatterlist *saved_sg = sgl, *sg;
253 struct pci_dev *pdev = to_pci_dev(dev); 280 struct pci_dev *pdev = to_pci_dev(dev);
254 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 281 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
255 int i; 282 int i;
283 int dmabarr;
284
285 dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);
256 286
257 BUG_ON(dev->bus != &pci_bus_type); 287 BUG_ON(dev->bus != &pci_bus_type);
258 288
@@ -260,11 +290,19 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries,
260 * Setup a DMA address for each entry in the scatterlist. 290 * Setup a DMA address for each entry in the scatterlist.
261 */ 291 */
262 for_each_sg(sgl, sg, nhwentries, i) { 292 for_each_sg(sgl, sg, nhwentries, i) {
293 dma_addr_t dma_addr;
263 phys_addr = SG_ENT_PHYS_ADDRESS(sg); 294 phys_addr = SG_ENT_PHYS_ADDRESS(sg);
264 sg->dma_address = provider->dma_map(pdev, 295 if (dmabarr)
265 phys_addr, sg->length, 296 dma_addr = provider->dma_map_consistent(pdev,
266 SN_DMA_ADDR_PHYS); 297 phys_addr,
298 sg->length,
299 SN_DMA_ADDR_PHYS);
300 else
301 dma_addr = provider->dma_map(pdev, phys_addr,
302 sg->length,
303 SN_DMA_ADDR_PHYS);
267 304
305 sg->dma_address = dma_addr;
268 if (!sg->dma_address) { 306 if (!sg->dma_address) {
269 printk(KERN_ERR "%s: out of ATEs\n", __func__); 307 printk(KERN_ERR "%s: out of ATEs\n", __func__);
270 308
@@ -272,7 +310,8 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries,
272 * Free any successfully allocated entries. 310 * Free any successfully allocated entries.
273 */ 311 */
274 if (i > 0) 312 if (i > 0)
275 sn_dma_unmap_sg(dev, saved_sg, i, direction); 313 sn_dma_unmap_sg_attrs(dev, saved_sg, i,
314 direction, attrs);
276 return 0; 315 return 0;
277 } 316 }
278 317
@@ -281,7 +320,7 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries,
281 320
282 return nhwentries; 321 return nhwentries;
283} 322}
284EXPORT_SYMBOL(sn_dma_map_sg); 323EXPORT_SYMBOL(sn_dma_map_sg_attrs);
285 324
286void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, 325void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
287 size_t size, int direction) 326 size_t size, int direction)
diff --git a/arch/m68k/kernel/asm-offsets.c b/arch/m68k/kernel/asm-offsets.c
index 246a8820c223..b1f012f6c493 100644
--- a/arch/m68k/kernel/asm-offsets.c
+++ b/arch/m68k/kernel/asm-offsets.c
@@ -11,14 +11,12 @@
11#include <linux/stddef.h> 11#include <linux/stddef.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/kernel_stat.h> 13#include <linux/kernel_stat.h>
14#include <linux/kbuild.h>
14#include <asm/bootinfo.h> 15#include <asm/bootinfo.h>
15#include <asm/irq.h> 16#include <asm/irq.h>
16#include <asm/amigahw.h> 17#include <asm/amigahw.h>
17#include <linux/font.h> 18#include <linux/font.h>
18 19
19#define DEFINE(sym, val) \
20 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
21
22int main(void) 20int main(void)
23{ 21{
24 /* offsets into the task struct */ 22 /* offsets into the task struct */
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c
index 5b2799eb96a6..326fb9978094 100644
--- a/arch/m68k/mac/iop.c
+++ b/arch/m68k/mac/iop.c
@@ -109,7 +109,6 @@
109#include <linux/mm.h> 109#include <linux/mm.h>
110#include <linux/delay.h> 110#include <linux/delay.h>
111#include <linux/init.h> 111#include <linux/init.h>
112#include <linux/proc_fs.h>
113#include <linux/interrupt.h> 112#include <linux/interrupt.h>
114 113
115#include <asm/bootinfo.h> 114#include <asm/bootinfo.h>
@@ -124,10 +123,6 @@
124 123
125int iop_scc_present,iop_ism_present; 124int iop_scc_present,iop_ism_present;
126 125
127#ifdef CONFIG_PROC_FS
128static int iop_get_proc_info(char *, char **, off_t, int);
129#endif /* CONFIG_PROC_FS */
130
131/* structure for tracking channel listeners */ 126/* structure for tracking channel listeners */
132 127
133struct listener { 128struct listener {
@@ -299,12 +294,6 @@ void __init iop_init(void)
299 iop_listeners[IOP_NUM_ISM][i].devname = NULL; 294 iop_listeners[IOP_NUM_ISM][i].devname = NULL;
300 iop_listeners[IOP_NUM_ISM][i].handler = NULL; 295 iop_listeners[IOP_NUM_ISM][i].handler = NULL;
301 } 296 }
302
303#if 0 /* Crashing in 2.4 now, not yet sure why. --jmt */
304#ifdef CONFIG_PROC_FS
305 create_proc_info_entry("mac_iop", 0, &proc_root, iop_get_proc_info);
306#endif
307#endif
308} 297}
309 298
310/* 299/*
@@ -637,77 +626,3 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id)
637 } 626 }
638 return IRQ_HANDLED; 627 return IRQ_HANDLED;
639} 628}
640
641#ifdef CONFIG_PROC_FS
642
643char *iop_chan_state(int state)
644{
645 switch(state) {
646 case IOP_MSG_IDLE : return "idle ";
647 case IOP_MSG_NEW : return "new ";
648 case IOP_MSG_RCVD : return "received ";
649 case IOP_MSG_COMPLETE : return "completed ";
650 default : return "unknown ";
651 }
652}
653
654int iop_dump_one_iop(char *buf, int iop_num, char *iop_name)
655{
656 int i,len = 0;
657 volatile struct mac_iop *iop = iop_base[iop_num];
658
659 len += sprintf(buf+len, "%s IOP channel states:\n\n", iop_name);
660 len += sprintf(buf+len, "## send_state recv_state device\n");
661 len += sprintf(buf+len, "------------------------------------------------\n");
662 for (i = 0 ; i < NUM_IOP_CHAN ; i++) {
663 len += sprintf(buf+len, "%2d %10s %10s %s\n", i,
664 iop_chan_state(iop_readb(iop, IOP_ADDR_SEND_STATE+i)),
665 iop_chan_state(iop_readb(iop, IOP_ADDR_RECV_STATE+i)),
666 iop_listeners[iop_num][i].handler?
667 iop_listeners[iop_num][i].devname : "");
668
669 }
670 len += sprintf(buf+len, "\n");
671 return len;
672}
673
674static int iop_get_proc_info(char *buf, char **start, off_t pos, int count)
675{
676 int len, cnt;
677
678 cnt = 0;
679 len = sprintf(buf, "IOPs detected:\n\n");
680
681 if (iop_scc_present) {
682 len += sprintf(buf+len, "SCC IOP (%p): status %02X\n",
683 iop_base[IOP_NUM_SCC],
684 (uint) iop_base[IOP_NUM_SCC]->status_ctrl);
685 }
686 if (iop_ism_present) {
687 len += sprintf(buf+len, "ISM IOP (%p): status %02X\n\n",
688 iop_base[IOP_NUM_ISM],
689 (uint) iop_base[IOP_NUM_ISM]->status_ctrl);
690 }
691
692 if (iop_scc_present) {
693 len += iop_dump_one_iop(buf+len, IOP_NUM_SCC, "SCC");
694
695 }
696
697 if (iop_ism_present) {
698 len += iop_dump_one_iop(buf+len, IOP_NUM_ISM, "ISM");
699
700 }
701
702 if (len >= pos) {
703 if (!*start) {
704 *start = buf + pos;
705 cnt = len - pos;
706 } else {
707 cnt += len;
708 }
709 }
710 return (count > cnt) ? cnt : count;
711}
712
713#endif /* CONFIG_PROC_FS */
diff --git a/arch/m68knommu/kernel/asm-offsets.c b/arch/m68knommu/kernel/asm-offsets.c
index d97b89bae53c..fd0c685a7f11 100644
--- a/arch/m68knommu/kernel/asm-offsets.c
+++ b/arch/m68knommu/kernel/asm-offsets.c
@@ -13,15 +13,11 @@
13#include <linux/kernel_stat.h> 13#include <linux/kernel_stat.h>
14#include <linux/ptrace.h> 14#include <linux/ptrace.h>
15#include <linux/hardirq.h> 15#include <linux/hardirq.h>
16#include <linux/kbuild.h>
16#include <asm/bootinfo.h> 17#include <asm/bootinfo.h>
17#include <asm/irq.h> 18#include <asm/irq.h>
18#include <asm/thread_info.h> 19#include <asm/thread_info.h>
19 20
20#define DEFINE(sym, val) \
21 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
22
23#define BLANK() asm volatile("\n->" : : )
24
25int main(void) 21int main(void)
26{ 22{
27 /* offsets into the task struct */ 23 /* offsets into the task struct */
diff --git a/arch/mips/basler/excite/excite_procfs.c b/arch/mips/basler/excite/excite_procfs.c
index 9ee67a95f6b9..08923e6825b5 100644
--- a/arch/mips/basler/excite/excite_procfs.c
+++ b/arch/mips/basler/excite/excite_procfs.c
@@ -18,8 +18,9 @@
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 21#include <linux/module.h>
22#include <linux/proc_fs.h> 22#include <linux/proc_fs.h>
23#include <linux/seq_file.h>
23#include <linux/stat.h> 24#include <linux/stat.h>
24#include <asm/page.h> 25#include <asm/page.h>
25#include <asm/io.h> 26#include <asm/io.h>
@@ -28,14 +29,25 @@
28 29
29#include <excite.h> 30#include <excite.h>
30 31
31static int excite_get_unit_id(char *buf, char **addr, off_t offs, int size) 32static int excite_unit_id_proc_show(struct seq_file *m, void *v)
32{ 33{
33 const int len = snprintf(buf, PAGE_SIZE, "%06x", unit_id); 34 seq_printf(m, "%06x", unit_id);
34 const int w = len - offs; 35 return 0;
35 *addr = buf + offs;
36 return w < size ? w : size;
37} 36}
38 37
38static int excite_unit_id_proc_open(struct inode *inode, struct file *file)
39{
40 return single_open(file, excite_unit_id_proc_show, NULL);
41}
42
43static const struct file_operations excite_unit_id_proc_fops = {
44 .owner = THIS_MODULE,
45 .open = excite_unit_id_proc_open,
46 .read = seq_read,
47 .llseek = seq_lseek,
48 .release = single_release,
49};
50
39static int 51static int
40excite_bootrom_read(char *page, char **start, off_t off, int count, 52excite_bootrom_read(char *page, char **start, off_t off, int count,
41 int *eof, void *data) 53 int *eof, void *data)
@@ -65,12 +77,12 @@ excite_bootrom_read(char *page, char **start, off_t off, int count,
65void excite_procfs_init(void) 77void excite_procfs_init(void)
66{ 78{
67 /* Create & populate /proc/excite */ 79 /* Create & populate /proc/excite */
68 struct proc_dir_entry * const pdir = proc_mkdir("excite", &proc_root); 80 struct proc_dir_entry * const pdir = proc_mkdir("excite", NULL);
69 if (pdir) { 81 if (pdir) {
70 struct proc_dir_entry * e; 82 struct proc_dir_entry * e;
71 83
72 e = create_proc_info_entry("unit_id", S_IRUGO, pdir, 84 e = proc_create("unit_id", S_IRUGO, pdir,
73 excite_get_unit_id); 85 &excite_unit_id_proc_fops);
74 if (e) e->size = 6; 86 if (e) e->size = 6;
75 87
76 e = create_proc_read_entry("bootrom", S_IRUGO, pdir, 88 e = create_proc_read_entry("bootrom", S_IRUGO, pdir,
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 5bf03b3c4150..72942226fcdd 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -13,327 +13,285 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16 16#include <linux/kbuild.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/processor.h> 18#include <asm/processor.h>
19 19
20#define text(t) __asm__("\n->#" t)
21#define _offset(type, member) (&(((type *)NULL)->member))
22#define offset(string, ptr, member) \
23 __asm__("\n->" string " %0" : : "i" (_offset(ptr, member)))
24#define constant(string, member) \
25 __asm__("\n->" string " %0" : : "ri" (member))
26#define size(string, size) \
27 __asm__("\n->" string " %0" : : "i" (sizeof(size)))
28#define linefeed text("")
29
30void output_ptreg_defines(void) 20void output_ptreg_defines(void)
31{ 21{
32 text("MIPS pt_regs offsets."); 22 COMMENT("MIPS pt_regs offsets.");
33 offset("PT_R0", struct pt_regs, regs[0]); 23 OFFSET(PT_R0, pt_regs, regs[0]);
34 offset("PT_R1", struct pt_regs, regs[1]); 24 OFFSET(PT_R1, pt_regs, regs[1]);
35 offset("PT_R2", struct pt_regs, regs[2]); 25 OFFSET(PT_R2, pt_regs, regs[2]);
36 offset("PT_R3", struct pt_regs, regs[3]); 26 OFFSET(PT_R3, pt_regs, regs[3]);
37 offset("PT_R4", struct pt_regs, regs[4]); 27 OFFSET(PT_R4, pt_regs, regs[4]);
38 offset("PT_R5", struct pt_regs, regs[5]); 28 OFFSET(PT_R5, pt_regs, regs[5]);
39 offset("PT_R6", struct pt_regs, regs[6]); 29 OFFSET(PT_R6, pt_regs, regs[6]);
40 offset("PT_R7", struct pt_regs, regs[7]); 30 OFFSET(PT_R7, pt_regs, regs[7]);
41 offset("PT_R8", struct pt_regs, regs[8]); 31 OFFSET(PT_R8, pt_regs, regs[8]);
42 offset("PT_R9", struct pt_regs, regs[9]); 32 OFFSET(PT_R9, pt_regs, regs[9]);
43 offset("PT_R10", struct pt_regs, regs[10]); 33 OFFSET(PT_R10, pt_regs, regs[10]);
44 offset("PT_R11", struct pt_regs, regs[11]); 34 OFFSET(PT_R11, pt_regs, regs[11]);
45 offset("PT_R12", struct pt_regs, regs[12]); 35 OFFSET(PT_R12, pt_regs, regs[12]);
46 offset("PT_R13", struct pt_regs, regs[13]); 36 OFFSET(PT_R13, pt_regs, regs[13]);
47 offset("PT_R14", struct pt_regs, regs[14]); 37 OFFSET(PT_R14, pt_regs, regs[14]);
48 offset("PT_R15", struct pt_regs, regs[15]); 38 OFFSET(PT_R15, pt_regs, regs[15]);
49 offset("PT_R16", struct pt_regs, regs[16]); 39 OFFSET(PT_R16, pt_regs, regs[16]);
50 offset("PT_R17", struct pt_regs, regs[17]); 40 OFFSET(PT_R17, pt_regs, regs[17]);
51 offset("PT_R18", struct pt_regs, regs[18]); 41 OFFSET(PT_R18, pt_regs, regs[18]);
52 offset("PT_R19", struct pt_regs, regs[19]); 42 OFFSET(PT_R19, pt_regs, regs[19]);
53 offset("PT_R20", struct pt_regs, regs[20]); 43 OFFSET(PT_R20, pt_regs, regs[20]);
54 offset("PT_R21", struct pt_regs, regs[21]); 44 OFFSET(PT_R21, pt_regs, regs[21]);
55 offset("PT_R22", struct pt_regs, regs[22]); 45 OFFSET(PT_R22, pt_regs, regs[22]);
56 offset("PT_R23", struct pt_regs, regs[23]); 46 OFFSET(PT_R23, pt_regs, regs[23]);
57 offset("PT_R24", struct pt_regs, regs[24]); 47 OFFSET(PT_R24, pt_regs, regs[24]);
58 offset("PT_R25", struct pt_regs, regs[25]); 48 OFFSET(PT_R25, pt_regs, regs[25]);
59 offset("PT_R26", struct pt_regs, regs[26]); 49 OFFSET(PT_R26, pt_regs, regs[26]);
60 offset("PT_R27", struct pt_regs, regs[27]); 50 OFFSET(PT_R27, pt_regs, regs[27]);
61 offset("PT_R28", struct pt_regs, regs[28]); 51 OFFSET(PT_R28, pt_regs, regs[28]);
62 offset("PT_R29", struct pt_regs, regs[29]); 52 OFFSET(PT_R29, pt_regs, regs[29]);
63 offset("PT_R30", struct pt_regs, regs[30]); 53 OFFSET(PT_R30, pt_regs, regs[30]);
64 offset("PT_R31", struct pt_regs, regs[31]); 54 OFFSET(PT_R31, pt_regs, regs[31]);
65 offset("PT_LO", struct pt_regs, lo); 55 OFFSET(PT_LO, pt_regs, lo);
66 offset("PT_HI", struct pt_regs, hi); 56 OFFSET(PT_HI, pt_regs, hi);
67#ifdef CONFIG_CPU_HAS_SMARTMIPS 57#ifdef CONFIG_CPU_HAS_SMARTMIPS
68 offset("PT_ACX", struct pt_regs, acx); 58 OFFSET(PT_ACX, pt_regs, acx);
69#endif 59#endif
70 offset("PT_EPC", struct pt_regs, cp0_epc); 60 OFFSET(PT_EPC, pt_regs, cp0_epc);
71 offset("PT_BVADDR", struct pt_regs, cp0_badvaddr); 61 OFFSET(PT_BVADDR, pt_regs, cp0_badvaddr);
72 offset("PT_STATUS", struct pt_regs, cp0_status); 62 OFFSET(PT_STATUS, pt_regs, cp0_status);
73 offset("PT_CAUSE", struct pt_regs, cp0_cause); 63 OFFSET(PT_CAUSE, pt_regs, cp0_cause);
74#ifdef CONFIG_MIPS_MT_SMTC 64#ifdef CONFIG_MIPS_MT_SMTC
75 offset("PT_TCSTATUS", struct pt_regs, cp0_tcstatus); 65 OFFSET(PT_TCSTATUS, pt_regs, cp0_tcstatus);
76#endif /* CONFIG_MIPS_MT_SMTC */ 66#endif /* CONFIG_MIPS_MT_SMTC */
77 size("PT_SIZE", struct pt_regs); 67 DEFINE(PT_SIZE, sizeof(struct pt_regs));
78 linefeed; 68 BLANK();
79} 69}
80 70
81void output_task_defines(void) 71void output_task_defines(void)
82{ 72{
83 text("MIPS task_struct offsets."); 73 COMMENT("MIPS task_struct offsets.");
84 offset("TASK_STATE", struct task_struct, state); 74 OFFSET(TASK_STATE, task_struct, state);
85 offset("TASK_THREAD_INFO", struct task_struct, stack); 75 OFFSET(TASK_THREAD_INFO, task_struct, stack);
86 offset("TASK_FLAGS", struct task_struct, flags); 76 OFFSET(TASK_FLAGS, task_struct, flags);
87 offset("TASK_MM", struct task_struct, mm); 77 OFFSET(TASK_MM, task_struct, mm);
88 offset("TASK_PID", struct task_struct, pid); 78 OFFSET(TASK_PID, task_struct, pid);
89 size( "TASK_STRUCT_SIZE", struct task_struct); 79 DEFINE(TASK_STRUCT_SIZE, sizeof(struct task_struct));
90 linefeed; 80 BLANK();
91} 81}
92 82
93void output_thread_info_defines(void) 83void output_thread_info_defines(void)
94{ 84{
95 text("MIPS thread_info offsets."); 85 COMMENT("MIPS thread_info offsets.");
96 offset("TI_TASK", struct thread_info, task); 86 OFFSET(TI_TASK, thread_info, task);
97 offset("TI_EXEC_DOMAIN", struct thread_info, exec_domain); 87 OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
98 offset("TI_FLAGS", struct thread_info, flags); 88 OFFSET(TI_FLAGS, thread_info, flags);
99 offset("TI_TP_VALUE", struct thread_info, tp_value); 89 OFFSET(TI_TP_VALUE, thread_info, tp_value);
100 offset("TI_CPU", struct thread_info, cpu); 90 OFFSET(TI_CPU, thread_info, cpu);
101 offset("TI_PRE_COUNT", struct thread_info, preempt_count); 91 OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
102 offset("TI_ADDR_LIMIT", struct thread_info, addr_limit); 92 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
103 offset("TI_RESTART_BLOCK", struct thread_info, restart_block); 93 OFFSET(TI_RESTART_BLOCK, thread_info, restart_block);
104 offset("TI_REGS", struct thread_info, regs); 94 OFFSET(TI_REGS, thread_info, regs);
105 constant("_THREAD_SIZE", THREAD_SIZE); 95 DEFINE(_THREAD_SIZE, THREAD_SIZE);
106 constant("_THREAD_MASK", THREAD_MASK); 96 DEFINE(_THREAD_MASK, THREAD_MASK);
107 linefeed; 97 BLANK();
108} 98}
109 99
110void output_thread_defines(void) 100void output_thread_defines(void)
111{ 101{
112 text("MIPS specific thread_struct offsets."); 102 COMMENT("MIPS specific thread_struct offsets.");
113 offset("THREAD_REG16", struct task_struct, thread.reg16); 103 OFFSET(THREAD_REG16, task_struct, thread.reg16);
114 offset("THREAD_REG17", struct task_struct, thread.reg17); 104 OFFSET(THREAD_REG17, task_struct, thread.reg17);
115 offset("THREAD_REG18", struct task_struct, thread.reg18); 105 OFFSET(THREAD_REG18, task_struct, thread.reg18);
116 offset("THREAD_REG19", struct task_struct, thread.reg19); 106 OFFSET(THREAD_REG19, task_struct, thread.reg19);
117 offset("THREAD_REG20", struct task_struct, thread.reg20); 107 OFFSET(THREAD_REG20, task_struct, thread.reg20);
118 offset("THREAD_REG21", struct task_struct, thread.reg21); 108 OFFSET(THREAD_REG21, task_struct, thread.reg21);
119 offset("THREAD_REG22", struct task_struct, thread.reg22); 109 OFFSET(THREAD_REG22, task_struct, thread.reg22);
120 offset("THREAD_REG23", struct task_struct, thread.reg23); 110 OFFSET(THREAD_REG23, task_struct, thread.reg23);
121 offset("THREAD_REG29", struct task_struct, thread.reg29); 111 OFFSET(THREAD_REG29, task_struct, thread.reg29);
122 offset("THREAD_REG30", struct task_struct, thread.reg30); 112 OFFSET(THREAD_REG30, task_struct, thread.reg30);
123 offset("THREAD_REG31", struct task_struct, thread.reg31); 113 OFFSET(THREAD_REG31, task_struct, thread.reg31);
124 offset("THREAD_STATUS", struct task_struct, 114 OFFSET(THREAD_STATUS, task_struct,
125 thread.cp0_status); 115 thread.cp0_status);
126 offset("THREAD_FPU", struct task_struct, thread.fpu); 116 OFFSET(THREAD_FPU, task_struct, thread.fpu);
127 117
128 offset("THREAD_BVADDR", struct task_struct, \ 118 OFFSET(THREAD_BVADDR, task_struct, \
129 thread.cp0_badvaddr); 119 thread.cp0_badvaddr);
130 offset("THREAD_BUADDR", struct task_struct, \ 120 OFFSET(THREAD_BUADDR, task_struct, \
131 thread.cp0_baduaddr); 121 thread.cp0_baduaddr);
132 offset("THREAD_ECODE", struct task_struct, \ 122 OFFSET(THREAD_ECODE, task_struct, \
133 thread.error_code); 123 thread.error_code);
134 offset("THREAD_TRAPNO", struct task_struct, thread.trap_no); 124 OFFSET(THREAD_TRAPNO, task_struct, thread.trap_no);
135 offset("THREAD_TRAMP", struct task_struct, \ 125 OFFSET(THREAD_TRAMP, task_struct, \
136 thread.irix_trampoline); 126 thread.irix_trampoline);
137 offset("THREAD_OLDCTX", struct task_struct, \ 127 OFFSET(THREAD_OLDCTX, task_struct, \
138 thread.irix_oldctx); 128 thread.irix_oldctx);
139 linefeed; 129 BLANK();
140} 130}
141 131
142void output_thread_fpu_defines(void) 132void output_thread_fpu_defines(void)
143{ 133{
144 offset("THREAD_FPR0", 134 OFFSET(THREAD_FPR0, task_struct, thread.fpu.fpr[0]);
145 struct task_struct, thread.fpu.fpr[0]); 135 OFFSET(THREAD_FPR1, task_struct, thread.fpu.fpr[1]);
146 offset("THREAD_FPR1", 136 OFFSET(THREAD_FPR2, task_struct, thread.fpu.fpr[2]);
147 struct task_struct, thread.fpu.fpr[1]); 137 OFFSET(THREAD_FPR3, task_struct, thread.fpu.fpr[3]);
148 offset("THREAD_FPR2", 138 OFFSET(THREAD_FPR4, task_struct, thread.fpu.fpr[4]);
149 struct task_struct, thread.fpu.fpr[2]); 139 OFFSET(THREAD_FPR5, task_struct, thread.fpu.fpr[5]);
150 offset("THREAD_FPR3", 140 OFFSET(THREAD_FPR6, task_struct, thread.fpu.fpr[6]);
151 struct task_struct, thread.fpu.fpr[3]); 141 OFFSET(THREAD_FPR7, task_struct, thread.fpu.fpr[7]);
152 offset("THREAD_FPR4", 142 OFFSET(THREAD_FPR8, task_struct, thread.fpu.fpr[8]);
153 struct task_struct, thread.fpu.fpr[4]); 143 OFFSET(THREAD_FPR9, task_struct, thread.fpu.fpr[9]);
154 offset("THREAD_FPR5", 144 OFFSET(THREAD_FPR10, task_struct, thread.fpu.fpr[10]);
155 struct task_struct, thread.fpu.fpr[5]); 145 OFFSET(THREAD_FPR11, task_struct, thread.fpu.fpr[11]);
156 offset("THREAD_FPR6", 146 OFFSET(THREAD_FPR12, task_struct, thread.fpu.fpr[12]);
157 struct task_struct, thread.fpu.fpr[6]); 147 OFFSET(THREAD_FPR13, task_struct, thread.fpu.fpr[13]);
158 offset("THREAD_FPR7", 148 OFFSET(THREAD_FPR14, task_struct, thread.fpu.fpr[14]);
159 struct task_struct, thread.fpu.fpr[7]); 149 OFFSET(THREAD_FPR15, task_struct, thread.fpu.fpr[15]);
160 offset("THREAD_FPR8", 150 OFFSET(THREAD_FPR16, task_struct, thread.fpu.fpr[16]);
161 struct task_struct, thread.fpu.fpr[8]); 151 OFFSET(THREAD_FPR17, task_struct, thread.fpu.fpr[17]);
162 offset("THREAD_FPR9", 152 OFFSET(THREAD_FPR18, task_struct, thread.fpu.fpr[18]);
163 struct task_struct, thread.fpu.fpr[9]); 153 OFFSET(THREAD_FPR19, task_struct, thread.fpu.fpr[19]);
164 offset("THREAD_FPR10", 154 OFFSET(THREAD_FPR20, task_struct, thread.fpu.fpr[20]);
165 struct task_struct, thread.fpu.fpr[10]); 155 OFFSET(THREAD_FPR21, task_struct, thread.fpu.fpr[21]);
166 offset("THREAD_FPR11", 156 OFFSET(THREAD_FPR22, task_struct, thread.fpu.fpr[22]);
167 struct task_struct, thread.fpu.fpr[11]); 157 OFFSET(THREAD_FPR23, task_struct, thread.fpu.fpr[23]);
168 offset("THREAD_FPR12", 158 OFFSET(THREAD_FPR24, task_struct, thread.fpu.fpr[24]);
169 struct task_struct, thread.fpu.fpr[12]); 159 OFFSET(THREAD_FPR25, task_struct, thread.fpu.fpr[25]);
170 offset("THREAD_FPR13", 160 OFFSET(THREAD_FPR26, task_struct, thread.fpu.fpr[26]);
171 struct task_struct, thread.fpu.fpr[13]); 161 OFFSET(THREAD_FPR27, task_struct, thread.fpu.fpr[27]);
172 offset("THREAD_FPR14", 162 OFFSET(THREAD_FPR28, task_struct, thread.fpu.fpr[28]);
173 struct task_struct, thread.fpu.fpr[14]); 163 OFFSET(THREAD_FPR29, task_struct, thread.fpu.fpr[29]);
174 offset("THREAD_FPR15", 164 OFFSET(THREAD_FPR30, task_struct, thread.fpu.fpr[30]);
175 struct task_struct, thread.fpu.fpr[15]); 165 OFFSET(THREAD_FPR31, task_struct, thread.fpu.fpr[31]);
176 offset("THREAD_FPR16",
177 struct task_struct, thread.fpu.fpr[16]);
178 offset("THREAD_FPR17",
179 struct task_struct, thread.fpu.fpr[17]);
180 offset("THREAD_FPR18",
181 struct task_struct, thread.fpu.fpr[18]);
182 offset("THREAD_FPR19",
183 struct task_struct, thread.fpu.fpr[19]);
184 offset("THREAD_FPR20",
185 struct task_struct, thread.fpu.fpr[20]);
186 offset("THREAD_FPR21",
187 struct task_struct, thread.fpu.fpr[21]);
188 offset("THREAD_FPR22",
189 struct task_struct, thread.fpu.fpr[22]);
190 offset("THREAD_FPR23",
191 struct task_struct, thread.fpu.fpr[23]);
192 offset("THREAD_FPR24",
193 struct task_struct, thread.fpu.fpr[24]);
194 offset("THREAD_FPR25",
195 struct task_struct, thread.fpu.fpr[25]);
196 offset("THREAD_FPR26",
197 struct task_struct, thread.fpu.fpr[26]);
198 offset("THREAD_FPR27",
199 struct task_struct, thread.fpu.fpr[27]);
200 offset("THREAD_FPR28",
201 struct task_struct, thread.fpu.fpr[28]);
202 offset("THREAD_FPR29",
203 struct task_struct, thread.fpu.fpr[29]);
204 offset("THREAD_FPR30",
205 struct task_struct, thread.fpu.fpr[30]);
206 offset("THREAD_FPR31",
207 struct task_struct, thread.fpu.fpr[31]);
208 166
209 offset("THREAD_FCR31", 167 OFFSET(THREAD_FCR31, task_struct, thread.fpu.fcr31);
210 struct task_struct, thread.fpu.fcr31); 168 BLANK();
211 linefeed;
212} 169}
213 170
214void output_mm_defines(void) 171void output_mm_defines(void)
215{ 172{
216 text("Size of struct page"); 173 COMMENT("Size of struct page");
217 size("STRUCT_PAGE_SIZE", struct page); 174 DEFINE(STRUCT_PAGE_SIZE, sizeof(struct page));
218 linefeed; 175 BLANK();
219 text("Linux mm_struct offsets."); 176 COMMENT("Linux mm_struct offsets.");
220 offset("MM_USERS", struct mm_struct, mm_users); 177 OFFSET(MM_USERS, mm_struct, mm_users);
221 offset("MM_PGD", struct mm_struct, pgd); 178 OFFSET(MM_PGD, mm_struct, pgd);
222 offset("MM_CONTEXT", struct mm_struct, context); 179 OFFSET(MM_CONTEXT, mm_struct, context);
223 linefeed; 180 BLANK();
224 constant("_PAGE_SIZE", PAGE_SIZE); 181 DEFINE(_PAGE_SIZE, PAGE_SIZE);
225 constant("_PAGE_SHIFT", PAGE_SHIFT); 182 DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
226 linefeed; 183 BLANK();
227 constant("_PGD_T_SIZE", sizeof(pgd_t)); 184 DEFINE(_PGD_T_SIZE, sizeof(pgd_t));
228 constant("_PMD_T_SIZE", sizeof(pmd_t)); 185 DEFINE(_PMD_T_SIZE, sizeof(pmd_t));
229 constant("_PTE_T_SIZE", sizeof(pte_t)); 186 DEFINE(_PTE_T_SIZE, sizeof(pte_t));
230 linefeed; 187 BLANK();
231 constant("_PGD_T_LOG2", PGD_T_LOG2); 188 DEFINE(_PGD_T_LOG2, PGD_T_LOG2);
232 constant("_PMD_T_LOG2", PMD_T_LOG2); 189 DEFINE(_PMD_T_LOG2, PMD_T_LOG2);
233 constant("_PTE_T_LOG2", PTE_T_LOG2); 190 DEFINE(_PTE_T_LOG2, PTE_T_LOG2);
234 linefeed; 191 BLANK();
235 constant("_PGD_ORDER", PGD_ORDER); 192 DEFINE(_PGD_ORDER, PGD_ORDER);
236 constant("_PMD_ORDER", PMD_ORDER); 193 DEFINE(_PMD_ORDER, PMD_ORDER);
237 constant("_PTE_ORDER", PTE_ORDER); 194 DEFINE(_PTE_ORDER, PTE_ORDER);
238 linefeed; 195 BLANK();
239 constant("_PMD_SHIFT", PMD_SHIFT); 196 DEFINE(_PMD_SHIFT, PMD_SHIFT);
240 constant("_PGDIR_SHIFT", PGDIR_SHIFT); 197 DEFINE(_PGDIR_SHIFT, PGDIR_SHIFT);
241 linefeed; 198 BLANK();
242 constant("_PTRS_PER_PGD", PTRS_PER_PGD); 199 DEFINE(_PTRS_PER_PGD, PTRS_PER_PGD);
243 constant("_PTRS_PER_PMD", PTRS_PER_PMD); 200 DEFINE(_PTRS_PER_PMD, PTRS_PER_PMD);
244 constant("_PTRS_PER_PTE", PTRS_PER_PTE); 201 DEFINE(_PTRS_PER_PTE, PTRS_PER_PTE);
245 linefeed; 202 BLANK();
246} 203}
247 204
248#ifdef CONFIG_32BIT 205#ifdef CONFIG_32BIT
249void output_sc_defines(void) 206void output_sc_defines(void)
250{ 207{
251 text("Linux sigcontext offsets."); 208 COMMENT("Linux sigcontext offsets.");
252 offset("SC_REGS", struct sigcontext, sc_regs); 209 OFFSET(SC_REGS, sigcontext, sc_regs);
253 offset("SC_FPREGS", struct sigcontext, sc_fpregs); 210 OFFSET(SC_FPREGS, sigcontext, sc_fpregs);
254 offset("SC_ACX", struct sigcontext, sc_acx); 211 OFFSET(SC_ACX, sigcontext, sc_acx);
255 offset("SC_MDHI", struct sigcontext, sc_mdhi); 212 OFFSET(SC_MDHI, sigcontext, sc_mdhi);
256 offset("SC_MDLO", struct sigcontext, sc_mdlo); 213 OFFSET(SC_MDLO, sigcontext, sc_mdlo);
257 offset("SC_PC", struct sigcontext, sc_pc); 214 OFFSET(SC_PC, sigcontext, sc_pc);
258 offset("SC_FPC_CSR", struct sigcontext, sc_fpc_csr); 215 OFFSET(SC_FPC_CSR, sigcontext, sc_fpc_csr);
259 offset("SC_FPC_EIR", struct sigcontext, sc_fpc_eir); 216 OFFSET(SC_FPC_EIR, sigcontext, sc_fpc_eir);
260 offset("SC_HI1", struct sigcontext, sc_hi1); 217 OFFSET(SC_HI1, sigcontext, sc_hi1);
261 offset("SC_LO1", struct sigcontext, sc_lo1); 218 OFFSET(SC_LO1, sigcontext, sc_lo1);
262 offset("SC_HI2", struct sigcontext, sc_hi2); 219 OFFSET(SC_HI2, sigcontext, sc_hi2);
263 offset("SC_LO2", struct sigcontext, sc_lo2); 220 OFFSET(SC_LO2, sigcontext, sc_lo2);
264 offset("SC_HI3", struct sigcontext, sc_hi3); 221 OFFSET(SC_HI3, sigcontext, sc_hi3);
265 offset("SC_LO3", struct sigcontext, sc_lo3); 222 OFFSET(SC_LO3, sigcontext, sc_lo3);
266 linefeed; 223 BLANK();
267} 224}
268#endif 225#endif
269 226
270#ifdef CONFIG_64BIT 227#ifdef CONFIG_64BIT
271void output_sc_defines(void) 228void output_sc_defines(void)
272{ 229{
273 text("Linux sigcontext offsets."); 230 COMMENT("Linux sigcontext offsets.");
274 offset("SC_REGS", struct sigcontext, sc_regs); 231 OFFSET(SC_REGS, sigcontext, sc_regs);
275 offset("SC_FPREGS", struct sigcontext, sc_fpregs); 232 OFFSET(SC_FPREGS, sigcontext, sc_fpregs);
276 offset("SC_MDHI", struct sigcontext, sc_mdhi); 233 OFFSET(SC_MDHI, sigcontext, sc_mdhi);
277 offset("SC_MDLO", struct sigcontext, sc_mdlo); 234 OFFSET(SC_MDLO, sigcontext, sc_mdlo);
278 offset("SC_PC", struct sigcontext, sc_pc); 235 OFFSET(SC_PC, sigcontext, sc_pc);
279 offset("SC_FPC_CSR", struct sigcontext, sc_fpc_csr); 236 OFFSET(SC_FPC_CSR, sigcontext, sc_fpc_csr);
280 linefeed; 237 BLANK();
281} 238}
282#endif 239#endif
283 240
284#ifdef CONFIG_MIPS32_COMPAT 241#ifdef CONFIG_MIPS32_COMPAT
285void output_sc32_defines(void) 242void output_sc32_defines(void)
286{ 243{
287 text("Linux 32-bit sigcontext offsets."); 244 COMMENT("Linux 32-bit sigcontext offsets.");
288 offset("SC32_FPREGS", struct sigcontext32, sc_fpregs); 245 OFFSET(SC32_FPREGS, sigcontext32, sc_fpregs);
289 offset("SC32_FPC_CSR", struct sigcontext32, sc_fpc_csr); 246 OFFSET(SC32_FPC_CSR, sigcontext32, sc_fpc_csr);
290 offset("SC32_FPC_EIR", struct sigcontext32, sc_fpc_eir); 247 OFFSET(SC32_FPC_EIR, sigcontext32, sc_fpc_eir);
291 linefeed; 248 BLANK();
292} 249}
293#endif 250#endif
294 251
295void output_signal_defined(void) 252void output_signal_defined(void)
296{ 253{
297 text("Linux signal numbers."); 254 COMMENT("Linux signal numbers.");
298 constant("_SIGHUP", SIGHUP); 255 DEFINE(_SIGHUP, SIGHUP);
299 constant("_SIGINT", SIGINT); 256 DEFINE(_SIGINT, SIGINT);
300 constant("_SIGQUIT", SIGQUIT); 257 DEFINE(_SIGQUIT, SIGQUIT);
301 constant("_SIGILL", SIGILL); 258 DEFINE(_SIGILL, SIGILL);
302 constant("_SIGTRAP", SIGTRAP); 259 DEFINE(_SIGTRAP, SIGTRAP);
303 constant("_SIGIOT", SIGIOT); 260 DEFINE(_SIGIOT, SIGIOT);
304 constant("_SIGABRT", SIGABRT); 261 DEFINE(_SIGABRT, SIGABRT);
305 constant("_SIGEMT", SIGEMT); 262 DEFINE(_SIGEMT, SIGEMT);
306 constant("_SIGFPE", SIGFPE); 263 DEFINE(_SIGFPE, SIGFPE);
307 constant("_SIGKILL", SIGKILL); 264 DEFINE(_SIGKILL, SIGKILL);
308 constant("_SIGBUS", SIGBUS); 265 DEFINE(_SIGBUS, SIGBUS);
309 constant("_SIGSEGV", SIGSEGV); 266 DEFINE(_SIGSEGV, SIGSEGV);
310 constant("_SIGSYS", SIGSYS); 267 DEFINE(_SIGSYS, SIGSYS);
311 constant("_SIGPIPE", SIGPIPE); 268 DEFINE(_SIGPIPE, SIGPIPE);
312 constant("_SIGALRM", SIGALRM); 269 DEFINE(_SIGALRM, SIGALRM);
313 constant("_SIGTERM", SIGTERM); 270 DEFINE(_SIGTERM, SIGTERM);
314 constant("_SIGUSR1", SIGUSR1); 271 DEFINE(_SIGUSR1, SIGUSR1);
315 constant("_SIGUSR2", SIGUSR2); 272 DEFINE(_SIGUSR2, SIGUSR2);
316 constant("_SIGCHLD", SIGCHLD); 273 DEFINE(_SIGCHLD, SIGCHLD);
317 constant("_SIGPWR", SIGPWR); 274 DEFINE(_SIGPWR, SIGPWR);
318 constant("_SIGWINCH", SIGWINCH); 275 DEFINE(_SIGWINCH, SIGWINCH);
319 constant("_SIGURG", SIGURG); 276 DEFINE(_SIGURG, SIGURG);
320 constant("_SIGIO", SIGIO); 277 DEFINE(_SIGIO, SIGIO);
321 constant("_SIGSTOP", SIGSTOP); 278 DEFINE(_SIGSTOP, SIGSTOP);
322 constant("_SIGTSTP", SIGTSTP); 279 DEFINE(_SIGTSTP, SIGTSTP);
323 constant("_SIGCONT", SIGCONT); 280 DEFINE(_SIGCONT, SIGCONT);
324 constant("_SIGTTIN", SIGTTIN); 281 DEFINE(_SIGTTIN, SIGTTIN);
325 constant("_SIGTTOU", SIGTTOU); 282 DEFINE(_SIGTTOU, SIGTTOU);
326 constant("_SIGVTALRM", SIGVTALRM); 283 DEFINE(_SIGVTALRM, SIGVTALRM);
327 constant("_SIGPROF", SIGPROF); 284 DEFINE(_SIGPROF, SIGPROF);
328 constant("_SIGXCPU", SIGXCPU); 285 DEFINE(_SIGXCPU, SIGXCPU);
329 constant("_SIGXFSZ", SIGXFSZ); 286 DEFINE(_SIGXFSZ, SIGXFSZ);
330 linefeed; 287 BLANK();
331} 288}
332 289
333void output_irq_cpustat_t_defines(void) 290void output_irq_cpustat_t_defines(void)
334{ 291{
335 text("Linux irq_cpustat_t offsets."); 292 COMMENT("Linux irq_cpustat_t offsets.");
336 offset("IC_SOFTIRQ_PENDING", irq_cpustat_t, __softirq_pending); 293 DEFINE(IC_SOFTIRQ_PENDING,
337 size("IC_IRQ_CPUSTAT_T", irq_cpustat_t); 294 offsetof(irq_cpustat_t, __softirq_pending));
338 linefeed; 295 DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t));
296 BLANK();
339} 297}
diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c
index c11b2494bb6e..2ab899c4b4ce 100644
--- a/arch/mips/lib/iomap-pci.c
+++ b/arch/mips/lib/iomap-pci.c
@@ -45,8 +45,8 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev,
45 */ 45 */
46void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 46void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
47{ 47{
48 unsigned long start = pci_resource_start(dev, bar); 48 resource_size_t start = pci_resource_start(dev, bar);
49 unsigned long len = pci_resource_len(dev, bar); 49 resource_size_t len = pci_resource_len(dev, bar);
50 unsigned long flags = pci_resource_flags(dev, bar); 50 unsigned long flags = pci_resource_flags(dev, bar);
51 51
52 if (!len || !start) 52 if (!len || !start)
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index 855977ca51cd..6537d90a25bb 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -143,9 +143,6 @@ void __init plat_time_init(void)
143mips_hpt_frequency = 33000000 * 3 * 5; 143mips_hpt_frequency = 33000000 * 3 * 5;
144} 144}
145 145
146/* No other usable initialization hook than this ... */
147extern void (*late_time_init)(void);
148
149unsigned long ocd_base; 146unsigned long ocd_base;
150 147
151EXPORT_SYMBOL(ocd_base); 148EXPORT_SYMBOL(ocd_base);
diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
index ee2d9f8af5ad..2646fcbd7d89 100644
--- a/arch/mn10300/kernel/asm-offsets.c
+++ b/arch/mn10300/kernel/asm-offsets.c
@@ -7,6 +7,7 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/signal.h> 8#include <linux/signal.h>
9#include <linux/personality.h> 9#include <linux/personality.h>
10#include <linux/kbuild.h>
10#include <asm/ucontext.h> 11#include <asm/ucontext.h>
11#include <asm/processor.h> 12#include <asm/processor.h>
12#include <asm/thread_info.h> 13#include <asm/thread_info.h>
@@ -14,14 +15,6 @@
14#include "sigframe.h" 15#include "sigframe.h"
15#include "mn10300-serial.h" 16#include "mn10300-serial.h"
16 17
17#define DEFINE(sym, val) \
18 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
19
20#define BLANK() asm volatile("\n->")
21
22#define OFFSET(sym, str, mem) \
23 DEFINE(sym, offsetof(struct str, mem));
24
25void foo(void) 18void foo(void)
26{ 19{
27 OFFSET(SIGCONTEXT_d0, sigcontext, d0); 20 OFFSET(SIGCONTEXT_d0, sigcontext, d0);
diff --git a/arch/mn10300/unit-asb2305/pci-iomap.c b/arch/mn10300/unit-asb2305/pci-iomap.c
index dbceae4307da..c1a8d8f941fd 100644
--- a/arch/mn10300/unit-asb2305/pci-iomap.c
+++ b/arch/mn10300/unit-asb2305/pci-iomap.c
@@ -16,8 +16,8 @@
16 */ 16 */
17void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 17void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
18{ 18{
19 unsigned long start = pci_resource_start(dev, bar); 19 resource_size_t start = pci_resource_start(dev, bar);
20 unsigned long len = pci_resource_len(dev, bar); 20 resource_size_t len = pci_resource_len(dev, bar);
21 unsigned long flags = pci_resource_flags(dev, bar); 21 unsigned long flags = pci_resource_flags(dev, bar);
22 22
23 if (!len || !start) 23 if (!len || !start)
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index eaa79bc14d94..3efc0b73e4ff 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -32,6 +32,7 @@
32#include <linux/thread_info.h> 32#include <linux/thread_info.h>
33#include <linux/ptrace.h> 33#include <linux/ptrace.h>
34#include <linux/hardirq.h> 34#include <linux/hardirq.h>
35#include <linux/kbuild.h>
35 36
36#include <asm/pgtable.h> 37#include <asm/pgtable.h>
37#include <asm/ptrace.h> 38#include <asm/ptrace.h>
@@ -39,11 +40,6 @@
39#include <asm/pdc.h> 40#include <asm/pdc.h>
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41 42
42#define DEFINE(sym, val) \
43 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
44
45#define BLANK() asm volatile("\n->" : : )
46
47#ifdef CONFIG_64BIT 43#ifdef CONFIG_64BIT
48#define FRAME_SIZE 128 44#define FRAME_SIZE 128
49#else 45#else
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 9448d4e91142..ccd61b9567a6 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -397,10 +397,9 @@ pcxl_dma_init(void)
397 "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); 397 "pcxl_dma_init: Unable to create gsc /proc dir entry\n");
398 else { 398 else {
399 struct proc_dir_entry* ent; 399 struct proc_dir_entry* ent;
400 ent = create_proc_entry("pcxl_dma", 0, proc_gsc_root); 400 ent = proc_create("pcxl_dma", 0, proc_gsc_root,
401 if (ent) 401 &proc_pcxl_dma_ops);
402 ent->proc_fops = &proc_pcxl_dma_ops; 402 if (!ent)
403 else
404 printk(KERN_WARNING 403 printk(KERN_WARNING
405 "pci-dma.c: Unable to create pcxl_dma /proc entry.\n"); 404 "pci-dma.c: Unable to create pcxl_dma /proc entry.\n");
406 } 405 }
diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
index f4a811690ab3..9abed07db7fc 100644
--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -438,8 +438,8 @@ void ioport_unmap(void __iomem *addr)
438/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 438/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
439void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 439void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
440{ 440{
441 unsigned long start = pci_resource_start(dev, bar); 441 resource_size_t start = pci_resource_start(dev, bar);
442 unsigned long len = pci_resource_len(dev, bar); 442 resource_size_t len = pci_resource_len(dev, bar);
443 unsigned long flags = pci_resource_flags(dev, bar); 443 unsigned long flags = pci_resource_flags(dev, bar);
444 444
445 if (!len || !start) 445 if (!len || !start)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 62134845af08..59044e7ed6f4 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -30,6 +30,7 @@
30#include <linux/time.h> 30#include <linux/time.h>
31#include <linux/hardirq.h> 31#include <linux/hardirq.h>
32#endif 32#endif
33#include <linux/kbuild.h>
33 34
34#include <asm/io.h> 35#include <asm/io.h>
35#include <asm/page.h> 36#include <asm/page.h>
@@ -51,11 +52,6 @@
51#include <asm/iseries/alpaca.h> 52#include <asm/iseries/alpaca.h>
52#endif 53#endif
53 54
54#define DEFINE(sym, val) \
55 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
56
57#define BLANK() asm volatile("\n->" : : )
58
59int main(void) 55int main(void)
60{ 56{
61 DEFINE(THREAD, offsetof(struct task_struct, thread)); 57 DEFINE(THREAD, offsetof(struct task_struct, thread));
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 1ffacc698ffb..1e656b43ad7f 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -591,10 +591,8 @@ int __init lparcfg_init(void)
591 !firmware_has_feature(FW_FEATURE_ISERIES)) 591 !firmware_has_feature(FW_FEATURE_ISERIES))
592 mode |= S_IWUSR; 592 mode |= S_IWUSR;
593 593
594 ent = create_proc_entry("ppc64/lparcfg", mode, NULL); 594 ent = proc_create("ppc64/lparcfg", mode, NULL, &lparcfg_fops);
595 if (ent) { 595 if (!ent) {
596 ent->proc_fops = &lparcfg_fops;
597 } else {
598 printk(KERN_ERR "Failed to create ppc64/lparcfg\n"); 596 printk(KERN_ERR "Failed to create ppc64/lparcfg\n");
599 return -EIO; 597 return -EIO;
600 } 598 }
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c
index f78dfce1b771..c647ddef40dc 100644
--- a/arch/powerpc/kernel/proc_ppc64.c
+++ b/arch/powerpc/kernel/proc_ppc64.c
@@ -68,12 +68,11 @@ static int __init proc_ppc64_init(void)
68{ 68{
69 struct proc_dir_entry *pde; 69 struct proc_dir_entry *pde;
70 70
71 pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL); 71 pde = proc_create_data("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL,
72 &page_map_fops, vdso_data);
72 if (!pde) 73 if (!pde)
73 return 1; 74 return 1;
74 pde->data = vdso_data;
75 pde->size = PAGE_SIZE; 75 pde->size = PAGE_SIZE;
76 pde->proc_fops = &page_map_fops;
77 76
78 return 0; 77 return 0;
79} 78}
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index f2e3bc714d76..f9c6abc84a94 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -255,8 +255,6 @@ static void check_location(struct seq_file *m, const char *c);
255 255
256static int __init proc_rtas_init(void) 256static int __init proc_rtas_init(void)
257{ 257{
258 struct proc_dir_entry *entry;
259
260 if (!machine_is(pseries)) 258 if (!machine_is(pseries))
261 return -ENODEV; 259 return -ENODEV;
262 260
@@ -264,35 +262,20 @@ static int __init proc_rtas_init(void)
264 if (rtas_node == NULL) 262 if (rtas_node == NULL)
265 return -ENODEV; 263 return -ENODEV;
266 264
267 entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL); 265 proc_create("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL,
268 if (entry) 266 &ppc_rtas_progress_operations);
269 entry->proc_fops = &ppc_rtas_progress_operations; 267 proc_create("ppc64/rtas/clock", S_IRUGO|S_IWUSR, NULL,
270 268 &ppc_rtas_clock_operations);
271 entry = create_proc_entry("ppc64/rtas/clock", S_IRUGO|S_IWUSR, NULL); 269 proc_create("ppc64/rtas/poweron", S_IWUSR|S_IRUGO, NULL,
272 if (entry) 270 &ppc_rtas_poweron_operations);
273 entry->proc_fops = &ppc_rtas_clock_operations; 271 proc_create("ppc64/rtas/sensors", S_IRUGO, NULL,
274 272 &ppc_rtas_sensors_operations);
275 entry = create_proc_entry("ppc64/rtas/poweron", S_IWUSR|S_IRUGO, NULL); 273 proc_create("ppc64/rtas/frequency", S_IWUSR|S_IRUGO, NULL,
276 if (entry) 274 &ppc_rtas_tone_freq_operations);
277 entry->proc_fops = &ppc_rtas_poweron_operations; 275 proc_create("ppc64/rtas/volume", S_IWUSR|S_IRUGO, NULL,
278 276 &ppc_rtas_tone_volume_operations);
279 entry = create_proc_entry("ppc64/rtas/sensors", S_IRUGO, NULL); 277 proc_create("ppc64/rtas/rmo_buffer", S_IRUSR, NULL,
280 if (entry) 278 &ppc_rtas_rmo_buf_ops);
281 entry->proc_fops = &ppc_rtas_sensors_operations;
282
283 entry = create_proc_entry("ppc64/rtas/frequency", S_IWUSR|S_IRUGO,
284 NULL);
285 if (entry)
286 entry->proc_fops = &ppc_rtas_tone_freq_operations;
287
288 entry = create_proc_entry("ppc64/rtas/volume", S_IWUSR|S_IRUGO, NULL);
289 if (entry)
290 entry->proc_fops = &ppc_rtas_tone_volume_operations;
291
292 entry = create_proc_entry("ppc64/rtas/rmo_buffer", S_IRUSR, NULL);
293 if (entry)
294 entry->proc_fops = &ppc_rtas_rmo_buf_ops;
295
296 return 0; 279 return 0;
297} 280}
298 281
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 627f126d1848..0a5e22b22729 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -704,18 +704,11 @@ static int initialize_flash_pde_data(const char *rtas_call_name,
704static struct proc_dir_entry *create_flash_pde(const char *filename, 704static struct proc_dir_entry *create_flash_pde(const char *filename,
705 const struct file_operations *fops) 705 const struct file_operations *fops)
706{ 706{
707 struct proc_dir_entry *ent = NULL; 707 return proc_create(filename, S_IRUSR | S_IWUSR, NULL, fops);
708
709 ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL);
710 if (ent != NULL) {
711 ent->proc_fops = fops;
712 ent->owner = THIS_MODULE;
713 }
714
715 return ent;
716} 708}
717 709
718static const struct file_operations rtas_flash_operations = { 710static const struct file_operations rtas_flash_operations = {
711 .owner = THIS_MODULE,
719 .read = rtas_flash_read, 712 .read = rtas_flash_read,
720 .write = rtas_flash_write, 713 .write = rtas_flash_write,
721 .open = rtas_excl_open, 714 .open = rtas_excl_open,
@@ -723,6 +716,7 @@ static const struct file_operations rtas_flash_operations = {
723}; 716};
724 717
725static const struct file_operations manage_flash_operations = { 718static const struct file_operations manage_flash_operations = {
719 .owner = THIS_MODULE,
726 .read = manage_flash_read, 720 .read = manage_flash_read,
727 .write = manage_flash_write, 721 .write = manage_flash_write,
728 .open = rtas_excl_open, 722 .open = rtas_excl_open,
@@ -730,6 +724,7 @@ static const struct file_operations manage_flash_operations = {
730}; 724};
731 725
732static const struct file_operations validate_flash_operations = { 726static const struct file_operations validate_flash_operations = {
727 .owner = THIS_MODULE,
733 .read = validate_flash_read, 728 .read = validate_flash_read,
734 .write = validate_flash_write, 729 .write = validate_flash_write,
735 .open = rtas_excl_open, 730 .open = rtas_excl_open,
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 00528ef84ad2..45dcd2693502 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1063,10 +1063,9 @@ int __init spu_sched_init(void)
1063 1063
1064 mod_timer(&spuloadavg_timer, 0); 1064 mod_timer(&spuloadavg_timer, 0);
1065 1065
1066 entry = create_proc_entry("spu_loadavg", 0, NULL); 1066 entry = proc_create("spu_loadavg", 0, NULL, &spu_loadavg_fops);
1067 if (!entry) 1067 if (!entry)
1068 goto out_stop_kthread; 1068 goto out_stop_kthread;
1069 entry->proc_fops = &spu_loadavg_fops;
1070 1069
1071 pr_debug("spusched: tick: %d, min ticks: %d, default ticks: %d\n", 1070 pr_debug("spusched: tick: %d, min ticks: %d, default ticks: %d\n",
1072 SPUSCHED_TICK, MIN_SPU_TIMESLICE, DEF_SPU_TIMESLICE); 1071 SPUSCHED_TICK, MIN_SPU_TIMESLICE, DEF_SPU_TIMESLICE);
diff --git a/arch/powerpc/platforms/cell/spufs/sputrace.c b/arch/powerpc/platforms/cell/spufs/sputrace.c
index 79aa773f3c99..aea5286f1245 100644
--- a/arch/powerpc/platforms/cell/spufs/sputrace.c
+++ b/arch/powerpc/platforms/cell/spufs/sputrace.c
@@ -201,10 +201,9 @@ static int __init sputrace_init(void)
201 if (!sputrace_log) 201 if (!sputrace_log)
202 goto out; 202 goto out;
203 203
204 entry = create_proc_entry("sputrace", S_IRUSR, NULL); 204 entry = proc_create("sputrace", S_IRUSR, NULL, &sputrace_fops);
205 if (!entry) 205 if (!entry)
206 goto out_free_log; 206 goto out_free_log;
207 entry->proc_fops = &sputrace_fops;
208 207
209 for (i = 0; i < ARRAY_SIZE(spu_probes); i++) { 208 for (i = 0; i < ARRAY_SIZE(spu_probes); i++) {
210 struct spu_probe *p = &spu_probes[i]; 209 struct spu_probe *p = &spu_probes[i];
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index e5b40e3e0082..b0f8a857ec02 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -330,15 +330,11 @@ static const struct file_operations proc_lpevents_operations = {
330 330
331static int __init proc_lpevents_init(void) 331static int __init proc_lpevents_init(void)
332{ 332{
333 struct proc_dir_entry *e;
334
335 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 333 if (!firmware_has_feature(FW_FEATURE_ISERIES))
336 return 0; 334 return 0;
337 335
338 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL); 336 proc_create("iSeries/lpevents", S_IFREG|S_IRUGO, NULL,
339 if (e) 337 &proc_lpevents_operations);
340 e->proc_fops = &proc_lpevents_operations;
341
342 return 0; 338 return 0;
343} 339}
344__initcall(proc_lpevents_init); 340__initcall(proc_lpevents_init);
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index c0f2433bc16e..1dc7295746da 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -1255,11 +1255,11 @@ static int __init mf_proc_init(void)
1255 if (i == 3) /* no vmlinux entry for 'D' */ 1255 if (i == 3) /* no vmlinux entry for 'D' */
1256 continue; 1256 continue;
1257 1257
1258 ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf); 1258 ent = proc_create_data("vmlinux", S_IFREG|S_IWUSR, mf,
1259 &proc_vmlinux_operations,
1260 (void *)(long)i);
1259 if (!ent) 1261 if (!ent)
1260 return 1; 1262 return 1;
1261 ent->data = (void *)(long)i;
1262 ent->proc_fops = &proc_vmlinux_operations;
1263 } 1263 }
1264 1264
1265 ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); 1265 ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index f2cde4180204..91f4c6cd4b99 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -110,15 +110,11 @@ static const struct file_operations proc_titantod_operations = {
110 110
111static int __init iseries_proc_init(void) 111static int __init iseries_proc_init(void)
112{ 112{
113 struct proc_dir_entry *e;
114
115 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 113 if (!firmware_has_feature(FW_FEATURE_ISERIES))
116 return 0; 114 return 0;
117 115
118 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL); 116 proc_create("iSeries/titanTod", S_IFREG|S_IRUGO, NULL,
119 if (e) 117 &proc_titantod_operations);
120 e->proc_fops = &proc_titantod_operations;
121
122 return 0; 118 return 0;
123} 119}
124__initcall(iseries_proc_init); 120__initcall(iseries_proc_init);
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index df23331eb25c..49ff4dc422b7 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -180,15 +180,10 @@ static const struct file_operations proc_viopath_operations = {
180 180
181static int __init vio_proc_init(void) 181static int __init vio_proc_init(void)
182{ 182{
183 struct proc_dir_entry *e;
184
185 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 183 if (!firmware_has_feature(FW_FEATURE_ISERIES))
186 return 0; 184 return 0;
187 185
188 e = create_proc_entry("iSeries/config", 0, NULL); 186 proc_create("iSeries/config", 0, NULL, &proc_viopath_operations);
189 if (e)
190 e->proc_fops = &proc_viopath_operations;
191
192 return 0; 187 return 0;
193} 188}
194__initcall(vio_proc_init); 189__initcall(vio_proc_init);
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index a3fd56b186e6..6f544ba4b37f 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1259,14 +1259,8 @@ static const struct file_operations proc_eeh_operations = {
1259 1259
1260static int __init eeh_init_proc(void) 1260static int __init eeh_init_proc(void)
1261{ 1261{
1262 struct proc_dir_entry *e; 1262 if (machine_is(pseries))
1263 1263 proc_create("ppc64/eeh", 0, NULL, &proc_eeh_operations);
1264 if (machine_is(pseries)) {
1265 e = create_proc_entry("ppc64/eeh", 0, NULL);
1266 if (e)
1267 e->proc_fops = &proc_eeh_operations;
1268 }
1269
1270 return 0; 1264 return 0;
1271} 1265}
1272__initcall(eeh_init_proc); 1266__initcall(eeh_init_proc);
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index ac75c10de278..75769aae41d5 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -512,12 +512,9 @@ static int proc_ppc64_create_ofdt(void)
512 if (!machine_is(pseries)) 512 if (!machine_is(pseries))
513 return 0; 513 return 0;
514 514
515 ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); 515 ent = proc_create("ppc64/ofdt", S_IWUSR, NULL, &ofdt_fops);
516 if (ent) { 516 if (ent)
517 ent->data = NULL;
518 ent->size = 0; 517 ent->size = 0;
519 ent->proc_fops = &ofdt_fops;
520 }
521 518
522 return 0; 519 return 0;
523} 520}
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index befadd4f9524..7d3e2b0bd4d2 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -468,10 +468,9 @@ static int __init rtas_init(void)
468 return -ENOMEM; 468 return -ENOMEM;
469 } 469 }
470 470
471 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL); 471 entry = proc_create("ppc64/rtas/error_log", S_IRUSR, NULL,
472 if (entry) 472 &proc_rtas_log_operations);
473 entry->proc_fops = &proc_rtas_log_operations; 473 if (!entry)
474 else
475 printk(KERN_ERR "Failed to create error_log proc entry\n"); 474 printk(KERN_ERR "Failed to create error_log proc entry\n");
476 475
477 if (kernel_thread(rtasd, NULL, CLONE_FS) < 0) 476 if (kernel_thread(rtasd, NULL, CLONE_FS) < 0)
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index a51a17714231..8dcbdd6c2d2c 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -18,6 +18,8 @@
18#include <linux/suspend.h> 18#include <linux/suspend.h>
19#include <linux/mman.h> 19#include <linux/mman.h>
20#include <linux/mm.h> 20#include <linux/mm.h>
21#include <linux/kbuild.h>
22
21#include <asm/io.h> 23#include <asm/io.h>
22#include <asm/page.h> 24#include <asm/page.h>
23#include <asm/pgtable.h> 25#include <asm/pgtable.h>
@@ -26,11 +28,6 @@
26#include <asm/thread_info.h> 28#include <asm/thread_info.h>
27#include <asm/vdso_datapage.h> 29#include <asm/vdso_datapage.h>
28 30
29#define DEFINE(sym, val) \
30 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
31
32#define BLANK() asm volatile("\n->" : : )
33
34int 31int
35main(void) 32main(void)
36{ 33{
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 50ce83f20adb..df3ef6db072c 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -1121,8 +1121,8 @@ void __init pci_init_resource(struct resource *res, resource_size_t start,
1121 1121
1122void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) 1122void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
1123{ 1123{
1124 unsigned long start = pci_resource_start(dev, bar); 1124 resource_size_t start = pci_resource_start(dev, bar);
1125 unsigned long len = pci_resource_len(dev, bar); 1125 resource_size_t len = pci_resource_len(dev, bar);
1126 unsigned long flags = pci_resource_flags(dev, bar); 1126 unsigned long flags = pci_resource_flags(dev, bar);
1127 1127
1128 if (!len) 1128 if (!len)
diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c
index 0df6aacb8237..24f6e0694ac1 100644
--- a/arch/ppc/platforms/sbc82xx.c
+++ b/arch/ppc/platforms/sbc82xx.c
@@ -30,8 +30,6 @@ static void (*callback_init_IRQ)(void);
30 30
31extern unsigned char __res[sizeof(bd_t)]; 31extern unsigned char __res[sizeof(bd_t)];
32 32
33extern void (*late_time_init)(void);
34
35#ifdef CONFIG_GEN_RTC 33#ifdef CONFIG_GEN_RTC
36TODC_ALLOC(); 34TODC_ALLOC();
37 35
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index 1375f8a4469e..fa28ecae636b 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -5,44 +5,38 @@
5 */ 5 */
6 6
7#include <linux/sched.h> 7#include <linux/sched.h>
8 8#include <linux/kbuild.h>
9/* Use marker if you need to separate the values later */
10
11#define DEFINE(sym, val, marker) \
12 asm volatile("\n->" #sym " %0 " #val " " #marker : : "i" (val))
13
14#define BLANK() asm volatile("\n->" : : )
15 9
16int main(void) 10int main(void)
17{ 11{
18 DEFINE(__THREAD_info, offsetof(struct task_struct, stack),); 12 DEFINE(__THREAD_info, offsetof(struct task_struct, stack));
19 DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp),); 13 DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp));
20 DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info),); 14 DEFINE(__THREAD_per, offsetof(struct task_struct, thread.per_info));
21 DEFINE(__THREAD_mm_segment, 15 DEFINE(__THREAD_mm_segment,
22 offsetof(struct task_struct, thread.mm_segment),); 16 offsetof(struct task_struct, thread.mm_segment));
23 BLANK(); 17 BLANK();
24 DEFINE(__TASK_pid, offsetof(struct task_struct, pid),); 18 DEFINE(__TASK_pid, offsetof(struct task_struct, pid));
25 BLANK(); 19 BLANK();
26 DEFINE(__PER_atmid, offsetof(per_struct, lowcore.words.perc_atmid),); 20 DEFINE(__PER_atmid, offsetof(per_struct, lowcore.words.perc_atmid));
27 DEFINE(__PER_address, offsetof(per_struct, lowcore.words.address),); 21 DEFINE(__PER_address, offsetof(per_struct, lowcore.words.address));
28 DEFINE(__PER_access_id, offsetof(per_struct, lowcore.words.access_id),); 22 DEFINE(__PER_access_id, offsetof(per_struct, lowcore.words.access_id));
29 BLANK(); 23 BLANK();
30 DEFINE(__TI_task, offsetof(struct thread_info, task),); 24 DEFINE(__TI_task, offsetof(struct thread_info, task));
31 DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain),); 25 DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain));
32 DEFINE(__TI_flags, offsetof(struct thread_info, flags),); 26 DEFINE(__TI_flags, offsetof(struct thread_info, flags));
33 DEFINE(__TI_cpu, offsetof(struct thread_info, cpu),); 27 DEFINE(__TI_cpu, offsetof(struct thread_info, cpu));
34 DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count),); 28 DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count));
35 BLANK(); 29 BLANK();
36 DEFINE(__PT_ARGS, offsetof(struct pt_regs, args),); 30 DEFINE(__PT_ARGS, offsetof(struct pt_regs, args));
37 DEFINE(__PT_PSW, offsetof(struct pt_regs, psw),); 31 DEFINE(__PT_PSW, offsetof(struct pt_regs, psw));
38 DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs),); 32 DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs));
39 DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2),); 33 DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2));
40 DEFINE(__PT_ILC, offsetof(struct pt_regs, ilc),); 34 DEFINE(__PT_ILC, offsetof(struct pt_regs, ilc));
41 DEFINE(__PT_TRAP, offsetof(struct pt_regs, trap),); 35 DEFINE(__PT_TRAP, offsetof(struct pt_regs, trap));
42 DEFINE(__PT_SIZE, sizeof(struct pt_regs),); 36 DEFINE(__PT_SIZE, sizeof(struct pt_regs));
43 BLANK(); 37 BLANK();
44 DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain),); 38 DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain));
45 DEFINE(__SF_GPRS, offsetof(struct stack_frame, gprs),); 39 DEFINE(__SF_GPRS, offsetof(struct stack_frame, gprs));
46 DEFINE(__SF_EMPTY, offsetof(struct stack_frame, empty1),); 40 DEFINE(__SF_EMPTY, offsetof(struct stack_frame, empty1));
47 return 0; 41 return 0;
48} 42}
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index c36d8123ca14..c59a86dca584 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -60,8 +60,6 @@ init_IRQ(void)
60/* 60/*
61 * Switch to the asynchronous interrupt stack for softirq execution. 61 * Switch to the asynchronous interrupt stack for softirq execution.
62 */ 62 */
63extern void __do_softirq(void);
64
65asmlinkage void do_softirq(void) 63asmlinkage void do_softirq(void)
66{ 64{
67 unsigned long flags, old, new; 65 unsigned long flags, old, new;
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 49b435c3a57a..08d2e7325252 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -191,8 +191,8 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq)
191 191
192void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 192void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
193{ 193{
194 unsigned long start = pci_resource_start(dev, bar); 194 resource_size_t start = pci_resource_start(dev, bar);
195 unsigned long len = pci_resource_len(dev, bar); 195 resource_size_t len = pci_resource_len(dev, bar);
196 unsigned long flags = pci_resource_flags(dev, bar); 196 unsigned long flags = pci_resource_flags(dev, bar);
197 197
198 if (unlikely(!len || !start)) 198 if (unlikely(!len || !start))
diff --git a/arch/sh/kernel/asm-offsets.c b/arch/sh/kernel/asm-offsets.c
index dc6725c51a89..57cf0e0680f3 100644
--- a/arch/sh/kernel/asm-offsets.c
+++ b/arch/sh/kernel/asm-offsets.c
@@ -11,12 +11,9 @@
11#include <linux/stddef.h> 11#include <linux/stddef.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <asm/thread_info.h> 14#include <linux/kbuild.h>
15
16#define DEFINE(sym, val) \
17 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
18 15
19#define BLANK() asm volatile("\n->" : : ) 16#include <asm/thread_info.h>
20 17
21int main(void) 18int main(void)
22{ 19{
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 9bf19b00696a..a2a99e487e33 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -200,8 +200,6 @@ void irq_ctx_exit(int cpu)
200 hardirq_ctx[cpu] = NULL; 200 hardirq_ctx[cpu] = NULL;
201} 201}
202 202
203extern asmlinkage void __do_softirq(void);
204
205asmlinkage void do_softirq(void) 203asmlinkage void do_softirq(void)
206{ 204{
207 unsigned long flags; 205 unsigned long flags;
diff --git a/arch/sparc/kernel/asm-offsets.c b/arch/sparc/kernel/asm-offsets.c
index 6773ed76e414..cd3f7694e9b9 100644
--- a/arch/sparc/kernel/asm-offsets.c
+++ b/arch/sparc/kernel/asm-offsets.c
@@ -12,11 +12,7 @@
12 12
13#include <linux/sched.h> 13#include <linux/sched.h>
14// #include <linux/mm.h> 14// #include <linux/mm.h>
15 15#include <linux/kbuild.h>
16#define DEFINE(sym, val) \
17 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
18
19#define BLANK() asm volatile("\n->" : : )
20 16
21int foo(void) 17int foo(void)
22{ 18{
diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c
index 54501c1ca785..9ef37e13a920 100644
--- a/arch/sparc/lib/iomap.c
+++ b/arch/sparc/lib/iomap.c
@@ -21,8 +21,8 @@ EXPORT_SYMBOL(ioport_unmap);
21/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 21/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
22void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 22void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
23{ 23{
24 unsigned long start = pci_resource_start(dev, bar); 24 resource_size_t start = pci_resource_start(dev, bar);
25 unsigned long len = pci_resource_len(dev, bar); 25 resource_size_t len = pci_resource_len(dev, bar);
26 unsigned long flags = pci_resource_flags(dev, bar); 26 unsigned long flags = pci_resource_flags(dev, bar);
27 27
28 if (!len || !start) 28 if (!len || !start)
diff --git a/arch/sparc64/lib/iomap.c b/arch/sparc64/lib/iomap.c
index ac556db06973..7120ebbd4d03 100644
--- a/arch/sparc64/lib/iomap.c
+++ b/arch/sparc64/lib/iomap.c
@@ -21,8 +21,8 @@ EXPORT_SYMBOL(ioport_unmap);
21/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 21/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
22void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 22void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
23{ 23{
24 unsigned long start = pci_resource_start(dev, bar); 24 resource_size_t start = pci_resource_start(dev, bar);
25 unsigned long len = pci_resource_len(dev, bar); 25 resource_size_t len = pci_resource_len(dev, bar);
26 unsigned long flags = pci_resource_flags(dev, bar); 26 unsigned long flags = pci_resource_flags(dev, bar);
27 27
28 if (!len || !start) 28 if (!len || !start)
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index 984f80e668ca..6540d2c9fbb7 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -59,7 +59,7 @@ static int make_proc_exitcode(void)
59{ 59{
60 struct proc_dir_entry *ent; 60 struct proc_dir_entry *ent;
61 61
62 ent = create_proc_entry("exitcode", 0600, &proc_root); 62 ent = create_proc_entry("exitcode", 0600, NULL);
63 if (ent == NULL) { 63 if (ent == NULL) {
64 printk(KERN_WARNING "make_proc_exitcode : Failed to register " 64 printk(KERN_WARNING "make_proc_exitcode : Failed to register "
65 "/proc/exitcode\n"); 65 "/proc/exitcode\n");
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index e8cb9ff183e9..83603cfbde81 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -364,7 +364,7 @@ int __init make_proc_sysemu(void)
364 if (!sysemu_supported) 364 if (!sysemu_supported)
365 return 0; 365 return 0;
366 366
367 ent = create_proc_entry("sysemu", 0600, &proc_root); 367 ent = create_proc_entry("sysemu", 0600, NULL);
368 368
369 if (ent == NULL) 369 if (ent == NULL)
370 { 370 {
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index e066e84493b1..0d0cea2ac98d 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/clockchips.h> 6#include <linux/clockchips.h>
7#include <linux/init.h>
7#include <linux/interrupt.h> 8#include <linux/interrupt.h>
8#include <linux/jiffies.h> 9#include <linux/jiffies.h>
9#include <linux/threads.h> 10#include <linux/threads.h>
@@ -109,8 +110,6 @@ static void __init setup_itimer(void)
109 clockevents_register_device(&itimer_clockevent); 110 clockevents_register_device(&itimer_clockevent);
110} 111}
111 112
112extern void (*late_time_init)(void);
113
114void __init time_init(void) 113void __init time_init(void)
115{ 114{
116 long long nsecs; 115 long long nsecs;
diff --git a/arch/v850/kernel/asm-offsets.c b/arch/v850/kernel/asm-offsets.c
index cee5c3142d41..581e6986a776 100644
--- a/arch/v850/kernel/asm-offsets.c
+++ b/arch/v850/kernel/asm-offsets.c
@@ -13,14 +13,11 @@
13#include <linux/kernel_stat.h> 13#include <linux/kernel_stat.h>
14#include <linux/ptrace.h> 14#include <linux/ptrace.h>
15#include <linux/hardirq.h> 15#include <linux/hardirq.h>
16#include <linux/kbuild.h>
17
16#include <asm/irq.h> 18#include <asm/irq.h>
17#include <asm/errno.h> 19#include <asm/errno.h>
18 20
19#define DEFINE(sym, val) \
20 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
21
22#define BLANK() asm volatile("\n->" : : )
23
24int main (void) 21int main (void)
25{ 22{
26 /* offsets into the task struct */ 23 /* offsets into the task struct */
diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c
index 7165478824e7..687e367d8b64 100644
--- a/arch/v850/kernel/rte_mb_a_pci.c
+++ b/arch/v850/kernel/rte_mb_a_pci.c
@@ -790,8 +790,8 @@ pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr,
790 790
791void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max) 791void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max)
792{ 792{
793 unsigned long start = pci_resource_start (dev, bar); 793 resource_size_t start = pci_resource_start (dev, bar);
794 unsigned long len = pci_resource_len (dev, bar); 794 resource_size_t len = pci_resource_len (dev, bar);
795 795
796 if (!start || len == 0) 796 if (!start || len == 0)
797 return 0; 797 return 0;
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a12dbb2b93f3..f70e3e3a9fa7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -537,9 +537,6 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
537 Calgary anyway, pass 'iommu=calgary' on the kernel command line. 537 Calgary anyway, pass 'iommu=calgary' on the kernel command line.
538 If unsure, say Y. 538 If unsure, say Y.
539 539
540config IOMMU_HELPER
541 def_bool (CALGARY_IOMMU || GART_IOMMU)
542
543# need this always selected by IOMMU for the VIA workaround 540# need this always selected by IOMMU for the VIA workaround
544config SWIOTLB 541config SWIOTLB
545 bool 542 bool
@@ -550,6 +547,8 @@ config SWIOTLB
550 access 32-bits of memory can be used on systems with more than 547 access 32-bits of memory can be used on systems with more than
551 3 GB of memory. If unsure, say Y. 548 3 GB of memory. If unsure, say Y.
552 549
550config IOMMU_HELPER
551 def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB)
553 552
554config NR_CPUS 553config NR_CPUS
555 int "Maximum number of CPUs (2-255)" 554 int "Maximum number of CPUs (2-255)"
@@ -1505,6 +1504,10 @@ config PCI_GODIRECT
1505config PCI_GOANY 1504config PCI_GOANY
1506 bool "Any" 1505 bool "Any"
1507 1506
1507config PCI_GOOLPC
1508 bool "OLPC"
1509 depends on OLPC
1510
1508endchoice 1511endchoice
1509 1512
1510config PCI_BIOS 1513config PCI_BIOS
@@ -1514,12 +1517,17 @@ config PCI_BIOS
1514# x86-64 doesn't support PCI BIOS access from long mode so always go direct. 1517# x86-64 doesn't support PCI BIOS access from long mode so always go direct.
1515config PCI_DIRECT 1518config PCI_DIRECT
1516 def_bool y 1519 def_bool y
1517 depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY) || X86_VISWS) 1520 depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC) || X86_VISWS)
1518 1521
1519config PCI_MMCONFIG 1522config PCI_MMCONFIG
1520 def_bool y 1523 def_bool y
1521 depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY) 1524 depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
1522 1525
1526config PCI_OLPC
1527 bool
1528 depends on PCI && PCI_GOOLPC
1529 default y
1530
1523config PCI_DOMAINS 1531config PCI_DOMAINS
1524 def_bool y 1532 def_bool y
1525 depends on PCI 1533 depends on PCI
@@ -1639,6 +1647,13 @@ config GEODE_MFGPT_TIMER
1639 MFGPTs have a better resolution and max interval than the 1647 MFGPTs have a better resolution and max interval than the
1640 generic PIT, and are suitable for use as high-res timers. 1648 generic PIT, and are suitable for use as high-res timers.
1641 1649
1650config OLPC
1651 bool "One Laptop Per Child support"
1652 default n
1653 help
1654 Add support for detecting the unique features of the OLPC
1655 XO hardware.
1656
1642endif # X86_32 1657endif # X86_32
1643 1658
1644config K8_NB 1659config K8_NB
diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index d84a48ece785..03399d64013b 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -126,17 +126,25 @@ void query_edd(void)
126{ 126{
127 char eddarg[8]; 127 char eddarg[8];
128 int do_mbr = 1; 128 int do_mbr = 1;
129#ifdef CONFIG_EDD_OFF
130 int do_edd = 0;
131#else
129 int do_edd = 1; 132 int do_edd = 1;
133#endif
130 int be_quiet; 134 int be_quiet;
131 int devno; 135 int devno;
132 struct edd_info ei, *edp; 136 struct edd_info ei, *edp;
133 u32 *mbrptr; 137 u32 *mbrptr;
134 138
135 if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) { 139 if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
136 if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) 140 if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) {
141 do_edd = 1;
137 do_mbr = 0; 142 do_mbr = 0;
143 }
138 else if (!strcmp(eddarg, "off")) 144 else if (!strcmp(eddarg, "off"))
139 do_edd = 0; 145 do_edd = 0;
146 else if (!strcmp(eddarg, "on"))
147 do_edd = 1;
140 } 148 }
141 149
142 be_quiet = cmdline_find_option_bool("quiet"); 150 be_quiet = cmdline_find_option_bool("quiet");
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index fa19c3819540..350eb1b2a208 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -91,6 +91,8 @@ endif
91obj-$(CONFIG_SCx200) += scx200.o 91obj-$(CONFIG_SCx200) += scx200.o
92scx200-y += scx200_32.o 92scx200-y += scx200_32.o
93 93
94obj-$(CONFIG_OLPC) += olpc.o
95
94### 96###
95# 64 bit specific files 97# 64 bit specific files
96ifeq ($(CONFIG_X86_64),y) 98ifeq ($(CONFIG_X86_64),y)
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 670c3c311289..92588083950f 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -9,6 +9,7 @@
9#include <linux/signal.h> 9#include <linux/signal.h>
10#include <linux/personality.h> 10#include <linux/personality.h>
11#include <linux/suspend.h> 11#include <linux/suspend.h>
12#include <linux/kbuild.h>
12#include <asm/ucontext.h> 13#include <asm/ucontext.h>
13#include "sigframe.h" 14#include "sigframe.h"
14#include <asm/pgtable.h> 15#include <asm/pgtable.h>
@@ -23,14 +24,6 @@
23#include <linux/lguest.h> 24#include <linux/lguest.h>
24#include "../../../drivers/lguest/lg.h" 25#include "../../../drivers/lguest/lg.h"
25 26
26#define DEFINE(sym, val) \
27 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
28
29#define BLANK() asm volatile("\n->" : : )
30
31#define OFFSET(sym, str, mem) \
32 DEFINE(sym, offsetof(struct str, mem));
33
34/* workaround for a warning with -Wmissing-prototypes */ 27/* workaround for a warning with -Wmissing-prototypes */
35void foo(void); 28void foo(void);
36 29
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 494e1e096ee6..f126c05d6170 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -10,6 +10,7 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/suspend.h> 12#include <linux/suspend.h>
13#include <linux/kbuild.h>
13#include <asm/pda.h> 14#include <asm/pda.h>
14#include <asm/processor.h> 15#include <asm/processor.h>
15#include <asm/segment.h> 16#include <asm/segment.h>
@@ -17,14 +18,6 @@
17#include <asm/ia32.h> 18#include <asm/ia32.h>
18#include <asm/bootparam.h> 19#include <asm/bootparam.h>
19 20
20#define DEFINE(sym, val) \
21 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
22
23#define BLANK() asm volatile("\n->" : : )
24
25#define OFFSET(sym, str, mem) \
26 DEFINE(sym, offsetof(struct str, mem))
27
28#define __NO_STUBS 1 21#define __NO_STUBS 1
29#undef __SYSCALL 22#undef __SYSCALL
30#undef _ASM_X86_64_UNISTD_H_ 23#undef _ASM_X86_64_UNISTD_H_
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index 1960f1985e5e..84c480bb3715 100644
--- a/arch/x86/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
@@ -424,7 +424,7 @@ static int __init mtrr_if_init(void)
424 return -ENODEV; 424 return -ENODEV;
425 425
426 proc_root_mtrr = 426 proc_root_mtrr =
427 proc_create("mtrr", S_IWUSR | S_IRUGO, &proc_root, &mtrr_fops); 427 proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
428 428
429 if (proc_root_mtrr) 429 if (proc_root_mtrr)
430 proc_root_mtrr->owner = THIS_MODULE; 430 proc_root_mtrr->owner = THIS_MODULE;
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 00bda7bcda63..147352df28b9 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -190,8 +190,6 @@ void irq_ctx_exit(int cpu)
190 hardirq_ctx[cpu] = NULL; 190 hardirq_ctx[cpu] = NULL;
191} 191}
192 192
193extern asmlinkage void __do_softirq(void);
194
195asmlinkage void do_softirq(void) 193asmlinkage void do_softirq(void)
196{ 194{
197 unsigned long flags; 195 unsigned long flags;
diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c
new file mode 100644
index 000000000000..3e6672274807
--- /dev/null
+++ b/arch/x86/kernel/olpc.c
@@ -0,0 +1,260 @@
1/*
2 * Support for the OLPC DCON and OLPC EC access
3 *
4 * Copyright © 2006 Advanced Micro Devices, Inc.
5 * Copyright © 2007-2008 Andres Salomon <dilinger@debian.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/delay.h>
17#include <linux/spinlock.h>
18#include <linux/io.h>
19#include <linux/string.h>
20#include <asm/geode.h>
21#include <asm/olpc.h>
22
23#ifdef CONFIG_OPEN_FIRMWARE
24#include <asm/ofw.h>
25#endif
26
27struct olpc_platform_t olpc_platform_info;
28EXPORT_SYMBOL_GPL(olpc_platform_info);
29
30static DEFINE_SPINLOCK(ec_lock);
31
32/* what the timeout *should* be (in ms) */
33#define EC_BASE_TIMEOUT 20
34
35/* the timeout that bugs in the EC might force us to actually use */
36static int ec_timeout = EC_BASE_TIMEOUT;
37
38static int __init olpc_ec_timeout_set(char *str)
39{
40 if (get_option(&str, &ec_timeout) != 1) {
41 ec_timeout = EC_BASE_TIMEOUT;
42 printk(KERN_ERR "olpc-ec: invalid argument to "
43 "'olpc_ec_timeout=', ignoring!\n");
44 }
45 printk(KERN_DEBUG "olpc-ec: using %d ms delay for EC commands.\n",
46 ec_timeout);
47 return 1;
48}
49__setup("olpc_ec_timeout=", olpc_ec_timeout_set);
50
51/*
52 * These {i,o}bf_status functions return whether the buffers are full or not.
53 */
54
55static inline unsigned int ibf_status(unsigned int port)
56{
57 return !!(inb(port) & 0x02);
58}
59
60static inline unsigned int obf_status(unsigned int port)
61{
62 return inb(port) & 0x01;
63}
64
65#define wait_on_ibf(p, d) __wait_on_ibf(__LINE__, (p), (d))
66static int __wait_on_ibf(unsigned int line, unsigned int port, int desired)
67{
68 unsigned int timeo;
69 int state = ibf_status(port);
70
71 for (timeo = ec_timeout; state != desired && timeo; timeo--) {
72 mdelay(1);
73 state = ibf_status(port);
74 }
75
76 if ((state == desired) && (ec_timeout > EC_BASE_TIMEOUT) &&
77 timeo < (ec_timeout - EC_BASE_TIMEOUT)) {
78 printk(KERN_WARNING "olpc-ec: %d: waited %u ms for IBF!\n",
79 line, ec_timeout - timeo);
80 }
81
82 return !(state == desired);
83}
84
85#define wait_on_obf(p, d) __wait_on_obf(__LINE__, (p), (d))
86static int __wait_on_obf(unsigned int line, unsigned int port, int desired)
87{
88 unsigned int timeo;
89 int state = obf_status(port);
90
91 for (timeo = ec_timeout; state != desired && timeo; timeo--) {
92 mdelay(1);
93 state = obf_status(port);
94 }
95
96 if ((state == desired) && (ec_timeout > EC_BASE_TIMEOUT) &&
97 timeo < (ec_timeout - EC_BASE_TIMEOUT)) {
98 printk(KERN_WARNING "olpc-ec: %d: waited %u ms for OBF!\n",
99 line, ec_timeout - timeo);
100 }
101
102 return !(state == desired);
103}
104
105/*
106 * This allows the kernel to run Embedded Controller commands. The EC is
107 * documented at <http://wiki.laptop.org/go/Embedded_controller>, and the
108 * available EC commands are here:
109 * <http://wiki.laptop.org/go/Ec_specification>. Unfortunately, while
110 * OpenFirmware's source is available, the EC's is not.
111 */
112int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
113 unsigned char *outbuf, size_t outlen)
114{
115 unsigned long flags;
116 int ret = -EIO;
117 int i;
118
119 spin_lock_irqsave(&ec_lock, flags);
120
121 /* Clear OBF */
122 for (i = 0; i < 10 && (obf_status(0x6c) == 1); i++)
123 inb(0x68);
124 if (i == 10) {
125 printk(KERN_ERR "olpc-ec: timeout while attempting to "
126 "clear OBF flag!\n");
127 goto err;
128 }
129
130 if (wait_on_ibf(0x6c, 0)) {
131 printk(KERN_ERR "olpc-ec: timeout waiting for EC to "
132 "quiesce!\n");
133 goto err;
134 }
135
136restart:
137 /*
138 * Note that if we time out during any IBF checks, that's a failure;
139 * we have to return. There's no way for the kernel to clear that.
140 *
141 * If we time out during an OBF check, we can restart the command;
142 * reissuing it will clear the OBF flag, and we should be alright.
143 * The OBF flag will sometimes misbehave due to what we believe
144 * is a hardware quirk..
145 */
146 printk(KERN_DEBUG "olpc-ec: running cmd 0x%x\n", cmd);
147 outb(cmd, 0x6c);
148
149 if (wait_on_ibf(0x6c, 0)) {
150 printk(KERN_ERR "olpc-ec: timeout waiting for EC to read "
151 "command!\n");
152 goto err;
153 }
154
155 if (inbuf && inlen) {
156 /* write data to EC */
157 for (i = 0; i < inlen; i++) {
158 if (wait_on_ibf(0x6c, 0)) {
159 printk(KERN_ERR "olpc-ec: timeout waiting for"
160 " EC accept data!\n");
161 goto err;
162 }
163 printk(KERN_DEBUG "olpc-ec: sending cmd arg 0x%x\n",
164 inbuf[i]);
165 outb(inbuf[i], 0x68);
166 }
167 }
168 if (outbuf && outlen) {
169 /* read data from EC */
170 for (i = 0; i < outlen; i++) {
171 if (wait_on_obf(0x6c, 1)) {
172 printk(KERN_ERR "olpc-ec: timeout waiting for"
173 " EC to provide data!\n");
174 goto restart;
175 }
176 outbuf[i] = inb(0x68);
177 printk(KERN_DEBUG "olpc-ec: received 0x%x\n",
178 outbuf[i]);
179 }
180 }
181
182 ret = 0;
183err:
184 spin_unlock_irqrestore(&ec_lock, flags);
185 return ret;
186}
187EXPORT_SYMBOL_GPL(olpc_ec_cmd);
188
189#ifdef CONFIG_OPEN_FIRMWARE
190static void __init platform_detect(void)
191{
192 size_t propsize;
193 u32 rev;
194
195 if (ofw("getprop", 4, 1, NULL, "board-revision-int", &rev, 4,
196 &propsize) || propsize != 4) {
197 printk(KERN_ERR "ofw: getprop call failed!\n");
198 rev = 0;
199 }
200 olpc_platform_info.boardrev = be32_to_cpu(rev);
201}
202#else
203static void __init platform_detect(void)
204{
205 /* stopgap until OFW support is added to the kernel */
206 olpc_platform_info.boardrev = be32_to_cpu(0xc2);
207}
208#endif
209
210static int __init olpc_init(void)
211{
212 unsigned char *romsig;
213
214 /* The ioremap check is dangerous; limit what we run it on */
215 if (!is_geode() || geode_has_vsa2())
216 return 0;
217
218 spin_lock_init(&ec_lock);
219
220 romsig = ioremap(0xffffffc0, 16);
221 if (!romsig)
222 return 0;
223
224 if (strncmp(romsig, "CL1 Q", 7))
225 goto unmap;
226 if (strncmp(romsig+6, romsig+13, 3)) {
227 printk(KERN_INFO "OLPC BIOS signature looks invalid. "
228 "Assuming not OLPC\n");
229 goto unmap;
230 }
231
232 printk(KERN_INFO "OLPC board with OpenFirmware %.16s\n", romsig);
233 olpc_platform_info.flags |= OLPC_F_PRESENT;
234
235 /* get the platform revision */
236 platform_detect();
237
238 /* assume B1 and above models always have a DCON */
239 if (olpc_board_at_least(olpc_board(0xb1)))
240 olpc_platform_info.flags |= OLPC_F_DCON;
241
242 /* get the EC revision */
243 olpc_ec_cmd(EC_FIRMWARE_REV, NULL, 0,
244 (unsigned char *) &olpc_platform_info.ecver, 1);
245
246 /* check to see if the VSA exists */
247 if (geode_has_vsa2())
248 olpc_platform_info.flags |= OLPC_F_VSA;
249
250 printk(KERN_INFO "OLPC board revision %s%X (EC=%x)\n",
251 ((olpc_platform_info.boardrev & 0xf) < 8) ? "pre" : "",
252 olpc_platform_info.boardrev >> 4,
253 olpc_platform_info.ecver);
254
255unmap:
256 iounmap(romsig);
257 return 0;
258}
259
260postcore_initcall(olpc_init);
diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c
index 1a89e93f3f1c..2ff21f398934 100644
--- a/arch/x86/kernel/time_32.c
+++ b/arch/x86/kernel/time_32.c
@@ -115,7 +115,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
115 return IRQ_HANDLED; 115 return IRQ_HANDLED;
116} 116}
117 117
118extern void (*late_time_init)(void);
119/* Duplicate of time_init() below, with hpet_enable part added */ 118/* Duplicate of time_init() below, with hpet_enable part added */
120void __init hpet_time_init(void) 119void __init hpet_time_init(void)
121{ 120{
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index b7ab3c335fae..fad3674b06a5 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -209,12 +209,6 @@ SECTIONS
209 EXIT_DATA 209 EXIT_DATA
210 } 210 }
211 211
212/* vdso blob that is mapped into user space */
213 vdso_start = . ;
214 .vdso : AT(ADDR(.vdso) - LOAD_OFFSET) { *(.vdso) }
215 . = ALIGN(PAGE_SIZE);
216 vdso_end = .;
217
218#ifdef CONFIG_BLK_DEV_INITRD 212#ifdef CONFIG_BLK_DEV_INITRD
219 . = ALIGN(PAGE_SIZE); 213 . = ALIGN(PAGE_SIZE);
220 __initramfs_start = .; 214 __initramfs_start = .;
diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32
index cdd6828b5abb..b859047a6376 100644
--- a/arch/x86/pci/Makefile_32
+++ b/arch/x86/pci/Makefile_32
@@ -3,6 +3,7 @@ obj-y := i386.o init.o
3obj-$(CONFIG_PCI_BIOS) += pcbios.o 3obj-$(CONFIG_PCI_BIOS) += pcbios.o
4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_32.o direct.o mmconfig-shared.o 4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_32.o direct.o mmconfig-shared.o
5obj-$(CONFIG_PCI_DIRECT) += direct.o 5obj-$(CONFIG_PCI_DIRECT) += direct.o
6obj-$(CONFIG_PCI_OLPC) += olpc.o
6 7
7pci-y := fixup.o 8pci-y := fixup.o
8pci-$(CONFIG_ACPI) += acpi.o 9pci-$(CONFIG_ACPI) += acpi.o
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
index 3de9f9ba2da6..0f5f7dd2a620 100644
--- a/arch/x86/pci/init.c
+++ b/arch/x86/pci/init.c
@@ -14,6 +14,9 @@ static __init int pci_access_init(void)
14#ifdef CONFIG_PCI_MMCONFIG 14#ifdef CONFIG_PCI_MMCONFIG
15 pci_mmcfg_init(type); 15 pci_mmcfg_init(type);
16#endif 16#endif
17#ifdef CONFIG_PCI_OLPC
18 pci_olpc_init();
19#endif
17 if (raw_pci_ops) 20 if (raw_pci_ops)
18 return 0; 21 return 0;
19#ifdef CONFIG_PCI_BIOS 22#ifdef CONFIG_PCI_BIOS
diff --git a/arch/x86/pci/olpc.c b/arch/x86/pci/olpc.c
new file mode 100644
index 000000000000..5e7636558c02
--- /dev/null
+++ b/arch/x86/pci/olpc.c
@@ -0,0 +1,313 @@
1/*
2 * Low-level PCI config space access for OLPC systems who lack the VSA
3 * PCI virtualization software.
4 *
5 * Copyright © 2006 Advanced Micro Devices, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * The AMD Geode chipset (ie: GX2 processor, cs5536 I/O companion device)
13 * has some I/O functions (display, southbridge, sound, USB HCIs, etc)
14 * that more or less behave like PCI devices, but the hardware doesn't
15 * directly implement the PCI configuration space headers. AMD provides
16 * "VSA" (Virtual System Architecture) software that emulates PCI config
17 * space for these devices, by trapping I/O accesses to PCI config register
18 * (CF8/CFC) and running some code in System Management Mode interrupt state.
19 * On the OLPC platform, we don't want to use that VSA code because
20 * (a) it slows down suspend/resume, and (b) recompiling it requires special
21 * compilers that are hard to get. So instead of letting the complex VSA
22 * code simulate the PCI config registers for the on-chip devices, we
23 * just simulate them the easy way, by inserting the code into the
24 * pci_write_config and pci_read_config path. Most of the config registers
25 * are read-only anyway, so the bulk of the simulation is just table lookup.
26 */
27
28#include <linux/pci.h>
29#include <linux/init.h>
30#include <asm/olpc.h>
31#include <asm/geode.h>
32#include "pci.h"
33
34/*
35 * In the tables below, the first two line (8 longwords) are the
36 * size masks that are used when the higher level PCI code determines
37 * the size of the region by writing ~0 to a base address register
38 * and reading back the result.
39 *
40 * The following lines are the values that are read during normal
41 * PCI config access cycles, i.e. not after just having written
42 * ~0 to a base address register.
43 */
44
45static const uint32_t lxnb_hdr[] = { /* dev 1 function 0 - devfn = 8 */
46 0x0, 0x0, 0x0, 0x0,
47 0x0, 0x0, 0x0, 0x0,
48
49 0x281022, 0x2200005, 0x6000021, 0x80f808, /* AMD Vendor ID */
50 0x0, 0x0, 0x0, 0x0, /* No virtual registers, hence no BAR */
51 0x0, 0x0, 0x0, 0x28100b,
52 0x0, 0x0, 0x0, 0x0,
53 0x0, 0x0, 0x0, 0x0,
54 0x0, 0x0, 0x0, 0x0,
55 0x0, 0x0, 0x0, 0x0,
56};
57
58static const uint32_t gxnb_hdr[] = { /* dev 1 function 0 - devfn = 8 */
59 0xfffffffd, 0x0, 0x0, 0x0,
60 0x0, 0x0, 0x0, 0x0,
61
62 0x28100b, 0x2200005, 0x6000021, 0x80f808, /* NSC Vendor ID */
63 0xac1d, 0x0, 0x0, 0x0, /* I/O BAR - base of virtual registers */
64 0x0, 0x0, 0x0, 0x28100b,
65 0x0, 0x0, 0x0, 0x0,
66 0x0, 0x0, 0x0, 0x0,
67 0x0, 0x0, 0x0, 0x0,
68 0x0, 0x0, 0x0, 0x0,
69};
70
71static const uint32_t lxfb_hdr[] = { /* dev 1 function 1 - devfn = 9 */
72 0xff000008, 0xffffc000, 0xffffc000, 0xffffc000,
73 0xffffc000, 0x0, 0x0, 0x0,
74
75 0x20811022, 0x2200003, 0x3000000, 0x0, /* AMD Vendor ID */
76 0xfd000000, 0xfe000000, 0xfe004000, 0xfe008000, /* FB, GP, VG, DF */
77 0xfe00c000, 0x0, 0x0, 0x30100b, /* VIP */
78 0x0, 0x0, 0x0, 0x10e, /* INTA, IRQ14 for graphics accel */
79 0x0, 0x0, 0x0, 0x0,
80 0x3d0, 0x3c0, 0xa0000, 0x0, /* VG IO, VG IO, EGA FB, MONO FB */
81 0x0, 0x0, 0x0, 0x0,
82};
83
84static const uint32_t gxfb_hdr[] = { /* dev 1 function 1 - devfn = 9 */
85 0xff800008, 0xffffc000, 0xffffc000, 0xffffc000,
86 0x0, 0x0, 0x0, 0x0,
87
88 0x30100b, 0x2200003, 0x3000000, 0x0, /* NSC Vendor ID */
89 0xfd000000, 0xfe000000, 0xfe004000, 0xfe008000, /* FB, GP, VG, DF */
90 0x0, 0x0, 0x0, 0x30100b,
91 0x0, 0x0, 0x0, 0x0,
92 0x0, 0x0, 0x0, 0x0,
93 0x3d0, 0x3c0, 0xa0000, 0x0, /* VG IO, VG IO, EGA FB, MONO FB */
94 0x0, 0x0, 0x0, 0x0,
95};
96
97static const uint32_t aes_hdr[] = { /* dev 1 function 2 - devfn = 0xa */
98 0xffffc000, 0x0, 0x0, 0x0,
99 0x0, 0x0, 0x0, 0x0,
100
101 0x20821022, 0x2a00006, 0x10100000, 0x8, /* NSC Vendor ID */
102 0xfe010000, 0x0, 0x0, 0x0, /* AES registers */
103 0x0, 0x0, 0x0, 0x20821022,
104 0x0, 0x0, 0x0, 0x0,
105 0x0, 0x0, 0x0, 0x0,
106 0x0, 0x0, 0x0, 0x0,
107 0x0, 0x0, 0x0, 0x0,
108};
109
110
111static const uint32_t isa_hdr[] = { /* dev f function 0 - devfn = 78 */
112 0xfffffff9, 0xffffff01, 0xffffffc1, 0xffffffe1,
113 0xffffff81, 0xffffffc1, 0x0, 0x0,
114
115 0x20901022, 0x2a00049, 0x6010003, 0x802000,
116 0x18b1, 0x1001, 0x1801, 0x1881, /* SMB-8 GPIO-256 MFGPT-64 IRQ-32 */
117 0x1401, 0x1841, 0x0, 0x20901022, /* PMS-128 ACPI-64 */
118 0x0, 0x0, 0x0, 0x0,
119 0x0, 0x0, 0x0, 0x0,
120 0x0, 0x0, 0x0, 0xaa5b, /* IRQ steering */
121 0x0, 0x0, 0x0, 0x0,
122};
123
124static const uint32_t ac97_hdr[] = { /* dev f function 3 - devfn = 7b */
125 0xffffff81, 0x0, 0x0, 0x0,
126 0x0, 0x0, 0x0, 0x0,
127
128 0x20931022, 0x2a00041, 0x4010001, 0x0,
129 0x1481, 0x0, 0x0, 0x0, /* I/O BAR-128 */
130 0x0, 0x0, 0x0, 0x20931022,
131 0x0, 0x0, 0x0, 0x205, /* IntB, IRQ5 */
132 0x0, 0x0, 0x0, 0x0,
133 0x0, 0x0, 0x0, 0x0,
134 0x0, 0x0, 0x0, 0x0,
135};
136
137static const uint32_t ohci_hdr[] = { /* dev f function 4 - devfn = 7c */
138 0xfffff000, 0x0, 0x0, 0x0,
139 0x0, 0x0, 0x0, 0x0,
140
141 0x20941022, 0x2300006, 0xc031002, 0x0,
142 0xfe01a000, 0x0, 0x0, 0x0, /* MEMBAR-1000 */
143 0x0, 0x0, 0x0, 0x20941022,
144 0x0, 0x40, 0x0, 0x40a, /* CapPtr INT-D, IRQA */
145 0xc8020001, 0x0, 0x0, 0x0, /* Capabilities - 40 is R/O,
146 44 is mask 8103 (power control) */
147 0x0, 0x0, 0x0, 0x0,
148 0x0, 0x0, 0x0, 0x0,
149};
150
151static const uint32_t ehci_hdr[] = { /* dev f function 4 - devfn = 7d */
152 0xfffff000, 0x0, 0x0, 0x0,
153 0x0, 0x0, 0x0, 0x0,
154
155 0x20951022, 0x2300006, 0xc032002, 0x0,
156 0xfe01b000, 0x0, 0x0, 0x0, /* MEMBAR-1000 */
157 0x0, 0x0, 0x0, 0x20951022,
158 0x0, 0x40, 0x0, 0x40a, /* CapPtr INT-D, IRQA */
159 0xc8020001, 0x0, 0x0, 0x0, /* Capabilities - 40 is R/O, 44 is
160 mask 8103 (power control) */
161#if 0
162 0x1, 0x40080000, 0x0, 0x0, /* EECP - see EHCI spec section 2.1.7 */
163#endif
164 0x01000001, 0x0, 0x0, 0x0, /* EECP - see EHCI spec section 2.1.7 */
165 0x2020, 0x0, 0x0, 0x0, /* (EHCI page 8) 60 SBRN (R/O),
166 61 FLADJ (R/W), PORTWAKECAP */
167};
168
169static uint32_t ff_loc = ~0;
170static uint32_t zero_loc;
171static int bar_probing; /* Set after a write of ~0 to a BAR */
172static int is_lx;
173
174#define NB_SLOT 0x1 /* Northbridge - GX chip - Device 1 */
175#define SB_SLOT 0xf /* Southbridge - CS5536 chip - Device F */
176
177static int is_simulated(unsigned int bus, unsigned int devfn)
178{
179 return (!bus && ((PCI_SLOT(devfn) == NB_SLOT) ||
180 (PCI_SLOT(devfn) == SB_SLOT)));
181}
182
183static uint32_t *hdr_addr(const uint32_t *hdr, int reg)
184{
185 uint32_t addr;
186
187 /*
188 * This is a little bit tricky. The header maps consist of
189 * 0x20 bytes of size masks, followed by 0x70 bytes of header data.
190 * In the normal case, when not probing a BAR's size, we want
191 * to access the header data, so we add 0x20 to the reg offset,
192 * thus skipping the size mask area.
193 * In the BAR probing case, we want to access the size mask for
194 * the BAR, so we subtract 0x10 (the config header offset for
195 * BAR0), and don't skip the size mask area.
196 */
197
198 addr = (uint32_t)hdr + reg + (bar_probing ? -0x10 : 0x20);
199
200 bar_probing = 0;
201 return (uint32_t *)addr;
202}
203
204static int pci_olpc_read(unsigned int seg, unsigned int bus,
205 unsigned int devfn, int reg, int len, uint32_t *value)
206{
207 uint32_t *addr;
208
209 /* Use the hardware mechanism for non-simulated devices */
210 if (!is_simulated(bus, devfn))
211 return pci_direct_conf1.read(seg, bus, devfn, reg, len, value);
212
213 /*
214 * No device has config registers past 0x70, so we save table space
215 * by not storing entries for the nonexistent registers
216 */
217 if (reg >= 0x70)
218 addr = &zero_loc;
219 else {
220 switch (devfn) {
221 case 0x8:
222 addr = hdr_addr(is_lx ? lxnb_hdr : gxnb_hdr, reg);
223 break;
224 case 0x9:
225 addr = hdr_addr(is_lx ? lxfb_hdr : gxfb_hdr, reg);
226 break;
227 case 0xa:
228 addr = is_lx ? hdr_addr(aes_hdr, reg) : &ff_loc;
229 break;
230 case 0x78:
231 addr = hdr_addr(isa_hdr, reg);
232 break;
233 case 0x7b:
234 addr = hdr_addr(ac97_hdr, reg);
235 break;
236 case 0x7c:
237 addr = hdr_addr(ohci_hdr, reg);
238 break;
239 case 0x7d:
240 addr = hdr_addr(ehci_hdr, reg);
241 break;
242 default:
243 addr = &ff_loc;
244 break;
245 }
246 }
247 switch (len) {
248 case 1:
249 *value = *(uint8_t *)addr;
250 break;
251 case 2:
252 *value = *(uint16_t *)addr;
253 break;
254 case 4:
255 *value = *addr;
256 break;
257 default:
258 BUG();
259 }
260
261 return 0;
262}
263
264static int pci_olpc_write(unsigned int seg, unsigned int bus,
265 unsigned int devfn, int reg, int len, uint32_t value)
266{
267 /* Use the hardware mechanism for non-simulated devices */
268 if (!is_simulated(bus, devfn))
269 return pci_direct_conf1.write(seg, bus, devfn, reg, len, value);
270
271 /* XXX we may want to extend this to simulate EHCI power management */
272
273 /*
274 * Mostly we just discard writes, but if the write is a size probe
275 * (i.e. writing ~0 to a BAR), we remember it and arrange to return
276 * the appropriate size mask on the next read. This is cheating
277 * to some extent, because it depends on the fact that the next
278 * access after such a write will always be a read to the same BAR.
279 */
280
281 if ((reg >= 0x10) && (reg < 0x2c)) {
282 /* write is to a BAR */
283 if (value == ~0)
284 bar_probing = 1;
285 } else {
286 /*
287 * No warning on writes to ROM BAR, CMD, LATENCY_TIMER,
288 * CACHE_LINE_SIZE, or PM registers.
289 */
290 if ((reg != PCI_ROM_ADDRESS) && (reg != PCI_COMMAND_MASTER) &&
291 (reg != PCI_LATENCY_TIMER) &&
292 (reg != PCI_CACHE_LINE_SIZE) && (reg != 0x44))
293 printk(KERN_WARNING "OLPC PCI: Config write to devfn"
294 " %x reg %x value %x\n", devfn, reg, value);
295 }
296
297 return 0;
298}
299
300static struct pci_raw_ops pci_olpc_conf = {
301 .read = pci_olpc_read,
302 .write = pci_olpc_write,
303};
304
305void __init pci_olpc_init(void)
306{
307 if (!machine_is_olpc() || olpc_has_vsa())
308 return;
309
310 printk(KERN_INFO "PCI: Using configuration type OLPC\n");
311 raw_pci_ops = &pci_olpc_conf;
312 is_lx = is_geode_lx();
313}
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index c4bddaeff619..7d84e813e958 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -98,6 +98,7 @@ extern int pci_direct_probe(void);
98extern void pci_direct_init(int type); 98extern void pci_direct_init(int type);
99extern void pci_pcbios_init(void); 99extern void pci_pcbios_init(void);
100extern void pci_mmcfg_init(int type); 100extern void pci_mmcfg_init(int type);
101extern void pci_olpc_init(void);
101 102
102/* pci-mmconfig.c */ 103/* pci-mmconfig.c */
103 104
diff --git a/arch/x86/vdso/vdso.S b/arch/x86/vdso/vdso.S
index 4b1620a1529e..1d3aa6b87181 100644
--- a/arch/x86/vdso/vdso.S
+++ b/arch/x86/vdso/vdso.S
@@ -1,2 +1,10 @@
1 .section ".vdso","a" 1#include <linux/init.h>
2
3__INITDATA
4
5 .globl vdso_start, vdso_end
6vdso_start:
2 .incbin "arch/x86/vdso/vdso.so" 7 .incbin "arch/x86/vdso/vdso.so"
8vdso_end:
9
10__FINIT
diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c
index ef63adadf7f4..070ff8af3a21 100644
--- a/arch/xtensa/kernel/asm-offsets.c
+++ b/arch/xtensa/kernel/asm-offsets.c
@@ -19,12 +19,11 @@
19#include <linux/thread_info.h> 19#include <linux/thread_info.h>
20#include <linux/ptrace.h> 20#include <linux/ptrace.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/kbuild.h>
22 23
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25 26
26#define DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
27
28int main(void) 27int main(void)
29{ 28{
30 /* struct pt_regs */ 29 /* struct pt_regs */