aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-v850
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-v850')
-rw-r--r--include/asm-v850/bitops.h6
-rw-r--r--include/asm-v850/cache.h7
-rw-r--r--include/asm-v850/io.h37
-rw-r--r--include/asm-v850/page.h5
-rw-r--r--include/asm-v850/pci.h37
-rw-r--r--include/asm-v850/pgtable.h2
-rw-r--r--include/asm-v850/v850e2_cache.h5
7 files changed, 71 insertions, 28 deletions
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index 7c4ecaf5151c..0e5c2f210872 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/bitops.h -- Bit operations 2 * include/asm-v850/bitops.h -- Bit operations
3 * 3 *
4 * Copyright (C) 2001,02,03,04 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org>
6 * Copyright (C) 1992 Linus Torvalds. 6 * Copyright (C) 1992 Linus Torvalds.
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General 8 * This file is subject to the terms and conditions of the GNU General
@@ -157,7 +157,7 @@ extern __inline__ int __test_bit (int nr, const void *addr)
157#define find_first_zero_bit(addr, size) \ 157#define find_first_zero_bit(addr, size) \
158 find_next_zero_bit ((addr), (size), 0) 158 find_next_zero_bit ((addr), (size), 0)
159 159
160extern __inline__ int find_next_zero_bit (void *addr, int size, int offset) 160extern __inline__ int find_next_zero_bit(const void *addr, int size, int offset)
161{ 161{
162 unsigned long *p = ((unsigned long *) addr) + (offset >> 5); 162 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
163 unsigned long result = offset & ~31UL; 163 unsigned long result = offset & ~31UL;
diff --git a/include/asm-v850/cache.h b/include/asm-v850/cache.h
index 027f8c9090cd..cbf9096e8517 100644
--- a/include/asm-v850/cache.h
+++ b/include/asm-v850/cache.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/cache.h -- Cache operations 2 * include/asm-v850/cache.h -- Cache operations
3 * 3 *
4 * Copyright (C) 2001 NEC Corporation 4 * Copyright (C) 2001,05 NEC Corporation
5 * Copyright (C) 2001 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -20,6 +20,9 @@
20#ifndef L1_CACHE_BYTES 20#ifndef L1_CACHE_BYTES
21/* This processor has no cache, so just choose an arbitrary value. */ 21/* This processor has no cache, so just choose an arbitrary value. */
22#define L1_CACHE_BYTES 16 22#define L1_CACHE_BYTES 16
23#define L1_CACHE_SHIFT 4
23#endif 24#endif
24 25
26#define L1_CACHE_SHIFT_MAX L1_CACHE_SHIFT
27
25#endif /* __V850_CACHE_H__ */ 28#endif /* __V850_CACHE_H__ */
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h
index bb5efd1b4b7d..cc364fcbec10 100644
--- a/include/asm-v850/io.h
+++ b/include/asm-v850/io.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/io.h -- Misc I/O operations 2 * include/asm-v850/io.h -- Misc I/O operations
3 * 3 *
4 * Copyright (C) 2001,02,03,04 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -27,12 +27,12 @@
27#define readw_relaxed(a) readw(a) 27#define readw_relaxed(a) readw(a)
28#define readl_relaxed(a) readl(a) 28#define readl_relaxed(a) readl(a)
29 29
30#define writeb(b, addr) \ 30#define writeb(val, addr) \
31 (void)((*(volatile unsigned char *) (addr)) = (b)) 31 (void)((*(volatile unsigned char *) (addr)) = (val))
32#define writew(b, addr) \ 32#define writew(val, addr) \
33 (void)((*(volatile unsigned short *) (addr)) = (b)) 33 (void)((*(volatile unsigned short *) (addr)) = (val))
34#define writel(b, addr) \ 34#define writel(val, addr) \
35 (void)((*(volatile unsigned int *) (addr)) = (b)) 35 (void)((*(volatile unsigned int *) (addr)) = (val))
36 36
37#define __raw_readb readb 37#define __raw_readb readb
38#define __raw_readw readw 38#define __raw_readw readw
@@ -96,11 +96,22 @@ outsl (unsigned long port, const void *src, unsigned long count)
96 outl (*p++, port); 96 outl (*p++, port);
97} 97}
98 98
99#define iounmap(addr) ((void)0) 99
100#define ioremap(physaddr, size) (physaddr) 100/* Some places try to pass in an loff_t for PHYSADDR (?!), so we cast it to
101#define ioremap_nocache(physaddr, size) (physaddr) 101 long before casting it to a pointer to avoid compiler warnings. */
102#define ioremap_writethrough(physaddr, size) (physaddr) 102#define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr))
103#define ioremap_fullcache(physaddr, size) (physaddr) 103#define iounmap(addr) ((void)0)
104
105#define ioremap_nocache(physaddr, size) ioremap (physaddr, size)
106#define ioremap_writethrough(physaddr, size) ioremap (physaddr, size)
107#define ioremap_fullcache(physaddr, size) ioremap (physaddr, size)
108
109#define ioread8(addr) readb (addr)
110#define ioread16(addr) readw (addr)
111#define ioread32(addr) readl (addr)
112#define iowrite8(val, addr) writeb (val, addr)
113#define iowrite16(val, addr) writew (val, addr)
114#define iowrite32(val, addr) writel (val, addr)
104 115
105#define mmiowb() 116#define mmiowb()
106 117
diff --git a/include/asm-v850/page.h b/include/asm-v850/page.h
index 06085b0c043e..d6091622935d 100644
--- a/include/asm-v850/page.h
+++ b/include/asm-v850/page.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/page.h -- VM ops 2 * include/asm-v850/page.h -- VM ops
3 * 3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -132,6 +132,7 @@ extern __inline__ int get_order (unsigned long size)
132 132
133#define pfn_to_page(pfn) virt_to_page (pfn_to_virt (pfn)) 133#define pfn_to_page(pfn) virt_to_page (pfn_to_virt (pfn))
134#define page_to_pfn(page) virt_to_pfn (page_to_virt (page)) 134#define page_to_pfn(page) virt_to_pfn (page_to_virt (page))
135#define pfn_valid(pfn) ((pfn) < max_mapnr)
135 136
136#define virt_addr_valid(kaddr) \ 137#define virt_addr_valid(kaddr) \
137 (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr) 138 (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr)
diff --git a/include/asm-v850/pci.h b/include/asm-v850/pci.h
index 8e79be0fe99d..4581826e1cac 100644
--- a/include/asm-v850/pci.h
+++ b/include/asm-v850/pci.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/pci.h -- PCI support 2 * include/asm-v850/pci.h -- PCI support
3 * 3 *
4 * Copyright (C) 2001,02 NEC Corporation 4 * Copyright (C) 2001,02,05 NEC Corporation
5 * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -48,12 +48,12 @@ pci_unmap_single (struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
48 perform a pci_dma_sync_for_device, and then the device again owns 48 perform a pci_dma_sync_for_device, and then the device again owns
49 the buffer. */ 49 the buffer. */
50extern void 50extern void
51pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 51pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr,
52 int dir); 52 size_t size, int dir);
53 53
54extern void 54extern void
55pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 55pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr,
56 int dir); 56 size_t size, int dir);
57 57
58 58
59/* Do multiple DMA mappings at once. */ 59/* Do multiple DMA mappings at once. */
@@ -65,6 +65,28 @@ extern void
65pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, 65pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len,
66 int dir); 66 int dir);
67 67
68/* SG-list versions of pci_dma_sync functions. */
69extern void
70pci_dma_sync_sg_for_cpu (struct pci_dev *dev,
71 struct scatterlist *sg, int sg_len,
72 int dir);
73extern void
74pci_dma_sync_sg_for_device (struct pci_dev *dev,
75 struct scatterlist *sg, int sg_len,
76 int dir);
77
78#define pci_map_page(dev, page, offs, size, dir) \
79 pci_map_single(dev, (page_address(page) + (offs)), size, dir)
80#define pci_unmap_page(dev,addr,sz,dir) \
81 pci_unmap_single(dev, addr, sz, dir)
82
83/* Test for pci_map_single or pci_map_page having generated an error. */
84static inline int
85pci_dma_mapping_error (dma_addr_t dma_addr)
86{
87 return dma_addr == 0;
88}
89
68/* Allocate and map kernel buffer using consistent mode DMA for PCI 90/* Allocate and map kernel buffer using consistent mode DMA for PCI
69 device. Returns non-NULL cpu-view pointer to the buffer if 91 device. Returns non-NULL cpu-view pointer to the buffer if
70 successful and sets *DMA_ADDR to the pci side dma address as well, 92 successful and sets *DMA_ADDR to the pci side dma address as well,
@@ -91,6 +113,9 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
91} 113}
92#endif 114#endif
93 115
116extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
117extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr);
118
94static inline void pcibios_add_platform_entries(struct pci_dev *dev) 119static inline void pcibios_add_platform_entries(struct pci_dev *dev)
95{ 120{
96} 121}
diff --git a/include/asm-v850/pgtable.h b/include/asm-v850/pgtable.h
index 76e380e481e9..3cf8775ce85f 100644
--- a/include/asm-v850/pgtable.h
+++ b/include/asm-v850/pgtable.h
@@ -23,6 +23,8 @@
23#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 23#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
24#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 24#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
25 25
26static inline int pte_file (pte_t pte) { return 0; }
27
26 28
27/* These mean nothing to !CONFIG_MMU. */ 29/* These mean nothing to !CONFIG_MMU. */
28#define PAGE_NONE __pgprot(0) 30#define PAGE_NONE __pgprot(0)
diff --git a/include/asm-v850/v850e2_cache.h b/include/asm-v850/v850e2_cache.h
index 61acda1023e8..87edf0d311d5 100644
--- a/include/asm-v850/v850e2_cache.h
+++ b/include/asm-v850/v850e2_cache.h
@@ -2,8 +2,8 @@
2 * include/asm-v850/v850e2_cache_cache.h -- Cache control for V850E2 2 * include/asm-v850/v850e2_cache_cache.h -- Cache control for V850E2
3 * cache memories 3 * cache memories
4 * 4 *
5 * Copyright (C) 2003 NEC Electronics Corporation 5 * Copyright (C) 2003,05 NEC Electronics Corporation
6 * Copyright (C) 2003 Miles Bader <miles@gnu.org> 6 * Copyright (C) 2003,05 Miles Bader <miles@gnu.org>
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General 8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this 9 * Public License. See the file COPYING in the main directory of this
@@ -69,6 +69,7 @@
69 69
70/* For <asm/cache.h> */ 70/* For <asm/cache.h> */
71#define L1_CACHE_BYTES V850E2_CACHE_LINE_SIZE 71#define L1_CACHE_BYTES V850E2_CACHE_LINE_SIZE
72#define L1_CACHE_SHIFT V850E2_CACHE_LINE_SIZE_BITS
72 73
73 74
74#endif /* __V850_V850E2_CACHE_H__ */ 75#endif /* __V850_V850E2_CACHE_H__ */