diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/Kconfig | 4 | ||||
-rw-r--r-- | arch/sparc/include/asm/memblock.h | 8 | ||||
-rw-r--r-- | arch/sparc/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/process_64.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/setup_32.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/sys_sparc_64.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/sysfs.c | 122 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 32 |
8 files changed, 80 insertions, 103 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e86607..70ae9d81870e 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -43,6 +43,7 @@ config SPARC64 | |||
43 | select HAVE_KPROBES | 43 | select HAVE_KPROBES |
44 | select HAVE_RCU_TABLE_FREE if SMP | 44 | select HAVE_RCU_TABLE_FREE if SMP |
45 | select HAVE_MEMBLOCK | 45 | select HAVE_MEMBLOCK |
46 | select HAVE_MEMBLOCK_NODE_MAP | ||
46 | select HAVE_SYSCALL_WRAPPERS | 47 | select HAVE_SYSCALL_WRAPPERS |
47 | select HAVE_DYNAMIC_FTRACE | 48 | select HAVE_DYNAMIC_FTRACE |
48 | select HAVE_FTRACE_MCOUNT_RECORD | 49 | select HAVE_FTRACE_MCOUNT_RECORD |
@@ -352,9 +353,6 @@ config NODES_SPAN_OTHER_NODES | |||
352 | def_bool y | 353 | def_bool y |
353 | depends on NEED_MULTIPLE_NODES | 354 | depends on NEED_MULTIPLE_NODES |
354 | 355 | ||
355 | config ARCH_POPULATES_NODE_MAP | ||
356 | def_bool y if SPARC64 | ||
357 | |||
358 | config ARCH_SELECT_MEMORY_MODEL | 356 | config ARCH_SELECT_MEMORY_MODEL |
359 | def_bool y if SPARC64 | 357 | def_bool y if SPARC64 |
360 | 358 | ||
diff --git a/arch/sparc/include/asm/memblock.h b/arch/sparc/include/asm/memblock.h deleted file mode 100644 index c67b047ef85e..000000000000 --- a/arch/sparc/include/asm/memblock.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef _SPARC64_MEMBLOCK_H | ||
2 | #define _SPARC64_MEMBLOCK_H | ||
3 | |||
4 | #include <asm/oplib.h> | ||
5 | |||
6 | #define MEMBLOCK_DBG(fmt...) prom_printf(fmt) | ||
7 | |||
8 | #endif /* !(_SPARC64_MEMBLOCK_H) */ | ||
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h index 9d3fefcff2f5..8af1b64168b3 100644 --- a/arch/sparc/include/asm/socket.h +++ b/arch/sparc/include/asm/socket.h | |||
@@ -58,6 +58,9 @@ | |||
58 | 58 | ||
59 | #define SO_RXQ_OVFL 0x0024 | 59 | #define SO_RXQ_OVFL 0x0024 |
60 | 60 | ||
61 | #define SO_WIFI_STATUS 0x0025 | ||
62 | #define SCM_WIFI_STATUS SO_WIFI_STATUS | ||
63 | |||
61 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 64 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
62 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 65 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
63 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 | 66 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index 3739a06a76cb..39d8b05201a2 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -95,12 +95,14 @@ void cpu_idle(void) | |||
95 | set_thread_flag(TIF_POLLING_NRFLAG); | 95 | set_thread_flag(TIF_POLLING_NRFLAG); |
96 | 96 | ||
97 | while(1) { | 97 | while(1) { |
98 | tick_nohz_stop_sched_tick(1); | 98 | tick_nohz_idle_enter(); |
99 | rcu_idle_enter(); | ||
99 | 100 | ||
100 | while (!need_resched() && !cpu_is_offline(cpu)) | 101 | while (!need_resched() && !cpu_is_offline(cpu)) |
101 | sparc64_yield(cpu); | 102 | sparc64_yield(cpu); |
102 | 103 | ||
103 | tick_nohz_restart_sched_tick(); | 104 | rcu_idle_exit(); |
105 | tick_nohz_idle_exit(); | ||
104 | 106 | ||
105 | preempt_enable_no_resched(); | 107 | preempt_enable_no_resched(); |
106 | 108 | ||
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index fe1e3fc31bc5..ffb883ddd0f0 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c | |||
@@ -84,7 +84,7 @@ static void prom_sync_me(void) | |||
84 | 84 | ||
85 | prom_printf("PROM SYNC COMMAND...\n"); | 85 | prom_printf("PROM SYNC COMMAND...\n"); |
86 | show_free_areas(0); | 86 | show_free_areas(0); |
87 | if(current->pid != 0) { | 87 | if (!is_idle_task(current)) { |
88 | local_irq_enable(); | 88 | local_irq_enable(); |
89 | sys_sync(); | 89 | sys_sync(); |
90 | local_irq_disable(); | 90 | local_irq_disable(); |
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 441521ad8a3f..232df9949530 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c | |||
@@ -368,11 +368,11 @@ static unsigned long mmap_rnd(void) | |||
368 | if (current->flags & PF_RANDOMIZE) { | 368 | if (current->flags & PF_RANDOMIZE) { |
369 | unsigned long val = get_random_int(); | 369 | unsigned long val = get_random_int(); |
370 | if (test_thread_flag(TIF_32BIT)) | 370 | if (test_thread_flag(TIF_32BIT)) |
371 | rnd = (val % (1UL << (22UL-PAGE_SHIFT))); | 371 | rnd = (val % (1UL << (23UL-PAGE_SHIFT))); |
372 | else | 372 | else |
373 | rnd = (val % (1UL << (29UL-PAGE_SHIFT))); | 373 | rnd = (val % (1UL << (30UL-PAGE_SHIFT))); |
374 | } | 374 | } |
375 | return (rnd << PAGE_SHIFT) * 2; | 375 | return rnd << PAGE_SHIFT; |
376 | } | 376 | } |
377 | 377 | ||
378 | void arch_pick_mmap_layout(struct mm_struct *mm) | 378 | void arch_pick_mmap_layout(struct mm_struct *mm) |
diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index 7408201d7efb..654e8aad3bbe 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * Copyright (C) 2007 David S. Miller <davem@davemloft.net> | 3 | * Copyright (C) 2007 David S. Miller <davem@davemloft.net> |
4 | */ | 4 | */ |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | #include <linux/sysdev.h> | 6 | #include <linux/device.h> |
7 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
8 | #include <linux/smp.h> | 8 | #include <linux/smp.h> |
9 | #include <linux/percpu.h> | 9 | #include <linux/percpu.h> |
@@ -16,13 +16,13 @@ | |||
16 | static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); | 16 | static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); |
17 | 17 | ||
18 | #define SHOW_MMUSTAT_ULONG(NAME) \ | 18 | #define SHOW_MMUSTAT_ULONG(NAME) \ |
19 | static ssize_t show_##NAME(struct sys_device *dev, \ | 19 | static ssize_t show_##NAME(struct device *dev, \ |
20 | struct sysdev_attribute *attr, char *buf) \ | 20 | struct device_attribute *attr, char *buf) \ |
21 | { \ | 21 | { \ |
22 | struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \ | 22 | struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \ |
23 | return sprintf(buf, "%lu\n", p->NAME); \ | 23 | return sprintf(buf, "%lu\n", p->NAME); \ |
24 | } \ | 24 | } \ |
25 | static SYSDEV_ATTR(NAME, 0444, show_##NAME, NULL) | 25 | static DEVICE_ATTR(NAME, 0444, show_##NAME, NULL) |
26 | 26 | ||
27 | SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); | 27 | SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); |
28 | SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); | 28 | SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); |
@@ -58,38 +58,38 @@ SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_256mb_tte); | |||
58 | SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); | 58 | SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); |
59 | 59 | ||
60 | static struct attribute *mmu_stat_attrs[] = { | 60 | static struct attribute *mmu_stat_attrs[] = { |
61 | &attr_immu_tsb_hits_ctx0_8k_tte.attr, | 61 | &dev_attr_immu_tsb_hits_ctx0_8k_tte.attr, |
62 | &attr_immu_tsb_ticks_ctx0_8k_tte.attr, | 62 | &dev_attr_immu_tsb_ticks_ctx0_8k_tte.attr, |
63 | &attr_immu_tsb_hits_ctx0_64k_tte.attr, | 63 | &dev_attr_immu_tsb_hits_ctx0_64k_tte.attr, |
64 | &attr_immu_tsb_ticks_ctx0_64k_tte.attr, | 64 | &dev_attr_immu_tsb_ticks_ctx0_64k_tte.attr, |
65 | &attr_immu_tsb_hits_ctx0_4mb_tte.attr, | 65 | &dev_attr_immu_tsb_hits_ctx0_4mb_tte.attr, |
66 | &attr_immu_tsb_ticks_ctx0_4mb_tte.attr, | 66 | &dev_attr_immu_tsb_ticks_ctx0_4mb_tte.attr, |
67 | &attr_immu_tsb_hits_ctx0_256mb_tte.attr, | 67 | &dev_attr_immu_tsb_hits_ctx0_256mb_tte.attr, |
68 | &attr_immu_tsb_ticks_ctx0_256mb_tte.attr, | 68 | &dev_attr_immu_tsb_ticks_ctx0_256mb_tte.attr, |
69 | &attr_immu_tsb_hits_ctxnon0_8k_tte.attr, | 69 | &dev_attr_immu_tsb_hits_ctxnon0_8k_tte.attr, |
70 | &attr_immu_tsb_ticks_ctxnon0_8k_tte.attr, | 70 | &dev_attr_immu_tsb_ticks_ctxnon0_8k_tte.attr, |
71 | &attr_immu_tsb_hits_ctxnon0_64k_tte.attr, | 71 | &dev_attr_immu_tsb_hits_ctxnon0_64k_tte.attr, |
72 | &attr_immu_tsb_ticks_ctxnon0_64k_tte.attr, | 72 | &dev_attr_immu_tsb_ticks_ctxnon0_64k_tte.attr, |
73 | &attr_immu_tsb_hits_ctxnon0_4mb_tte.attr, | 73 | &dev_attr_immu_tsb_hits_ctxnon0_4mb_tte.attr, |
74 | &attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr, | 74 | &dev_attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr, |
75 | &attr_immu_tsb_hits_ctxnon0_256mb_tte.attr, | 75 | &dev_attr_immu_tsb_hits_ctxnon0_256mb_tte.attr, |
76 | &attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr, | 76 | &dev_attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr, |
77 | &attr_dmmu_tsb_hits_ctx0_8k_tte.attr, | 77 | &dev_attr_dmmu_tsb_hits_ctx0_8k_tte.attr, |
78 | &attr_dmmu_tsb_ticks_ctx0_8k_tte.attr, | 78 | &dev_attr_dmmu_tsb_ticks_ctx0_8k_tte.attr, |
79 | &attr_dmmu_tsb_hits_ctx0_64k_tte.attr, | 79 | &dev_attr_dmmu_tsb_hits_ctx0_64k_tte.attr, |
80 | &attr_dmmu_tsb_ticks_ctx0_64k_tte.attr, | 80 | &dev_attr_dmmu_tsb_ticks_ctx0_64k_tte.attr, |
81 | &attr_dmmu_tsb_hits_ctx0_4mb_tte.attr, | 81 | &dev_attr_dmmu_tsb_hits_ctx0_4mb_tte.attr, |
82 | &attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr, | 82 | &dev_attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr, |
83 | &attr_dmmu_tsb_hits_ctx0_256mb_tte.attr, | 83 | &dev_attr_dmmu_tsb_hits_ctx0_256mb_tte.attr, |
84 | &attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr, | 84 | &dev_attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr, |
85 | &attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr, | 85 | &dev_attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr, |
86 | &attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr, | 86 | &dev_attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr, |
87 | &attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr, | 87 | &dev_attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr, |
88 | &attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr, | 88 | &dev_attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr, |
89 | &attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr, | 89 | &dev_attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr, |
90 | &attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr, | 90 | &dev_attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr, |
91 | &attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr, | 91 | &dev_attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr, |
92 | &attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr, | 92 | &dev_attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr, |
93 | NULL, | 93 | NULL, |
94 | }; | 94 | }; |
95 | 95 | ||
@@ -139,15 +139,15 @@ static unsigned long write_mmustat_enable(unsigned long val) | |||
139 | return sun4v_mmustat_conf(ra, &orig_ra); | 139 | return sun4v_mmustat_conf(ra, &orig_ra); |
140 | } | 140 | } |
141 | 141 | ||
142 | static ssize_t show_mmustat_enable(struct sys_device *s, | 142 | static ssize_t show_mmustat_enable(struct device *s, |
143 | struct sysdev_attribute *attr, char *buf) | 143 | struct device_attribute *attr, char *buf) |
144 | { | 144 | { |
145 | unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0); | 145 | unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0); |
146 | return sprintf(buf, "%lx\n", val); | 146 | return sprintf(buf, "%lx\n", val); |
147 | } | 147 | } |
148 | 148 | ||
149 | static ssize_t store_mmustat_enable(struct sys_device *s, | 149 | static ssize_t store_mmustat_enable(struct device *s, |
150 | struct sysdev_attribute *attr, const char *buf, | 150 | struct device_attribute *attr, const char *buf, |
151 | size_t count) | 151 | size_t count) |
152 | { | 152 | { |
153 | unsigned long val, err; | 153 | unsigned long val, err; |
@@ -163,39 +163,39 @@ static ssize_t store_mmustat_enable(struct sys_device *s, | |||
163 | return count; | 163 | return count; |
164 | } | 164 | } |
165 | 165 | ||
166 | static SYSDEV_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable); | 166 | static DEVICE_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable); |
167 | 167 | ||
168 | static int mmu_stats_supported; | 168 | static int mmu_stats_supported; |
169 | 169 | ||
170 | static int register_mmu_stats(struct sys_device *s) | 170 | static int register_mmu_stats(struct device *s) |
171 | { | 171 | { |
172 | if (!mmu_stats_supported) | 172 | if (!mmu_stats_supported) |
173 | return 0; | 173 | return 0; |
174 | sysdev_create_file(s, &attr_mmustat_enable); | 174 | device_create_file(s, &dev_attr_mmustat_enable); |
175 | return sysfs_create_group(&s->kobj, &mmu_stat_group); | 175 | return sysfs_create_group(&s->kobj, &mmu_stat_group); |
176 | } | 176 | } |
177 | 177 | ||
178 | #ifdef CONFIG_HOTPLUG_CPU | 178 | #ifdef CONFIG_HOTPLUG_CPU |
179 | static void unregister_mmu_stats(struct sys_device *s) | 179 | static void unregister_mmu_stats(struct device *s) |
180 | { | 180 | { |
181 | if (!mmu_stats_supported) | 181 | if (!mmu_stats_supported) |
182 | return; | 182 | return; |
183 | sysfs_remove_group(&s->kobj, &mmu_stat_group); | 183 | sysfs_remove_group(&s->kobj, &mmu_stat_group); |
184 | sysdev_remove_file(s, &attr_mmustat_enable); | 184 | device_remove_file(s, &dev_attr_mmustat_enable); |
185 | } | 185 | } |
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | #define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \ | 188 | #define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \ |
189 | static ssize_t show_##NAME(struct sys_device *dev, \ | 189 | static ssize_t show_##NAME(struct device *dev, \ |
190 | struct sysdev_attribute *attr, char *buf) \ | 190 | struct device_attribute *attr, char *buf) \ |
191 | { \ | 191 | { \ |
192 | cpuinfo_sparc *c = &cpu_data(dev->id); \ | 192 | cpuinfo_sparc *c = &cpu_data(dev->id); \ |
193 | return sprintf(buf, "%lu\n", c->MEMBER); \ | 193 | return sprintf(buf, "%lu\n", c->MEMBER); \ |
194 | } | 194 | } |
195 | 195 | ||
196 | #define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \ | 196 | #define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \ |
197 | static ssize_t show_##NAME(struct sys_device *dev, \ | 197 | static ssize_t show_##NAME(struct device *dev, \ |
198 | struct sysdev_attribute *attr, char *buf) \ | 198 | struct device_attribute *attr, char *buf) \ |
199 | { \ | 199 | { \ |
200 | cpuinfo_sparc *c = &cpu_data(dev->id); \ | 200 | cpuinfo_sparc *c = &cpu_data(dev->id); \ |
201 | return sprintf(buf, "%u\n", c->MEMBER); \ | 201 | return sprintf(buf, "%u\n", c->MEMBER); \ |
@@ -209,14 +209,14 @@ SHOW_CPUDATA_UINT_NAME(l1_icache_line_size, icache_line_size); | |||
209 | SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size); | 209 | SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size); |
210 | SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size); | 210 | SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size); |
211 | 211 | ||
212 | static struct sysdev_attribute cpu_core_attrs[] = { | 212 | static struct device_attribute cpu_core_attrs[] = { |
213 | _SYSDEV_ATTR(clock_tick, 0444, show_clock_tick, NULL), | 213 | __ATTR(clock_tick, 0444, show_clock_tick, NULL), |
214 | _SYSDEV_ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL), | 214 | __ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL), |
215 | _SYSDEV_ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL), | 215 | __ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL), |
216 | _SYSDEV_ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL), | 216 | __ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL), |
217 | _SYSDEV_ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL), | 217 | __ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL), |
218 | _SYSDEV_ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL), | 218 | __ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL), |
219 | _SYSDEV_ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL), | 219 | __ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL), |
220 | }; | 220 | }; |
221 | 221 | ||
222 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | 222 | static DEFINE_PER_CPU(struct cpu, cpu_devices); |
@@ -224,11 +224,11 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); | |||
224 | static void register_cpu_online(unsigned int cpu) | 224 | static void register_cpu_online(unsigned int cpu) |
225 | { | 225 | { |
226 | struct cpu *c = &per_cpu(cpu_devices, cpu); | 226 | struct cpu *c = &per_cpu(cpu_devices, cpu); |
227 | struct sys_device *s = &c->sysdev; | 227 | struct device *s = &c->dev; |
228 | int i; | 228 | int i; |
229 | 229 | ||
230 | for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) | 230 | for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) |
231 | sysdev_create_file(s, &cpu_core_attrs[i]); | 231 | device_create_file(s, &cpu_core_attrs[i]); |
232 | 232 | ||
233 | register_mmu_stats(s); | 233 | register_mmu_stats(s); |
234 | } | 234 | } |
@@ -237,12 +237,12 @@ static void register_cpu_online(unsigned int cpu) | |||
237 | static void unregister_cpu_online(unsigned int cpu) | 237 | static void unregister_cpu_online(unsigned int cpu) |
238 | { | 238 | { |
239 | struct cpu *c = &per_cpu(cpu_devices, cpu); | 239 | struct cpu *c = &per_cpu(cpu_devices, cpu); |
240 | struct sys_device *s = &c->sysdev; | 240 | struct device *s = &c->dev; |
241 | int i; | 241 | int i; |
242 | 242 | ||
243 | unregister_mmu_stats(s); | 243 | unregister_mmu_stats(s); |
244 | for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) | 244 | for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) |
245 | sysdev_remove_file(s, &cpu_core_attrs[i]); | 245 | device_remove_file(s, &cpu_core_attrs[i]); |
246 | } | 246 | } |
247 | #endif | 247 | #endif |
248 | 248 | ||
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 8e073d802139..b3f5e7dfea51 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -790,7 +790,7 @@ static int find_node(unsigned long addr) | |||
790 | return -1; | 790 | return -1; |
791 | } | 791 | } |
792 | 792 | ||
793 | u64 memblock_nid_range(u64 start, u64 end, int *nid) | 793 | static u64 memblock_nid_range(u64 start, u64 end, int *nid) |
794 | { | 794 | { |
795 | *nid = find_node(start); | 795 | *nid = find_node(start); |
796 | start += PAGE_SIZE; | 796 | start += PAGE_SIZE; |
@@ -808,7 +808,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid) | |||
808 | return start; | 808 | return start; |
809 | } | 809 | } |
810 | #else | 810 | #else |
811 | u64 memblock_nid_range(u64 start, u64 end, int *nid) | 811 | static u64 memblock_nid_range(u64 start, u64 end, int *nid) |
812 | { | 812 | { |
813 | *nid = 0; | 813 | *nid = 0; |
814 | return end; | 814 | return end; |
@@ -816,7 +816,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid) | |||
816 | #endif | 816 | #endif |
817 | 817 | ||
818 | /* This must be invoked after performing all of the necessary | 818 | /* This must be invoked after performing all of the necessary |
819 | * add_active_range() calls for 'nid'. We need to be able to get | 819 | * memblock_set_node() calls for 'nid'. We need to be able to get |
820 | * correct data from get_pfn_range_for_nid(). | 820 | * correct data from get_pfn_range_for_nid(). |
821 | */ | 821 | */ |
822 | static void __init allocate_node_data(int nid) | 822 | static void __init allocate_node_data(int nid) |
@@ -987,14 +987,11 @@ static void __init add_node_ranges(void) | |||
987 | 987 | ||
988 | this_end = memblock_nid_range(start, end, &nid); | 988 | this_end = memblock_nid_range(start, end, &nid); |
989 | 989 | ||
990 | numadbg("Adding active range nid[%d] " | 990 | numadbg("Setting memblock NUMA node nid[%d] " |
991 | "start[%lx] end[%lx]\n", | 991 | "start[%lx] end[%lx]\n", |
992 | nid, start, this_end); | 992 | nid, start, this_end); |
993 | 993 | ||
994 | add_active_range(nid, | 994 | memblock_set_node(start, this_end - start, nid); |
995 | start >> PAGE_SHIFT, | ||
996 | this_end >> PAGE_SHIFT); | ||
997 | |||
998 | start = this_end; | 995 | start = this_end; |
999 | } | 996 | } |
1000 | } | 997 | } |
@@ -1282,7 +1279,6 @@ static void __init bootmem_init_nonnuma(void) | |||
1282 | { | 1279 | { |
1283 | unsigned long top_of_ram = memblock_end_of_DRAM(); | 1280 | unsigned long top_of_ram = memblock_end_of_DRAM(); |
1284 | unsigned long total_ram = memblock_phys_mem_size(); | 1281 | unsigned long total_ram = memblock_phys_mem_size(); |
1285 | struct memblock_region *reg; | ||
1286 | 1282 | ||
1287 | numadbg("bootmem_init_nonnuma()\n"); | 1283 | numadbg("bootmem_init_nonnuma()\n"); |
1288 | 1284 | ||
@@ -1292,20 +1288,8 @@ static void __init bootmem_init_nonnuma(void) | |||
1292 | (top_of_ram - total_ram) >> 20); | 1288 | (top_of_ram - total_ram) >> 20); |
1293 | 1289 | ||
1294 | init_node_masks_nonnuma(); | 1290 | init_node_masks_nonnuma(); |
1295 | 1291 | memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0); | |
1296 | for_each_memblock(memory, reg) { | ||
1297 | unsigned long start_pfn, end_pfn; | ||
1298 | |||
1299 | if (!reg->size) | ||
1300 | continue; | ||
1301 | |||
1302 | start_pfn = memblock_region_memory_base_pfn(reg); | ||
1303 | end_pfn = memblock_region_memory_end_pfn(reg); | ||
1304 | add_active_range(0, start_pfn, end_pfn); | ||
1305 | } | ||
1306 | |||
1307 | allocate_node_data(0); | 1292 | allocate_node_data(0); |
1308 | |||
1309 | node_set_online(0); | 1293 | node_set_online(0); |
1310 | } | 1294 | } |
1311 | 1295 | ||
@@ -1769,8 +1753,6 @@ void __init paging_init(void) | |||
1769 | sun4v_ktsb_init(); | 1753 | sun4v_ktsb_init(); |
1770 | } | 1754 | } |
1771 | 1755 | ||
1772 | memblock_init(); | ||
1773 | |||
1774 | /* Find available physical memory... | 1756 | /* Find available physical memory... |
1775 | * | 1757 | * |
1776 | * Read it twice in order to work around a bug in openfirmware. | 1758 | * Read it twice in order to work around a bug in openfirmware. |
@@ -1796,7 +1778,7 @@ void __init paging_init(void) | |||
1796 | 1778 | ||
1797 | memblock_enforce_memory_limit(cmdline_memory_size); | 1779 | memblock_enforce_memory_limit(cmdline_memory_size); |
1798 | 1780 | ||
1799 | memblock_analyze(); | 1781 | memblock_allow_resize(); |
1800 | memblock_dump_all(); | 1782 | memblock_dump_all(); |
1801 | 1783 | ||
1802 | set_bit(0, mmu_context_bmap); | 1784 | set_bit(0, mmu_context_bmap); |