aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/lib
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/parisc/lib
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/parisc/lib')
-rw-r--r--arch/parisc/lib/bitops.c1
-rw-r--r--arch/parisc/lib/iomap.c24
-rw-r--r--arch/parisc/lib/lusercopy.S41
3 files changed, 65 insertions, 1 deletions
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index 187118841af..a8bffd8af77 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -8,6 +8,7 @@
8 8
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/spinlock.h> 10#include <linux/spinlock.h>
11#include <asm/system.h>
11#include <linux/atomic.h> 12#include <linux/atomic.h>
12 13
13#ifdef CONFIG_SMP 14#ifdef CONFIG_SMP
diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
index fb8e10a4fb3..5069e8b2ca7 100644
--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -5,7 +5,6 @@
5 5
6#include <linux/ioport.h> 6#include <linux/ioport.h>
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <linux/export.h>
9#include <asm/io.h> 8#include <asm/io.h>
10 9
11/* 10/*
@@ -436,6 +435,28 @@ void ioport_unmap(void __iomem *addr)
436 } 435 }
437} 436}
438 437
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)
440{
441 resource_size_t start = pci_resource_start(dev, bar);
442 resource_size_t len = pci_resource_len(dev, bar);
443 unsigned long flags = pci_resource_flags(dev, bar);
444
445 if (!len || !start)
446 return NULL;
447 if (maxlen && len > maxlen)
448 len = maxlen;
449 if (flags & IORESOURCE_IO)
450 return ioport_map(start, len);
451 if (flags & IORESOURCE_MEM) {
452 if (flags & IORESOURCE_CACHEABLE)
453 return ioremap(start, len);
454 return ioremap_nocache(start, len);
455 }
456 /* What? */
457 return NULL;
458}
459
439void pci_iounmap(struct pci_dev *dev, void __iomem * addr) 460void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
440{ 461{
441 if (!INDIRECT_ADDR(addr)) { 462 if (!INDIRECT_ADDR(addr)) {
@@ -461,4 +482,5 @@ EXPORT_SYMBOL(iowrite16_rep);
461EXPORT_SYMBOL(iowrite32_rep); 482EXPORT_SYMBOL(iowrite32_rep);
462EXPORT_SYMBOL(ioport_map); 483EXPORT_SYMBOL(ioport_map);
463EXPORT_SYMBOL(ioport_unmap); 484EXPORT_SYMBOL(ioport_unmap);
485EXPORT_SYMBOL(pci_iomap);
464EXPORT_SYMBOL(pci_iounmap); 486EXPORT_SYMBOL(pci_iounmap);
diff --git a/arch/parisc/lib/lusercopy.S b/arch/parisc/lib/lusercopy.S
index 6f2d9355efe..1bd23ccec17 100644
--- a/arch/parisc/lib/lusercopy.S
+++ b/arch/parisc/lib/lusercopy.S
@@ -61,6 +61,47 @@
61 .endm 61 .endm
62 62
63 /* 63 /*
64 * long lstrncpy_from_user(char *dst, const char *src, long n)
65 *
66 * Returns -EFAULT if exception before terminator,
67 * N if the entire buffer filled,
68 * otherwise strlen (i.e. excludes zero byte)
69 */
70
71ENTRY(lstrncpy_from_user)
72 .proc
73 .callinfo NO_CALLS
74 .entry
75 comib,= 0,%r24,$lsfu_done
76 copy %r24,%r23
77 get_sr
781: ldbs,ma 1(%sr1,%r25),%r1
79$lsfu_loop:
80 stbs,ma %r1,1(%r26)
81 comib,=,n 0,%r1,$lsfu_done
82 addib,<>,n -1,%r24,$lsfu_loop
832: ldbs,ma 1(%sr1,%r25),%r1
84$lsfu_done:
85 sub %r23,%r24,%r28
86$lsfu_exit:
87 bv %r0(%r2)
88 nop
89 .exit
90ENDPROC(lstrncpy_from_user)
91
92 .section .fixup,"ax"
933: fixup_branch $lsfu_exit
94 ldi -EFAULT,%r28
95 .previous
96
97 .section __ex_table,"aw"
98 ASM_ULONG_INSN 1b,3b
99 ASM_ULONG_INSN 2b,3b
100 .previous
101
102 .procend
103
104 /*
64 * unsigned long lclear_user(void *to, unsigned long n) 105 * unsigned long lclear_user(void *to, unsigned long n)
65 * 106 *
66 * Returns 0 for success. 107 * Returns 0 for success.