aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/include/asm
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/mn10300/include/asm
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/mn10300/include/asm')
-rw-r--r--arch/mn10300/include/asm/Kbuild5
-rw-r--r--arch/mn10300/include/asm/atomic.h109
-rw-r--r--arch/mn10300/include/asm/barrier.h37
-rw-r--r--arch/mn10300/include/asm/cmpxchg.h115
-rw-r--r--arch/mn10300/include/asm/dma.h1
-rw-r--r--arch/mn10300/include/asm/elf.h3
-rw-r--r--arch/mn10300/include/asm/exceptions.h2
-rw-r--r--arch/mn10300/include/asm/frame.inc2
-rw-r--r--arch/mn10300/include/asm/highmem.h2
-rw-r--r--arch/mn10300/include/asm/io.h18
-rw-r--r--arch/mn10300/include/asm/module.h7
-rw-r--r--arch/mn10300/include/asm/pci.h16
-rw-r--r--arch/mn10300/include/asm/processor.h21
-rw-r--r--arch/mn10300/include/asm/ptrace.h76
-rw-r--r--arch/mn10300/include/asm/reset-regs.h4
-rw-r--r--arch/mn10300/include/asm/setup.h4
-rw-r--r--arch/mn10300/include/asm/signal.h125
-rw-r--r--arch/mn10300/include/asm/switch_to.h49
-rw-r--r--arch/mn10300/include/asm/termios.h81
-rw-r--r--arch/mn10300/include/asm/thread_info.h22
-rw-r--r--arch/mn10300/include/asm/timex.h11
-rw-r--r--arch/mn10300/include/asm/types.h11
-rw-r--r--arch/mn10300/include/asm/unistd.h346
23 files changed, 825 insertions, 242 deletions
diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild
index c5d76702830..c68e1680da0 100644
--- a/arch/mn10300/include/asm/Kbuild
+++ b/arch/mn10300/include/asm/Kbuild
@@ -1,4 +1 @@
1 include include/asm-generic/Kbuild.asm
2generic-y += clkdev.h
3generic-y += exec.h
4generic-y += trace_clock.h
diff --git a/arch/mn10300/include/asm/atomic.h b/arch/mn10300/include/asm/atomic.h
index 975e1841ca6..b9a8f846126 100644
--- a/arch/mn10300/include/asm/atomic.h
+++ b/arch/mn10300/include/asm/atomic.h
@@ -12,7 +12,112 @@
12#define _ASM_ATOMIC_H 12#define _ASM_ATOMIC_H
13 13
14#include <asm/irqflags.h> 14#include <asm/irqflags.h>
15#include <asm/cmpxchg.h> 15
16#ifndef __ASSEMBLY__
17
18#ifdef CONFIG_SMP
19#ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT
20static inline
21unsigned long __xchg(volatile unsigned long *m, unsigned long val)
22{
23 unsigned long status;
24 unsigned long oldval;
25
26 asm volatile(
27 "1: mov %4,(_AAR,%3) \n"
28 " mov (_ADR,%3),%1 \n"
29 " mov %5,(_ADR,%3) \n"
30 " mov (_ADR,%3),%0 \n" /* flush */
31 " mov (_ASR,%3),%0 \n"
32 " or %0,%0 \n"
33 " bne 1b \n"
34 : "=&r"(status), "=&r"(oldval), "=m"(*m)
35 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m), "r"(val)
36 : "memory", "cc");
37
38 return oldval;
39}
40
41static inline unsigned long __cmpxchg(volatile unsigned long *m,
42 unsigned long old, unsigned long new)
43{
44 unsigned long status;
45 unsigned long oldval;
46
47 asm volatile(
48 "1: mov %4,(_AAR,%3) \n"
49 " mov (_ADR,%3),%1 \n"
50 " cmp %5,%1 \n"
51 " bne 2f \n"
52 " mov %6,(_ADR,%3) \n"
53 "2: mov (_ADR,%3),%0 \n" /* flush */
54 " mov (_ASR,%3),%0 \n"
55 " or %0,%0 \n"
56 " bne 1b \n"
57 : "=&r"(status), "=&r"(oldval), "=m"(*m)
58 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m),
59 "r"(old), "r"(new)
60 : "memory", "cc");
61
62 return oldval;
63}
64#else /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
65#error "No SMP atomic operation support!"
66#endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
67
68#else /* CONFIG_SMP */
69
70/*
71 * Emulate xchg for non-SMP MN10300
72 */
73struct __xchg_dummy { unsigned long a[100]; };
74#define __xg(x) ((struct __xchg_dummy *)(x))
75
76static inline
77unsigned long __xchg(volatile unsigned long *m, unsigned long val)
78{
79 unsigned long oldval;
80 unsigned long flags;
81
82 flags = arch_local_cli_save();
83 oldval = *m;
84 *m = val;
85 arch_local_irq_restore(flags);
86 return oldval;
87}
88
89/*
90 * Emulate cmpxchg for non-SMP MN10300
91 */
92static inline unsigned long __cmpxchg(volatile unsigned long *m,
93 unsigned long old, unsigned long new)
94{
95 unsigned long oldval;
96 unsigned long flags;
97
98 flags = arch_local_cli_save();
99 oldval = *m;
100 if (oldval == old)
101 *m = new;
102 arch_local_irq_restore(flags);
103 return oldval;
104}
105
106#endif /* CONFIG_SMP */
107
108#define xchg(ptr, v) \
109 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
110 (unsigned long)(v)))
111
112#define cmpxchg(ptr, o, n) \
113 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
114 (unsigned long)(o), \
115 (unsigned long)(n)))
116
117#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
118#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
119
120#endif /* !__ASSEMBLY__ */
16 121
17#ifndef CONFIG_SMP 122#ifndef CONFIG_SMP
18#include <asm-generic/atomic.h> 123#include <asm-generic/atomic.h>
@@ -164,8 +269,6 @@ static inline void atomic_dec(atomic_t *v)
164 c; \ 269 c; \
165}) 270})
166 271
167#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
168#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
169 272
170/** 273/**
171 * atomic_clear_mask - Atomically clear bits in memory 274 * atomic_clear_mask - Atomically clear bits in memory
diff --git a/arch/mn10300/include/asm/barrier.h b/arch/mn10300/include/asm/barrier.h
deleted file mode 100644
index 2bd97a5c8af..00000000000
--- a/arch/mn10300/include/asm/barrier.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/* MN10300 memory barrier definitions
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_BARRIER_H
12#define _ASM_BARRIER_H
13
14#define nop() asm volatile ("nop")
15
16#define mb() asm volatile ("": : :"memory")
17#define rmb() mb()
18#define wmb() asm volatile ("": : :"memory")
19
20#ifdef CONFIG_SMP
21#define smp_mb() mb()
22#define smp_rmb() rmb()
23#define smp_wmb() wmb()
24#define set_mb(var, value) do { xchg(&var, value); } while (0)
25#else /* CONFIG_SMP */
26#define smp_mb() barrier()
27#define smp_rmb() barrier()
28#define smp_wmb() barrier()
29#define set_mb(var, value) do { var = value; mb(); } while (0)
30#endif /* CONFIG_SMP */
31
32#define set_wmb(var, value) do { var = value; wmb(); } while (0)
33
34#define read_barrier_depends() do {} while (0)
35#define smp_read_barrier_depends() do {} while (0)
36
37#endif /* _ASM_BARRIER_H */
diff --git a/arch/mn10300/include/asm/cmpxchg.h b/arch/mn10300/include/asm/cmpxchg.h
deleted file mode 100644
index 97a4aaf387a..00000000000
--- a/arch/mn10300/include/asm/cmpxchg.h
+++ /dev/null
@@ -1,115 +0,0 @@
1/* MN10300 Atomic xchg/cmpxchg operations
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_CMPXCHG_H
12#define _ASM_CMPXCHG_H
13
14#include <asm/irqflags.h>
15
16#ifdef CONFIG_SMP
17#ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT
18static inline
19unsigned long __xchg(volatile unsigned long *m, unsigned long val)
20{
21 unsigned long status;
22 unsigned long oldval;
23
24 asm volatile(
25 "1: mov %4,(_AAR,%3) \n"
26 " mov (_ADR,%3),%1 \n"
27 " mov %5,(_ADR,%3) \n"
28 " mov (_ADR,%3),%0 \n" /* flush */
29 " mov (_ASR,%3),%0 \n"
30 " or %0,%0 \n"
31 " bne 1b \n"
32 : "=&r"(status), "=&r"(oldval), "=m"(*m)
33 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m), "r"(val)
34 : "memory", "cc");
35
36 return oldval;
37}
38
39static inline unsigned long __cmpxchg(volatile unsigned long *m,
40 unsigned long old, unsigned long new)
41{
42 unsigned long status;
43 unsigned long oldval;
44
45 asm volatile(
46 "1: mov %4,(_AAR,%3) \n"
47 " mov (_ADR,%3),%1 \n"
48 " cmp %5,%1 \n"
49 " bne 2f \n"
50 " mov %6,(_ADR,%3) \n"
51 "2: mov (_ADR,%3),%0 \n" /* flush */
52 " mov (_ASR,%3),%0 \n"
53 " or %0,%0 \n"
54 " bne 1b \n"
55 : "=&r"(status), "=&r"(oldval), "=m"(*m)
56 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m),
57 "r"(old), "r"(new)
58 : "memory", "cc");
59
60 return oldval;
61}
62#else /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
63#error "No SMP atomic operation support!"
64#endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
65
66#else /* CONFIG_SMP */
67
68/*
69 * Emulate xchg for non-SMP MN10300
70 */
71struct __xchg_dummy { unsigned long a[100]; };
72#define __xg(x) ((struct __xchg_dummy *)(x))
73
74static inline
75unsigned long __xchg(volatile unsigned long *m, unsigned long val)
76{
77 unsigned long oldval;
78 unsigned long flags;
79
80 flags = arch_local_cli_save();
81 oldval = *m;
82 *m = val;
83 arch_local_irq_restore(flags);
84 return oldval;
85}
86
87/*
88 * Emulate cmpxchg for non-SMP MN10300
89 */
90static inline unsigned long __cmpxchg(volatile unsigned long *m,
91 unsigned long old, unsigned long new)
92{
93 unsigned long oldval;
94 unsigned long flags;
95
96 flags = arch_local_cli_save();
97 oldval = *m;
98 if (oldval == old)
99 *m = new;
100 arch_local_irq_restore(flags);
101 return oldval;
102}
103
104#endif /* CONFIG_SMP */
105
106#define xchg(ptr, v) \
107 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
108 (unsigned long)(v)))
109
110#define cmpxchg(ptr, o, n) \
111 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
112 (unsigned long)(o), \
113 (unsigned long)(n)))
114
115#endif /* _ASM_CMPXCHG_H */
diff --git a/arch/mn10300/include/asm/dma.h b/arch/mn10300/include/asm/dma.h
index 10b77d4628c..098df2e617a 100644
--- a/arch/mn10300/include/asm/dma.h
+++ b/arch/mn10300/include/asm/dma.h
@@ -11,6 +11,7 @@
11#ifndef _ASM_DMA_H 11#ifndef _ASM_DMA_H
12#define _ASM_DMA_H 12#define _ASM_DMA_H
13 13
14#include <asm/system.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
15#include <asm/io.h> 16#include <asm/io.h>
16#include <linux/delay.h> 17#include <linux/delay.h>
diff --git a/arch/mn10300/include/asm/elf.h b/arch/mn10300/include/asm/elf.h
index 4ebd6b3a0a1..8157c9267f4 100644
--- a/arch/mn10300/include/asm/elf.h
+++ b/arch/mn10300/include/asm/elf.h
@@ -151,8 +151,7 @@ do { \
151#define ELF_PLATFORM (NULL) 151#define ELF_PLATFORM (NULL)
152 152
153#ifdef __KERNEL__ 153#ifdef __KERNEL__
154#define SET_PERSONALITY(ex) \ 154#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
155 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
156#endif 155#endif
157 156
158#endif /* _ASM_ELF_H */ 157#endif /* _ASM_ELF_H */
diff --git a/arch/mn10300/include/asm/exceptions.h b/arch/mn10300/include/asm/exceptions.h
index 95a4d42c3a0..ca3e20508c7 100644
--- a/arch/mn10300/include/asm/exceptions.h
+++ b/arch/mn10300/include/asm/exceptions.h
@@ -110,7 +110,7 @@ extern asmlinkage void nmi_handler(void);
110extern asmlinkage void misalignment(struct pt_regs *, enum exception_code); 110extern asmlinkage void misalignment(struct pt_regs *, enum exception_code);
111 111
112extern void die(const char *, struct pt_regs *, enum exception_code) 112extern void die(const char *, struct pt_regs *, enum exception_code)
113 __noreturn; 113 ATTRIB_NORET;
114 114
115extern int die_if_no_fixup(const char *, struct pt_regs *, enum exception_code); 115extern int die_if_no_fixup(const char *, struct pt_regs *, enum exception_code);
116 116
diff --git a/arch/mn10300/include/asm/frame.inc b/arch/mn10300/include/asm/frame.inc
index 1c3eb4fda95..2ee58e3eb6b 100644
--- a/arch/mn10300/include/asm/frame.inc
+++ b/arch/mn10300/include/asm/frame.inc
@@ -61,7 +61,7 @@
61############################################################################### 61###############################################################################
62.macro RESTORE_ALL 62.macro RESTORE_ALL
63 # peel back the stack to the calling frame 63 # peel back the stack to the calling frame
64 # - we need that when returning from interrupts to kernel mode 64 # - this permits execve() to discard extra frames due to kernel syscalls
65 GET_THREAD_INFO a0 65 GET_THREAD_INFO a0
66 mov (TI_frame,a0),fp 66 mov (TI_frame,a0),fp
67 mov fp,sp 67 mov fp,sp
diff --git a/arch/mn10300/include/asm/highmem.h b/arch/mn10300/include/asm/highmem.h
index 7c137cd8aa3..bfe2d88604d 100644
--- a/arch/mn10300/include/asm/highmem.h
+++ b/arch/mn10300/include/asm/highmem.h
@@ -70,7 +70,7 @@ static inline void kunmap(struct page *page)
70 * be used in IRQ contexts, so in some (very limited) cases we need 70 * be used in IRQ contexts, so in some (very limited) cases we need
71 * it. 71 * it.
72 */ 72 */
73static inline unsigned long kmap_atomic(struct page *page) 73static inline unsigned long __kmap_atomic(struct page *page)
74{ 74{
75 unsigned long vaddr; 75 unsigned long vaddr;
76 int idx, type; 76 int idx, type;
diff --git a/arch/mn10300/include/asm/io.h b/arch/mn10300/include/asm/io.h
index e6ed0d897cc..787255da744 100644
--- a/arch/mn10300/include/asm/io.h
+++ b/arch/mn10300/include/asm/io.h
@@ -14,7 +14,6 @@
14#include <asm/page.h> /* I/O is all done through memory accesses */ 14#include <asm/page.h> /* I/O is all done through memory accesses */
15#include <asm/cpu-regs.h> 15#include <asm/cpu-regs.h>
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm-generic/pci_iomap.h>
18 17
19#define mmiowb() do {} while (0) 18#define mmiowb() do {} while (0)
20 19
@@ -230,6 +229,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
230 229
231/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 230/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
232struct pci_dev; 231struct pci_dev;
232extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
233static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) 233static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
234{ 234{
235} 235}
@@ -251,15 +251,15 @@ static inline void *phys_to_virt(unsigned long address)
251/* 251/*
252 * Change "struct page" to physical address. 252 * Change "struct page" to physical address.
253 */ 253 */
254static inline void __iomem *__ioremap(unsigned long offset, unsigned long size, 254static inline void *__ioremap(unsigned long offset, unsigned long size,
255 unsigned long flags) 255 unsigned long flags)
256{ 256{
257 return (void __iomem *) offset; 257 return (void *) offset;
258} 258}
259 259
260static inline void __iomem *ioremap(unsigned long offset, unsigned long size) 260static inline void *ioremap(unsigned long offset, unsigned long size)
261{ 261{
262 return (void __iomem *)(offset & ~0x20000000); 262 return (void *) offset;
263} 263}
264 264
265/* 265/*
@@ -267,14 +267,14 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
267 * area. it's useful if some control registers are in such an area and write 267 * area. it's useful if some control registers are in such an area and write
268 * combining or read caching is not desirable: 268 * combining or read caching is not desirable:
269 */ 269 */
270static inline void __iomem *ioremap_nocache(unsigned long offset, unsigned long size) 270static inline void *ioremap_nocache(unsigned long offset, unsigned long size)
271{ 271{
272 return (void __iomem *) (offset | 0x20000000); 272 return (void *) (offset | 0x20000000);
273} 273}
274 274
275#define ioremap_wc ioremap_nocache 275#define ioremap_wc ioremap_nocache
276 276
277static inline void iounmap(void __iomem *addr) 277static inline void iounmap(void *addr)
278{ 278{
279} 279}
280 280
diff --git a/arch/mn10300/include/asm/module.h b/arch/mn10300/include/asm/module.h
index 6571103b051..5d7057d0149 100644
--- a/arch/mn10300/include/asm/module.h
+++ b/arch/mn10300/include/asm/module.h
@@ -12,7 +12,12 @@
12#ifndef _ASM_MODULE_H 12#ifndef _ASM_MODULE_H
13#define _ASM_MODULE_H 13#define _ASM_MODULE_H
14 14
15#include <asm-generic/module.h> 15struct mod_arch_specific {
16};
17
18#define Elf_Shdr Elf32_Shdr
19#define Elf_Sym Elf32_Sym
20#define Elf_Ehdr Elf32_Ehdr
16 21
17/* 22/*
18 * Include the MN10300 architecture version. 23 * Include the MN10300 architecture version.
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h
index 8137c25c4e1..6095a28561d 100644
--- a/arch/mn10300/include/asm/pci.h
+++ b/arch/mn10300/include/asm/pci.h
@@ -85,6 +85,22 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
85/* implement the pci_ DMA API in terms of the generic device dma_ one */ 85/* implement the pci_ DMA API in terms of the generic device dma_ one */
86#include <asm-generic/pci-dma-compat.h> 86#include <asm-generic/pci-dma-compat.h>
87 87
88/**
89 * pcibios_resource_to_bus - convert resource to PCI bus address
90 * @dev: device which owns this resource
91 * @region: converted bus-centric region (start,end)
92 * @res: resource to convert
93 *
94 * Convert a resource to a PCI device bus address or bus window.
95 */
96extern void pcibios_resource_to_bus(struct pci_dev *dev,
97 struct pci_bus_region *region,
98 struct resource *res);
99
100extern void pcibios_bus_to_resource(struct pci_dev *dev,
101 struct resource *res,
102 struct pci_bus_region *region);
103
88static inline struct resource * 104static inline struct resource *
89pcibios_select_root(struct pci_dev *pdev, struct resource *res) 105pcibios_select_root(struct pci_dev *pdev, struct resource *res)
90{ 106{
diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h
index 8b80b19d0c8..f7b3c9ab2cb 100644
--- a/arch/mn10300/include/asm/processor.h
+++ b/arch/mn10300/include/asm/processor.h
@@ -119,19 +119,34 @@ struct thread_struct {
119 119
120/* 120/*
121 * do necessary setup to start up a newly executed thread 121 * do necessary setup to start up a newly executed thread
122 * - need to discard the frame stacked by the kernel thread invoking the execve
123 * syscall (see RESTORE_ALL macro)
122 */ 124 */
123static inline void start_thread(struct pt_regs *regs, 125static inline void start_thread(struct pt_regs *regs,
124 unsigned long new_pc, unsigned long new_sp) 126 unsigned long new_pc, unsigned long new_sp)
125{ 127{
126 regs->epsw = EPSW_nSL | EPSW_IE | EPSW_IM; 128 struct thread_info *ti = current_thread_info();
127 regs->pc = new_pc; 129 struct pt_regs *frame0;
128 regs->sp = new_sp; 130
131 frame0 = thread_info_to_uregs(ti);
132 frame0->epsw = EPSW_nSL | EPSW_IE | EPSW_IM;
133 frame0->pc = new_pc;
134 frame0->sp = new_sp;
135 ti->frame = frame0;
129} 136}
130 137
131 138
132/* Free all resources held by a thread. */ 139/* Free all resources held by a thread. */
133extern void release_thread(struct task_struct *); 140extern void release_thread(struct task_struct *);
134 141
142/* Prepare to copy thread state - unlazy all lazy status */
143extern void prepare_to_copy(struct task_struct *tsk);
144
145/*
146 * create a kernel thread without removing it from tasklists
147 */
148extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
149
135/* 150/*
136 * Return saved PC of a blocked thread. 151 * Return saved PC of a blocked thread.
137 */ 152 */
diff --git a/arch/mn10300/include/asm/ptrace.h b/arch/mn10300/include/asm/ptrace.h
index 838a3830010..55b79ef1002 100644
--- a/arch/mn10300/include/asm/ptrace.h
+++ b/arch/mn10300/include/asm/ptrace.h
@@ -11,16 +11,88 @@
11#ifndef _ASM_PTRACE_H 11#ifndef _ASM_PTRACE_H
12#define _ASM_PTRACE_H 12#define _ASM_PTRACE_H
13 13
14#include <uapi/asm/ptrace.h> 14#define PT_A3 0
15#define PT_A2 1
16#define PT_D3 2
17#define PT_D2 3
18#define PT_MCVF 4
19#define PT_MCRL 5
20#define PT_MCRH 6
21#define PT_MDRQ 7
22#define PT_E1 8
23#define PT_E0 9
24#define PT_E7 10
25#define PT_E6 11
26#define PT_E5 12
27#define PT_E4 13
28#define PT_E3 14
29#define PT_E2 15
30#define PT_SP 16
31#define PT_LAR 17
32#define PT_LIR 18
33#define PT_MDR 19
34#define PT_A1 20
35#define PT_A0 21
36#define PT_D1 22
37#define PT_D0 23
38#define PT_ORIG_D0 24
39#define PT_EPSW 25
40#define PT_PC 26
41#define NR_PTREGS 27
15 42
43/*
44 * This defines the way registers are stored in the event of an exception
45 * - the strange order is due to the MOVM instruction
46 */
47struct pt_regs {
48 unsigned long a3; /* syscall arg 3 */
49 unsigned long a2; /* syscall arg 4 */
50 unsigned long d3; /* syscall arg 5 */
51 unsigned long d2; /* syscall arg 6 */
52 unsigned long mcvf;
53 unsigned long mcrl;
54 unsigned long mcrh;
55 unsigned long mdrq;
56 unsigned long e1;
57 unsigned long e0;
58 unsigned long e7;
59 unsigned long e6;
60 unsigned long e5;
61 unsigned long e4;
62 unsigned long e3;
63 unsigned long e2;
64 unsigned long sp;
65 unsigned long lar;
66 unsigned long lir;
67 unsigned long mdr;
68 unsigned long a1;
69 unsigned long a0; /* syscall arg 1 */
70 unsigned long d1; /* syscall arg 2 */
71 unsigned long d0; /* syscall ret */
72 struct pt_regs *next; /* next frame pointer */
73 unsigned long orig_d0; /* syscall number */
74 unsigned long epsw;
75 unsigned long pc;
76};
77
78/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
79#define PTRACE_GETREGS 12
80#define PTRACE_SETREGS 13
81#define PTRACE_GETFPREGS 14
82#define PTRACE_SETFPREGS 15
83
84/* options set using PTRACE_SETOPTIONS */
85#define PTRACE_O_TRACESYSGOOD 0x00000001
86
87#ifdef __KERNEL__
16 88
17#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) 89#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL)
18#define instruction_pointer(regs) ((regs)->pc) 90#define instruction_pointer(regs) ((regs)->pc)
19#define user_stack_pointer(regs) ((regs)->sp) 91#define user_stack_pointer(regs) ((regs)->sp)
20#define current_pt_regs() current_frame()
21 92
22#define arch_has_single_step() (1) 93#define arch_has_single_step() (1)
23 94
24#define profile_pc(regs) ((regs)->pc) 95#define profile_pc(regs) ((regs)->pc)
25 96
97#endif /* __KERNEL__ */
26#endif /* _ASM_PTRACE_H */ 98#endif /* _ASM_PTRACE_H */
diff --git a/arch/mn10300/include/asm/reset-regs.h b/arch/mn10300/include/asm/reset-regs.h
index 8ca2a42d365..10c7502a113 100644
--- a/arch/mn10300/include/asm/reset-regs.h
+++ b/arch/mn10300/include/asm/reset-regs.h
@@ -17,6 +17,10 @@
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#ifdef CONFIG_MN10300_WD_TIMER
21#define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */
22#endif
23
20/* 24/*
21 * watchdog timer registers 25 * watchdog timer registers
22 */ 26 */
diff --git a/arch/mn10300/include/asm/setup.h b/arch/mn10300/include/asm/setup.h
index fb024555d2a..c229d1e3f99 100644
--- a/arch/mn10300/include/asm/setup.h
+++ b/arch/mn10300/include/asm/setup.h
@@ -11,8 +11,8 @@
11#ifndef _ASM_SETUP_H 11#ifndef _ASM_SETUP_H
12#define _ASM_SETUP_H 12#define _ASM_SETUP_H
13 13
14#include <uapi/asm/setup.h> 14#ifdef __KERNEL__
15
16extern void __init unit_setup(void); 15extern void __init unit_setup(void);
17extern void __init unit_init_IRQ(void); 16extern void __init unit_init_IRQ(void);
17#endif
18#endif /* _ASM_SETUP_H */ 18#endif /* _ASM_SETUP_H */
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h
index d280e978079..1865d72a86f 100644
--- a/arch/mn10300/include/asm/signal.h
+++ b/arch/mn10300/include/asm/signal.h
@@ -11,8 +11,12 @@
11#ifndef _ASM_SIGNAL_H 11#ifndef _ASM_SIGNAL_H
12#define _ASM_SIGNAL_H 12#define _ASM_SIGNAL_H
13 13
14#include <uapi/asm/signal.h> 14#include <linux/types.h>
15 15
16/* Avoid too many header ordering problems. */
17struct siginfo;
18
19#ifdef __KERNEL__
16/* Most things should be clean enough to redefine this at will, if care 20/* Most things should be clean enough to redefine this at will, if care
17 is taken to make libc match. */ 21 is taken to make libc match. */
18 22
@@ -26,6 +30,94 @@ typedef struct {
26 unsigned long sig[_NSIG_WORDS]; 30 unsigned long sig[_NSIG_WORDS];
27} sigset_t; 31} sigset_t;
28 32
33#else
34/* Here we must cater to libcs that poke about in kernel headers. */
35
36#define NSIG 32
37typedef unsigned long sigset_t;
38
39#endif /* __KERNEL__ */
40
41#define SIGHUP 1
42#define SIGINT 2
43#define SIGQUIT 3
44#define SIGILL 4
45#define SIGTRAP 5
46#define SIGABRT 6
47#define SIGIOT 6
48#define SIGBUS 7
49#define SIGFPE 8
50#define SIGKILL 9
51#define SIGUSR1 10
52#define SIGSEGV 11
53#define SIGUSR2 12
54#define SIGPIPE 13
55#define SIGALRM 14
56#define SIGTERM 15
57#define SIGSTKFLT 16
58#define SIGCHLD 17
59#define SIGCONT 18
60#define SIGSTOP 19
61#define SIGTSTP 20
62#define SIGTTIN 21
63#define SIGTTOU 22
64#define SIGURG 23
65#define SIGXCPU 24
66#define SIGXFSZ 25
67#define SIGVTALRM 26
68#define SIGPROF 27
69#define SIGWINCH 28
70#define SIGIO 29
71#define SIGPOLL SIGIO
72/*
73#define SIGLOST 29
74*/
75#define SIGPWR 30
76#define SIGSYS 31
77#define SIGUNUSED 31
78
79/* These should not be considered constants from userland. */
80#define SIGRTMIN 32
81#define SIGRTMAX _NSIG
82
83/*
84 * SA_FLAGS values:
85 *
86 * SA_ONSTACK indicates that a registered stack_t will be used.
87 * SA_RESTART flag to get restarting signals (which were the default long ago)
88 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
89 * SA_RESETHAND clears the handler when the signal is delivered.
90 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
91 * SA_NODEFER prevents the current signal from being masked in the handler.
92 *
93 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
94 * Unix names RESETHAND and NODEFER respectively.
95 */
96#define SA_NOCLDSTOP 0x00000001U
97#define SA_NOCLDWAIT 0x00000002U
98#define SA_SIGINFO 0x00000004U
99#define SA_ONSTACK 0x08000000U
100#define SA_RESTART 0x10000000U
101#define SA_NODEFER 0x40000000U
102#define SA_RESETHAND 0x80000000U
103
104#define SA_NOMASK SA_NODEFER
105#define SA_ONESHOT SA_RESETHAND
106
107#define SA_RESTORER 0x04000000
108
109/*
110 * sigaltstack controls
111 */
112#define SS_ONSTACK 1
113#define SS_DISABLE 2
114
115#define MINSIGSTKSZ 2048
116#define SIGSTKSZ 8192
117
118#include <asm-generic/signal-defs.h>
119
120#ifdef __KERNEL__
29struct old_sigaction { 121struct old_sigaction {
30 __sighandler_t sa_handler; 122 __sighandler_t sa_handler;
31 old_sigset_t sa_mask; 123 old_sigset_t sa_mask;
@@ -43,6 +135,37 @@ struct sigaction {
43struct k_sigaction { 135struct k_sigaction {
44 struct sigaction sa; 136 struct sigaction sa;
45}; 137};
138#else
139/* Here we must cater to libcs that poke about in kernel headers. */
140
141struct sigaction {
142 union {
143 __sighandler_t _sa_handler;
144 void (*_sa_sigaction)(int, struct siginfo *, void *);
145 } _u;
146 sigset_t sa_mask;
147 unsigned long sa_flags;
148 void (*sa_restorer)(void);
149};
150
151#define sa_handler _u._sa_handler
152#define sa_sigaction _u._sa_sigaction
153
154#endif /* __KERNEL__ */
155
156typedef struct sigaltstack {
157 void __user *ss_sp;
158 int ss_flags;
159 size_t ss_size;
160} stack_t;
161
162#ifdef __KERNEL__
46#include <asm/sigcontext.h> 163#include <asm/sigcontext.h>
47 164
165
166struct pt_regs;
167#define ptrace_signal_deliver(regs, cookie) do { } while (0)
168
169#endif /* __KERNEL__ */
170
48#endif /* _ASM_SIGNAL_H */ 171#endif /* _ASM_SIGNAL_H */
diff --git a/arch/mn10300/include/asm/switch_to.h b/arch/mn10300/include/asm/switch_to.h
deleted file mode 100644
index 393d311735c..00000000000
--- a/arch/mn10300/include/asm/switch_to.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* MN10300 task switching definitions
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_SWITCH_TO_H
12#define _ASM_SWITCH_TO_H
13
14#include <asm/barrier.h>
15
16struct task_struct;
17struct thread_struct;
18
19#if !defined(CONFIG_LAZY_SAVE_FPU)
20struct fpu_state_struct;
21extern asmlinkage void fpu_save(struct fpu_state_struct *);
22#define switch_fpu(prev, next) \
23 do { \
24 if ((prev)->thread.fpu_flags & THREAD_HAS_FPU) { \
25 (prev)->thread.fpu_flags &= ~THREAD_HAS_FPU; \
26 (prev)->thread.uregs->epsw &= ~EPSW_FE; \
27 fpu_save(&(prev)->thread.fpu_state); \
28 } \
29 } while (0)
30#else
31#define switch_fpu(prev, next) do {} while (0)
32#endif
33
34/* context switching is now performed out-of-line in switch_to.S */
35extern asmlinkage
36struct task_struct *__switch_to(struct thread_struct *prev,
37 struct thread_struct *next,
38 struct task_struct *prev_task);
39
40#define switch_to(prev, next, last) \
41do { \
42 switch_fpu(prev, next); \
43 current->thread.wchan = (u_long) __builtin_return_address(0); \
44 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
45 mb(); \
46 current->thread.wchan = 0; \
47} while (0)
48
49#endif /* _ASM_SWITCH_TO_H */
diff --git a/arch/mn10300/include/asm/termios.h b/arch/mn10300/include/asm/termios.h
index c2e29c75dfa..dd7cf617e11 100644
--- a/arch/mn10300/include/asm/termios.h
+++ b/arch/mn10300/include/asm/termios.h
@@ -1,8 +1,27 @@
1#ifndef _ASM_TERMIOS_H 1#ifndef _ASM_TERMIOS_H
2#define _ASM_TERMIOS_H 2#define _ASM_TERMIOS_H
3 3
4#include <uapi/asm/termios.h> 4#include <asm/termbits.h>
5#include <asm/ioctls.h>
5 6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24#ifdef __KERNEL__
6/* intr=^C quit=^| erase=del kill=^U 25/* intr=^C quit=^| erase=del kill=^U
7 eof=^D vtime=\0 vmin=\1 sxtc=\0 26 eof=^D vtime=\0 vmin=\1 sxtc=\0
8 start=^Q stop=^S susp=^Z eol=\0 27 start=^Q stop=^S susp=^Z eol=\0
@@ -10,4 +29,64 @@
10 eol2=\0 29 eol2=\0
11*/ 30*/
12#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" 31#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
32#endif
33
34/* modem lines */
35#define TIOCM_LE 0x001
36#define TIOCM_DTR 0x002
37#define TIOCM_RTS 0x004
38#define TIOCM_ST 0x008
39#define TIOCM_SR 0x010
40#define TIOCM_CTS 0x020
41#define TIOCM_CAR 0x040
42#define TIOCM_RNG 0x080
43#define TIOCM_DSR 0x100
44#define TIOCM_CD TIOCM_CAR
45#define TIOCM_RI TIOCM_RNG
46#define TIOCM_OUT1 0x2000
47#define TIOCM_OUT2 0x4000
48#define TIOCM_LOOP 0x8000
49
50#define TIOCM_MODEM_BITS TIOCM_OUT2 /* IRDA support */
51
52/*
53 * Translate a "termio" structure into a "termios". Ugh.
54 */
55#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
56 unsigned short __tmp; \
57 get_user(__tmp, &(termio)->x); \
58 *(unsigned short *) &(termios)->x = __tmp; \
59}
60
61#define user_termio_to_kernel_termios(termios, termio) \
62({ \
63 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
64 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
65 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
66 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
67 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
68})
69
70/*
71 * Translate a "termios" structure into a "termio". Ugh.
72 */
73#define kernel_termios_to_user_termio(termio, termios) \
74({ \
75 put_user((termios)->c_iflag, &(termio)->c_iflag); \
76 put_user((termios)->c_oflag, &(termio)->c_oflag); \
77 put_user((termios)->c_cflag, &(termio)->c_cflag); \
78 put_user((termios)->c_lflag, &(termio)->c_lflag); \
79 put_user((termios)->c_line, &(termio)->c_line); \
80 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
81})
82
83#define user_termios_to_kernel_termios(k, u) \
84 copy_from_user(k, u, sizeof(struct termios2))
85#define kernel_termios_to_user_termios(u, k) \
86 copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) \
88 copy_from_user(k, u, sizeof(struct termios))
89#define kernel_termios_to_user_termios_1(u, k) \
90 copy_to_user(u, k, sizeof(struct termios))
91
13#endif /* _ASM_TERMIOS_H */ 92#endif /* _ASM_TERMIOS_H */
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index f90062b0622..87c213002d4 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -20,10 +20,8 @@
20 20
21#ifdef CONFIG_4KSTACKS 21#ifdef CONFIG_4KSTACKS
22#define THREAD_SIZE (4096) 22#define THREAD_SIZE (4096)
23#define THREAD_SIZE_ORDER (0)
24#else 23#else
25#define THREAD_SIZE (8192) 24#define THREAD_SIZE (8192)
26#define THREAD_SIZE_ORDER (1)
27#endif 25#endif
28 26
29#define STACK_WARN (THREAD_SIZE / 8) 27#define STACK_WARN (THREAD_SIZE / 8)
@@ -122,8 +120,21 @@ static inline unsigned long current_stack_pointer(void)
122 return sp; 120 return sp;
123} 121}
124 122
123#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
124
125/* thread information allocation */
126#ifdef CONFIG_DEBUG_STACK_USAGE
127#define alloc_thread_info_node(tsk, node) \
128 kzalloc_node(THREAD_SIZE, GFP_KERNEL, node)
129#else
130#define alloc_thread_info_node(tsk, node) \
131 kmalloc_node(THREAD_SIZE, GFP_KERNEL, node)
132#endif
133
125#ifndef CONFIG_KGDB 134#ifndef CONFIG_KGDB
126void arch_release_thread_info(struct thread_info *ti); 135#define free_thread_info(ti) kfree((ti))
136#else
137extern void free_thread_info(struct thread_info *);
127#endif 138#endif
128#define get_thread_info(ti) get_task_struct((ti)->task) 139#define get_thread_info(ti) get_task_struct((ti)->task)
129#define put_thread_info(ti) put_task_struct((ti)->task) 140#define put_thread_info(ti) put_task_struct((ti)->task)
@@ -154,19 +165,20 @@ void arch_release_thread_info(struct thread_info *ti);
154#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 165#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
155#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 166#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
156#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ 167#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
168#define TIF_FREEZE 18 /* freezing for suspend */
157 169
158#define _TIF_SYSCALL_TRACE +(1 << TIF_SYSCALL_TRACE) 170#define _TIF_SYSCALL_TRACE +(1 << TIF_SYSCALL_TRACE)
159#define _TIF_NOTIFY_RESUME +(1 << TIF_NOTIFY_RESUME) 171#define _TIF_NOTIFY_RESUME +(1 << TIF_NOTIFY_RESUME)
160#define _TIF_SIGPENDING +(1 << TIF_SIGPENDING) 172#define _TIF_SIGPENDING +(1 << TIF_SIGPENDING)
161#define _TIF_NEED_RESCHED +(1 << TIF_NEED_RESCHED) 173#define _TIF_NEED_RESCHED +(1 << TIF_NEED_RESCHED)
162#define _TIF_SINGLESTEP +(1 << TIF_SINGLESTEP) 174#define _TIF_SINGLESTEP +(1 << TIF_SINGLESTEP)
175#define _TIF_RESTORE_SIGMASK +(1 << TIF_RESTORE_SIGMASK)
163#define _TIF_POLLING_NRFLAG +(1 << TIF_POLLING_NRFLAG) 176#define _TIF_POLLING_NRFLAG +(1 << TIF_POLLING_NRFLAG)
177#define _TIF_FREEZE +(1 << TIF_FREEZE)
164 178
165#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 179#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
166#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 180#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
167 181
168#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
169
170#endif /* __KERNEL__ */ 182#endif /* __KERNEL__ */
171 183
172#endif /* _ASM_THREAD_INFO_H */ 184#endif /* _ASM_THREAD_INFO_H */
diff --git a/arch/mn10300/include/asm/timex.h b/arch/mn10300/include/asm/timex.h
index f8e66425cbf..bd4e90dfe6c 100644
--- a/arch/mn10300/include/asm/timex.h
+++ b/arch/mn10300/include/asm/timex.h
@@ -11,6 +11,7 @@
11#ifndef _ASM_TIMEX_H 11#ifndef _ASM_TIMEX_H
12#define _ASM_TIMEX_H 12#define _ASM_TIMEX_H
13 13
14#include <asm/hardirq.h>
14#include <unit/timex.h> 15#include <unit/timex.h>
15 16
16#define TICK_SIZE (tick_nsec / 1000) 17#define TICK_SIZE (tick_nsec / 1000)
@@ -29,6 +30,16 @@ static inline cycles_t get_cycles(void)
29extern int init_clockevents(void); 30extern int init_clockevents(void);
30extern int init_clocksource(void); 31extern int init_clocksource(void);
31 32
33static inline void setup_jiffies_interrupt(int irq,
34 struct irqaction *action)
35{
36 u16 tmp;
37 setup_irq(irq, action);
38 set_intr_level(irq, NUM2GxICR_LEVEL(CONFIG_TIMER_IRQ_LEVEL));
39 GxICR(irq) |= GxICR_ENABLE | GxICR_DETECT | GxICR_REQUEST;
40 tmp = GxICR(irq);
41}
42
32#endif /* __KERNEL__ */ 43#endif /* __KERNEL__ */
33 44
34#endif /* _ASM_TIMEX_H */ 45#endif /* _ASM_TIMEX_H */
diff --git a/arch/mn10300/include/asm/types.h b/arch/mn10300/include/asm/types.h
index 3d6e48311be..c1833eb192e 100644
--- a/arch/mn10300/include/asm/types.h
+++ b/arch/mn10300/include/asm/types.h
@@ -11,12 +11,21 @@
11#ifndef _ASM_TYPES_H 11#ifndef _ASM_TYPES_H
12#define _ASM_TYPES_H 12#define _ASM_TYPES_H
13 13
14#include <uapi/asm/types.h> 14#include <asm-generic/int-ll64.h>
15
16#ifndef __ASSEMBLY__
17
18typedef unsigned short umode_t;
19
20#endif /* __ASSEMBLY__ */
15 21
16/* 22/*
17 * These aren't exported outside the kernel to avoid name space clashes 23 * These aren't exported outside the kernel to avoid name space clashes
18 */ 24 */
25#ifdef __KERNEL__
19 26
20#define BITS_PER_LONG 32 27#define BITS_PER_LONG 32
21 28
29#endif /* __KERNEL__ */
30
22#endif /* _ASM_TYPES_H */ 31#endif /* _ASM_TYPES_H */
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h
index e6d2ed4ba68..9051f921cbc 100644
--- a/arch/mn10300/include/asm/unistd.h
+++ b/arch/mn10300/include/asm/unistd.h
@@ -11,14 +11,354 @@
11#ifndef _ASM_UNISTD_H 11#ifndef _ASM_UNISTD_H
12#define _ASM_UNISTD_H 12#define _ASM_UNISTD_H
13 13
14#include <uapi/asm/unistd.h> 14#define __NR_restart_syscall 0
15#define __NR_exit 1
16#define __NR_fork 2
17#define __NR_read 3
18#define __NR_write 4
19#define __NR_open 5
20#define __NR_close 6
21#define __NR_waitpid 7
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_time 13
28#define __NR_mknod 14
29#define __NR_chmod 15
30#define __NR_lchown 16
31#define __NR_break 17
32#define __NR_oldstat 18
33#define __NR_lseek 19
34#define __NR_getpid 20
35#define __NR_mount 21
36#define __NR_umount 22
37#define __NR_setuid 23
38#define __NR_getuid 24
39#define __NR_stime 25
40#define __NR_ptrace 26
41#define __NR_alarm 27
42#define __NR_oldfstat 28
43#define __NR_pause 29
44#define __NR_utime 30
45#define __NR_stty 31
46#define __NR_gtty 32
47#define __NR_access 33
48#define __NR_nice 34
49#define __NR_ftime 35
50#define __NR_sync 36
51#define __NR_kill 37
52#define __NR_rename 38
53#define __NR_mkdir 39
54#define __NR_rmdir 40
55#define __NR_dup 41
56#define __NR_pipe 42
57#define __NR_times 43
58#define __NR_prof 44
59#define __NR_brk 45
60#define __NR_setgid 46
61#define __NR_getgid 47
62#define __NR_signal 48
63#define __NR_geteuid 49
64#define __NR_getegid 50
65#define __NR_acct 51
66#define __NR_umount2 52
67#define __NR_lock 53
68#define __NR_ioctl 54
69#define __NR_fcntl 55
70#define __NR_mpx 56
71#define __NR_setpgid 57
72#define __NR_ulimit 58
73#define __NR_oldolduname 59
74#define __NR_umask 60
75#define __NR_chroot 61
76#define __NR_ustat 62
77#define __NR_dup2 63
78#define __NR_getppid 64
79#define __NR_getpgrp 65
80#define __NR_setsid 66
81#define __NR_sigaction 67
82#define __NR_sgetmask 68
83#define __NR_ssetmask 69
84#define __NR_setreuid 70
85#define __NR_setregid 71
86#define __NR_sigsuspend 72
87#define __NR_sigpending 73
88#define __NR_sethostname 74
89#define __NR_setrlimit 75
90#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
91#define __NR_getrusage 77
92#define __NR_gettimeofday 78
93#define __NR_settimeofday 79
94#define __NR_getgroups 80
95#define __NR_setgroups 81
96#define __NR_select 82
97#define __NR_symlink 83
98#define __NR_oldlstat 84
99#define __NR_readlink 85
100#define __NR_uselib 86
101#define __NR_swapon 87
102#define __NR_reboot 88
103#define __NR_readdir 89
104#define __NR_mmap 90
105#define __NR_munmap 91
106#define __NR_truncate 92
107#define __NR_ftruncate 93
108#define __NR_fchmod 94
109#define __NR_fchown 95
110#define __NR_getpriority 96
111#define __NR_setpriority 97
112#define __NR_profil 98
113#define __NR_statfs 99
114#define __NR_fstatfs 100
115#define __NR_ioperm 101
116#define __NR_socketcall 102
117#define __NR_syslog 103
118#define __NR_setitimer 104
119#define __NR_getitimer 105
120#define __NR_stat 106
121#define __NR_lstat 107
122#define __NR_fstat 108
123#define __NR_olduname 109
124#define __NR_iopl 110
125#define __NR_vhangup 111
126#define __NR_idle 112
127#define __NR_vm86old 113
128#define __NR_wait4 114
129#define __NR_swapoff 115
130#define __NR_sysinfo 116
131#define __NR_ipc 117
132#define __NR_fsync 118
133#define __NR_sigreturn 119
134#define __NR_clone 120
135#define __NR_setdomainname 121
136#define __NR_uname 122
137#define __NR_modify_ldt 123
138#define __NR_adjtimex 124
139#define __NR_mprotect 125
140#define __NR_sigprocmask 126
141#define __NR_create_module 127
142#define __NR_init_module 128
143#define __NR_delete_module 129
144#define __NR_get_kernel_syms 130
145#define __NR_quotactl 131
146#define __NR_getpgid 132
147#define __NR_fchdir 133
148#define __NR_bdflush 134
149#define __NR_sysfs 135
150#define __NR_personality 136
151#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
152#define __NR_setfsuid 138
153#define __NR_setfsgid 139
154#define __NR__llseek 140
155#define __NR_getdents 141
156#define __NR__newselect 142
157#define __NR_flock 143
158#define __NR_msync 144
159#define __NR_readv 145
160#define __NR_writev 146
161#define __NR_getsid 147
162#define __NR_fdatasync 148
163#define __NR__sysctl 149
164#define __NR_mlock 150
165#define __NR_munlock 151
166#define __NR_mlockall 152
167#define __NR_munlockall 153
168#define __NR_sched_setparam 154
169#define __NR_sched_getparam 155
170#define __NR_sched_setscheduler 156
171#define __NR_sched_getscheduler 157
172#define __NR_sched_yield 158
173#define __NR_sched_get_priority_max 159
174#define __NR_sched_get_priority_min 160
175#define __NR_sched_rr_get_interval 161
176#define __NR_nanosleep 162
177#define __NR_mremap 163
178#define __NR_setresuid 164
179#define __NR_getresuid 165
180#define __NR_vm86 166
181#define __NR_query_module 167
182#define __NR_poll 168
183#define __NR_nfsservctl 169
184#define __NR_setresgid 170
185#define __NR_getresgid 171
186#define __NR_prctl 172
187#define __NR_rt_sigreturn 173
188#define __NR_rt_sigaction 174
189#define __NR_rt_sigprocmask 175
190#define __NR_rt_sigpending 176
191#define __NR_rt_sigtimedwait 177
192#define __NR_rt_sigqueueinfo 178
193#define __NR_rt_sigsuspend 179
194#define __NR_pread64 180
195#define __NR_pwrite64 181
196#define __NR_chown 182
197#define __NR_getcwd 183
198#define __NR_capget 184
199#define __NR_capset 185
200#define __NR_sigaltstack 186
201#define __NR_sendfile 187
202#define __NR_getpmsg 188 /* some people actually want streams */
203#define __NR_putpmsg 189 /* some people actually want streams */
204#define __NR_vfork 190
205#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
206#define __NR_mmap2 192
207#define __NR_truncate64 193
208#define __NR_ftruncate64 194
209#define __NR_stat64 195
210#define __NR_lstat64 196
211#define __NR_fstat64 197
212#define __NR_lchown32 198
213#define __NR_getuid32 199
214#define __NR_getgid32 200
215#define __NR_geteuid32 201
216#define __NR_getegid32 202
217#define __NR_setreuid32 203
218#define __NR_setregid32 204
219#define __NR_getgroups32 205
220#define __NR_setgroups32 206
221#define __NR_fchown32 207
222#define __NR_setresuid32 208
223#define __NR_getresuid32 209
224#define __NR_setresgid32 210
225#define __NR_getresgid32 211
226#define __NR_chown32 212
227#define __NR_setuid32 213
228#define __NR_setgid32 214
229#define __NR_setfsuid32 215
230#define __NR_setfsgid32 216
231#define __NR_pivot_root 217
232#define __NR_mincore 218
233#define __NR_madvise 219
234#define __NR_madvise1 219 /* delete when C lib stub is removed */
235#define __NR_getdents64 220
236#define __NR_fcntl64 221
237/* 223 is unused */
238#define __NR_gettid 224
239#define __NR_readahead 225
240#define __NR_setxattr 226
241#define __NR_lsetxattr 227
242#define __NR_fsetxattr 228
243#define __NR_getxattr 229
244#define __NR_lgetxattr 230
245#define __NR_fgetxattr 231
246#define __NR_listxattr 232
247#define __NR_llistxattr 233
248#define __NR_flistxattr 234
249#define __NR_removexattr 235
250#define __NR_lremovexattr 236
251#define __NR_fremovexattr 237
252#define __NR_tkill 238
253#define __NR_sendfile64 239
254#define __NR_futex 240
255#define __NR_sched_setaffinity 241
256#define __NR_sched_getaffinity 242
257#define __NR_set_thread_area 243
258#define __NR_get_thread_area 244
259#define __NR_io_setup 245
260#define __NR_io_destroy 246
261#define __NR_io_getevents 247
262#define __NR_io_submit 248
263#define __NR_io_cancel 249
264#define __NR_fadvise64 250
15 265
266#define __NR_exit_group 252
267#define __NR_lookup_dcookie 253
268#define __NR_epoll_create 254
269#define __NR_epoll_ctl 255
270#define __NR_epoll_wait 256
271#define __NR_remap_file_pages 257
272#define __NR_set_tid_address 258
273#define __NR_timer_create 259
274#define __NR_timer_settime (__NR_timer_create+1)
275#define __NR_timer_gettime (__NR_timer_create+2)
276#define __NR_timer_getoverrun (__NR_timer_create+3)
277#define __NR_timer_delete (__NR_timer_create+4)
278#define __NR_clock_settime (__NR_timer_create+5)
279#define __NR_clock_gettime (__NR_timer_create+6)
280#define __NR_clock_getres (__NR_timer_create+7)
281#define __NR_clock_nanosleep (__NR_timer_create+8)
282#define __NR_statfs64 268
283#define __NR_fstatfs64 269
284#define __NR_tgkill 270
285#define __NR_utimes 271
286#define __NR_fadvise64_64 272
287#define __NR_vserver 273
288#define __NR_mbind 274
289#define __NR_get_mempolicy 275
290#define __NR_set_mempolicy 276
291#define __NR_mq_open 277
292#define __NR_mq_unlink (__NR_mq_open+1)
293#define __NR_mq_timedsend (__NR_mq_open+2)
294#define __NR_mq_timedreceive (__NR_mq_open+3)
295#define __NR_mq_notify (__NR_mq_open+4)
296#define __NR_mq_getsetattr (__NR_mq_open+5)
297#define __NR_kexec_load 283
298#define __NR_waitid 284
299#define __NR_add_key 286
300#define __NR_request_key 287
301#define __NR_keyctl 288
302#define __NR_cacheflush 289
303#define __NR_ioprio_set 290
304#define __NR_ioprio_get 291
305#define __NR_inotify_init 292
306#define __NR_inotify_add_watch 293
307#define __NR_inotify_rm_watch 294
308#define __NR_migrate_pages 295
309#define __NR_openat 296
310#define __NR_mkdirat 297
311#define __NR_mknodat 298
312#define __NR_fchownat 299
313#define __NR_futimesat 300
314#define __NR_fstatat64 301
315#define __NR_unlinkat 302
316#define __NR_renameat 303
317#define __NR_linkat 304
318#define __NR_symlinkat 305
319#define __NR_readlinkat 306
320#define __NR_fchmodat 307
321#define __NR_faccessat 308
322#define __NR_pselect6 309
323#define __NR_ppoll 310
324#define __NR_unshare 311
325#define __NR_set_robust_list 312
326#define __NR_get_robust_list 313
327#define __NR_splice 314
328#define __NR_sync_file_range 315
329#define __NR_tee 316
330#define __NR_vmsplice 317
331#define __NR_move_pages 318
332#define __NR_getcpu 319
333#define __NR_epoll_pwait 320
334#define __NR_utimensat 321
335#define __NR_signalfd 322
336#define __NR_timerfd_create 323
337#define __NR_eventfd 324
338#define __NR_fallocate 325
339#define __NR_timerfd_settime 326
340#define __NR_timerfd_gettime 327
341#define __NR_signalfd4 328
342#define __NR_eventfd2 329
343#define __NR_epoll_create1 330
344#define __NR_dup3 331
345#define __NR_pipe2 332
346#define __NR_inotify_init1 333
347#define __NR_preadv 334
348#define __NR_pwritev 335
349#define __NR_rt_tgsigqueueinfo 336
350#define __NR_perf_event_open 337
351#define __NR_recvmmsg 338
352#define __NR_setns 339
353
354#ifdef __KERNEL__
16 355
17#define NR_syscalls 340 356#define NR_syscalls 340
18 357
19/* 358/*
20 * specify the deprecated syscalls we want to support on this arch 359 * specify the deprecated syscalls we want to support on this arch
21 */ 360 */
361#define __ARCH_WANT_IPC_PARSE_VERSION
22#define __ARCH_WANT_OLD_READDIR 362#define __ARCH_WANT_OLD_READDIR
23#define __ARCH_WANT_OLD_STAT 363#define __ARCH_WANT_OLD_STAT
24#define __ARCH_WANT_STAT64 364#define __ARCH_WANT_STAT64
@@ -43,9 +383,6 @@
43#define __ARCH_WANT_SYS_SIGPROCMASK 383#define __ARCH_WANT_SYS_SIGPROCMASK
44#define __ARCH_WANT_SYS_RT_SIGACTION 384#define __ARCH_WANT_SYS_RT_SIGACTION
45#define __ARCH_WANT_SYS_RT_SIGSUSPEND 385#define __ARCH_WANT_SYS_RT_SIGSUSPEND
46#define __ARCH_WANT_SYS_FORK
47#define __ARCH_WANT_SYS_VFORK
48#define __ARCH_WANT_SYS_CLONE
49 386
50/* 387/*
51 * "Conditional" syscalls 388 * "Conditional" syscalls
@@ -57,4 +394,5 @@
57#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); 394#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
58#endif 395#endif
59 396
397#endif /* __KERNEL__ */
60#endif /* _ASM_UNISTD_H */ 398#endif /* _ASM_UNISTD_H */