Commit MetaInfo

Revisionecde16be1b8bda3b1edb07a28670d4bfb8958352 (tree)
Time2018-11-05 01:17:04
AuthorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

build fix 4.19

Change Summary

Incremental Difference

--- a/arch/rx/Kconfig
+++ b/arch/rx/Kconfig
@@ -24,6 +24,7 @@ config RX
2424 select CLKSRC_OF
2525 select GENERIC_CLOCKEVENTS
2626 select HAVE_EFFICIENT_UNALIGNED_ACCESS
27+ select DMA_DIRECT_OPS
2728
2829 config MMU
2930 def_bool n
@@ -98,8 +99,6 @@ config NR_CPUS
9899 config GENERIC_IRQ_SHOW
99100 def_bool y
100101
101-source "init/Kconfig"
102-
103102 source "kernel/Kconfig.freezer"
104103
105104 menu "Processor type and features"
@@ -191,34 +190,5 @@ config BOOT_LINK_OFFSET
191190 hex "Link offset of zImage"
192191 endmenu
193192
194-config PREEMPT
195- bool "Preemptible Kernel"
196- default n
197-
198-source "mm/Kconfig"
199-
200193 endmenu
201194
202-menu "Executable file formats"
203-
204-source "fs/Kconfig.binfmt"
205-
206-endmenu
207-
208-source "net/Kconfig"
209-
210-source "drivers/Kconfig"
211-
212-source "fs/Kconfig"
213-
214-menu "Kernel Hacking"
215-
216-source "lib/Kconfig.debug"
217-
218-endmenu
219-
220-source "security/Kconfig"
221-
222-source "crypto/Kconfig"
223-
224-source "lib/Kconfig"
--- a/arch/rx/Kconfig.debug
+++ b/arch/rx/Kconfig.debug
@@ -1,7 +1,5 @@
11 menu "Kernel Hacking"
22
3-source "lib/Kconfig.debug"
4-
53 config EARLY_PRINTK
64 bool "Early printk support"
75
--- a/arch/rx/boot/compressed/head.S
+++ b/arch/rx/boot/compressed/head.S
@@ -10,10 +10,10 @@
1010
1111 .global startup
1212 startup:
13- mov #_stext,r0
13+ mov #__stext,r0
1414 mov r1,r6
15- mov #_sbss,r1
16- mov #_ebss,r3
15+ mov #__sbss,r1
16+ mov #__ebss,r3
1717 sub r1,r3
1818 mov #0,r2
1919 sstr.b
--- a/arch/rx/boot/compressed/misc.c
+++ b/arch/rx/boot/compressed/misc.c
@@ -8,9 +8,6 @@
88 *
99 */
1010
11-#include <asm/uaccess.h>
12-#include <asm/page.h>
13-
1411 /*
1512 * gzip declarations
1613 */
--- /dev/null
+++ b/arch/rx/boot/compressed/vmlinux.lds
@@ -0,0 +1,35 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+SECTIONS
3+{
4+ .text :
5+ {
6+ __stext = . ;
7+ __text = .;
8+ *(.text..startup)
9+ *(.text)
10+ __etext = . ;
11+ }
12+
13+ .rodata :
14+ {
15+ *(.rodata)
16+ }
17+ . = ALIGN(0x4) ;
18+ .data :
19+
20+ {
21+ . = ALIGN(0x4) ;
22+ __sdata = . ;
23+ ___data_start = . ;
24+ *(.data.*)
25+ }
26+ . = ALIGN(0x4) ;
27+ .bss :
28+ {
29+ __sbss = . ;
30+ *(.bss*)
31+ . = ALIGN(0x4) ;
32+ __ebss = . ;
33+ }
34+ _end = . ;
35+}
--- a/arch/rx/include/asm/Kbuild
+++ b/arch/rx/include/asm/Kbuild
@@ -4,6 +4,7 @@ generic-y += barrier.h
44 generic-y += bugs.h
55 generic-y += cacheflush.h
66 generic-y += checksum.h
7+generic-y += compat.h
78 generic-y += clkdev.h
89 generic-y += cputime.h
910 generic-y += current.h
@@ -11,9 +12,11 @@ generic-y += delay.h
1112 generic-y += device.h
1213 generic-y += div64.h
1314 generic-y += dma.h
15+generic-y += dma-mapping.h
1416 generic-y += emergency-restart.h
1517 generic-y += errno.h
1618 generic-y += exec.h
19+generic-y += extable.h
1720 generic-y += fb.h
1821 generic-y += fcntl.h
1922 generic-y += ftrace.h
@@ -27,6 +30,7 @@ generic-y += ipcbuf.h
2730 generic-y += irq_regs.h
2831 generic-y += irq_work.h
2932 generic-y += kmap_types.h
33+generic-y += kprobes.h
3034 generic-y += kvm_para.h
3135 generic-y += linkage.h
3236 generic-y += local.h
--- a/arch/rx/include/asm/atomic.h
+++ b/arch/rx/include/asm/atomic.h
@@ -1,6 +1,7 @@
11 #ifndef __ARCH_RX_ATOMIC__
22 #define __ARCH_RX_ATOMIC__
33
4+#include <linux/compiler.h>
45 #include <linux/types.h>
56 #include <asm/cmpxchg.h>
67
@@ -14,8 +15,6 @@
1415 #define atomic_read(v) READ_ONCE((v)->counter)
1516 #define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i))
1617
17-#include <linux/kernel.h>
18-
1918 #define ATOMIC_OP_RETURN(op, c_op) \
2019 static inline int atomic_##op##_return(int i, atomic_t *v) \
2120 { \
@@ -28,6 +27,19 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \
2827 return ret; \
2928 }
3029
30+#define ATOMIC_FETCH_OP(op, c_op) \
31+static inline int atomic_fetch_##op(int i, atomic_t *v) \
32+{ \
33+ unsigned long flags; \
34+ int ret; \
35+ \
36+ flags = arch_local_irq_save(); \
37+ ret = v->counter; \
38+ v->counter c_op i; \
39+ arch_local_irq_restore(flags); \
40+ return ret; \
41+}
42+
3143 #define ATOMIC_OP(op, c_op) \
3244 static inline void atomic_##op(int i, atomic_t *v) \
3345 { \
@@ -41,28 +53,20 @@ static inline void atomic_##op(int i, atomic_t *v) \
4153 ATOMIC_OP_RETURN(add, +=)
4254 ATOMIC_OP_RETURN(sub, -=)
4355
44-ATOMIC_OP(and, &=)
45-ATOMIC_OP(or, |=)
46-ATOMIC_OP(xor, ^=)
56+#define ATOMIC_OPS(op, c_op) \
57+ ATOMIC_OP(op, c_op) \
58+ ATOMIC_FETCH_OP(op, c_op)
4759
60+ATOMIC_OPS(and, &=)
61+ATOMIC_OPS(or, |=)
62+ATOMIC_OPS(xor, ^=)
63+ATOMIC_OPS(add, +=)
64+ATOMIC_OPS(sub, -=)
65+
66+#undef ATOMIC_OPS
4867 #undef ATOMIC_OP_RETURN
4968 #undef ATOMIC_OP
5069
51-#define atomic_add(i, v) (void)atomic_add_return(i, v)
52-#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
53-
54-#define atomic_sub(i, v) (void)atomic_sub_return(i, v)
55-#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
56-
57-#define atomic_inc_return(v) atomic_add_return(1, v)
58-#define atomic_dec_return(v) atomic_sub_return(1, v)
59-
60-#define atomic_inc(v) (void)atomic_inc_return(v)
61-#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
62-
63-#define atomic_dec(v) (void)atomic_dec_return(v)
64-#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
65-
6670 static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
6771 {
6872 int ret;
@@ -76,7 +80,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
7680 return ret;
7781 }
7882
79-static inline int __atomic_add_unless(atomic_t *v, int a, int u)
83+static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
8084 {
8185 int ret;
8286 unsigned long flags;
@@ -88,5 +92,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
8892 arch_local_irq_restore(flags);
8993 return ret;
9094 }
95+#define atomic_fetch_add_unless atomic_fetch_add_unless
9196
9297 #endif /* __ARCH_RX_ATOMIC __ */
--- a/arch/rx/include/asm/dma-mapping.h
+++ /dev/null
@@ -1,12 +0,0 @@
1-#ifndef __ASM_RX_DMA_MAPPING_H
2-#define __ASM_RX_DMA_MAPPING_H
3-
4-extern struct dma_map_ops *dma_ops;
5-extern void no_iommu_init(void);
6-
7-static inline struct dma_map_ops *get_dma_ops(struct device *dev)
8-{
9- return dma_ops;
10-}
11-
12-#endif /* __ASM_RX_DMA_MAPPING_H */
--- a/arch/rx/include/asm/irqflags.h
+++ b/arch/rx/include/asm/irqflags.h
@@ -1,7 +1,7 @@
11 #ifndef _RX_IRQFLAGS_H_
22 #define _RX_IRQFLAGS_H_
33
4-static inline unsigned long arch_local_irq_save_flags(void)
4+static inline unsigned long arch_local_save_flags(void)
55 {
66 unsigned long iflag;
77 asm volatile ("mvfc psw, %0\n\t"
@@ -22,7 +22,7 @@ static inline void arch_local_irq_enable(void)
2222 static inline unsigned long arch_local_irq_save(void)
2323 {
2424 unsigned long iflag;
25- iflag = arch_local_irq_save_flags();
25+ iflag = arch_local_save_flags();
2626 arch_local_irq_disable();
2727 return iflag;
2828 }
@@ -43,7 +43,7 @@ static inline int arch_irqs_disabled_flags(unsigned long psw)
4343
4444 static inline int arch_irqs_disabled(void)
4545 {
46- return arch_irqs_disabled_flags(arch_local_irq_save_flags());
46+ return arch_irqs_disabled_flags(arch_local_save_flags());
4747 }
4848
4949 #endif
--- a/arch/rx/include/asm/page.h
+++ b/arch/rx/include/asm/page.h
@@ -1 +1,19 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _RX_PAGE_H
3+#define _RX_PAGE_H
4+
15 #include <asm-generic/page.h>
6+#include <linux/types.h>
7+
8+#define MAP_NR(addr) (((uintptr_t)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
9+#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
10+ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
11+
12+#ifndef __ASSEMBLY__
13+extern unsigned long rom_length;
14+extern unsigned long memory_start;
15+extern unsigned long memory_end;
16+extern unsigned long _ramend;
17+#endif
18+
19+#endif
--- a/arch/rx/include/asm/processor.h
+++ b/arch/rx/include/asm/processor.h
@@ -78,17 +78,6 @@ static inline void prepare_to_copy(struct task_struct *tsk)
7878 }
7979
8080 /*
81- * Free current thread data structures etc..
82- */
83-static inline void exit_thread(void)
84-{
85-}
86-
87-static inline void flush_thread(void)
88-{
89-}
90-
91-/*
9281 * Return saved PC of a blocked thread.
9382 */
9483 #define thread_saved_pc(tsk) (tsk->thread.pc)
@@ -96,9 +85,6 @@ static inline void flush_thread(void)
9685 unsigned long get_wchan(struct task_struct *p);
9786 void show_trace(struct task_struct *tsk, unsigned long *sp,
9887 struct pt_regs *regs);
99-
100-#define task_pt_regs(tsk) \
101- ((struct pt_regs *)(task_stack_page(tsk) + THREAD_SIZE) - 1)
10288 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
10389 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->r[0])
10490
--- /dev/null
+++ b/arch/rx/include/asm/ptrace.h
@@ -0,0 +1,9 @@
1+#ifndef __ASM_RX_PTRACE_H__
2+#define __ASM_RX_PTRACE_H__
3+
4+#include <uapi/asm/ptrace.h>
5+
6+#define task_pt_regs(tsk) \
7+ ((struct pt_regs *)(task_stack_page(tsk) + THREAD_SIZE) - 1)
8+
9+#endif
--- a/arch/rx/include/asm/segment.h
+++ b/arch/rx/include/asm/segment.h
@@ -5,6 +5,7 @@
55 typedef struct {
66 unsigned long seg;
77 } mm_segment_t;
8+
89 #endif
910
1011 #endif
--- a/arch/rx/include/asm/system.h
+++ b/arch/rx/include/asm/system.h
@@ -23,17 +23,6 @@ __asm__ volatile("switch_to:"); \
2323 } while(0)
2424
2525
26-#define nop() asm volatile ("nop"::)
27-#define mb() asm volatile ("" : : :"memory")
28-#define rmb() asm volatile ("" : : :"memory")
29-#define wmb() asm volatile ("" : : :"memory")
30-#define set_mb(var, value) do { var = value; } while (0)
31-
32-#define smp_mb() barrier()
33-#define smp_rmb() barrier()
34-#define smp_wmb() barrier()
35-#define smp_read_barrier_depends() do { } while(0)
36-
3726 #define arch_align_stack(x) (x)
3827
3928 #endif /* __ASM_RX_SYSTEM_H__ */
--- a/arch/rx/include/asm/thread_info.h
+++ b/arch/rx/include/asm/thread_info.h
@@ -43,10 +43,6 @@ struct thread_info {
4343 }, \
4444 }
4545
46-#define init_thread_info (init_thread_union.thread_info)
47-#define init_stack (init_thread_union.stack)
48-
49-
5046 /* how to get the thread information struct from C */
5147 static inline struct thread_info *current_thread_info(void)
5248 {
--- /dev/null
+++ b/arch/rx/include/asm/uaccess.h
@@ -0,0 +1,55 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_UACCESS_H
3+#define _ASM_UACCESS_H
4+
5+#include <linux/string.h>
6+
7+static inline __must_check unsigned long
8+raw_copy_from_user(void *to, const void __user * from, unsigned long n)
9+{
10+ if (__builtin_constant_p(n)) {
11+ switch(n) {
12+ case 1:
13+ *(u8 *)to = *(u8 __force *)from;
14+ return 0;
15+ case 2:
16+ *(u16 *)to = *(u16 __force *)from;
17+ return 0;
18+ case 4:
19+ *(u32 *)to = *(u32 __force *)from;
20+ return 0;
21+ }
22+ }
23+
24+ memcpy(to, (const void __force *)from, n);
25+ return 0;
26+}
27+
28+static inline __must_check unsigned long
29+raw_copy_to_user(void __user *to, const void *from, unsigned long n)
30+{
31+ if (__builtin_constant_p(n)) {
32+ switch(n) {
33+ case 1:
34+ *(u8 __force *)to = *(u8 *)from;
35+ return 0;
36+ case 2:
37+ *(u16 __force *)to = *(u16 *)from;
38+ return 0;
39+ case 4:
40+ *(u32 __force *)to = *(u32 *)from;
41+ return 0;
42+ default:
43+ break;
44+ }
45+ }
46+
47+ memcpy((void __force *)to, from, n);
48+ return 0;
49+}
50+#define INLINE_COPY_FROM_USER
51+#define INLINE_COPY_TO_USER
52+
53+#include <asm-generic/uaccess.h>
54+
55+#endif
--- a/arch/rx/include/uapi/asm/Kbuild
+++ b/arch/rx/include/uapi/asm/Kbuild
@@ -1,30 +1,30 @@
11 # UAPI Header export list
22 include include/uapi/asm-generic/Kbuild.asm
33
4-header-y += auxvec.h
5-header-y += bitsperlong.h
6-header-y += errno.h
7-header-y += fcntl.h
8-header-y += ioctl.h
9-header-y += ioctls.h
10-header-y += ipcbuf.h
11-header-y += kvm_para.h
12-header-y += mman.h
13-header-y += msgbuf.h
14-header-y += param.h
15-header-y += poll.h
16-header-y += posix_types.h
17-header-y += resource.h
18-header-y += sembuf.h
19-header-y += setup.h
20-header-y += shmbuf.h
21-header-y += siginfo.h
22-header-y += socket.h
23-header-y += sockios.h
24-header-y += stat.h
25-header-y += statfs.h
26-header-y += swab.h
27-header-y += termbits.h
28-header-y += termios.h
29-header-y += types.h
30-header-y += unistd.h
4+generic-y += auxvec.h
5+generic-y += bpf_perf_event.h
6+generic-y += errno.h
7+generic-y += fcntl.h
8+generic-y += ioctl.h
9+generic-y += ioctls.h
10+generic-y += ipcbuf.h
11+generic-y += kvm_para.h
12+generic-y += mman.h
13+generic-y += msgbuf.h
14+generic-y += param.h
15+generic-y += poll.h
16+generic-y += posix_types.h
17+generic-y += resource.h
18+generic-y += sembuf.h
19+generic-y += setup.h
20+generic-y += shmbuf.h
21+generic-y += siginfo.h
22+generic-y += socket.h
23+generic-y += sockios.h
24+generic-y += stat.h
25+generic-y += statfs.h
26+generic-y += swab.h
27+generic-y += termbits.h
28+generic-y += termios.h
29+generic-y += types.h
30+generic-y += unistd.h
--- /dev/null
+++ b/arch/rx/include/uapi/asm/bitsperlong.h
@@ -0,0 +1,15 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+#ifndef _UAPI__ASM_RX_BITS_PER_LONG
3+#define _UAPI__ASM_RX_BITS_PER_LONG
4+
5+#include <asm-generic/bitsperlong.h>
6+
7+#if !defined(__ASSEMBLY__)
8+/* rx-unknown-linux required long */
9+#define __kernel_size_t __kernel_size_t
10+typedef unsigned long __kernel_size_t;
11+typedef long __kernel_ssize_t;
12+typedef long __kernel_ptrdiff_t;
13+#endif
14+
15+#endif /* _UAPI__ASM_RX_BITS_PER_LONG */
--- a/arch/rx/include/uapi/asm/ptrace.h
+++ b/arch/rx/include/uapi/asm/ptrace.h
@@ -1,5 +1,5 @@
1-#ifndef __ASM_RX_PTRACE_H__
2-#define __ASM_RX_PTRACE_H__
1+#ifndef __UAPI_ASM_RX_PTRACE_H__
2+#define __UAPI_ASM_RX_PTRACE_H__
33
44 #ifndef __ASSEMBLY__
55
--- a/arch/rx/kernel/Makefile
+++ b/arch/rx/kernel/Makefile
@@ -5,7 +5,7 @@
55 extra-y := vmlinux.lds
66
77 obj-y := head.o process.o traps.o irq.o signal.o \
8- setup.o syscalls.o entry.o ptrace.o dma-nommu.o
8+ setup.o syscalls.o entry.o ptrace.o
99
1010 obj-$(CONFIG_RX_GDB_SIM) += sim-console.o
1111 ifeq '$(CONFIG_RXV2)' 'y'
--- a/arch/rx/kernel/process.c
+++ b/arch/rx/kernel/process.c
@@ -19,6 +19,7 @@
1919 #include <linux/fs.h>
2020 #include <linux/ftrace.h>
2121 #include <linux/preempt.h>
22+#include <linux/sched/debug.h>
2223 #include <asm/uaccess.h>
2324 #include <asm/mmu_context.h>
2425 #include <asm/pgalloc.h>
@@ -72,7 +73,7 @@ void show_regs(struct pt_regs * regs)
7273 {
7374 printk("\n");
7475 printk("Pid : %d, Comm: \t\t%s\n", task_pid_nr(current), current->comm);
75- print_symbol("PC is at %s\n", instruction_pointer(regs));
76+ printk("PC is at %pS\n", (void *)instruction_pointer(regs));
7677
7778 printk("PC : %08lx SP : %08lx PSW : %08lx\n",
7879 regs->pc, regs->r[0], regs->psw);
@@ -93,6 +94,10 @@ void show_regs(struct pt_regs * regs)
9394 asmlinkage void ret_from_fork(void);
9495 asmlinkage void ret_from_kernel_thread(void);
9596
97+void flush_thread(void)
98+{
99+}
100+
96101 int copy_thread(unsigned long clone_flags,
97102 unsigned long usp, unsigned long topstk,
98103 struct task_struct * p)
--- a/arch/rx/kernel/setup.c
+++ b/arch/rx/kernel/setup.c
@@ -51,12 +51,6 @@ static struct resource bss_resource = {
5151 .name = "Kernel bss",
5252 };
5353
54-extern void *_ramstart, *_ramend;
55-extern void *_stext, *_etext;
56-extern void *_sdata, *_edata;
57-extern void *_sbss, *_ebss;
58-extern void *_end;
59-
6054 void __init rx_fdt_init(void *fdt)
6155 {
6256 char saved_command_line[512];
@@ -208,7 +202,7 @@ device_initcall(device_probe);
208202 void __init time_init(void)
209203 {
210204 of_clk_init(NULL);
211- clocksource_probe();
205+ timer_probe();
212206 }
213207
214208 void __init calibrate_delay(void)
--- a/arch/rx/kernel/signal.c
+++ b/arch/rx/kernel/signal.c
@@ -1,4 +1,5 @@
11 #include <linux/sched.h>
2+#include <linux/sched/task_stack.h>
23 #include <linux/mm.h>
34 #include <linux/smp.h>
45 #include <linux/kernel.h>
@@ -60,7 +61,7 @@ asmlinkage int sys_rt_sigreturn(void)
6061
6162 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
6263 goto badframe;
63- if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
64+ if (raw_copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
6465 goto badframe;
6566
6667 set_current_blocked(&set);
@@ -145,7 +146,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
145146 &frame->uc.uc_stack.ss_flags);
146147 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
147148 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
148- err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
149+ err |= raw_copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
149150 if (err)
150151 return -EFAULT;
151152
--- a/arch/rx/kernel/traps.c
+++ b/arch/rx/kernel/traps.c
@@ -200,7 +200,6 @@ void die(const char *str, struct pt_regs *regs)
200200 do_exit(SIGSEGV);
201201 }
202202
203-extern char _stext, _etext;
204203 #define check_kernel_text(addr) \
205204 ((addr >= (unsigned long)(&_stext)) && \
206205 (addr < (unsigned long)(&_etext)))
@@ -254,13 +253,6 @@ void show_trace_task(struct task_struct *tsk)
254253 show_stack(tsk,(unsigned long *)tsk->thread.sp);
255254 }
256255
257-void dump_stack(void)
258-{
259- show_stack(NULL,NULL);
260-}
261-
262-EXPORT_SYMBOL(dump_stack);
263-
264256 asmlinkage void unhandled_exception(struct pt_regs *regs, unsigned int ex)
265257 {
266258 if (!user_mode(regs))
--- a/arch/rx/kernel/vmlinux.lds.S
+++ b/arch/rx/kernel/vmlinux.lds.S
@@ -36,6 +36,7 @@ SECTIONS
3636 {
3737 TEXT_TEXT
3838 SCHED_TEXT
39+ CPUIDLE_TEXT
3940 LOCK_TEXT
4041 _etext = . ;
4142 }
--- a/arch/rx/mm/init.c
+++ b/arch/rx/mm/init.c
@@ -22,14 +22,13 @@
2222 #include <linux/highmem.h>
2323 #include <linux/pagemap.h>
2424 #include <linux/bootmem.h>
25-#include <linux/slab.h>
26-#include <linux/dma-mapping.h>
25+#include <linux/gfp.h>
2726
2827 #include <asm/setup.h>
2928 #include <asm/segment.h>
3029 #include <asm/page.h>
3130 #include <asm/pgtable.h>
32-#include <asm/system.h>
31+#include <asm/sections.h>
3332
3433 #undef DEBUG
3534
@@ -113,77 +112,26 @@ void __init paging_init(void)
113112
114113 void __init mem_init(void)
115114 {
116- unsigned long tmp;
117- extern char _etext[], _stext[], _sdata[], _ebss[], __init_begin[], __init_end[];
118- extern unsigned long _ramend, _ramstart;
119- unsigned long len;
120- unsigned long end_mem = (unsigned long)&_ramend;
121- unsigned int codek, datak, initk;
115+ pr_devel("Mem_init: start=%lx, end=%lx\n", memory_start, memory_end);
122116
123-#ifdef DEBUG
124- printk(KERN_DEBUG "Mem_init: start=%lx, end=%lx\n",
125- (unsigned long)&_ram_start, end_mem);
126-#endif
127-#ifdef CONFIG_ROMKERNEL
128- len = &_ramend - &_ramstart;
129-#else
130- len = memory_end - memory_start;
131-#endif
132- end_mem &= PAGE_MASK;
133- high_memory = (void *) end_mem;
134-
135- max_mapnr = len >> PAGE_SHIFT;
136-
137- totalram_pages = free_all_bootmem();
138-
139- codek = (_etext - _stext) >> 10;
140- datak = (_ebss - _sdata) >> 10;
141- initk = (__init_begin - __init_end) >> 10;
142-
143- tmp = nr_free_pages() << PAGE_SHIFT;
144- printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n",
145- tmp >> 10,
146- len >> 10,
147- (rom_length > 0) ? ((rom_length >> 10) - codek) : 0,
148- rom_length >> 10,
149- codek,
150- datak
151- );
152- no_iommu_init();
153-}
117+ high_memory = (void *) (memory_end & PAGE_MASK);
118+ max_mapnr = MAP_NR(high_memory);
154119
120+ /* this will put all low memory onto the freelists */
121+ free_all_bootmem();
122+
123+ mem_init_print_info(NULL);
124+}
155125
156126 #ifdef CONFIG_BLK_DEV_INITRD
157127 void free_initrd_mem(unsigned long start, unsigned long end)
158128 {
159- int pages = 0;
160- for (; start < end; start += PAGE_SIZE) {
161- ClearPageReserved(virt_to_page(start));
162- init_page_count(virt_to_page(start));
163- free_page(start);
164- totalram_pages++;
165- pages++;
166- }
167- printk ("Freeing initrd memory: %dk freed\n", pages);
129+ free_reserved_area((void *)start, (void *)end, -1, "initrd");
168130 }
169131 #endif
170132
171-void free_initmem(void)
133+void
134+free_initmem(void)
172135 {
173- unsigned long addr;
174- extern char __init_begin[], __init_end[];
175-
176- addr = PAGE_ALIGN((unsigned long)(&__init_begin));
177- /* next to check that the page we free is not a partial page */
178- for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) {
179- ClearPageReserved(virt_to_page(addr));
180- init_page_count(virt_to_page(addr));
181- free_page(addr);
182- totalram_pages++;
183- }
184- printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
185- (addr - PAGE_ALIGN((long) &__init_begin)) >> 10,
186- (int)(PAGE_ALIGN((unsigned long)(&__init_begin))),
187- (int)(addr - PAGE_SIZE));
136+ free_initmem_default(-1);
188137 }
189-
--- a/drivers/clocksource/rx_tpu.c
+++ b/drivers/clocksource/rx_tpu.c
@@ -57,7 +57,7 @@ static inline struct tpu_priv *cs_to_priv(struct clocksource *cs)
5757 return container_of(cs, struct tpu_priv, cs);
5858 }
5959
60-static cycle_t tpu_clocksource_read(struct clocksource *cs)
60+static u64 tpu_clocksource_read(struct clocksource *cs)
6161 {
6262 struct tpu_priv *p = cs_to_priv(cs);
6363 unsigned long flags;
Show on old repository browser