diff options
Diffstat (limited to 'include/asm-v850')
-rw-r--r-- | include/asm-v850/bitops.h | 6 | ||||
-rw-r--r-- | include/asm-v850/cache.h | 7 | ||||
-rw-r--r-- | include/asm-v850/checksum.h | 11 | ||||
-rw-r--r-- | include/asm-v850/emergency-restart.h | 6 | ||||
-rw-r--r-- | include/asm-v850/io.h | 37 | ||||
-rw-r--r-- | include/asm-v850/mmu.h | 17 | ||||
-rw-r--r-- | include/asm-v850/page.h | 5 | ||||
-rw-r--r-- | include/asm-v850/pci.h | 47 | ||||
-rw-r--r-- | include/asm-v850/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-v850/thread_info.h | 3 | ||||
-rw-r--r-- | include/asm-v850/v850e2_cache.h | 5 |
11 files changed, 98 insertions, 48 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 | ||
160 | extern __inline__ int find_next_zero_bit (void *addr, int size, int offset) | 160 | extern __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/checksum.h b/include/asm-v850/checksum.h index d3aedb7bfc5c..4df5e71098f9 100644 --- a/include/asm-v850/checksum.h +++ b/include/asm-v850/checksum.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-v850/checksum.h -- Checksum ops | 2 | * include/asm-v850/checksum.h -- Checksum ops |
3 | * | 3 | * |
4 | * Copyright (C) 2001 NEC Corporation | 4 | * Copyright (C) 2001,2005 NEC Corporation |
5 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | 5 | * Copyright (C) 2001,2005 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 |
@@ -36,8 +36,8 @@ extern unsigned int csum_partial (const unsigned char * buff, int len, | |||
36 | * here even more important to align src and dst on a 32-bit (or even | 36 | * here even more important to align src and dst on a 32-bit (or even |
37 | * better 64-bit) boundary | 37 | * better 64-bit) boundary |
38 | */ | 38 | */ |
39 | extern unsigned csum_partial_copy (const char *src, char *dst, int len, | 39 | extern unsigned csum_partial_copy (const unsigned char *src, |
40 | unsigned sum); | 40 | unsigned char *dst, int len, unsigned sum); |
41 | 41 | ||
42 | 42 | ||
43 | /* | 43 | /* |
@@ -46,7 +46,8 @@ extern unsigned csum_partial_copy (const char *src, char *dst, int len, | |||
46 | * here even more important to align src and dst on a 32-bit (or even | 46 | * here even more important to align src and dst on a 32-bit (or even |
47 | * better 64-bit) boundary | 47 | * better 64-bit) boundary |
48 | */ | 48 | */ |
49 | extern unsigned csum_partial_copy_from_user (const char *src, char *dst, | 49 | extern unsigned csum_partial_copy_from_user (const unsigned char *src, |
50 | unsigned char *dst, | ||
50 | int len, unsigned sum, | 51 | int len, unsigned sum, |
51 | int *csum_err); | 52 | int *csum_err); |
52 | 53 | ||
diff --git a/include/asm-v850/emergency-restart.h b/include/asm-v850/emergency-restart.h new file mode 100644 index 000000000000..108d8c48e42e --- /dev/null +++ b/include/asm-v850/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_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/mmu.h b/include/asm-v850/mmu.h index e30a52becfd6..267768c66ef6 100644 --- a/include/asm-v850/mmu.h +++ b/include/asm-v850/mmu.h | |||
@@ -1,22 +1,11 @@ | |||
1 | /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ | 1 | /* Copyright (C) 2002, 2005, David McCullough <davidm@snapgear.com> */ |
2 | 2 | ||
3 | #ifndef __V850_MMU_H__ | 3 | #ifndef __V850_MMU_H__ |
4 | #define __V850_MMU_H__ | 4 | #define __V850_MMU_H__ |
5 | 5 | ||
6 | struct mm_rblock_struct { | ||
7 | int size; | ||
8 | int refcount; | ||
9 | void *kblock; | ||
10 | }; | ||
11 | |||
12 | struct mm_tblock_struct { | ||
13 | struct mm_rblock_struct *rblock; | ||
14 | struct mm_tblock_struct *next; | ||
15 | }; | ||
16 | |||
17 | typedef struct { | 6 | typedef struct { |
18 | struct mm_tblock_struct tblock; | 7 | struct vm_list_struct *vmlist; |
19 | unsigned long end_brk; | 8 | unsigned long end_brk; |
20 | } mm_context_t; | 9 | } mm_context_t; |
21 | 10 | ||
22 | #endif /* __V850_MMU_H__ */ | 11 | #endif /* __V850_MMU_H__ */ |
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 e41941447b49..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. */ |
50 | extern void | 50 | extern void |
51 | pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, | 51 | pci_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 | ||
54 | extern void | 54 | extern void |
55 | pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, | 55 | pci_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 | |||
65 | pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, | 65 | pci_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. */ | ||
69 | extern void | ||
70 | pci_dma_sync_sg_for_cpu (struct pci_dev *dev, | ||
71 | struct scatterlist *sg, int sg_len, | ||
72 | int dir); | ||
73 | extern void | ||
74 | pci_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. */ | ||
84 | static inline int | ||
85 | pci_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, |
@@ -81,6 +103,19 @@ extern void | |||
81 | pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr, | 103 | pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr, |
82 | dma_addr_t dma_addr); | 104 | dma_addr_t dma_addr); |
83 | 105 | ||
106 | #ifdef CONFIG_PCI | ||
107 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
108 | enum pci_dma_burst_strategy *strat, | ||
109 | unsigned long *strategy_parameter) | ||
110 | { | ||
111 | *strat = PCI_DMA_BURST_INFINITY; | ||
112 | *strategy_parameter = ~0UL; | ||
113 | } | ||
114 | #endif | ||
115 | |||
116 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
117 | extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr); | ||
118 | |||
84 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 119 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
85 | { | 120 | { |
86 | } | 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 | ||
26 | static 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/thread_info.h b/include/asm-v850/thread_info.h index e2ef44593752..e4cfad94a553 100644 --- a/include/asm-v850/thread_info.h +++ b/include/asm-v850/thread_info.h | |||
@@ -30,7 +30,8 @@ struct thread_info { | |||
30 | struct exec_domain *exec_domain; /* execution domain */ | 30 | struct exec_domain *exec_domain; /* execution domain */ |
31 | unsigned long flags; /* low level flags */ | 31 | unsigned long flags; /* low level flags */ |
32 | int cpu; /* cpu we're on */ | 32 | int cpu; /* cpu we're on */ |
33 | int preempt_count; | 33 | int preempt_count; /* 0 => preemptable, |
34 | <0 => BUG */ | ||
34 | struct restart_block restart_block; | 35 | struct restart_block restart_block; |
35 | }; | 36 | }; |
36 | 37 | ||
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__ */ |