aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/Kconfig6
-rw-r--r--arch/ia64/include/asm/cputime.h72
-rw-r--r--arch/ia64/include/asm/socket.h3
-rw-r--r--arch/ia64/kernel/setup.c19
-rw-r--r--arch/ia64/mm/contig.c3
-rw-r--r--arch/ia64/mm/init.c4
-rw-r--r--arch/ia64/sn/kernel/irq.c5
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c3
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c4
9 files changed, 68 insertions, 51 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 27489b6dd533..3b7a7c483785 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -23,6 +23,9 @@ config IA64
23 select HAVE_ARCH_TRACEHOOK 23 select HAVE_ARCH_TRACEHOOK
24 select HAVE_DMA_API_DEBUG 24 select HAVE_DMA_API_DEBUG
25 select HAVE_GENERIC_HARDIRQS 25 select HAVE_GENERIC_HARDIRQS
26 select HAVE_MEMBLOCK
27 select HAVE_MEMBLOCK_NODE_MAP
28 select ARCH_DISCARD_MEMBLOCK
26 select GENERIC_IRQ_PROBE 29 select GENERIC_IRQ_PROBE
27 select GENERIC_PENDING_IRQ if SMP 30 select GENERIC_PENDING_IRQ if SMP
28 select IRQ_PER_CPU 31 select IRQ_PER_CPU
@@ -474,9 +477,6 @@ config NODES_SHIFT
474 MAX_NUMNODES will be 2^(This value). 477 MAX_NUMNODES will be 2^(This value).
475 If in doubt, use the default. 478 If in doubt, use the default.
476 479
477config ARCH_POPULATES_NODE_MAP
478 def_bool y
479
480# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent. 480# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent.
481# VIRTUAL_MEM_MAP has been retained for historical reasons. 481# VIRTUAL_MEM_MAP has been retained for historical reasons.
482config VIRTUAL_MEM_MAP 482config VIRTUAL_MEM_MAP
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h
index 5a274af31b2b..3deac956d325 100644
--- a/arch/ia64/include/asm/cputime.h
+++ b/arch/ia64/include/asm/cputime.h
@@ -26,60 +26,53 @@
26#include <linux/jiffies.h> 26#include <linux/jiffies.h>
27#include <asm/processor.h> 27#include <asm/processor.h>
28 28
29typedef u64 cputime_t; 29typedef u64 __nocast cputime_t;
30typedef u64 cputime64_t; 30typedef u64 __nocast cputime64_t;
31 31
32#define cputime_zero ((cputime_t)0)
33#define cputime_one_jiffy jiffies_to_cputime(1) 32#define cputime_one_jiffy jiffies_to_cputime(1)
34#define cputime_max ((~((cputime_t)0) >> 1) - 1)
35#define cputime_add(__a, __b) ((__a) + (__b))
36#define cputime_sub(__a, __b) ((__a) - (__b))
37#define cputime_div(__a, __n) ((__a) / (__n))
38#define cputime_halve(__a) ((__a) >> 1)
39#define cputime_eq(__a, __b) ((__a) == (__b))
40#define cputime_gt(__a, __b) ((__a) > (__b))
41#define cputime_ge(__a, __b) ((__a) >= (__b))
42#define cputime_lt(__a, __b) ((__a) < (__b))
43#define cputime_le(__a, __b) ((__a) <= (__b))
44
45#define cputime64_zero ((cputime64_t)0)
46#define cputime64_add(__a, __b) ((__a) + (__b))
47#define cputime64_sub(__a, __b) ((__a) - (__b))
48#define cputime_to_cputime64(__ct) (__ct)
49 33
50/* 34/*
51 * Convert cputime <-> jiffies (HZ) 35 * Convert cputime <-> jiffies (HZ)
52 */ 36 */
53#define cputime_to_jiffies(__ct) ((__ct) / (NSEC_PER_SEC / HZ)) 37#define cputime_to_jiffies(__ct) \
54#define jiffies_to_cputime(__jif) ((__jif) * (NSEC_PER_SEC / HZ)) 38 ((__force u64)(__ct) / (NSEC_PER_SEC / HZ))
55#define cputime64_to_jiffies64(__ct) ((__ct) / (NSEC_PER_SEC / HZ)) 39#define jiffies_to_cputime(__jif) \
56#define jiffies64_to_cputime64(__jif) ((__jif) * (NSEC_PER_SEC / HZ)) 40 (__force cputime_t)((__jif) * (NSEC_PER_SEC / HZ))
41#define cputime64_to_jiffies64(__ct) \
42 ((__force u64)(__ct) / (NSEC_PER_SEC / HZ))
43#define jiffies64_to_cputime64(__jif) \
44 (__force cputime64_t)((__jif) * (NSEC_PER_SEC / HZ))
57 45
58/* 46/*
59 * Convert cputime <-> microseconds 47 * Convert cputime <-> microseconds
60 */ 48 */
61#define cputime_to_usecs(__ct) ((__ct) / NSEC_PER_USEC) 49#define cputime_to_usecs(__ct) \
62#define usecs_to_cputime(__usecs) ((__usecs) * NSEC_PER_USEC) 50 ((__force u64)(__ct) / NSEC_PER_USEC)
63#define usecs_to_cputime64(__usecs) usecs_to_cputime(__usecs) 51#define usecs_to_cputime(__usecs) \
52 (__force cputime_t)((__usecs) * NSEC_PER_USEC)
53#define usecs_to_cputime64(__usecs) \
54 (__force cputime64_t)((__usecs) * NSEC_PER_USEC)
64 55
65/* 56/*
66 * Convert cputime <-> seconds 57 * Convert cputime <-> seconds
67 */ 58 */
68#define cputime_to_secs(__ct) ((__ct) / NSEC_PER_SEC) 59#define cputime_to_secs(__ct) \
69#define secs_to_cputime(__secs) ((__secs) * NSEC_PER_SEC) 60 ((__force u64)(__ct) / NSEC_PER_SEC)
61#define secs_to_cputime(__secs) \
62 (__force cputime_t)((__secs) * NSEC_PER_SEC)
70 63
71/* 64/*
72 * Convert cputime <-> timespec (nsec) 65 * Convert cputime <-> timespec (nsec)
73 */ 66 */
74static inline cputime_t timespec_to_cputime(const struct timespec *val) 67static inline cputime_t timespec_to_cputime(const struct timespec *val)
75{ 68{
76 cputime_t ret = val->tv_sec * NSEC_PER_SEC; 69 u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_nsec;
77 return (ret + val->tv_nsec); 70 return (__force cputime_t) ret;
78} 71}
79static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val) 72static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
80{ 73{
81 val->tv_sec = ct / NSEC_PER_SEC; 74 val->tv_sec = (__force u64) ct / NSEC_PER_SEC;
82 val->tv_nsec = ct % NSEC_PER_SEC; 75 val->tv_nsec = (__force u64) ct % NSEC_PER_SEC;
83} 76}
84 77
85/* 78/*
@@ -87,25 +80,28 @@ static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val)
87 */ 80 */
88static inline cputime_t timeval_to_cputime(struct timeval *val) 81static inline cputime_t timeval_to_cputime(struct timeval *val)
89{ 82{
90 cputime_t ret = val->tv_sec * NSEC_PER_SEC; 83 u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_usec * NSEC_PER_USEC;
91 return (ret + val->tv_usec * NSEC_PER_USEC); 84 return (__force cputime_t) ret;
92} 85}
93static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val) 86static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val)
94{ 87{
95 val->tv_sec = ct / NSEC_PER_SEC; 88 val->tv_sec = (__force u64) ct / NSEC_PER_SEC;
96 val->tv_usec = (ct % NSEC_PER_SEC) / NSEC_PER_USEC; 89 val->tv_usec = ((__force u64) ct % NSEC_PER_SEC) / NSEC_PER_USEC;
97} 90}
98 91
99/* 92/*
100 * Convert cputime <-> clock (USER_HZ) 93 * Convert cputime <-> clock (USER_HZ)
101 */ 94 */
102#define cputime_to_clock_t(__ct) ((__ct) / (NSEC_PER_SEC / USER_HZ)) 95#define cputime_to_clock_t(__ct) \
103#define clock_t_to_cputime(__x) ((__x) * (NSEC_PER_SEC / USER_HZ)) 96 ((__force u64)(__ct) / (NSEC_PER_SEC / USER_HZ))
97#define clock_t_to_cputime(__x) \
98 (__force cputime_t)((__x) * (NSEC_PER_SEC / USER_HZ))
104 99
105/* 100/*
106 * Convert cputime64 to clock. 101 * Convert cputime64 to clock.
107 */ 102 */
108#define cputime64_to_clock_t(__ct) cputime_to_clock_t((cputime_t)__ct) 103#define cputime64_to_clock_t(__ct) \
104 cputime_to_clock_t((__force cputime_t)__ct)
109 105
110#endif /* CONFIG_VIRT_CPU_ACCOUNTING */ 106#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
111#endif /* __IA64_CPUTIME_H */ 107#endif /* __IA64_CPUTIME_H */
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index 51427eaa51ba..4b03664e3fb5 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -71,4 +71,7 @@
71 71
72#define SO_RXQ_OVFL 40 72#define SO_RXQ_OVFL 40
73 73
74#define SO_WIFI_STATUS 41
75#define SCM_WIFI_STATUS SO_WIFI_STATUS
76
74#endif /* _ASM_IA64_SOCKET_H */ 77#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5e2c72498c51..cd57d7312de0 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -220,6 +220,23 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
220 } 220 }
221} 221}
222 222
223/* merge overlaps */
224static int __init
225merge_regions (struct rsvd_region *rsvd_region, int max)
226{
227 int i;
228 for (i = 1; i < max; ++i) {
229 if (rsvd_region[i].start >= rsvd_region[i-1].end)
230 continue;
231 if (rsvd_region[i].end > rsvd_region[i-1].end)
232 rsvd_region[i-1].end = rsvd_region[i].end;
233 --max;
234 memmove(&rsvd_region[i], &rsvd_region[i+1],
235 (max - i) * sizeof(struct rsvd_region));
236 }
237 return max;
238}
239
223/* 240/*
224 * Request address space for all standard resources 241 * Request address space for all standard resources
225 */ 242 */
@@ -270,6 +287,7 @@ static void __init setup_crashkernel(unsigned long total, int *n)
270 if (ret == 0 && size > 0) { 287 if (ret == 0 && size > 0) {
271 if (!base) { 288 if (!base) {
272 sort_regions(rsvd_region, *n); 289 sort_regions(rsvd_region, *n);
290 *n = merge_regions(rsvd_region, *n);
273 base = kdump_find_rsvd_region(size, 291 base = kdump_find_rsvd_region(size,
274 rsvd_region, *n); 292 rsvd_region, *n);
275 } 293 }
@@ -373,6 +391,7 @@ reserve_memory (void)
373 BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n); 391 BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n);
374 392
375 sort_regions(rsvd_region, num_rsvd_regions); 393 sort_regions(rsvd_region, num_rsvd_regions);
394 num_rsvd_regions = merge_regions(rsvd_region, num_rsvd_regions);
376} 395}
377 396
378 397
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index f114a3b14c6a..1516d1dc11fd 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -16,6 +16,7 @@
16 */ 16 */
17#include <linux/bootmem.h> 17#include <linux/bootmem.h>
18#include <linux/efi.h> 18#include <linux/efi.h>
19#include <linux/memblock.h>
19#include <linux/mm.h> 20#include <linux/mm.h>
20#include <linux/nmi.h> 21#include <linux/nmi.h>
21#include <linux/swap.h> 22#include <linux/swap.h>
@@ -348,7 +349,7 @@ paging_init (void)
348 printk("Virtual mem_map starts at 0x%p\n", mem_map); 349 printk("Virtual mem_map starts at 0x%p\n", mem_map);
349 } 350 }
350#else /* !CONFIG_VIRTUAL_MEM_MAP */ 351#else /* !CONFIG_VIRTUAL_MEM_MAP */
351 add_active_range(0, 0, max_low_pfn); 352 memblock_add_node(0, PFN_PHYS(max_low_pfn), 0);
352 free_area_init_nodes(max_zone_pfns); 353 free_area_init_nodes(max_zone_pfns);
353#endif /* !CONFIG_VIRTUAL_MEM_MAP */ 354#endif /* !CONFIG_VIRTUAL_MEM_MAP */
354 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); 355 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 00cb0e26c64e..13df239dbed1 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -10,6 +10,7 @@
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/efi.h> 11#include <linux/efi.h>
12#include <linux/elf.h> 12#include <linux/elf.h>
13#include <linux/memblock.h>
13#include <linux/mm.h> 14#include <linux/mm.h>
14#include <linux/mmzone.h> 15#include <linux/mmzone.h>
15#include <linux/module.h> 16#include <linux/module.h>
@@ -557,8 +558,7 @@ int __init register_active_ranges(u64 start, u64 len, int nid)
557#endif 558#endif
558 559
559 if (start < end) 560 if (start < end)
560 add_active_range(nid, __pa(start) >> PAGE_SHIFT, 561 memblock_add_node(__pa(start), end - start, nid);
561 __pa(end) >> PAGE_SHIFT);
562 return 0; 562 return 0;
563} 563}
564 564
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 485c42d97e83..dfac09ab027a 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -150,12 +150,11 @@ struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info,
150 * PROM does not support SAL_INTR_REDIRECT, or it failed. 150 * PROM does not support SAL_INTR_REDIRECT, or it failed.
151 * Revert to old method. 151 * Revert to old method.
152 */ 152 */
153 new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); 153 new_irq_info = kmemdup(sn_irq_info, sizeof(struct sn_irq_info),
154 GFP_ATOMIC);
154 if (new_irq_info == NULL) 155 if (new_irq_info == NULL)
155 return NULL; 156 return NULL;
156 157
157 memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));
158
159 /* Free the old PROM new_irq_info structure */ 158 /* Free the old PROM new_irq_info structure */
160 sn_intr_free(local_nasid, local_widget, new_irq_info); 159 sn_intr_free(local_nasid, local_widget, new_irq_info);
161 unregister_intr_pda(new_irq_info); 160 unregister_intr_pda(new_irq_info);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 5698f29d5add..8886a0bc4a11 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -127,12 +127,11 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
127 * Allocate kernel bus soft and copy from prom. 127 * Allocate kernel bus soft and copy from prom.
128 */ 128 */
129 129
130 soft = kmalloc(sizeof(struct pcibus_info), GFP_KERNEL); 130 soft = kmemdup(prom_bussoft, sizeof(struct pcibus_info), GFP_KERNEL);
131 if (!soft) { 131 if (!soft) {
132 return NULL; 132 return NULL;
133 } 133 }
134 134
135 memcpy(soft, prom_bussoft, sizeof(struct pcibus_info));
136 soft->pbi_buscommon.bs_base = (unsigned long) 135 soft->pbi_buscommon.bs_base = (unsigned long)
137 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base), 136 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base),
138 sizeof(struct pic)); 137 sizeof(struct pic));
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 642451e770ea..e77c477245fd 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -600,11 +600,11 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
600 * Allocate kernel bus soft and copy from prom. 600 * Allocate kernel bus soft and copy from prom.
601 */ 601 */
602 602
603 tioca_common = kzalloc(sizeof(struct tioca_common), GFP_KERNEL); 603 tioca_common = kmemdup(prom_bussoft, sizeof(struct tioca_common),
604 GFP_KERNEL);
604 if (!tioca_common) 605 if (!tioca_common)
605 return NULL; 606 return NULL;
606 607
607 memcpy(tioca_common, prom_bussoft, sizeof(struct tioca_common));
608 tioca_common->ca_common.bs_base = (unsigned long) 608 tioca_common->ca_common.bs_base = (unsigned long)
609 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base), 609 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base),
610 sizeof(struct tioca_common)); 610 sizeof(struct tioca_common));