aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r--arch/microblaze/include/asm/Kbuild26
-rw-r--r--arch/microblaze/include/asm/atomic.h123
-rw-r--r--arch/microblaze/include/asm/auxvec.h1
-rw-r--r--arch/microblaze/include/asm/bitops.h27
-rw-r--r--arch/microblaze/include/asm/bug.h15
-rw-r--r--arch/microblaze/include/asm/bugs.h17
-rw-r--r--arch/microblaze/include/asm/byteorder.h6
-rw-r--r--arch/microblaze/include/asm/cache.h45
-rw-r--r--arch/microblaze/include/asm/cacheflush.h85
-rw-r--r--arch/microblaze/include/asm/checksum.h98
-rw-r--r--arch/microblaze/include/asm/clinkage.h1
-rw-r--r--arch/microblaze/include/asm/cpuinfo.h102
-rw-r--r--arch/microblaze/include/asm/cputable.h1
-rw-r--r--arch/microblaze/include/asm/cputime.h1
-rw-r--r--arch/microblaze/include/asm/current.h21
-rw-r--r--arch/microblaze/include/asm/delay.h72
-rw-r--r--arch/microblaze/include/asm/device.h21
-rw-r--r--arch/microblaze/include/asm/div64.h1
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h129
-rw-r--r--arch/microblaze/include/asm/dma.h16
-rw-r--r--arch/microblaze/include/asm/elf.h30
-rw-r--r--arch/microblaze/include/asm/emergency-restart.h1
-rw-r--r--arch/microblaze/include/asm/entry.h35
-rw-r--r--arch/microblaze/include/asm/errno.h1
-rw-r--r--arch/microblaze/include/asm/exceptions.h96
-rw-r--r--arch/microblaze/include/asm/fcntl.h1
-rw-r--r--arch/microblaze/include/asm/flat.h90
-rw-r--r--arch/microblaze/include/asm/ftrace.h1
-rw-r--r--arch/microblaze/include/asm/futex.h1
-rw-r--r--arch/microblaze/include/asm/gpio.h56
-rw-r--r--arch/microblaze/include/asm/hardirq.h29
-rw-r--r--arch/microblaze/include/asm/hw_irq.h1
-rw-r--r--arch/microblaze/include/asm/io.h208
-rw-r--r--arch/microblaze/include/asm/ioctl.h1
-rw-r--r--arch/microblaze/include/asm/ioctls.h91
-rw-r--r--arch/microblaze/include/asm/ipc.h1
-rw-r--r--arch/microblaze/include/asm/ipcbuf.h36
-rw-r--r--arch/microblaze/include/asm/irq.h47
-rw-r--r--arch/microblaze/include/asm/irq_regs.h1
-rw-r--r--arch/microblaze/include/asm/irqflags.h123
-rw-r--r--arch/microblaze/include/asm/kdebug.h1
-rw-r--r--arch/microblaze/include/asm/kmap_types.h29
-rw-r--r--arch/microblaze/include/asm/linkage.h15
-rw-r--r--arch/microblaze/include/asm/lmb.h17
-rw-r--r--arch/microblaze/include/asm/local.h1
-rw-r--r--arch/microblaze/include/asm/mman.h25
-rw-r--r--arch/microblaze/include/asm/mmu.h19
-rw-r--r--arch/microblaze/include/asm/mmu_context.h21
-rw-r--r--arch/microblaze/include/asm/module.h37
-rw-r--r--arch/microblaze/include/asm/msgbuf.h31
-rw-r--r--arch/microblaze/include/asm/mutex.h1
-rw-r--r--arch/microblaze/include/asm/namei.h22
-rw-r--r--arch/microblaze/include/asm/of_device.h45
-rw-r--r--arch/microblaze/include/asm/of_platform.h64
-rw-r--r--arch/microblaze/include/asm/page.h140
-rw-r--r--arch/microblaze/include/asm/param.h30
-rw-r--r--arch/microblaze/include/asm/pci-bridge.h1
-rw-r--r--arch/microblaze/include/asm/pci.h1
-rw-r--r--arch/microblaze/include/asm/percpu.h1
-rw-r--r--arch/microblaze/include/asm/pgalloc.h14
-rw-r--r--arch/microblaze/include/asm/pgtable.h54
-rw-r--r--arch/microblaze/include/asm/poll.h1
-rw-r--r--arch/microblaze/include/asm/posix_types.h73
-rw-r--r--arch/microblaze/include/asm/processor.h93
-rw-r--r--arch/microblaze/include/asm/prom.h313
-rw-r--r--arch/microblaze/include/asm/ptrace.h68
-rw-r--r--arch/microblaze/include/asm/pvr.h209
-rw-r--r--arch/microblaze/include/asm/registers.h33
-rw-r--r--arch/microblaze/include/asm/resource.h1
-rw-r--r--arch/microblaze/include/asm/scatterlist.h28
-rw-r--r--arch/microblaze/include/asm/sections.h25
-rw-r--r--arch/microblaze/include/asm/segment.h43
-rw-r--r--arch/microblaze/include/asm/selfmod.h24
-rw-r--r--arch/microblaze/include/asm/sembuf.h34
-rw-r--r--arch/microblaze/include/asm/serial.h14
-rw-r--r--arch/microblaze/include/asm/setup.h44
-rw-r--r--arch/microblaze/include/asm/shmbuf.h42
-rw-r--r--arch/microblaze/include/asm/shmparam.h6
-rw-r--r--arch/microblaze/include/asm/sigcontext.h20
-rw-r--r--arch/microblaze/include/asm/siginfo.h15
-rw-r--r--arch/microblaze/include/asm/signal.h165
-rw-r--r--arch/microblaze/include/asm/socket.h69
-rw-r--r--arch/microblaze/include/asm/sockios.h23
-rw-r--r--arch/microblaze/include/asm/stat.h73
-rw-r--r--arch/microblaze/include/asm/statfs.h1
-rw-r--r--arch/microblaze/include/asm/string.h24
-rw-r--r--arch/microblaze/include/asm/swab.h8
-rw-r--r--arch/microblaze/include/asm/syscalls.h45
-rw-r--r--arch/microblaze/include/asm/system.h91
-rw-r--r--arch/microblaze/include/asm/termbits.h203
-rw-r--r--arch/microblaze/include/asm/termios.h88
-rw-r--r--arch/microblaze/include/asm/thread_info.h159
-rw-r--r--arch/microblaze/include/asm/timex.h18
-rw-r--r--arch/microblaze/include/asm/tlb.h16
-rw-r--r--arch/microblaze/include/asm/tlbflush.h20
-rw-r--r--arch/microblaze/include/asm/topology.h11
-rw-r--r--arch/microblaze/include/asm/types.h38
-rw-r--r--arch/microblaze/include/asm/uaccess.h134
-rw-r--r--arch/microblaze/include/asm/ucontext.h22
-rw-r--r--arch/microblaze/include/asm/unaligned.h22
-rw-r--r--arch/microblaze/include/asm/unistd.h421
-rw-r--r--arch/microblaze/include/asm/user.h1
-rw-r--r--arch/microblaze/include/asm/vga.h1
-rw-r--r--arch/microblaze/include/asm/xor.h1
104 files changed, 4967 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
new file mode 100644
index 000000000000..31820dfef56b
--- /dev/null
+++ b/arch/microblaze/include/asm/Kbuild
@@ -0,0 +1,26 @@
1include include/asm-generic/Kbuild.asm
2
3header-y += auxvec.h
4header-y += errno.h
5header-y += fcntl.h
6header-y += ioctl.h
7header-y += ioctls.h
8header-y += ipcbuf.h
9header-y += linkage.h
10header-y += msgbuf.h
11header-y += poll.h
12header-y += resource.h
13header-y += sembuf.h
14header-y += shmbuf.h
15header-y += sigcontext.h
16header-y += siginfo.h
17header-y += socket.h
18header-y += sockios.h
19header-y += statfs.h
20header-y += stat.h
21header-y += termbits.h
22header-y += ucontext.h
23
24unifdef-y += cputable.h
25unifdef-y += elf.h
26unifdef-y += termios.h
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
new file mode 100644
index 000000000000..a448d94ab721
--- /dev/null
+++ b/arch/microblaze/include/asm/atomic.h
@@ -0,0 +1,123 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_ATOMIC_H
10#define _ASM_MICROBLAZE_ATOMIC_H
11
12#include <linux/types.h>
13#include <linux/compiler.h> /* likely */
14#include <asm/system.h> /* local_irq_XXX and friends */
15
16#define ATOMIC_INIT(i) { (i) }
17#define atomic_read(v) ((v)->counter)
18#define atomic_set(v, i) (((v)->counter) = (i))
19
20#define atomic_inc(v) (atomic_add_return(1, (v)))
21#define atomic_dec(v) (atomic_sub_return(1, (v)))
22
23#define atomic_add(i, v) (atomic_add_return(i, (v)))
24#define atomic_sub(i, v) (atomic_sub_return(i, (v)))
25
26#define atomic_inc_return(v) (atomic_add_return(1, (v)))
27#define atomic_dec_return(v) (atomic_sub_return(1, (v)))
28
29#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
30#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
31
32#define atomic_inc_not_zero(v) (atomic_add_unless((v), 1, 0))
33
34#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
35
36static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
37{
38 int ret;
39 unsigned long flags;
40
41 local_irq_save(flags);
42 ret = v->counter;
43 if (likely(ret == old))
44 v->counter = new;
45 local_irq_restore(flags);
46
47 return ret;
48}
49
50static inline int atomic_add_unless(atomic_t *v, int a, int u)
51{
52 int c, old;
53
54 c = atomic_read(v);
55 while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
56 c = old;
57 return c != u;
58}
59
60static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
61{
62 unsigned long flags;
63
64 local_irq_save(flags);
65 *addr &= ~mask;
66 local_irq_restore(flags);
67}
68
69/**
70 * atomic_add_return - add and return
71 * @i: integer value to add
72 * @v: pointer of type atomic_t
73 *
74 * Atomically adds @i to @v and returns @i + @v
75 */
76static inline int atomic_add_return(int i, atomic_t *v)
77{
78 unsigned long flags;
79 int val;
80
81 local_irq_save(flags);
82 val = v->counter;
83 v->counter = val += i;
84 local_irq_restore(flags);
85
86 return val;
87}
88
89static inline int atomic_sub_return(int i, atomic_t *v)
90{
91 return atomic_add_return(-i, v);
92}
93
94/*
95 * Atomically test *v and decrement if it is greater than 0.
96 * The function returns the old value of *v minus 1.
97 */
98static inline int atomic_dec_if_positive(atomic_t *v)
99{
100 unsigned long flags;
101 int res;
102
103 local_irq_save(flags);
104 res = v->counter - 1;
105 if (res >= 0)
106 v->counter = res;
107 local_irq_restore(flags);
108
109 return res;
110}
111
112#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
113#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
114
115/* Atomic operations are already serializing */
116#define smp_mb__before_atomic_dec() barrier()
117#define smp_mb__after_atomic_dec() barrier()
118#define smp_mb__before_atomic_inc() barrier()
119#define smp_mb__after_atomic_inc() barrier()
120
121#include <asm-generic/atomic.h>
122
123#endif /* _ASM_MICROBLAZE_ATOMIC_H */
diff --git a/arch/microblaze/include/asm/auxvec.h b/arch/microblaze/include/asm/auxvec.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/auxvec.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h
new file mode 100644
index 000000000000..d6df1fd4e1e8
--- /dev/null
+++ b/arch/microblaze/include/asm/bitops.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BITOPS_H
10#define _ASM_MICROBLAZE_BITOPS_H
11
12/*
13 * Copyright 1992, Linus Torvalds.
14 */
15
16#include <asm/byteorder.h> /* swab32 */
17#include <asm/system.h> /* save_flags */
18
19/*
20 * clear_bit() doesn't provide any barrier for the compiler.
21 */
22#define smp_mb__before_clear_bit() barrier()
23#define smp_mb__after_clear_bit() barrier()
24#include <asm-generic/bitops.h>
25#include <asm-generic/bitops/__fls.h>
26
27#endif /* _ASM_MICROBLAZE_BITOPS_H */
diff --git a/arch/microblaze/include/asm/bug.h b/arch/microblaze/include/asm/bug.h
new file mode 100644
index 000000000000..8eb2cdde11d7
--- /dev/null
+++ b/arch/microblaze/include/asm/bug.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BUG_H
10#define _ASM_MICROBLAZE_BUG_H
11
12#include <linux/kernel.h>
13#include <asm-generic/bug.h>
14
15#endif /* _ASM_MICROBLAZE_BUG_H */
diff --git a/arch/microblaze/include/asm/bugs.h b/arch/microblaze/include/asm/bugs.h
new file mode 100644
index 000000000000..f2c6593653fb
--- /dev/null
+++ b/arch/microblaze/include/asm/bugs.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BUGS_H
10#define _ASM_MICROBLAZE_BUGS_H
11
12static inline void check_bugs(void)
13{
14 /* nothing to do */
15}
16
17#endif /* _ASM_MICROBLAZE_BUGS_H */
diff --git a/arch/microblaze/include/asm/byteorder.h b/arch/microblaze/include/asm/byteorder.h
new file mode 100644
index 000000000000..ce9c58732ffc
--- /dev/null
+++ b/arch/microblaze/include/asm/byteorder.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_MICROBLAZE_BYTEORDER_H
2#define _ASM_MICROBLAZE_BYTEORDER_H
3
4#include <linux/byteorder/big_endian.h>
5
6#endif /* _ASM_MICROBLAZE_BYTEORDER_H */
diff --git a/arch/microblaze/include/asm/cache.h b/arch/microblaze/include/asm/cache.h
new file mode 100644
index 000000000000..c4c64b43c074
--- /dev/null
+++ b/arch/microblaze/include/asm/cache.h
@@ -0,0 +1,45 @@
1/*
2 * Cache operations
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_CACHE_H
14#define _ASM_MICROBLAZE_CACHE_H
15
16#include <asm/registers.h>
17
18#define L1_CACHE_SHIFT 2
19/* word-granular cache in microblaze */
20#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
21
22#define SMP_CACHE_BYTES L1_CACHE_BYTES
23
24void _enable_icache(void);
25void _disable_icache(void);
26void _invalidate_icache(unsigned int addr);
27
28#define __enable_icache() _enable_icache()
29#define __disable_icache() _disable_icache()
30#define __invalidate_icache(addr) _invalidate_icache(addr)
31
32void _enable_dcache(void);
33void _disable_dcache(void);
34void _invalidate_dcache(unsigned int addr);
35
36#define __enable_dcache() _enable_dcache()
37#define __disable_dcache() _disable_dcache()
38#define __invalidate_dcache(addr) _invalidate_dcache(addr)
39
40/* FIXME - I don't think this is right */
41#ifdef CONFIG_XILINX_UNCACHED_SHADOW
42#define UNCACHED_SHADOW_MASK (CONFIG_XILINX_ERAM_SIZE)
43#endif
44
45#endif /* _ASM_MICROBLAZE_CACHE_H */
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
new file mode 100644
index 000000000000..3300b785049b
--- /dev/null
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) 2007 PetaLogix
3 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
4 * based on v850 version which was
5 * Copyright (C) 2001,02,03 NEC Electronics Corporation
6 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 *
12 */
13
14#ifndef _ASM_MICROBLAZE_CACHEFLUSH_H
15#define _ASM_MICROBLAZE_CACHEFLUSH_H
16
17/* Somebody depends on this; sigh... */
18#include <linux/mm.h>
19
20/*
21 * Cache handling functions.
22 * Microblaze has a write-through data cache, meaning that the data cache
23 * never needs to be flushed. The only flushing operations that are
24 * implemented are to invalidate the instruction cache. These are called
25 * after loading a user application into memory, we must invalidate the
26 * instruction cache to make sure we don't fetch old, bad code.
27 */
28
29/* FIXME for LL-temac driver */
30#define invalidate_dcache_range(start, end) \
31 __invalidate_dcache_range(start, end)
32
33#define flush_cache_all() __invalidate_cache_all()
34#define flush_cache_mm(mm) do { } while (0)
35#define flush_cache_range(vma, start, end) __invalidate_cache_all()
36#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
37
38#define flush_dcache_range(start, end) __invalidate_dcache_range(start, end)
39#define flush_dcache_page(page) do { } while (0)
40#define flush_dcache_mmap_lock(mapping) do { } while (0)
41#define flush_dcache_mmap_unlock(mapping) do { } while (0)
42
43#define flush_icache_range(start, len) __invalidate_icache_range(start, len)
44#define flush_icache_page(vma, pg) do { } while (0)
45
46#define flush_cache_vmap(start, end) do { } while (0)
47#define flush_cache_vunmap(start, end) do { } while (0)
48
49struct page;
50struct mm_struct;
51struct vm_area_struct;
52
53/* see arch/microblaze/kernel/cache.c */
54extern void __invalidate_icache_all(void);
55extern void __invalidate_icache_range(unsigned long start, unsigned long end);
56extern void __invalidate_icache_page(struct vm_area_struct *vma,
57 struct page *page);
58extern void __invalidate_icache_user_range(struct vm_area_struct *vma,
59 struct page *page,
60 unsigned long adr, int len);
61extern void __invalidate_cache_sigtramp(unsigned long addr);
62
63extern void __invalidate_dcache_all(void);
64extern void __invalidate_dcache_range(unsigned long start, unsigned long end);
65extern void __invalidate_dcache_page(struct vm_area_struct *vma,
66 struct page *page);
67extern void __invalidate_dcache_user_range(struct vm_area_struct *vma,
68 struct page *page,
69 unsigned long adr, int len);
70
71extern inline void __invalidate_cache_all(void)
72{
73 __invalidate_icache_all();
74 __invalidate_dcache_all();
75}
76
77#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
78do { memcpy((dst), (src), (len)); \
79 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
80} while (0)
81
82#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
83 memcpy((dst), (src), (len))
84
85#endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */
diff --git a/arch/microblaze/include/asm/checksum.h b/arch/microblaze/include/asm/checksum.h
new file mode 100644
index 000000000000..92b30762ce59
--- /dev/null
+++ b/arch/microblaze/include/asm/checksum.h
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_CHECKSUM_H
11#define _ASM_MICROBLAZE_CHECKSUM_H
12
13#include <linux/in6.h>
14
15/*
16 * computes the checksum of the TCP/UDP pseudo-header
17 * returns a 16-bit checksum, already complemented
18 */
19static inline __wsum
20csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
21 unsigned short proto, __wsum sum)
22{
23 __asm__("add %0, %0, %1\n\t"
24 "addc %0, %0, %2\n\t"
25 "addc %0, %0, %3\n\t"
26 "addc %0, %0, r0\n\t"
27 : "+&d" (sum)
28 : "d" (saddr), "d" (daddr), "d" (len + proto));
29
30 return sum;
31}
32
33/*
34 * computes the checksum of a memory block at buff, length len,
35 * and adds in "sum" (32-bit)
36 *
37 * returns a 32-bit number suitable for feeding into itself
38 * or csum_tcpudp_magic
39 *
40 * this function must be called with even lengths, except
41 * for the last fragment, which may be odd
42 *
43 * it's best to have buff aligned on a 32-bit boundary
44 */
45extern __wsum csum_partial(const void *buff, int len, __wsum sum);
46
47/*
48 * the same as csum_partial, but copies from src while it
49 * checksums
50 *
51 * here even more important to align src and dst on a 32-bit (or even
52 * better 64-bit) boundary
53 */
54extern __wsum csum_partial_copy(const char *src, char *dst, int len, int sum);
55
56/*
57 * the same as csum_partial_copy, but copies from user space.
58 *
59 * here even more important to align src and dst on a 32-bit (or even
60 * better 64-bit) boundary
61 */
62extern __wsum csum_partial_copy_from_user(const char *src, char *dst,
63 int len, int sum, int *csum_err);
64
65#define csum_partial_copy_nocheck(src, dst, len, sum) \
66 csum_partial_copy((src), (dst), (len), (sum))
67
68/*
69 * This is a version of ip_compute_csum() optimized for IP headers,
70 * which always checksum on 4 octet boundaries.
71 *
72 */
73extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
74
75/*
76 * Fold a partial checksum
77 */
78static inline __sum16 csum_fold(unsigned int sum)
79{
80 sum = (sum & 0xffff) + (sum >> 16);
81 sum = (sum & 0xffff) + (sum >> 16);
82 return ~sum;
83}
84
85static inline __sum16
86csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
87 unsigned short proto, __wsum sum)
88{
89 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
90}
91
92/*
93 * this routine is used for miscellaneous IP-like checksums, mainly
94 * in icmp.c
95 */
96extern __sum16 ip_compute_csum(const unsigned char *buff, int len);
97
98#endif /* _ASM_MICROBLAZE_CHECKSUM_H */
diff --git a/arch/microblaze/include/asm/clinkage.h b/arch/microblaze/include/asm/clinkage.h
new file mode 100644
index 000000000000..9e218435a55c
--- /dev/null
+++ b/arch/microblaze/include/asm/clinkage.h
@@ -0,0 +1 @@
#include <linux/linkage.h>
diff --git a/arch/microblaze/include/asm/cpuinfo.h b/arch/microblaze/include/asm/cpuinfo.h
new file mode 100644
index 000000000000..52f28f6dc4eb
--- /dev/null
+++ b/arch/microblaze/include/asm/cpuinfo.h
@@ -0,0 +1,102 @@
1/*
2 * Generic support for queying CPU info
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2007 John Williams <jwilliams@itee.uq.edu.au>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_CPUINFO_H
14#define _ASM_MICROBLAZE_CPUINFO_H
15
16#include <asm/prom.h>
17
18/* CPU Version and FPGA Family code conversion table type */
19struct cpu_ver_key {
20 const char *s;
21 const unsigned k;
22};
23
24extern const struct cpu_ver_key cpu_ver_lookup[];
25
26struct family_string_key {
27 const char *s;
28 const unsigned k;
29};
30
31extern const struct family_string_key family_string_lookup[];
32
33struct cpuinfo {
34 /* Core CPU configuration */
35 u32 use_instr;
36 u32 use_mult;
37 u32 use_fpu;
38 u32 use_exc;
39 u32 ver_code;
40 u32 mmu;
41
42 /* CPU caches */
43 u32 use_icache;
44 u32 icache_tagbits;
45 u32 icache_write;
46 u32 icache_line;
47 u32 icache_size;
48 unsigned long icache_base;
49 unsigned long icache_high;
50
51 u32 use_dcache;
52 u32 dcache_tagbits;
53 u32 dcache_write;
54 u32 dcache_line;
55 u32 dcache_size;
56 unsigned long dcache_base;
57 unsigned long dcache_high;
58
59 /* Bus connections */
60 u32 use_dopb;
61 u32 use_iopb;
62 u32 use_dlmb;
63 u32 use_ilmb;
64 u32 num_fsl;
65
66 /* CPU interrupt line info */
67 u32 irq_edge;
68 u32 irq_positive;
69
70 u32 area_optimised;
71
72 /* HW debug support */
73 u32 hw_debug;
74 u32 num_pc_brk;
75 u32 num_rd_brk;
76 u32 num_wr_brk;
77 u32 cpu_clock_freq; /* store real freq of cpu */
78 u32 freq_div_hz; /* store freq/HZ */
79
80 /* FPGA family */
81 u32 fpga_family_code;
82
83 /* User define */
84 u32 pvr_user1;
85 u32 pvr_user2;
86};
87
88extern struct cpuinfo cpuinfo;
89
90/* fwd declarations of the various CPUinfo populators */
91void setup_cpuinfo(void);
92
93void set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu);
94void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
95
96static inline unsigned int fcpu(struct device_node *cpu, char *n)
97{
98 int *val;
99 return (val = (int *) of_get_property(cpu, n, NULL)) ? *val : 0;
100}
101
102#endif /* _ASM_MICROBLAZE_CPUINFO_H */
diff --git a/arch/microblaze/include/asm/cputable.h b/arch/microblaze/include/asm/cputable.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/cputable.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/cputime.h b/arch/microblaze/include/asm/cputime.h
new file mode 100644
index 000000000000..6d68ad7e0ea3
--- /dev/null
+++ b/arch/microblaze/include/asm/cputime.h
@@ -0,0 +1 @@
#include <asm-generic/cputime.h>
diff --git a/arch/microblaze/include/asm/current.h b/arch/microblaze/include/asm/current.h
new file mode 100644
index 000000000000..8375ea991e26
--- /dev/null
+++ b/arch/microblaze/include/asm/current.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_CURRENT_H
10#define _ASM_MICROBLAZE_CURRENT_H
11
12# ifndef __ASSEMBLY__
13/*
14 * Dedicate r31 to keeping the current task pointer
15 */
16register struct task_struct *current asm("r31");
17
18# define get_current() current
19# endif /* __ASSEMBLY__ */
20
21#endif /* _ASM_MICROBLAZE_CURRENT_H */
diff --git a/arch/microblaze/include/asm/delay.h b/arch/microblaze/include/asm/delay.h
new file mode 100644
index 000000000000..05b7d39e4391
--- /dev/null
+++ b/arch/microblaze/include/asm/delay.h
@@ -0,0 +1,72 @@
1/*
2 * include/asm-microblaze/delay.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2008 Michal Simek
9 * Copyright (C) 2007 John Williams
10 * Copyright (C) 2006 Atmark Techno, Inc.
11 */
12
13#ifndef _ASM_MICROBLAZE_DELAY_H
14#define _ASM_MICROBLAZE_DELAY_H
15
16extern inline void __delay(unsigned long loops)
17{
18 asm volatile ("# __delay \n\t" \
19 "1: addi %0, %0, -1\t\n" \
20 "bneid %0, 1b \t\n" \
21 "nop \t\n"
22 : "=r" (loops)
23 : "0" (loops));
24}
25
26/*
27 * Note that 19 * 226 == 4294 ==~ 2^32 / 10^6, so
28 * loops = (4294 * usecs * loops_per_jiffy * HZ) / 2^32.
29 *
30 * The mul instruction gives us loops = (a * b) / 2^32.
31 * We choose a = usecs * 19 * HZ and b = loops_per_jiffy * 226
32 * because this lets us support a wide range of HZ and
33 * loops_per_jiffy values without either a or b overflowing 2^32.
34 * Thus we need usecs * HZ <= (2^32 - 1) / 19 = 226050910 and
35 * loops_per_jiffy <= (2^32 - 1) / 226 = 19004280
36 * (which corresponds to ~3800 bogomips at HZ = 100).
37 * -- paulus
38 */
39#define __MAX_UDELAY (226050910UL/HZ) /* maximum udelay argument */
40#define __MAX_NDELAY (4294967295UL/HZ) /* maximum ndelay argument */
41
42extern unsigned long loops_per_jiffy;
43
44extern inline void __udelay(unsigned int x)
45{
46
47 unsigned long long tmp =
48 (unsigned long long)x * (unsigned long long)loops_per_jiffy \
49 * 226LL;
50 unsigned loops = tmp >> 32;
51
52/*
53 __asm__("mulxuu %0,%1,%2" : "=r" (loops) :
54 "r" (x), "r" (loops_per_jiffy * 226));
55*/
56 __delay(loops);
57}
58
59extern void __bad_udelay(void); /* deliberately undefined */
60extern void __bad_ndelay(void); /* deliberately undefined */
61
62#define udelay(n) (__builtin_constant_p(n) ? \
63 ((n) > __MAX_UDELAY ? __bad_udelay() : __udelay((n) * (19 * HZ))) : \
64 __udelay((n) * (19 * HZ)))
65
66#define ndelay(n) (__builtin_constant_p(n) ? \
67 ((n) > __MAX_NDELAY ? __bad_ndelay() : __udelay((n) * HZ)) : \
68 __udelay((n) * HZ))
69
70#define muldiv(a, b, c) (((a)*(b))/(c))
71
72#endif /* _ASM_MICROBLAZE_DELAY_H */
diff --git a/arch/microblaze/include/asm/device.h b/arch/microblaze/include/asm/device.h
new file mode 100644
index 000000000000..c042830793ed
--- /dev/null
+++ b/arch/microblaze/include/asm/device.h
@@ -0,0 +1,21 @@
1/*
2 * Arch specific extensions to struct device
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License v2. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DEVICE_H
10#define _ASM_MICROBLAZE_DEVICE_H
11
12struct device_node;
13
14struct dev_archdata {
15 /* Optional pointer to an OF device node */
16 struct device_node *of_node;
17};
18
19#endif /* _ASM_MICROBLAZE_DEVICE_H */
20
21
diff --git a/arch/microblaze/include/asm/div64.h b/arch/microblaze/include/asm/div64.h
new file mode 100644
index 000000000000..6cd978cefb28
--- /dev/null
+++ b/arch/microblaze/include/asm/div64.h
@@ -0,0 +1 @@
#include <asm-generic/div64.h>
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
new file mode 100644
index 000000000000..17336252a9b8
--- /dev/null
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -0,0 +1,129 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DMA_MAPPING_H
10#define _ASM_MICROBLAZE_DMA_MAPPING_H
11
12#include <asm/cacheflush.h>
13#include <linux/io.h>
14#include <linux/bug.h>
15
16struct scatterlist;
17
18#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
19#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
20
21/* FIXME */
22static inline int
23dma_supported(struct device *dev, u64 mask)
24{
25 return 1;
26}
27
28static inline dma_addr_t
29dma_map_page(struct device *dev, struct page *page,
30 unsigned long offset, size_t size,
31 enum dma_data_direction direction)
32{
33 BUG();
34 return 0;
35}
36
37static inline void
38dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
39 enum dma_data_direction direction)
40{
41 BUG();
42}
43
44static inline int
45dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
46 enum dma_data_direction direction)
47{
48 BUG();
49 return 0;
50}
51
52static inline void
53dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
54 enum dma_data_direction direction)
55{
56 BUG();
57}
58
59static inline void
60dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
61 enum dma_data_direction direction)
62{
63 BUG();
64}
65
66static inline void
67dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
68 size_t size, enum dma_data_direction direction)
69{
70 BUG();
71}
72
73static inline void
74dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
75 enum dma_data_direction direction)
76{
77 BUG();
78}
79
80static inline void
81dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
82 enum dma_data_direction direction)
83{
84 BUG();
85}
86
87static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
88{
89 return 0;
90}
91
92static inline void *dma_alloc_coherent(struct device *dev, size_t size,
93 dma_addr_t *dma_handle, int flag)
94{
95 return NULL; /* consistent_alloc(flag, size, dma_handle); */
96}
97
98static inline void dma_free_coherent(struct device *dev, size_t size,
99 void *vaddr, dma_addr_t dma_handle)
100{
101 BUG();
102}
103
104static inline dma_addr_t
105dma_map_single(struct device *dev, void *ptr, size_t size,
106 enum dma_data_direction direction)
107{
108 BUG_ON(direction == DMA_NONE);
109
110 return virt_to_bus(ptr);
111}
112
113static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
114 size_t size,
115 enum dma_data_direction direction)
116{
117 switch (direction) {
118 case DMA_FROM_DEVICE:
119 flush_dcache_range((unsigned)dma_addr,
120 (unsigned)dma_addr + size);
121 /* Fall through */
122 case DMA_TO_DEVICE:
123 break;
124 default:
125 BUG();
126 }
127}
128
129#endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */
diff --git a/arch/microblaze/include/asm/dma.h b/arch/microblaze/include/asm/dma.h
new file mode 100644
index 000000000000..0967fa04fc5e
--- /dev/null
+++ b/arch/microblaze/include/asm/dma.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DMA_H
10#define _ASM_MICROBLAZE_DMA_H
11
12/* we don't have dma address limit. define it as zero to be
13 * unlimited. */
14#define MAX_DMA_ADDRESS (0)
15
16#endif /* _ASM_MICROBLAZE_DMA_H */
diff --git a/arch/microblaze/include/asm/elf.h b/arch/microblaze/include/asm/elf.h
new file mode 100644
index 000000000000..81337f241347
--- /dev/null
+++ b/arch/microblaze/include/asm/elf.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_ELF_H
10#define _ASM_MICROBLAZE_ELF_H
11
12/*
13 * Note there is no "official" ELF designation for Microblaze.
14 * I've snaffled the value from the microblaze binutils source code
15 * /binutils/microblaze/include/elf/microblaze.h
16 */
17#define EM_XILINX_MICROBLAZE 0xbaab
18#define ELF_ARCH EM_XILINX_MICROBLAZE
19
20/*
21 * This is used to ensure we don't load something for the wrong architecture.
22 */
23#define elf_check_arch(x) ((x)->e_machine == EM_XILINX_MICROBLAZE)
24
25/*
26 * These are used to set parameters in the core dumps.
27 */
28#define ELF_CLASS ELFCLASS32
29
30#endif /* _ASM_MICROBLAZE_ELF_H */
diff --git a/arch/microblaze/include/asm/emergency-restart.h b/arch/microblaze/include/asm/emergency-restart.h
new file mode 100644
index 000000000000..3711bd9d50bd
--- /dev/null
+++ b/arch/microblaze/include/asm/emergency-restart.h
@@ -0,0 +1 @@
#include <asm-generic/emergency-restart.h>
diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h
new file mode 100644
index 000000000000..7f57e42ee467
--- /dev/null
+++ b/arch/microblaze/include/asm/entry.h
@@ -0,0 +1,35 @@
1/*
2 * Definitions used by low-level trap handlers
3 *
4 * Copyright (C) 2008 Michal Simek
5 * Copyright (C) 2007 - 2008 PetaLogix
6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_ENTRY_H
14#define _ASM_MICROBLAZE_ENTRY_H
15
16#include <asm/percpu.h>
17#include <asm/ptrace.h>
18
19/*
20 * These are per-cpu variables required in entry.S, among other
21 * places
22 */
23
24#define PER_CPU(var) per_cpu__##var
25
26# ifndef __ASSEMBLY__
27DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */
28DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */
29DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */
30DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
31DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
32DECLARE_PER_CPU(unsigned int, SYSCALL_SAVE); /* Saved syscall number */
33# endif /* __ASSEMBLY__ */
34
35#endif /* _ASM_MICROBLAZE_ENTRY_H */
diff --git a/arch/microblaze/include/asm/errno.h b/arch/microblaze/include/asm/errno.h
new file mode 100644
index 000000000000..4c82b503d92f
--- /dev/null
+++ b/arch/microblaze/include/asm/errno.h
@@ -0,0 +1 @@
#include <asm-generic/errno.h>
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
new file mode 100644
index 000000000000..4cdd2159f470
--- /dev/null
+++ b/arch/microblaze/include/asm/exceptions.h
@@ -0,0 +1,96 @@
1/*
2 * Preliminary support for HW exception handing for Microblaze
3 *
4 * Copyright (C) 2008 Michal Simek
5 * Copyright (C) 2008 PetaLogix
6 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_EXCEPTIONS_H
14#define _ASM_MICROBLAZE_EXCEPTIONS_H
15
16#ifdef __KERNEL__
17#ifndef __ASSEMBLY__
18
19/* Macros to enable and disable HW exceptions in the MSR */
20/* Define MSR enable bit for HW exceptions */
21#define HWEX_MSR_BIT (1 << 8)
22
23#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
24#define __enable_hw_exceptions() \
25 __asm__ __volatile__ (" msrset r0, %0; \
26 nop;" \
27 : \
28 : "i" (HWEX_MSR_BIT) \
29 : "memory")
30
31#define __disable_hw_exceptions() \
32 __asm__ __volatile__ (" msrclr r0, %0; \
33 nop;" \
34 : \
35 : "i" (HWEX_MSR_BIT) \
36 : "memory")
37#else /* !CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
38#define __enable_hw_exceptions() \
39 __asm__ __volatile__ (" \
40 mfs r12, rmsr; \
41 nop; \
42 ori r12, r12, %0; \
43 mts rmsr, r12; \
44 nop;" \
45 : \
46 : "i" (HWEX_MSR_BIT) \
47 : "memory", "r12")
48
49#define __disable_hw_exceptions() \
50 __asm__ __volatile__ (" \
51 mfs r12, rmsr; \
52 nop; \
53 andi r12, r12, ~%0; \
54 mts rmsr, r12; \
55 nop;" \
56 : \
57 : "i" (HWEX_MSR_BIT) \
58 : "memory", "r12")
59#endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
60
61asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
62 int fsr, int addr);
63
64#if defined(CONFIG_XMON)
65extern void xmon(struct pt_regs *regs);
66extern int xmon_bpt(struct pt_regs *regs);
67extern int xmon_sstep(struct pt_regs *regs);
68extern int xmon_iabr_match(struct pt_regs *regs);
69extern int xmon_dabr_match(struct pt_regs *regs);
70extern void (*xmon_fault_handler)(struct pt_regs *regs);
71
72void (*debugger)(struct pt_regs *regs) = xmon;
73int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
74int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
75int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
76int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
77void (*debugger_fault_handler)(struct pt_regs *regs);
78#elif defined(CONFIG_KGDB)
79void (*debugger)(struct pt_regs *regs);
80int (*debugger_bpt)(struct pt_regs *regs);
81int (*debugger_sstep)(struct pt_regs *regs);
82int (*debugger_iabr_match)(struct pt_regs *regs);
83int (*debugger_dabr_match)(struct pt_regs *regs);
84void (*debugger_fault_handler)(struct pt_regs *regs);
85#else
86#define debugger(regs) do { } while (0)
87#define debugger_bpt(regs) 0
88#define debugger_sstep(regs) 0
89#define debugger_iabr_match(regs) 0
90#define debugger_dabr_match(regs) 0
91#define debugger_fault_handler ((void (*)(struct pt_regs *))0)
92#endif
93
94#endif /*__ASSEMBLY__ */
95#endif /* __KERNEL__ */
96#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
diff --git a/arch/microblaze/include/asm/fcntl.h b/arch/microblaze/include/asm/fcntl.h
new file mode 100644
index 000000000000..46ab12db5739
--- /dev/null
+++ b/arch/microblaze/include/asm/fcntl.h
@@ -0,0 +1 @@
#include <asm-generic/fcntl.h>
diff --git a/arch/microblaze/include/asm/flat.h b/arch/microblaze/include/asm/flat.h
new file mode 100644
index 000000000000..acf0da543ef1
--- /dev/null
+++ b/arch/microblaze/include/asm/flat.h
@@ -0,0 +1,90 @@
1/*
2 * uClinux flat-format executables
3 *
4 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file COPYING in the main directory of this
8 * archive for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_FLAT_H
12#define _ASM_MICROBLAZE_FLAT_H
13
14#include <asm/unaligned.h>
15
16#define flat_stack_align(sp) /* nothing needed */
17#define flat_argvp_envp_on_stack() 0
18#define flat_old_ram_flag(flags) (flags)
19#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
20#define flat_set_persistent(relval, p) 0
21
22/*
23 * Microblaze works a little differently from other arches, because
24 * of the MICROBLAZE_64 reloc type. Here, a 32 bit address is split
25 * over two instructions, an 'imm' instruction which provides the top
26 * 16 bits, then the instruction "proper" which provides the low 16
27 * bits.
28 */
29
30/*
31 * Crack open a symbol reference and extract the address to be
32 * relocated. rp is a potentially unaligned pointer to the
33 * reference
34 */
35
36static inline unsigned long
37flat_get_addr_from_rp(unsigned long *rp, unsigned long relval,
38 unsigned long flags, unsigned long *persistent)
39{
40 unsigned long addr;
41 (void)flags;
42
43 /* Is it a split 64/32 reference? */
44 if (relval & 0x80000000) {
45 /* Grab the two halves of the reference */
46 unsigned long val_hi, val_lo;
47
48 val_hi = get_unaligned(rp);
49 val_lo = get_unaligned(rp+1);
50
51 /* Crack the address out */
52 addr = ((val_hi & 0xffff) << 16) + (val_lo & 0xffff);
53 } else {
54 /* Get the address straight out */
55 addr = get_unaligned(rp);
56 }
57
58 return addr;
59}
60
61/*
62 * Insert an address into the symbol reference at rp. rp is potentially
63 * unaligned.
64 */
65
66static inline void
67flat_put_addr_at_rp(unsigned long *rp, unsigned long addr, unsigned long relval)
68{
69 /* Is this a split 64/32 reloc? */
70 if (relval & 0x80000000) {
71 /* Get the two "halves" */
72 unsigned long val_hi = get_unaligned(rp);
73 unsigned long val_lo = get_unaligned(rp + 1);
74
75 /* insert the address */
76 val_hi = (val_hi & 0xffff0000) | addr >> 16;
77 val_lo = (val_lo & 0xffff0000) | (addr & 0xffff);
78
79 /* store the two halves back into memory */
80 put_unaligned(val_hi, rp);
81 put_unaligned(val_lo, rp+1);
82 } else {
83 /* Put it straight in, no messing around */
84 put_unaligned(addr, rp);
85 }
86}
87
88#define flat_get_relocate_addr(rel) (rel & 0x7fffffff)
89
90#endif /* _ASM_MICROBLAZE_FLAT_H */
diff --git a/arch/microblaze/include/asm/ftrace.h b/arch/microblaze/include/asm/ftrace.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/ftrace.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/futex.h b/arch/microblaze/include/asm/futex.h
new file mode 100644
index 000000000000..0b745828f42b
--- /dev/null
+++ b/arch/microblaze/include/asm/futex.h
@@ -0,0 +1 @@
#include <asm-generic/futex.h>
diff --git a/arch/microblaze/include/asm/gpio.h b/arch/microblaze/include/asm/gpio.h
new file mode 100644
index 000000000000..ea04632399d8
--- /dev/null
+++ b/arch/microblaze/include/asm/gpio.h
@@ -0,0 +1,56 @@
1/*
2 * Generic GPIO API implementation for PowerPC.
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __ASM_POWERPC_GPIO_H
15#define __ASM_POWERPC_GPIO_H
16
17#include <linux/errno.h>
18#include <asm-generic/gpio.h>
19
20#ifdef CONFIG_GPIOLIB
21
22/*
23 * We don't (yet) implement inlined/rapid versions for on-chip gpios.
24 * Just call gpiolib.
25 */
26static inline int gpio_get_value(unsigned int gpio)
27{
28 return __gpio_get_value(gpio);
29}
30
31static inline void gpio_set_value(unsigned int gpio, int value)
32{
33 __gpio_set_value(gpio, value);
34}
35
36static inline int gpio_cansleep(unsigned int gpio)
37{
38 return __gpio_cansleep(gpio);
39}
40
41/*
42 * Not implemented, yet.
43 */
44static inline int gpio_to_irq(unsigned int gpio)
45{
46 return -ENOSYS;
47}
48
49static inline int irq_to_gpio(unsigned int irq)
50{
51 return -EINVAL;
52}
53
54#endif /* CONFIG_GPIOLIB */
55
56#endif /* __ASM_POWERPC_GPIO_H */
diff --git a/arch/microblaze/include/asm/hardirq.h b/arch/microblaze/include/asm/hardirq.h
new file mode 100644
index 000000000000..0f2d6b013e11
--- /dev/null
+++ b/arch/microblaze/include/asm/hardirq.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_HARDIRQ_H
10#define _ASM_MICROBLAZE_HARDIRQ_H
11
12#include <linux/cache.h>
13#include <linux/irq.h>
14#include <asm/irq.h>
15#include <asm/current.h>
16#include <linux/ptrace.h>
17
18/* should be defined in each interrupt controller driver */
19extern unsigned int get_irq(struct pt_regs *regs);
20
21typedef struct {
22 unsigned int __softirq_pending;
23} ____cacheline_aligned irq_cpustat_t;
24
25void ack_bad_irq(unsigned int irq);
26
27#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
28
29#endif /* _ASM_MICROBLAZE_HARDIRQ_H */
diff --git a/arch/microblaze/include/asm/hw_irq.h b/arch/microblaze/include/asm/hw_irq.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/hw_irq.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
new file mode 100644
index 000000000000..8b5853ee6b5c
--- /dev/null
+++ b/arch/microblaze/include/asm/io.h
@@ -0,0 +1,208 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IO_H
10#define _ASM_MICROBLAZE_IO_H
11
12#include <asm/byteorder.h>
13#include <asm/page.h>
14#include <linux/types.h>
15
16#define IO_SPACE_LIMIT (0xFFFFFFFF)
17
18static inline unsigned char __raw_readb(const volatile void __iomem *addr)
19{
20 return *(volatile unsigned char __force *)addr;
21}
22static inline unsigned short __raw_readw(const volatile void __iomem *addr)
23{
24 return *(volatile unsigned short __force *)addr;
25}
26static inline unsigned int __raw_readl(const volatile void __iomem *addr)
27{
28 return *(volatile unsigned int __force *)addr;
29}
30static inline unsigned long __raw_readq(const volatile void __iomem *addr)
31{
32 return *(volatile unsigned long __force *)addr;
33}
34static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
35{
36 *(volatile unsigned char __force *)addr = v;
37}
38static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
39{
40 *(volatile unsigned short __force *)addr = v;
41}
42static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
43{
44 *(volatile unsigned int __force *)addr = v;
45}
46static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
47{
48 *(volatile unsigned long __force *)addr = v;
49}
50
51/*
52 * read (readb, readw, readl, readq) and write (writeb, writew,
53 * writel, writeq) accessors are for PCI and thus littel endian.
54 * Linux 2.4 for Microblaze had this wrong.
55 */
56static inline unsigned char readb(const volatile void __iomem *addr)
57{
58 return *(volatile unsigned char __force *)addr;
59}
60static inline unsigned short readw(const volatile void __iomem *addr)
61{
62 return le16_to_cpu(*(volatile unsigned short __force *)addr);
63}
64static inline unsigned int readl(const volatile void __iomem *addr)
65{
66 return le32_to_cpu(*(volatile unsigned int __force *)addr);
67}
68static inline void writeb(unsigned char v, volatile void __iomem *addr)
69{
70 *(volatile unsigned char __force *)addr = v;
71}
72static inline void writew(unsigned short v, volatile void __iomem *addr)
73{
74 *(volatile unsigned short __force *)addr = cpu_to_le16(v);
75}
76static inline void writel(unsigned int v, volatile void __iomem *addr)
77{
78 *(volatile unsigned int __force *)addr = cpu_to_le32(v);
79}
80
81/* ioread and iowrite variants. thease are for now same as __raw_
82 * variants of accessors. we might check for endianess in the feature
83 */
84#define ioread8(addr) __raw_readb((u8 *)(addr))
85#define ioread16(addr) __raw_readw((u16 *)(addr))
86#define ioread32(addr) __raw_readl((u32 *)(addr))
87#define iowrite8(v, addr) __raw_writeb((u8)(v), (u8 *)(addr))
88#define iowrite16(v, addr) __raw_writew((u16)(v), (u16 *)(addr))
89#define iowrite32(v, addr) __raw_writel((u32)(v), (u32 *)(addr))
90
91/* These are the definitions for the x86 IO instructions
92 * inb/inw/inl/outb/outw/outl, the "string" versions
93 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
94 * inb_p/inw_p/...
95 * The macros don't do byte-swapping.
96 */
97#define inb(port) readb((u8 *)((port)))
98#define outb(val, port) writeb((val), (u8 *)((unsigned long)(port)))
99#define inw(port) readw((u16 *)((port)))
100#define outw(val, port) writew((val), (u16 *)((unsigned long)(port)))
101#define inl(port) readl((u32 *)((port)))
102#define outl(val, port) writel((val), (u32 *)((unsigned long)(port)))
103
104#define inb_p(port) inb((port))
105#define outb_p(val, port) outb((val), (port))
106#define inw_p(port) inw((port))
107#define outw_p(val, port) outw((val), (port))
108#define inl_p(port) inl((port))
109#define outl_p(val, port) outl((val), (port))
110
111#define memset_io(a, b, c) memset((void *)(a), (b), (c))
112#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c))
113#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c))
114
115/**
116 * virt_to_phys - map virtual addresses to physical
117 * @address: address to remap
118 *
119 * The returned physical address is the physical (CPU) mapping for
120 * the memory address given. It is only valid to use this function on
121 * addresses directly mapped or allocated via kmalloc.
122 *
123 * This function does not give bus mappings for DMA transfers. In
124 * almost all conceivable cases a device driver should not be using
125 * this function
126 */
127static inline unsigned long __iomem virt_to_phys(volatile void *address)
128{
129 return __pa((unsigned long)address);
130}
131
132#define virt_to_bus virt_to_phys
133
134/**
135 * phys_to_virt - map physical address to virtual
136 * @address: address to remap
137 *
138 * The returned virtual address is a current CPU mapping for
139 * the memory address given. It is only valid to use this function on
140 * addresses that have a kernel mapping
141 *
142 * This function does not handle bus mappings for DMA transfers. In
143 * almost all conceivable cases a device driver should not be using
144 * this function
145 */
146static inline void *phys_to_virt(unsigned long address)
147{
148 return (void *)__va(address);
149}
150
151#define bus_to_virt(a) phys_to_virt(a)
152
153static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
154 unsigned long flags)
155{
156 return (void *)address;
157}
158
159#define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr))
160#define iounmap(addr) ((void)0)
161#define ioremap_nocache(physaddr, size) ioremap(physaddr, size)
162
163/*
164 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
165 * access
166 */
167#define xlate_dev_mem_ptr(p) __va(p)
168
169/*
170 * Convert a virtual cached pointer to an uncached pointer
171 */
172#define xlate_dev_kmem_ptr(p) p
173
174/*
175 * Big Endian
176 */
177#define out_be32(a, v) __raw_writel((v), (void __iomem __force *)(a))
178#define out_be16(a, v) __raw_writew((v), (a))
179
180#define in_be32(a) __raw_readl((const void __iomem __force *)(a))
181#define in_be16(a) __raw_readw(a)
182
183/*
184 * Little endian
185 */
186
187#define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a));
188#define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a))
189
190#define in_le32(a) __le32_to_cpu(__raw_readl(a))
191#define in_le16(a) __le16_to_cpu(__raw_readw(a))
192
193/* Byte ops */
194#define out_8(a, v) __raw_writeb((v), (a))
195#define in_8(a) __raw_readb(a)
196
197/* FIXME */
198static inline void __iomem *ioport_map(unsigned long port, unsigned int len)
199{
200 return (void __iomem *) (port);
201}
202
203static inline void ioport_unmap(void __iomem *addr)
204{
205 /* Nothing to do */
206}
207
208#endif /* _ASM_MICROBLAZE_IO_H */
diff --git a/arch/microblaze/include/asm/ioctl.h b/arch/microblaze/include/asm/ioctl.h
new file mode 100644
index 000000000000..b279fe06dfe5
--- /dev/null
+++ b/arch/microblaze/include/asm/ioctl.h
@@ -0,0 +1 @@
#include <asm-generic/ioctl.h>
diff --git a/arch/microblaze/include/asm/ioctls.h b/arch/microblaze/include/asm/ioctls.h
new file mode 100644
index 000000000000..03582b249204
--- /dev/null
+++ b/arch/microblaze/include/asm/ioctls.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IOCTLS_H
10#define _ASM_MICROBLAZE_IOCTLS_H
11
12#include <linux/ioctl.h>
13
14/* 0x54 is just a magic number to make these relatively unique ('T') */
15
16#define TCGETS 0x5401
17#define TCSETS 0x5402
18#define TCSETSW 0x5403
19#define TCSETSF 0x5404
20#define TCGETA 0x5405
21#define TCSETA 0x5406
22#define TCSETAW 0x5407
23#define TCSETAF 0x5408
24#define TCSBRK 0x5409
25#define TCXONC 0x540A
26#define TCFLSH 0x540B
27#define TIOCEXCL 0x540C
28#define TIOCNXCL 0x540D
29#define TIOCSCTTY 0x540E
30#define TIOCGPGRP 0x540F
31#define TIOCSPGRP 0x5410
32#define TIOCOUTQ 0x5411
33#define TIOCSTI 0x5412
34#define TIOCGWINSZ 0x5413
35#define TIOCSWINSZ 0x5414
36#define TIOCMGET 0x5415
37#define TIOCMBIS 0x5416
38#define TIOCMBIC 0x5417
39#define TIOCMSET 0x5418
40#define TIOCGSOFTCAR 0x5419
41#define TIOCSSOFTCAR 0x541A
42#define FIONREAD 0x541B
43#define TIOCINQ FIONREAD
44#define TIOCLINUX 0x541C
45#define TIOCCONS 0x541D
46#define TIOCGSERIAL 0x541E
47#define TIOCSSERIAL 0x541F
48#define TIOCPKT 0x5420
49#define FIONBIO 0x5421
50#define TIOCNOTTY 0x5422
51#define TIOCSETD 0x5423
52#define TIOCGETD 0x5424
53#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
54#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
55#define TIOCSBRK 0x5427 /* BSD compatibility */
56#define TIOCCBRK 0x5428 /* BSD compatibility */
57#define TIOCGSID 0x5429 /* Return the session ID of FD */
58/* Get Pty Number (of pty-mux device) */
59#define TIOCGPTN _IOR('T', 0x30, unsigned int)
60#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
61
62#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
63#define FIOCLEX 0x5451
64#define FIOASYNC 0x5452
65#define TIOCSERCONFIG 0x5453
66#define TIOCSERGWILD 0x5454
67#define TIOCSERSWILD 0x5455
68#define TIOCGLCKTRMIOS 0x5456
69#define TIOCSLCKTRMIOS 0x5457
70#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
71#define TIOCSERGETLSR 0x5459 /* Get line status register */
72#define TIOCSERGETMULTI 0x545A /* Get multiport config */
73#define TIOCSERSETMULTI 0x545B /* Set multiport config */
74
75#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
76#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
77
78#define FIOQSIZE 0x545E
79
80/* Used for packet mode */
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88
89#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
90
91#endif /* _ASM_MICROBLAZE_IOCTLS_H */
diff --git a/arch/microblaze/include/asm/ipc.h b/arch/microblaze/include/asm/ipc.h
new file mode 100644
index 000000000000..a46e3d9c2a3f
--- /dev/null
+++ b/arch/microblaze/include/asm/ipc.h
@@ -0,0 +1 @@
#include <asm-generic/ipc.h>
diff --git a/arch/microblaze/include/asm/ipcbuf.h b/arch/microblaze/include/asm/ipcbuf.h
new file mode 100644
index 000000000000..b056fa420654
--- /dev/null
+++ b/arch/microblaze/include/asm/ipcbuf.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IPCBUF_H
10#define _ASM_MICROBLAZE_IPCBUF_H
11
12/*
13 * The user_ipc_perm structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 32-bit mode_t and seq
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct ipc64_perm {
23 __kernel_key_t key;
24 __kernel_uid32_t uid;
25 __kernel_gid32_t gid;
26 __kernel_uid32_t cuid;
27 __kernel_gid32_t cgid;
28 __kernel_mode_t mode;
29 unsigned short __pad1;
30 unsigned short seq;
31 unsigned short __pad2;
32 unsigned long __unused1;
33 unsigned long __unused2;
34};
35
36#endif /* _ASM_MICROBLAZE_IPCBUF_H */
diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h
new file mode 100644
index 000000000000..db515deaa720
--- /dev/null
+++ b/arch/microblaze/include/asm/irq.h
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IRQ_H
10#define _ASM_MICROBLAZE_IRQ_H
11
12#define NR_IRQS 32
13
14#include <linux/interrupt.h>
15
16extern unsigned int nr_irq;
17
18#define NO_IRQ (-1)
19
20static inline int irq_canonicalize(int irq)
21{
22 return irq;
23}
24
25struct pt_regs;
26extern void do_IRQ(struct pt_regs *regs);
27
28/* irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
29 * @device: Device node of the device whose interrupt is to be mapped
30 * @index: Index of the interrupt to map
31 *
32 * This function is a wrapper that chains of_irq_map_one() and
33 * irq_create_of_mapping() to make things easier to callers
34 */
35struct device_node;
36extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index);
37
38/** FIXME - not implement
39 * irq_dispose_mapping - Unmap an interrupt
40 * @virq: linux virq number of the interrupt to unmap
41 */
42static inline void irq_dispose_mapping(unsigned int virq)
43{
44 return;
45}
46
47#endif /* _ASM_MICROBLAZE_IRQ_H */
diff --git a/arch/microblaze/include/asm/irq_regs.h b/arch/microblaze/include/asm/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/arch/microblaze/include/asm/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/arch/microblaze/include/asm/irqflags.h b/arch/microblaze/include/asm/irqflags.h
new file mode 100644
index 000000000000..dea65645a4f8
--- /dev/null
+++ b/arch/microblaze/include/asm/irqflags.h
@@ -0,0 +1,123 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IRQFLAGS_H
10#define _ASM_MICROBLAZE_IRQFLAGS_H
11
12#include <linux/irqflags.h>
13
14# if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
15
16# define local_irq_save(flags) \
17 do { \
18 asm volatile ("# local_irq_save \n\t" \
19 "msrclr %0, %1 \n\t" \
20 "nop \n\t" \
21 : "=r"(flags) \
22 : "i"(MSR_IE) \
23 : "memory"); \
24 } while (0)
25
26# define local_irq_disable() \
27 do { \
28 asm volatile ("# local_irq_disable \n\t" \
29 "msrclr r0, %0 \n\t" \
30 "nop \n\t" \
31 : \
32 : "i"(MSR_IE) \
33 : "memory"); \
34 } while (0)
35
36# define local_irq_enable() \
37 do { \
38 asm volatile ("# local_irq_enable \n\t" \
39 "msrset r0, %0 \n\t" \
40 "nop \n\t" \
41 : \
42 : "i"(MSR_IE) \
43 : "memory"); \
44 } while (0)
45
46# else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
47
48# define local_irq_save(flags) \
49 do { \
50 register unsigned tmp; \
51 asm volatile ("# local_irq_save \n\t" \
52 "mfs %0, rmsr \n\t" \
53 "nop \n\t" \
54 "andi %1, %0, %2 \n\t" \
55 "mts rmsr, %1 \n\t" \
56 "nop \n\t" \
57 : "=r"(flags), "=r" (tmp) \
58 : "i"(~MSR_IE) \
59 : "memory"); \
60 } while (0)
61
62# define local_irq_disable() \
63 do { \
64 register unsigned tmp; \
65 asm volatile ("# local_irq_disable \n\t" \
66 "mfs %0, rmsr \n\t" \
67 "nop \n\t" \
68 "andi %0, %0, %1 \n\t" \
69 "mts rmsr, %0 \n\t" \
70 "nop \n\t" \
71 : "=r"(tmp) \
72 : "i"(~MSR_IE) \
73 : "memory"); \
74 } while (0)
75
76# define local_irq_enable() \
77 do { \
78 register unsigned tmp; \
79 asm volatile ("# local_irq_enable \n\t" \
80 "mfs %0, rmsr \n\t" \
81 "nop \n\t" \
82 "ori %0, %0, %1 \n\t" \
83 "mts rmsr, %0 \n\t" \
84 "nop \n\t" \
85 : "=r"(tmp) \
86 : "i"(MSR_IE) \
87 : "memory"); \
88 } while (0)
89
90# endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
91
92#define local_save_flags(flags) \
93 do { \
94 asm volatile ("# local_save_flags \n\t" \
95 "mfs %0, rmsr \n\t" \
96 "nop \n\t" \
97 : "=r"(flags) \
98 : \
99 : "memory"); \
100 } while (0)
101
102#define local_irq_restore(flags) \
103 do { \
104 asm volatile ("# local_irq_restore \n\t"\
105 "mts rmsr, %0 \n\t" \
106 "nop \n\t" \
107 : \
108 : "r"(flags) \
109 : "memory"); \
110 } while (0)
111
112static inline int irqs_disabled(void)
113{
114 unsigned long flags;
115
116 local_save_flags(flags);
117 return ((flags & MSR_IE) == 0);
118}
119
120#define raw_irqs_disabled irqs_disabled
121#define raw_irqs_disabled_flags(flags) ((flags) == 0)
122
123#endif /* _ASM_MICROBLAZE_IRQFLAGS_H */
diff --git a/arch/microblaze/include/asm/kdebug.h b/arch/microblaze/include/asm/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/arch/microblaze/include/asm/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/arch/microblaze/include/asm/kmap_types.h b/arch/microblaze/include/asm/kmap_types.h
new file mode 100644
index 000000000000..4d7e222f5dd7
--- /dev/null
+++ b/arch/microblaze/include/asm/kmap_types.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_KMAP_TYPES_H
10#define _ASM_MICROBLAZE_KMAP_TYPES_H
11
12enum km_type {
13 KM_BOUNCE_READ,
14 KM_SKB_SUNRPC_DATA,
15 KM_SKB_DATA_SOFTIRQ,
16 KM_USER0,
17 KM_USER1,
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR,
27};
28
29#endif /* _ASM_MICROBLAZE_KMAP_TYPES_H */
diff --git a/arch/microblaze/include/asm/linkage.h b/arch/microblaze/include/asm/linkage.h
new file mode 100644
index 000000000000..3a8e36d057eb
--- /dev/null
+++ b/arch/microblaze/include/asm/linkage.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_LINKAGE_H
10#define _ASM_MICROBLAZE_LINKAGE_H
11
12#define __ALIGN .align 4
13#define __ALIGN_STR ".align 4"
14
15#endif /* _ASM_MICROBLAZE_LINKAGE_H */
diff --git a/arch/microblaze/include/asm/lmb.h b/arch/microblaze/include/asm/lmb.h
new file mode 100644
index 000000000000..a0a0a929c293
--- /dev/null
+++ b/arch/microblaze/include/asm/lmb.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_LMB_H
10#define _ASM_MICROBLAZE_LMB_H
11
12/* LMB limit is OFF */
13#define LMB_REAL_LIMIT 0xFFFFFFFF
14
15#endif /* _ASM_MICROBLAZE_LMB_H */
16
17
diff --git a/arch/microblaze/include/asm/local.h b/arch/microblaze/include/asm/local.h
new file mode 100644
index 000000000000..c11c530f74d0
--- /dev/null
+++ b/arch/microblaze/include/asm/local.h
@@ -0,0 +1 @@
#include <asm-generic/local.h>
diff --git a/arch/microblaze/include/asm/mman.h b/arch/microblaze/include/asm/mman.h
new file mode 100644
index 000000000000..4914b1329445
--- /dev/null
+++ b/arch/microblaze/include/asm/mman.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMAN_H
10#define _ASM_MICROBLAZE_MMAN_H
11
12#include <asm-generic/mman.h>
13
14#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
15#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
16#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
17#define MAP_LOCKED 0x2000 /* pages are locked */
18#define MAP_NORESERVE 0x4000 /* don't check for reservations */
19#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
20#define MAP_NONBLOCK 0x10000 /* do not block on IO */
21
22#define MCL_CURRENT 1 /* lock all current mappings */
23#define MCL_FUTURE 2 /* lock all future mappings */
24
25#endif /* _ASM_MICROBLAZE_MMAN_H */
diff --git a/arch/microblaze/include/asm/mmu.h b/arch/microblaze/include/asm/mmu.h
new file mode 100644
index 000000000000..0e0431d61635
--- /dev/null
+++ b/arch/microblaze/include/asm/mmu.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMU_H
10#define _ASM_MICROBLAZE_MMU_H
11
12#ifndef __ASSEMBLY__
13typedef struct {
14 struct vm_list_struct *vmlist;
15 unsigned long end_brk;
16} mm_context_t;
17#endif /* __ASSEMBLY__ */
18
19#endif /* _ASM_MICROBLAZE_MMU_H */
diff --git a/arch/microblaze/include/asm/mmu_context.h b/arch/microblaze/include/asm/mmu_context.h
new file mode 100644
index 000000000000..150ca01b74ba
--- /dev/null
+++ b/arch/microblaze/include/asm/mmu_context.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
10#define _ASM_MICROBLAZE_MMU_CONTEXT_H
11
12# define init_new_context(tsk, mm) ({ 0; })
13
14# define enter_lazy_tlb(mm, tsk) do {} while (0)
15# define change_mm_context(old, ctx, _pml4) do {} while (0)
16# define destroy_context(mm) do {} while (0)
17# define deactivate_mm(tsk, mm) do {} while (0)
18# define switch_mm(prev, next, tsk) do {} while (0)
19# define activate_mm(prev, next) do {} while (0)
20
21#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/module.h b/arch/microblaze/include/asm/module.h
new file mode 100644
index 000000000000..914565a90315
--- /dev/null
+++ b/arch/microblaze/include/asm/module.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MODULE_H
10#define _ASM_MICROBLAZE_MODULE_H
11
12/* Microblaze Relocations */
13#define R_MICROBLAZE_NONE 0
14#define R_MICROBLAZE_32 1
15#define R_MICROBLAZE_32_PCREL 2
16#define R_MICROBLAZE_64_PCREL 3
17#define R_MICROBLAZE_32_PCREL_LO 4
18#define R_MICROBLAZE_64 5
19#define R_MICROBLAZE_32_LO 6
20#define R_MICROBLAZE_SRO32 7
21#define R_MICROBLAZE_SRW32 8
22#define R_MICROBLAZE_64_NONE 9
23#define R_MICROBLAZE_32_SYM_OP_SYM 10
24/* Keep this the last entry. */
25#define R_MICROBLAZE_NUM 11
26
27struct mod_arch_specific {
28 int foo;
29};
30
31#define Elf_Shdr Elf32_Shdr
32#define Elf_Sym Elf32_Sym
33#define Elf_Ehdr Elf32_Ehdr
34
35typedef struct { volatile int counter; } module_t;
36
37#endif /* _ASM_MICROBLAZE_MODULE_H */
diff --git a/arch/microblaze/include/asm/msgbuf.h b/arch/microblaze/include/asm/msgbuf.h
new file mode 100644
index 000000000000..09dd97097211
--- /dev/null
+++ b/arch/microblaze/include/asm/msgbuf.h
@@ -0,0 +1,31 @@
1#ifndef _ASM_MICROBLAZE_MSGBUF_H
2#define _ASM_MICROBLAZE_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASM_MICROBLAZE_MSGBUF_H */
diff --git a/arch/microblaze/include/asm/mutex.h b/arch/microblaze/include/asm/mutex.h
new file mode 100644
index 000000000000..ff6101aa2c71
--- /dev/null
+++ b/arch/microblaze/include/asm/mutex.h
@@ -0,0 +1 @@
#include <asm-generic/mutex-dec.h>
diff --git a/arch/microblaze/include/asm/namei.h b/arch/microblaze/include/asm/namei.h
new file mode 100644
index 000000000000..61d60b8a07d5
--- /dev/null
+++ b/arch/microblaze/include/asm/namei.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_NAMEI_H
10#define _ASM_MICROBLAZE_NAMEI_H
11
12#ifdef __KERNEL__
13
14/* This dummy routine maybe changed to something useful
15 * for /usr/gnemul/ emulation stuff.
16 * Look at asm-sparc/namei.h for details.
17 */
18#define __emul_prefix() NULL
19
20#endif /* __KERNEL__ */
21
22#endif /* _ASM_MICROBLAZE_NAMEI_H */
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h
new file mode 100644
index 000000000000..ba917cfaefe6
--- /dev/null
+++ b/arch/microblaze/include/asm/of_device.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 *
4 * based on PowerPC of_device.h
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_OF_DEVICE_H
12#define _ASM_MICROBLAZE_OF_DEVICE_H
13#ifdef __KERNEL__
14
15#include <linux/device.h>
16#include <linux/of.h>
17
18/*
19 * The of_device is a kind of "base class" that is a superset of
20 * struct device for use by devices attached to an OF node and
21 * probed using OF properties.
22 */
23struct of_device {
24 struct device_node *node; /* to be obsoleted */
25 u64 dma_mask; /* DMA mask */
26 struct device dev; /* Generic device interface */
27};
28
29extern ssize_t of_device_get_modalias(struct of_device *ofdev,
30 char *str, ssize_t len);
31
32extern struct of_device *of_device_alloc(struct device_node *np,
33 const char *bus_id,
34 struct device *parent);
35
36extern int of_device_uevent(struct device *dev,
37 struct kobj_uevent_env *env);
38
39extern void of_device_make_bus_id(struct of_device *dev);
40
41/* This is just here during the transition */
42#include <linux/of_device.h>
43
44#endif /* __KERNEL__ */
45#endif /* _ASM_MICROBLAZE_OF_DEVICE_H */
diff --git a/arch/microblaze/include/asm/of_platform.h b/arch/microblaze/include/asm/of_platform.h
new file mode 100644
index 000000000000..187c0eedaece
--- /dev/null
+++ b/arch/microblaze/include/asm/of_platform.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
3 * <benh@kernel.crashing.org>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _ASM_MICROBLAZE_OF_PLATFORM_H
12#define _ASM_MICROBLAZE_OF_PLATFORM_H
13
14/* This is just here during the transition */
15#include <linux/of_platform.h>
16
17/*
18 * The list of OF IDs below is used for matching bus types in the
19 * system whose devices are to be exposed as of_platform_devices.
20 *
21 * This is the default list valid for most platforms. This file provides
22 * functions who can take an explicit list if necessary though
23 *
24 * The search is always performed recursively looking for children of
25 * the provided device_node and recursively if such a children matches
26 * a bus type in the list
27 */
28
29static const struct of_device_id of_default_bus_ids[] = {
30 { .type = "soc", },
31 { .compatible = "soc", },
32 { .type = "plb5", },
33 { .type = "plb4", },
34 { .type = "opb", },
35 { .type = "simple", },
36 {},
37};
38
39/* Platform drivers register/unregister */
40static inline int of_register_platform_driver(struct of_platform_driver *drv)
41{
42 return of_register_driver(drv, &of_platform_bus_type);
43}
44static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
45{
46 of_unregister_driver(drv);
47}
48
49/* Platform devices and busses creation */
50extern struct of_device *of_platform_device_create(struct device_node *np,
51 const char *bus_id,
52 struct device *parent);
53/* pseudo "matches" value to not do deep probe */
54#define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
55
56extern int of_platform_bus_probe(struct device_node *root,
57 const struct of_device_id *matches,
58 struct device *parent);
59
60extern struct of_device *of_find_device_by_phandle(phandle ph);
61
62extern void of_instantiate_rtc(void);
63
64#endif /* _ASM_MICROBLAZE_OF_PLATFORM_H */
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
new file mode 100644
index 000000000000..7238dcfcc517
--- /dev/null
+++ b/arch/microblaze/include/asm/page.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 * Changes for MMU support:
6 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_PAGE_H
14#define _ASM_MICROBLAZE_PAGE_H
15
16#include <linux/pfn.h>
17#include <asm/setup.h>
18
19/* PAGE_SHIFT determines the page size */
20#define PAGE_SHIFT (12)
21#define PAGE_SIZE (1UL << PAGE_SHIFT)
22#define PAGE_MASK (~(PAGE_SIZE-1))
23
24#ifdef __KERNEL__
25
26#ifndef __ASSEMBLY__
27
28#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
29#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
30
31/* align addr on a size boundary - adjust address up/down if needed */
32#define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((size)-1)))
33#define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
34
35/* align addr on a size boundary - adjust address up if needed */
36#define _ALIGN(addr, size) _ALIGN_UP(addr, size)
37
38/*
39 * PAGE_OFFSET -- the first address of the first page of memory. When not
40 * using MMU this corresponds to the first free page in physical memory (aligned
41 * on a page boundary).
42 */
43extern unsigned int __page_offset;
44#define PAGE_OFFSET __page_offset
45
46#define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
47#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
48#define free_user_page(page, addr) free_page(addr)
49
50#define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
51
52
53#define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
54#define copy_user_page(vto, vfrom, vaddr, topg) \
55 memcpy((vto), (vfrom), PAGE_SIZE)
56
57/*
58 * These are used to make use of C type-checking..
59 */
60typedef struct page *pgtable_t;
61typedef struct { unsigned long pte; } pte_t;
62typedef struct { unsigned long pgprot; } pgprot_t;
63typedef struct { unsigned long ste[64]; } pmd_t;
64typedef struct { pmd_t pue[1]; } pud_t;
65typedef struct { pud_t pge[1]; } pgd_t;
66
67
68#define pte_val(x) ((x).pte)
69#define pgprot_val(x) ((x).pgprot)
70#define pmd_val(x) ((x).ste[0])
71#define pud_val(x) ((x).pue[0])
72#define pgd_val(x) ((x).pge[0])
73
74#define __pte(x) ((pte_t) { (x) })
75#define __pmd(x) ((pmd_t) { (x) })
76#define __pgd(x) ((pgd_t) { (x) })
77#define __pgprot(x) ((pgprot_t) { (x) })
78
79/**
80 * Conversions for virtual address, physical address, pfn, and struct
81 * page are defined in the following files.
82 *
83 * virt -+
84 * | asm-microblaze/page.h
85 * phys -+
86 * | linux/pfn.h
87 * pfn -+
88 * | asm-generic/memory_model.h
89 * page -+
90 *
91 */
92
93extern unsigned long max_low_pfn;
94extern unsigned long min_low_pfn;
95extern unsigned long max_pfn;
96
97#define __pa(vaddr) ((unsigned long) (vaddr))
98#define __va(paddr) ((void *) (paddr))
99
100#define phys_to_pfn(phys) (PFN_DOWN(phys))
101#define pfn_to_phys(pfn) (PFN_PHYS(pfn))
102
103#define virt_to_pfn(vaddr) (phys_to_pfn((__pa(vaddr))))
104#define pfn_to_virt(pfn) __va(pfn_to_phys((pfn)))
105
106#define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
107#define page_to_virt(page) (pfn_to_virt(page_to_pfn(page)))
108
109#define page_to_phys(page) (pfn_to_phys(page_to_pfn(page)))
110#define page_to_bus(page) (page_to_phys(page))
111#define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr)))
112
113extern unsigned int memory_start;
114extern unsigned int memory_end;
115extern unsigned int memory_size;
116
117#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_mapnr)
118
119#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
120
121#else
122#define tophys(rd, rs) (addik rd, rs, 0)
123#define tovirt(rd, rs) (addik rd, rs, 0)
124#endif /* __ASSEMBLY__ */
125
126#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
127
128/* Convert between virtual and physical address for MMU. */
129/* Handle MicroBlaze processor with virtual memory. */
130#define __virt_to_phys(addr) addr
131#define __phys_to_virt(addr) addr
132
133#define TOPHYS(addr) __virt_to_phys(addr)
134
135#endif /* __KERNEL__ */
136
137#include <asm-generic/memory_model.h>
138#include <asm-generic/page.h>
139
140#endif /* _ASM_MICROBLAZE_PAGE_H */
diff --git a/arch/microblaze/include/asm/param.h b/arch/microblaze/include/asm/param.h
new file mode 100644
index 000000000000..8c538a49616d
--- /dev/null
+++ b/arch/microblaze/include/asm/param.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PARAM_H
10#define _ASM_MICROBLAZE_PARAM_H
11
12#ifdef __KERNEL__
13#define HZ CONFIG_HZ /* internal kernel timer frequency */
14#define USER_HZ 100 /* for user interfaces in "ticks" */
15#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
16#endif /* __KERNEL__ */
17
18#ifndef HZ
19#define HZ 100
20#endif
21
22#define EXEC_PAGESIZE 4096
23
24#ifndef NOGROUP
25#define NOGROUP (-1)
26#endif
27
28#define MAXHOSTNAMELEN 64 /* max length of hostname */
29
30#endif /* _ASM_MICROBLAZE_PARAM_H */
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h
new file mode 100644
index 000000000000..7ad28f6f5f1a
--- /dev/null
+++ b/arch/microblaze/include/asm/pci-bridge.h
@@ -0,0 +1 @@
#include <linux/pci.h>
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
new file mode 100644
index 000000000000..ca03794cf3f0
--- /dev/null
+++ b/arch/microblaze/include/asm/pci.h
@@ -0,0 +1 @@
#include <linux/io.h>
diff --git a/arch/microblaze/include/asm/percpu.h b/arch/microblaze/include/asm/percpu.h
new file mode 100644
index 000000000000..06a959d67234
--- /dev/null
+++ b/arch/microblaze/include/asm/percpu.h
@@ -0,0 +1 @@
#include <asm-generic/percpu.h>
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
new file mode 100644
index 000000000000..2a4b35484010
--- /dev/null
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PGALLOC_H
10#define _ASM_MICROBLAZE_PGALLOC_H
11
12#define check_pgt_cache() do {} while (0)
13
14#endif /* _ASM_MICROBLAZE_PGALLOC_H */
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
new file mode 100644
index 000000000000..4df31e46568e
--- /dev/null
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -0,0 +1,54 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PGTABLE_H
10#define _ASM_MICROBLAZE_PGTABLE_H
11
12#include <asm/setup.h>
13
14#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
15 remap_pfn_range(vma, vaddr, pfn, size, prot)
16
17#define pgd_present(pgd) (1) /* pages are always present on non MMU */
18#define pgd_none(pgd) (0)
19#define pgd_bad(pgd) (0)
20#define pgd_clear(pgdp)
21#define kern_addr_valid(addr) (1)
22#define pmd_offset(a, b) ((void *) 0)
23
24#define PAGE_NONE __pgprot(0) /* these mean nothing to non MMU */
25#define PAGE_SHARED __pgprot(0) /* these mean nothing to non MMU */
26#define PAGE_COPY __pgprot(0) /* these mean nothing to non MMU */
27#define PAGE_READONLY __pgprot(0) /* these mean nothing to non MMU */
28#define PAGE_KERNEL __pgprot(0) /* these mean nothing to non MMU */
29
30#define __swp_type(x) (0)
31#define __swp_offset(x) (0)
32#define __swp_entry(typ, off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
33#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
34#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
35
36#ifndef __ASSEMBLY__
37static inline int pte_file(pte_t pte) { return 0; }
38#endif /* __ASSEMBLY__ */
39
40#define ZERO_PAGE(vaddr) ({ BUG(); NULL; })
41
42#define swapper_pg_dir ((pgd_t *) NULL)
43
44#define pgtable_cache_init() do {} while (0)
45
46#define arch_enter_lazy_cpu_mode() do {} while (0)
47
48#ifndef __ASSEMBLY__
49#include <asm-generic/pgtable.h>
50
51void setup_memory(void);
52#endif /* __ASSEMBLY__ */
53
54#endif /* _ASM_MICROBLAZE_PGTABLE_H */
diff --git a/arch/microblaze/include/asm/poll.h b/arch/microblaze/include/asm/poll.h
new file mode 100644
index 000000000000..c98509d3149e
--- /dev/null
+++ b/arch/microblaze/include/asm/poll.h
@@ -0,0 +1 @@
#include <asm-generic/poll.h>
diff --git a/arch/microblaze/include/asm/posix_types.h b/arch/microblaze/include/asm/posix_types.h
new file mode 100644
index 000000000000..b4df41c5dde2
--- /dev/null
+++ b/arch/microblaze/include/asm/posix_types.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H
10#define _ASM_MICROBLAZE_POSIX_TYPES_H
11
12/*
13 * This file is generally used by user-level software, so you need to
14 * be a little careful about namespace pollution etc. Also, we cannot
15 * assume GCC is being used.
16 */
17
18typedef unsigned long __kernel_ino_t;
19typedef unsigned int __kernel_mode_t;
20typedef unsigned int __kernel_nlink_t;
21typedef long __kernel_off_t;
22typedef int __kernel_pid_t;
23typedef unsigned int __kernel_ipc_pid_t;
24typedef unsigned int __kernel_uid_t;
25typedef unsigned int __kernel_gid_t;
26typedef unsigned long __kernel_size_t;
27typedef long __kernel_ssize_t;
28typedef int __kernel_ptrdiff_t;
29typedef long __kernel_time_t;
30typedef long __kernel_suseconds_t;
31typedef long __kernel_clock_t;
32typedef int __kernel_timer_t;
33typedef int __kernel_clockid_t;
34typedef int __kernel_daddr_t;
35typedef char *__kernel_caddr_t;
36typedef unsigned short __kernel_uid16_t;
37typedef unsigned short __kernel_gid16_t;
38typedef unsigned int __kernel_uid32_t;
39typedef unsigned int __kernel_gid32_t;
40
41typedef unsigned int __kernel_old_uid_t;
42typedef unsigned int __kernel_old_gid_t;
43typedef unsigned int __kernel_old_dev_t;
44
45#ifdef __GNUC__
46typedef long long __kernel_loff_t;
47#endif
48
49typedef struct {
50#if defined(__KERNEL__) || defined(__USE_ALL)
51 int val[2];
52#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
53 int __val[2];
54#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
55} __kernel_fsid_t;
56
57#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
58
59#undef __FD_SET
60#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
61
62#undef __FD_CLR
63#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
64
65#undef __FD_ISSET
66#define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
67
68#undef __FD_ZERO
69#define __FD_ZERO(fdsetp) (memset(fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
70
71#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
72
73#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
new file mode 100644
index 000000000000..d8e15434ba21
--- /dev/null
+++ b/arch/microblaze/include/asm/processor.h
@@ -0,0 +1,93 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_PROCESSOR_H
12#define _ASM_MICROBLAZE_PROCESSOR_H
13
14#include <asm/ptrace.h>
15#include <asm/setup.h>
16#include <asm/registers.h>
17#include <asm/segment.h>
18
19# ifndef __ASSEMBLY__
20/* from kernel/cpu/mb.c */
21extern const struct seq_operations cpuinfo_op;
22
23# define cpu_relax() barrier()
24# define cpu_sleep() do {} while (0)
25# define prepare_to_copy(tsk) do {} while (0)
26
27# endif /* __ASSEMBLY__ */
28
29/*
30 * User space process size: memory size
31 *
32 * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both
33 * user processes and the kernel is on the same memory region. They
34 * both share the memory space and that is limited by the amount of
35 * physical memory. thus, we set TASK_SIZE == amount of total memory.
36 */
37# define TASK_SIZE (0x81000000 - 0x80000000)
38
39/*
40 * Default implementation of macro that returns current
41 * instruction pointer ("program counter").
42 */
43# define current_text_addr() ({ __label__ _l; _l: &&_l; })
44
45/*
46 * This decides where the kernel will search for a free chunk of vm
47 * space during mmap's. We won't be using it
48 */
49# define TASK_UNMAPPED_BASE 0
50
51/* definition in include/linux/sched.h */
52struct task_struct;
53
54/* thread_struct is gone. use thread_info instead. */
55struct thread_struct { };
56# define INIT_THREAD { }
57
58/* Do necessary setup to start up a newly executed thread. */
59static inline void start_thread(struct pt_regs *regs,
60 unsigned long pc,
61 unsigned long usp)
62{
63 regs->pc = pc;
64 regs->r1 = usp;
65 regs->kernel_mode = 0;
66}
67
68/* Free all resources held by a thread. */
69static inline void release_thread(struct task_struct *dead_task)
70{
71}
72
73/* Free all resources held by a thread. */
74static inline void exit_thread(void)
75{
76}
77
78extern unsigned long thread_saved_pc(struct task_struct *t);
79
80extern unsigned long get_wchan(struct task_struct *p);
81
82/*
83 * create a kernel thread without removing it from tasklists
84 */
85extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
86
87# define task_pt_regs(tsk) \
88 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
89
90# define KSTK_EIP(tsk) (0)
91# define KSTK_ESP(tsk) (0)
92
93#endif /* _ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
new file mode 100644
index 000000000000..20f7b3a926e8
--- /dev/null
+++ b/arch/microblaze/include/asm/prom.h
@@ -0,0 +1,313 @@
1/*
2 * Definitions for talking to the Open Firmware PROM on
3 * Power Macintosh computers.
4 *
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#ifndef _ASM_MICROBLAZE_PROM_H
16#define _ASM_MICROBLAZE_PROM_H
17#ifdef __KERNEL__
18
19#include <linux/types.h>
20#include <linux/proc_fs.h>
21#include <linux/platform_device.h>
22#include <asm/irq.h>
23#include <asm/atomic.h>
24
25#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
26#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
27
28#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
29#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
30#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
31
32/* Definitions used by the flattened device tree */
33#define OF_DT_HEADER 0xd00dfeed /* marker */
34#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
35#define OF_DT_END_NODE 0x2 /* End node */
36#define OF_DT_PROP 0x3 /* Property: name off, size, content */
37#define OF_DT_NOP 0x4 /* nop */
38#define OF_DT_END 0x9
39
40#define OF_DT_VERSION 0x10
41
42/*
43 * This is what gets passed to the kernel by prom_init or kexec
44 *
45 * The dt struct contains the device tree structure, full pathes and
46 * property contents. The dt strings contain a separate block with just
47 * the strings for the property names, and is fully page aligned and
48 * self contained in a page, so that it can be kept around by the kernel,
49 * each property name appears only once in this page (cheap compression)
50 *
51 * the mem_rsvmap contains a map of reserved ranges of physical memory,
52 * passing it here instead of in the device-tree itself greatly simplifies
53 * the job of everybody. It's just a list of u64 pairs (base/size) that
54 * ends when size is 0
55 */
56struct boot_param_header {
57 u32 magic; /* magic word OF_DT_HEADER */
58 u32 totalsize; /* total size of DT block */
59 u32 off_dt_struct; /* offset to structure */
60 u32 off_dt_strings; /* offset to strings */
61 u32 off_mem_rsvmap; /* offset to memory reserve map */
62 u32 version; /* format version */
63 u32 last_comp_version; /* last compatible version */
64 /* version 2 fields below */
65 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
66 /* version 3 fields below */
67 u32 dt_strings_size; /* size of the DT strings block */
68 /* version 17 fields below */
69 u32 dt_struct_size; /* size of the DT structure block */
70};
71
72typedef u32 phandle;
73typedef u32 ihandle;
74
75struct property {
76 char *name;
77 int length;
78 void *value;
79 struct property *next;
80};
81
82struct device_node {
83 const char *name;
84 const char *type;
85 phandle node;
86 phandle linux_phandle;
87 char *full_name;
88
89 struct property *properties;
90 struct property *deadprops; /* removed properties */
91 struct device_node *parent;
92 struct device_node *child;
93 struct device_node *sibling;
94 struct device_node *next; /* next device of same type */
95 struct device_node *allnext; /* next in list of all nodes */
96 struct proc_dir_entry *pde; /* this node's proc directory */
97 struct kref kref;
98 unsigned long _flags;
99 void *data;
100};
101
102extern struct device_node *of_chosen;
103
104static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
105{
106 return test_bit(flag, &n->_flags);
107}
108
109static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
110{
111 set_bit(flag, &n->_flags);
112}
113
114#define HAVE_ARCH_DEVTREE_FIXUPS
115
116static inline void set_node_proc_entry(struct device_node *dn,
117 struct proc_dir_entry *de)
118{
119 dn->pde = de;
120}
121
122extern struct device_node *allnodes; /* temporary while merging */
123extern rwlock_t devtree_lock; /* temporary while merging */
124
125extern struct device_node *of_find_all_nodes(struct device_node *prev);
126extern struct device_node *of_node_get(struct device_node *node);
127extern void of_node_put(struct device_node *node);
128
129/* For scanning the flat device-tree at boot time */
130extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
131 const char *uname, int depth,
132 void *data),
133 void *data);
134extern void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
135 unsigned long *size);
136extern int __init
137 of_flat_dt_is_compatible(unsigned long node, const char *name);
138extern unsigned long __init of_get_flat_dt_root(void);
139
140/* For updating the device tree at runtime */
141extern void of_attach_node(struct device_node *);
142extern void of_detach_node(struct device_node *);
143
144/* Other Prototypes */
145extern void finish_device_tree(void);
146extern void unflatten_device_tree(void);
147extern int early_uartlite_console(void);
148extern void early_init_devtree(void *);
149extern int machine_is_compatible(const char *compat);
150extern void print_properties(struct device_node *node);
151extern int prom_n_intr_cells(struct device_node *np);
152extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
153extern int prom_add_property(struct device_node *np, struct property *prop);
154extern int prom_remove_property(struct device_node *np, struct property *prop);
155extern int prom_update_property(struct device_node *np,
156 struct property *newprop,
157 struct property *oldprop);
158
159extern struct resource *request_OF_resource(struct device_node *node,
160 int index, const char *name_postfix);
161extern int release_OF_resource(struct device_node *node, int index);
162
163/*
164 * OF address retreival & translation
165 */
166
167/* Helper to read a big number; size is in cells (not bytes) */
168static inline u64 of_read_number(const u32 *cell, int size)
169{
170 u64 r = 0;
171 while (size--)
172 r = (r << 32) | *(cell++);
173 return r;
174}
175
176/* Like of_read_number, but we want an unsigned long result */
177#define of_read_ulong(cell, size) of_read_number(cell, size)
178
179/* Translate an OF address block into a CPU physical address
180 */
181extern u64 of_translate_address(struct device_node *np, const u32 *addr);
182
183/* Extract an address from a device, returns the region size and
184 * the address space flags too. The PCI version uses a BAR number
185 * instead of an absolute index
186 */
187extern const u32 *of_get_address(struct device_node *dev, int index,
188 u64 *size, unsigned int *flags);
189extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
190 u64 *size, unsigned int *flags);
191
192/* Get an address as a resource. Note that if your address is
193 * a PIO address, the conversion will fail if the physical address
194 * can't be internally converted to an IO token with
195 * pci_address_to_pio(), that is because it's either called to early
196 * or it can't be matched to any host bridge IO space
197 */
198extern int of_address_to_resource(struct device_node *dev, int index,
199 struct resource *r);
200extern int of_pci_address_to_resource(struct device_node *dev, int bar,
201 struct resource *r);
202
203/* Parse the ibm,dma-window property of an OF node into the busno, phys and
204 * size parameters.
205 */
206void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
207 unsigned long *busno, unsigned long *phys, unsigned long *size);
208
209extern void kdump_move_device_tree(void);
210
211/* CPU OF node matching */
212struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
213
214/* Get the MAC address */
215extern const void *of_get_mac_address(struct device_node *np);
216
217/*
218 * OF interrupt mapping
219 */
220
221/* This structure is returned when an interrupt is mapped. The controller
222 * field needs to be put() after use
223 */
224
225#define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */
226
227struct of_irq {
228 struct device_node *controller; /* Interrupt controller node */
229 u32 size; /* Specifier size */
230 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */
231};
232
233/**
234 * of_irq_map_init - Initialize the irq remapper
235 * @flags: flags defining workarounds to enable
236 *
237 * Some machines have bugs in the device-tree which require certain workarounds
238 * to be applied. Call this before any interrupt mapping attempts to enable
239 * those workarounds.
240 */
241#define OF_IMAP_OLDWORLD_MAC 0x00000001
242#define OF_IMAP_NO_PHANDLE 0x00000002
243
244extern void of_irq_map_init(unsigned int flags);
245
246/**
247 * of_irq_map_raw - Low level interrupt tree parsing
248 * @parent: the device interrupt parent
249 * @intspec: interrupt specifier ("interrupts" property of the device)
250 * @ointsize: size of the passed in interrupt specifier
251 * @addr: address specifier (start of "reg" property of the device)
252 * @out_irq: structure of_irq filled by this function
253 *
254 * Returns 0 on success and a negative number on error
255 *
256 * This function is a low-level interrupt tree walking function. It
257 * can be used to do a partial walk with synthetized reg and interrupts
258 * properties, for example when resolving PCI interrupts when no device
259 * node exist for the parent.
260 *
261 */
262
263extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
264 u32 ointsize, const u32 *addr,
265 struct of_irq *out_irq);
266
267/**
268 * of_irq_map_one - Resolve an interrupt for a device
269 * @device: the device whose interrupt is to be resolved
270 * @index: index of the interrupt to resolve
271 * @out_irq: structure of_irq filled by this function
272 *
273 * This function resolves an interrupt, walking the tree, for a given
274 * device-tree node. It's the high level pendant to of_irq_map_raw().
275 * It also implements the workarounds for OldWolrd Macs.
276 */
277extern int of_irq_map_one(struct device_node *device, int index,
278 struct of_irq *out_irq);
279
280/**
281 * of_irq_map_pci - Resolve the interrupt for a PCI device
282 * @pdev: the device whose interrupt is to be resolved
283 * @out_irq: structure of_irq filled by this function
284 *
285 * This function resolves the PCI interrupt for a given PCI device. If a
286 * device-node exists for a given pci_dev, it will use normal OF tree
287 * walking. If not, it will implement standard swizzling and walk up the
288 * PCI tree until an device-node is found, at which point it will finish
289 * resolving using the OF tree walking.
290 */
291struct pci_dev;
292extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
293
294extern int of_irq_to_resource(struct device_node *dev, int index,
295 struct resource *r);
296
297/**
298 * of_iomap - Maps the memory mapped IO for a given device_node
299 * @device: the device whose io range will be mapped
300 * @index: index of the io range
301 *
302 * Returns a pointer to the mapped memory
303 */
304extern void __iomem *of_iomap(struct device_node *device, int index);
305
306/*
307 * NB: This is here while we transition from using asm/prom.h
308 * to linux/of.h
309 */
310#include <linux/of.h>
311
312#endif /* __KERNEL__ */
313#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h
new file mode 100644
index 000000000000..f1f03486428a
--- /dev/null
+++ b/arch/microblaze/include/asm/ptrace.h
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PTRACE_H
10#define _ASM_MICROBLAZE_PTRACE_H
11
12#ifndef __ASSEMBLY__
13#include <linux/types.h>
14
15typedef unsigned long microblaze_reg_t;
16
17struct pt_regs {
18 microblaze_reg_t r0;
19 microblaze_reg_t r1;
20 microblaze_reg_t r2;
21 microblaze_reg_t r3;
22 microblaze_reg_t r4;
23 microblaze_reg_t r5;
24 microblaze_reg_t r6;
25 microblaze_reg_t r7;
26 microblaze_reg_t r8;
27 microblaze_reg_t r9;
28 microblaze_reg_t r10;
29 microblaze_reg_t r11;
30 microblaze_reg_t r12;
31 microblaze_reg_t r13;
32 microblaze_reg_t r14;
33 microblaze_reg_t r15;
34 microblaze_reg_t r16;
35 microblaze_reg_t r17;
36 microblaze_reg_t r18;
37 microblaze_reg_t r19;
38 microblaze_reg_t r20;
39 microblaze_reg_t r21;
40 microblaze_reg_t r22;
41 microblaze_reg_t r23;
42 microblaze_reg_t r24;
43 microblaze_reg_t r25;
44 microblaze_reg_t r26;
45 microblaze_reg_t r27;
46 microblaze_reg_t r28;
47 microblaze_reg_t r29;
48 microblaze_reg_t r30;
49 microblaze_reg_t r31;
50 microblaze_reg_t pc;
51 microblaze_reg_t msr;
52 microblaze_reg_t ear;
53 microblaze_reg_t esr;
54 microblaze_reg_t fsr;
55 int kernel_mode;
56};
57
58#define kernel_mode(regs) ((regs)->kernel_mode)
59#define user_mode(regs) (!kernel_mode(regs))
60
61#define instruction_pointer(regs) ((regs)->pc)
62#define profile_pc(regs) instruction_pointer(regs)
63
64void show_regs(struct pt_regs *);
65
66#endif /* __ASSEMBLY__ */
67
68#endif /* _ASM_MICROBLAZE_PTRACE_H */
diff --git a/arch/microblaze/include/asm/pvr.h b/arch/microblaze/include/asm/pvr.h
new file mode 100644
index 000000000000..66f1b30dd097
--- /dev/null
+++ b/arch/microblaze/include/asm/pvr.h
@@ -0,0 +1,209 @@
1/*
2 * Support for the MicroBlaze PVR (Processor Version Register)
3 *
4 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
6 * Copyright (C) 2007 - 2009 PetaLogix
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_PVR_H
14#define _ASM_MICROBLAZE_PVR_H
15
16#define PVR_MSR_BIT 0x400
17
18struct pvr_s {
19 unsigned pvr[16];
20};
21
22/* The following taken from Xilinx's standalone BSP pvr.h */
23
24/* Basic PVR mask */
25#define PVR0_PVR_FULL_MASK 0x80000000
26#define PVR0_USE_BARREL_MASK 0x40000000
27#define PVR0_USE_DIV_MASK 0x20000000
28#define PVR0_USE_HW_MUL_MASK 0x10000000
29#define PVR0_USE_FPU_MASK 0x08000000
30#define PVR0_USE_EXC_MASK 0x04000000
31#define PVR0_USE_ICACHE_MASK 0x02000000
32#define PVR0_USE_DCACHE_MASK 0x01000000
33#define PVR0_USE_MMU 0x00800000 /* new */
34#define PVR0_VERSION_MASK 0x0000FF00
35#define PVR0_USER1_MASK 0x000000FF
36
37/* User 2 PVR mask */
38#define PVR1_USER2_MASK 0xFFFFFFFF
39
40/* Configuration PVR masks */
41#define PVR2_D_OPB_MASK 0x80000000
42#define PVR2_D_LMB_MASK 0x40000000
43#define PVR2_I_OPB_MASK 0x20000000
44#define PVR2_I_LMB_MASK 0x10000000
45#define PVR2_INTERRUPT_IS_EDGE_MASK 0x08000000
46#define PVR2_EDGE_IS_POSITIVE_MASK 0x04000000
47#define PVR2_D_PLB_MASK 0x02000000 /* new */
48#define PVR2_I_PLB_MASK 0x01000000 /* new */
49#define PVR2_INTERCONNECT 0x00800000 /* new */
50#define PVR2_USE_EXTEND_FSL 0x00080000 /* new */
51#define PVR2_USE_FSL_EXC 0x00040000 /* new */
52#define PVR2_USE_MSR_INSTR 0x00020000
53#define PVR2_USE_PCMP_INSTR 0x00010000
54#define PVR2_AREA_OPTIMISED 0x00008000
55#define PVR2_USE_BARREL_MASK 0x00004000
56#define PVR2_USE_DIV_MASK 0x00002000
57#define PVR2_USE_HW_MUL_MASK 0x00001000
58#define PVR2_USE_FPU_MASK 0x00000800
59#define PVR2_USE_MUL64_MASK 0x00000400
60#define PVR2_USE_FPU2_MASK 0x00000200 /* new */
61#define PVR2_USE_IPLBEXC 0x00000100
62#define PVR2_USE_DPLBEXC 0x00000080
63#define PVR2_OPCODE_0x0_ILL_MASK 0x00000040
64#define PVR2_UNALIGNED_EXC_MASK 0x00000020
65#define PVR2_ILL_OPCODE_EXC_MASK 0x00000010
66#define PVR2_IOPB_BUS_EXC_MASK 0x00000008
67#define PVR2_DOPB_BUS_EXC_MASK 0x00000004
68#define PVR2_DIV_ZERO_EXC_MASK 0x00000002
69#define PVR2_FPU_EXC_MASK 0x00000001
70
71/* Debug and exception PVR masks */
72#define PVR3_DEBUG_ENABLED_MASK 0x80000000
73#define PVR3_NUMBER_OF_PC_BRK_MASK 0x1E000000
74#define PVR3_NUMBER_OF_RD_ADDR_BRK_MASK 0x00380000
75#define PVR3_NUMBER_OF_WR_ADDR_BRK_MASK 0x0000E000
76#define PVR3_FSL_LINKS_MASK 0x00000380
77
78/* ICache config PVR masks */
79#define PVR4_USE_ICACHE_MASK 0x80000000
80#define PVR4_ICACHE_ADDR_TAG_BITS_MASK 0x7C000000
81#define PVR4_ICACHE_USE_FSL_MASK 0x02000000
82#define PVR4_ICACHE_ALLOW_WR_MASK 0x01000000
83#define PVR4_ICACHE_LINE_LEN_MASK 0x00E00000
84#define PVR4_ICACHE_BYTE_SIZE_MASK 0x001F0000
85
86/* DCache config PVR masks */
87#define PVR5_USE_DCACHE_MASK 0x80000000
88#define PVR5_DCACHE_ADDR_TAG_BITS_MASK 0x7C000000
89#define PVR5_DCACHE_USE_FSL_MASK 0x02000000
90#define PVR5_DCACHE_ALLOW_WR_MASK 0x01000000
91#define PVR5_DCACHE_LINE_LEN_MASK 0x00E00000
92#define PVR5_DCACHE_BYTE_SIZE_MASK 0x001F0000
93
94/* ICache base address PVR mask */
95#define PVR6_ICACHE_BASEADDR_MASK 0xFFFFFFFF
96
97/* ICache high address PVR mask */
98#define PVR7_ICACHE_HIGHADDR_MASK 0xFFFFFFFF
99
100/* DCache base address PVR mask */
101#define PVR8_DCACHE_BASEADDR_MASK 0xFFFFFFFF
102
103/* DCache high address PVR mask */
104#define PVR9_DCACHE_HIGHADDR_MASK 0xFFFFFFFF
105
106/* Target family PVR mask */
107#define PVR10_TARGET_FAMILY_MASK 0xFF000000
108
109/* MMU descrtiption */
110#define PVR11_USE_MMU 0xC0000000
111#define PVR11_MMU_ITLB_SIZE 0x38000000
112#define PVR11_MMU_DTLB_SIZE 0x07000000
113#define PVR11_MMU_TLB_ACCESS 0x00C00000
114#define PVR11_MMU_ZONES 0x003C0000
115/* MSR Reset value PVR mask */
116#define PVR11_MSR_RESET_VALUE_MASK 0x000007FF
117
118
119/* PVR access macros */
120#define PVR_IS_FULL(pvr) (pvr.pvr[0] & PVR0_PVR_FULL_MASK)
121#define PVR_USE_BARREL(pvr) (pvr.pvr[0] & PVR0_USE_BARREL_MASK)
122#define PVR_USE_DIV(pvr) (pvr.pvr[0] & PVR0_USE_DIV_MASK)
123#define PVR_USE_HW_MUL(pvr) (pvr.pvr[0] & PVR0_USE_HW_MUL_MASK)
124#define PVR_USE_FPU(pvr) (pvr.pvr[0] & PVR0_USE_FPU_MASK)
125#define PVR_USE_FPU2(pvr) (pvr.pvr[2] & PVR2_USE_FPU2_MASK)
126#define PVR_USE_ICACHE(pvr) (pvr.pvr[0] & PVR0_USE_ICACHE_MASK)
127#define PVR_USE_DCACHE(pvr) (pvr.pvr[0] & PVR0_USE_DCACHE_MASK)
128#define PVR_VERSION(pvr) ((pvr.pvr[0] & PVR0_VERSION_MASK) >> 8)
129#define PVR_USER1(pvr) (pvr.pvr[0] & PVR0_USER1_MASK)
130#define PVR_USER2(pvr) (pvr.pvr[1] & PVR1_USER2_MASK)
131
132#define PVR_D_OPB(pvr) (pvr.pvr[2] & PVR2_D_OPB_MASK)
133#define PVR_D_LMB(pvr) (pvr.pvr[2] & PVR2_D_LMB_MASK)
134#define PVR_I_OPB(pvr) (pvr.pvr[2] & PVR2_I_OPB_MASK)
135#define PVR_I_LMB(pvr) (pvr.pvr[2] & PVR2_I_LMB_MASK)
136#define PVR_INTERRUPT_IS_EDGE(pvr) \
137 (pvr.pvr[2] & PVR2_INTERRUPT_IS_EDGE_MASK)
138#define PVR_EDGE_IS_POSITIVE(pvr) \
139 (pvr.pvr[2] & PVR2_EDGE_IS_POSITIVE_MASK)
140#define PVR_USE_MSR_INSTR(pvr) (pvr.pvr[2] & PVR2_USE_MSR_INSTR)
141#define PVR_USE_PCMP_INSTR(pvr) (pvr.pvr[2] & PVR2_USE_PCMP_INSTR)
142#define PVR_AREA_OPTIMISED(pvr) (pvr.pvr[2] & PVR2_AREA_OPTIMISED)
143#define PVR_USE_MUL64(pvr) (pvr.pvr[2] & PVR2_USE_MUL64_MASK)
144#define PVR_OPCODE_0x0_ILLEGAL(pvr) \
145 (pvr.pvr[2] & PVR2_OPCODE_0x0_ILL_MASK)
146#define PVR_UNALIGNED_EXCEPTION(pvr) \
147 (pvr.pvr[2] & PVR2_UNALIGNED_EXC_MASK)
148#define PVR_ILL_OPCODE_EXCEPTION(pvr) \
149 (pvr.pvr[2] & PVR2_ILL_OPCODE_EXC_MASK)
150#define PVR_IOPB_BUS_EXCEPTION(pvr) \
151 (pvr.pvr[2] & PVR2_IOPB_BUS_EXC_MASK)
152#define PVR_DOPB_BUS_EXCEPTION(pvr) \
153 (pvr.pvr[2] & PVR2_DOPB_BUS_EXC_MASK)
154#define PVR_DIV_ZERO_EXCEPTION(pvr) \
155 (pvr.pvr[2] & PVR2_DIV_ZERO_EXC_MASK)
156#define PVR_FPU_EXCEPTION(pvr) (pvr.pvr[2] & PVR2_FPU_EXC_MASK)
157#define PVR_FSL_EXCEPTION(pvr) (pvr.pvr[2] & PVR2_USE_EXTEND_FSL)
158
159#define PVR_DEBUG_ENABLED(pvr) (pvr.pvr[3] & PVR3_DEBUG_ENABLED_MASK)
160#define PVR_NUMBER_OF_PC_BRK(pvr) \
161 ((pvr.pvr[3] & PVR3_NUMBER_OF_PC_BRK_MASK) >> 25)
162#define PVR_NUMBER_OF_RD_ADDR_BRK(pvr) \
163 ((pvr.pvr[3] & PVR3_NUMBER_OF_RD_ADDR_BRK_MASK) >> 19)
164#define PVR_NUMBER_OF_WR_ADDR_BRK(pvr) \
165 ((pvr.pvr[3] & PVR3_NUMBER_OF_WR_ADDR_BRK_MASK) >> 13)
166#define PVR_FSL_LINKS(pvr) ((pvr.pvr[3] & PVR3_FSL_LINKS_MASK) >> 7)
167
168#define PVR_ICACHE_ADDR_TAG_BITS(pvr) \
169 ((pvr.pvr[4] & PVR4_ICACHE_ADDR_TAG_BITS_MASK) >> 26)
170#define PVR_ICACHE_USE_FSL(pvr) (pvr.pvr[4] & PVR4_ICACHE_USE_FSL_MASK)
171#define PVR_ICACHE_ALLOW_WR(pvr) (pvr.pvr[4] & PVR4_ICACHE_ALLOW_WR_MASK)
172#define PVR_ICACHE_LINE_LEN(pvr) \
173 (1 << ((pvr.pvr[4] & PVR4_ICACHE_LINE_LEN_MASK) >> 21))
174#define PVR_ICACHE_BYTE_SIZE(pvr) \
175 (1 << ((pvr.pvr[4] & PVR4_ICACHE_BYTE_SIZE_MASK) >> 16))
176
177#define PVR_DCACHE_ADDR_TAG_BITS(pvr) \
178 ((pvr.pvr[5] & PVR5_DCACHE_ADDR_TAG_BITS_MASK) >> 26)
179#define PVR_DCACHE_USE_FSL(pvr) (pvr.pvr[5] & PVR5_DCACHE_USE_FSL_MASK)
180#define PVR_DCACHE_ALLOW_WR(pvr) (pvr.pvr[5] & PVR5_DCACHE_ALLOW_WR_MASK)
181#define PVR_DCACHE_LINE_LEN(pvr) \
182 (1 << ((pvr.pvr[5] & PVR5_DCACHE_LINE_LEN_MASK) >> 21))
183#define PVR_DCACHE_BYTE_SIZE(pvr) \
184 (1 << ((pvr.pvr[5] & PVR5_DCACHE_BYTE_SIZE_MASK) >> 16))
185
186
187#define PVR_ICACHE_BASEADDR(pvr) (pvr.pvr[6] & PVR6_ICACHE_BASEADDR_MASK)
188#define PVR_ICACHE_HIGHADDR(pvr) (pvr.pvr[7] & PVR7_ICACHE_HIGHADDR_MASK)
189
190#define PVR_DCACHE_BASEADDR(pvr) (pvr.pvr[8] & PVR8_DCACHE_BASEADDR_MASK)
191#define PVR_DCACHE_HIGHADDR(pvr) (pvr.pvr[9] & PVR9_DCACHE_HIGHADDR_MASK)
192
193#define PVR_TARGET_FAMILY(pvr) ((pvr.pvr[10] & PVR10_TARGET_FAMILY_MASK) >> 24)
194
195#define PVR_MSR_RESET_VALUE(pvr) \
196 (pvr.pvr[11] & PVR11_MSR_RESET_VALUE_MASK)
197
198/* mmu */
199#define PVR_USE_MMU(pvr) ((pvr.pvr[11] & PVR11_USE_MMU) >> 30)
200#define PVR_MMU_ITLB_SIZE(pvr) (pvr.pvr[11] & PVR11_MMU_ITLB_SIZE)
201#define PVR_MMU_DTLB_SIZE(pvr) (pvr.pvr[11] & PVR11_MMU_DTLB_SIZE)
202#define PVR_MMU_TLB_ACCESS(pvr) (pvr.pvr[11] & PVR11_MMU_TLB_ACCESS)
203#define PVR_MMU_ZONES(pvr) (pvr.pvr[11] & PVR11_MMU_ZONES)
204
205
206int cpu_has_pvr(void);
207void get_pvr(struct pvr_s *pvr);
208
209#endif /* _ASM_MICROBLAZE_PVR_H */
diff --git a/arch/microblaze/include/asm/registers.h b/arch/microblaze/include/asm/registers.h
new file mode 100644
index 000000000000..834142d9356f
--- /dev/null
+++ b/arch/microblaze/include/asm/registers.h
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_REGISTERS_H
12#define _ASM_MICROBLAZE_REGISTERS_H
13
14#define MSR_BE (1<<0) /* 0x001 */
15#define MSR_IE (1<<1) /* 0x002 */
16#define MSR_C (1<<2) /* 0x004 */
17#define MSR_BIP (1<<3) /* 0x008 */
18#define MSR_FSL (1<<4) /* 0x010 */
19#define MSR_ICE (1<<5) /* 0x020 */
20#define MSR_DZ (1<<6) /* 0x040 */
21#define MSR_DCE (1<<7) /* 0x080 */
22#define MSR_EE (1<<8) /* 0x100 */
23#define MSR_EIP (1<<9) /* 0x200 */
24#define MSR_CC (1<<31)
25
26/* Floating Point Status Register (FSR) Bits */
27#define FSR_IO (1<<4) /* Invalid operation */
28#define FSR_DZ (1<<3) /* Divide-by-zero */
29#define FSR_OF (1<<2) /* Overflow */
30#define FSR_UF (1<<1) /* Underflow */
31#define FSR_DO (1<<0) /* Denormalized operand error */
32
33#endif /* _ASM_MICROBLAZE_REGISTERS_H */
diff --git a/arch/microblaze/include/asm/resource.h b/arch/microblaze/include/asm/resource.h
new file mode 100644
index 000000000000..04bc4db8921b
--- /dev/null
+++ b/arch/microblaze/include/asm/resource.h
@@ -0,0 +1 @@
#include <asm-generic/resource.h>
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
new file mode 100644
index 000000000000..08ff1d049b42
--- /dev/null
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_SCATTERLIST_H
11#define _ASM_MICROBLAZE_SCATTERLIST_H
12
13struct scatterlist {
14#ifdef CONFIG_DEBUG_SG
15 unsigned long sg_magic;
16#endif
17 unsigned long page_link;
18 dma_addr_t dma_address;
19 unsigned int offset;
20 unsigned int length;
21};
22
23#define sg_dma_address(sg) ((sg)->dma_address)
24#define sg_dma_len(sg) ((sg)->length)
25
26#define ISA_DMA_THRESHOLD (~0UL)
27
28#endif /* _ASM_MICROBLAZE_SCATTERLIST_H */
diff --git a/arch/microblaze/include/asm/sections.h b/arch/microblaze/include/asm/sections.h
new file mode 100644
index 000000000000..8434a43e5421
--- /dev/null
+++ b/arch/microblaze/include/asm/sections.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SECTIONS_H
10#define _ASM_MICROBLAZE_SECTIONS_H
11
12#include <asm-generic/sections.h>
13
14# ifndef __ASSEMBLY__
15extern char _ssbss[], _esbss[];
16extern unsigned long __ivt_start[], __ivt_end[];
17
18# ifdef CONFIG_MTD_UCLINUX
19extern char *_ebss;
20# endif
21
22extern u32 _fdt_start[], _fdt_end[];
23
24# endif /* !__ASSEMBLY__ */
25#endif /* _ASM_MICROBLAZE_SECTIONS_H */
diff --git a/arch/microblaze/include/asm/segment.h b/arch/microblaze/include/asm/segment.h
new file mode 100644
index 000000000000..7f5dcc56eea1
--- /dev/null
+++ b/arch/microblaze/include/asm/segment.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_SEGMENT_H
12#define _ASM_MICROBLAZE_SEGMENT_H
13
14#ifndef __ASSEMBLY__
15
16typedef struct {
17 unsigned long seg;
18} mm_segment_t;
19
20/*
21 * On Microblaze the fs value is actually the top of the corresponding
22 * address space.
23 *
24 * The fs value determines whether argument validity checking should be
25 * performed or not. If get_fs() == USER_DS, checking is performed, with
26 * get_fs() == KERNEL_DS, checking is bypassed.
27 *
28 * For historical reasons, these macros are grossly misnamed.
29 *
30 * For non-MMU arch like Microblaze, KERNEL_DS and USER_DS is equal.
31 */
32# define KERNEL_DS ((mm_segment_t){0})
33# define USER_DS KERNEL_DS
34
35# define get_ds() (KERNEL_DS)
36# define get_fs() (current_thread_info()->addr_limit)
37# define set_fs(x) \
38 do { current_thread_info()->addr_limit = (x); } while (0)
39
40# define segment_eq(a, b) ((a).seg == (b).seg)
41
42# endif /* __ASSEMBLY__ */
43#endif /* _ASM_MICROBLAZE_SEGMENT_H */
diff --git a/arch/microblaze/include/asm/selfmod.h b/arch/microblaze/include/asm/selfmod.h
new file mode 100644
index 000000000000..c42aff2e6cd0
--- /dev/null
+++ b/arch/microblaze/include/asm/selfmod.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SELFMOD_H
10#define _ASM_MICROBLAZE_SELFMOD_H
11
12/*
13 * BARRIER_BASE_ADDR is constant address for selfmod function.
14 * do not change this value - selfmod function is in
15 * arch/microblaze/kernel/selfmod.c: selfmod_function()
16 *
17 * last 16 bits is used for storing register offset
18 */
19
20#define BARRIER_BASE_ADDR 0x1234ff00
21
22void selfmod_function(const int *arr_fce, const unsigned int base);
23
24#endif /* _ASM_MICROBLAZE_SELFMOD_H */
diff --git a/arch/microblaze/include/asm/sembuf.h b/arch/microblaze/include/asm/sembuf.h
new file mode 100644
index 000000000000..b804ed71a57e
--- /dev/null
+++ b/arch/microblaze/include/asm/sembuf.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SEMBUF_H
10#define _ASM_MICROBLAZE_SEMBUF_H
11
12/*
13 * The semid64_ds structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 64-bit time_t to solve y2038 problem
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct semid64_ds {
23 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
24 __kernel_time_t sem_otime; /* last semop time */
25 unsigned long __unused1;
26 __kernel_time_t sem_ctime; /* last change time */
27 unsigned long __unused2;
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long __unused3;
30 unsigned long __unused4;
31};
32
33
34#endif /* _ASM_MICROBLAZE_SEMBUF_H */
diff --git a/arch/microblaze/include/asm/serial.h b/arch/microblaze/include/asm/serial.h
new file mode 100644
index 000000000000..39bfc8ce6af5
--- /dev/null
+++ b/arch/microblaze/include/asm/serial.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SERIAL_H
10#define _ASM_MICROBLAZE_SERIAL_H
11
12# define BASE_BAUD (1843200 / 16)
13
14#endif /* _ASM_MICROBLAZE_SERIAL_H */
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
new file mode 100644
index 000000000000..9b98e8e6abae
--- /dev/null
+++ b/arch/microblaze/include/asm/setup.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_SETUP_H
11#define _ASM_MICROBLAZE_SETUP_H
12
13#define COMMAND_LINE_SIZE 256
14
15# ifndef __ASSEMBLY__
16
17# ifdef __KERNEL__
18extern unsigned int boot_cpuid; /* move to smp.h */
19
20extern char cmd_line[COMMAND_LINE_SIZE];
21# endif/* __KERNEL__ */
22
23void early_printk(const char *fmt, ...);
24
25int setup_early_printk(char *opt);
26void disable_early_printk(void);
27
28void heartbeat(void);
29void setup_heartbeat(void);
30
31unsigned long long sched_clock(void);
32
33void time_init(void);
34void init_IRQ(void);
35void machine_early_init(const char *cmdline, unsigned int ram,
36 unsigned int fdt);
37
38void machine_restart(char *cmd);
39void machine_shutdown(void);
40void machine_halt(void);
41void machine_power_off(void);
42
43# endif /* __ASSEMBLY__ */
44#endif /* _ASM_MICROBLAZE_SETUP_H */
diff --git a/arch/microblaze/include/asm/shmbuf.h b/arch/microblaze/include/asm/shmbuf.h
new file mode 100644
index 000000000000..f829c5843618
--- /dev/null
+++ b/arch/microblaze/include/asm/shmbuf.h
@@ -0,0 +1,42 @@
1#ifndef _ASM_MICROBLAZE_SHMBUF_H
2#define _ASM_MICROBLAZE_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASM_MICROBLAZE_SHMBUF_H */
diff --git a/arch/microblaze/include/asm/shmparam.h b/arch/microblaze/include/asm/shmparam.h
new file mode 100644
index 000000000000..9f5fc2b3b6a3
--- /dev/null
+++ b/arch/microblaze/include/asm/shmparam.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_MICROBLAZE_SHMPARAM_H
2#define _ASM_MICROBLAZE_SHMPARAM_H
3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5
6#endif /* _ASM_MICROBLAZE_SHMPARAM_H */
diff --git a/arch/microblaze/include/asm/sigcontext.h b/arch/microblaze/include/asm/sigcontext.h
new file mode 100644
index 000000000000..55873c80c917
--- /dev/null
+++ b/arch/microblaze/include/asm/sigcontext.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SIGCONTEXT_H
10#define _ASM_MICROBLAZE_SIGCONTEXT_H
11
12/* FIXME should be linux/ptrace.h */
13#include <asm/ptrace.h>
14
15struct sigcontext {
16 struct pt_regs regs;
17 unsigned long oldmask;
18};
19
20#endif /* _ASM_MICROBLAZE_SIGCONTEXT_H */
diff --git a/arch/microblaze/include/asm/siginfo.h b/arch/microblaze/include/asm/siginfo.h
new file mode 100644
index 000000000000..f162911a8f50
--- /dev/null
+++ b/arch/microblaze/include/asm/siginfo.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SIGINFO_H
10#define _ASM_MICROBLAZE_SIGINFO_H
11
12#include <linux/types.h>
13#include <asm-generic/siginfo.h>
14
15#endif /* _ASM_MICROBLAZE_SIGINFO_H */
diff --git a/arch/microblaze/include/asm/signal.h b/arch/microblaze/include/asm/signal.h
new file mode 100644
index 000000000000..9676fad3486c
--- /dev/null
+++ b/arch/microblaze/include/asm/signal.h
@@ -0,0 +1,165 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 * Yasushi SHOJI <yashi@atmark-techno.com>
4 * Tetsuya OHKAWA <tetsuya@atmark-techno.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_SIGNAL_H
12#define _ASM_MICROBLAZE_SIGNAL_H
13
14#define SIGHUP 1
15#define SIGINT 2
16#define SIGQUIT 3
17#define SIGILL 4
18#define SIGTRAP 5
19#define SIGABRT 6
20#define SIGIOT 6
21#define SIGBUS 7
22#define SIGFPE 8
23#define SIGKILL 9
24#define SIGUSR1 10
25#define SIGSEGV 11
26#define SIGUSR2 12
27#define SIGPIPE 13
28#define SIGALRM 14
29#define SIGTERM 15
30#define SIGSTKFLT 16
31#define SIGCHLD 17
32#define SIGCONT 18
33#define SIGSTOP 19
34#define SIGTSTP 20
35#define SIGTTIN 21
36#define SIGTTOU 22
37#define SIGURG 23
38#define SIGXCPU 24
39#define SIGXFSZ 25
40#define SIGVTALRM 26
41#define SIGPROF 27
42#define SIGWINCH 28
43#define SIGIO 29
44#define SIGPOLL SIGIO
45/*
46#define SIGLOST 29
47*/
48#define SIGPWR 30
49#define SIGSYS 31
50#define SIGUNUSED 31
51
52/* These should not be considered constants from userland. */
53#define SIGRTMIN 32
54#define SIGRTMAX _NSIG
55
56/*
57 * SA_FLAGS values:
58 *
59 * SA_ONSTACK indicates that a registered stack_t will be used.
60 * SA_RESTART flag to get restarting signals (which were the default long ago)
61 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
62 * SA_RESETHAND clears the handler when the signal is delivered.
63 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
64 * SA_NODEFER prevents the current signal from being masked in the handler.
65 *
66 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
67 * Unix names RESETHAND and NODEFER respectively.
68 */
69#define SA_NOCLDSTOP 0x00000001
70#define SA_NOCLDWAIT 0x00000002
71#define SA_SIGINFO 0x00000004
72#define SA_ONSTACK 0x08000000
73#define SA_RESTART 0x10000000
74#define SA_NODEFER 0x40000000
75#define SA_RESETHAND 0x80000000
76
77#define SA_NOMASK SA_NODEFER
78#define SA_ONESHOT SA_RESETHAND
79
80#define SA_RESTORER 0x04000000
81
82/*
83 * sigaltstack controls
84 */
85#define SS_ONSTACK 1
86#define SS_DISABLE 2
87
88#define MINSIGSTKSZ 2048
89#define SIGSTKSZ 8192
90
91# ifndef __ASSEMBLY__
92# include <linux/types.h>
93# include <asm-generic/signal.h>
94
95/* Avoid too many header ordering problems. */
96struct siginfo;
97
98# ifdef __KERNEL__
99/*
100 * Most things should be clean enough to redefine this at will, if care
101 * is taken to make libc match.
102 */
103# define _NSIG 64
104# define _NSIG_BPW 32
105# define _NSIG_WORDS (_NSIG / _NSIG_BPW)
106
107typedef unsigned long old_sigset_t; /* at least 32 bits */
108
109typedef struct {
110 unsigned long sig[_NSIG_WORDS];
111} sigset_t;
112
113struct old_sigaction {
114 __sighandler_t sa_handler;
115 old_sigset_t sa_mask;
116 unsigned long sa_flags;
117 void (*sa_restorer)(void);
118};
119
120struct sigaction {
121 __sighandler_t sa_handler;
122 unsigned long sa_flags;
123 void (*sa_restorer)(void);
124 sigset_t sa_mask; /* mask last for extensibility */
125};
126
127struct k_sigaction {
128 struct sigaction sa;
129};
130
131# include <asm/sigcontext.h>
132# undef __HAVE_ARCH_SIG_BITOPS
133
134# define ptrace_signal_deliver(regs, cookie) do { } while (0)
135
136# else /* !__KERNEL__ */
137
138/* Here we must cater to libcs that poke about in kernel headers. */
139
140# define NSIG 32
141typedef unsigned long sigset_t;
142
143struct sigaction {
144 union {
145 __sighandler_t _sa_handler;
146 void (*_sa_sigaction)(int, struct siginfo *, void *);
147 } _u;
148 sigset_t sa_mask;
149 unsigned long sa_flags;
150 void (*sa_restorer)(void);
151};
152
153# define sa_handler _u._sa_handler
154# define sa_sigaction _u._sa_sigaction
155
156# endif /* __KERNEL__ */
157
158typedef struct sigaltstack {
159 void *ss_sp;
160 int ss_flags;
161 size_t ss_size;
162} stack_t;
163
164# endif /* __ASSEMBLY__ */
165#endif /* _ASM_MICROBLAZE_SIGNAL_H */
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h
new file mode 100644
index 000000000000..825936860314
--- /dev/null
+++ b/arch/microblaze/include/asm/socket.h
@@ -0,0 +1,69 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SOCKET_H
10#define _ASM_MICROBLAZE_SOCKET_H
11
12#include <asm/sockios.h>
13
14/* For setsockoptions(2) */
15#define SOL_SOCKET 1
16
17#define SO_DEBUG 1
18#define SO_REUSEADDR 2
19#define SO_TYPE 3
20#define SO_ERROR 4
21#define SO_DONTROUTE 5
22#define SO_BROADCAST 6
23#define SO_SNDBUF 7
24#define SO_RCVBUF 8
25#define SO_SNDBUFFORCE 32
26#define SO_RCVBUFFORCE 33
27#define SO_KEEPALIVE 9
28#define SO_OOBINLINE 10
29#define SO_NO_CHECK 11
30#define SO_PRIORITY 12
31#define SO_LINGER 13
32#define SO_BSDCOMPAT 14
33/* To add :#define SO_REUSEPORT 15 */
34#define SO_PASSCRED 16
35#define SO_PEERCRED 17
36#define SO_RCVLOWAT 18
37#define SO_SNDLOWAT 19
38#define SO_RCVTIMEO 20
39#define SO_SNDTIMEO 21
40
41/* Security levels - as per NRL IPv6 - don't actually do anything */
42#define SO_SECURITY_AUTHENTICATION 22
43#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
44#define SO_SECURITY_ENCRYPTION_NETWORK 24
45
46#define SO_BINDTODEVICE 25
47
48/* Socket filtering */
49#define SO_ATTACH_FILTER 26
50#define SO_DETACH_FILTER 27
51
52#define SO_PEERNAME 28
53#define SO_TIMESTAMP 29
54#define SCM_TIMESTAMP SO_TIMESTAMP
55
56#define SO_ACCEPTCONN 30
57
58#define SO_PEERSEC 31
59#define SO_PASSSEC 34
60
61#define SO_TIMESTAMPNS 35
62#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
63
64#define SO_MARK 36
65
66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68
69#endif /* _ASM_MICROBLAZE_SOCKET_H */
diff --git a/arch/microblaze/include/asm/sockios.h b/arch/microblaze/include/asm/sockios.h
new file mode 100644
index 000000000000..9fff57a701e1
--- /dev/null
+++ b/arch/microblaze/include/asm/sockios.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SOCKIOS_H
10#define _ASM_MICROBLAZE_SOCKIOS_H
11
12#include <linux/ioctl.h>
13
14/* Socket-level I/O control calls. */
15#define FIOSETOWN 0x8901
16#define SIOCSPGRP 0x8902
17#define FIOGETOWN 0x8903
18#define SIOCGPGRP 0x8904
19#define SIOCATMARK 0x8905
20#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
21#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
22
23#endif /* _ASM_MICROBLAZE_SOCKIOS_H */
diff --git a/arch/microblaze/include/asm/stat.h b/arch/microblaze/include/asm/stat.h
new file mode 100644
index 000000000000..5f18b8aed220
--- /dev/null
+++ b/arch/microblaze/include/asm/stat.h
@@ -0,0 +1,73 @@
1/*
2 * Microblaze stat structure
3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
10 *
11 * Written by Miles Bader <miles@gnu.org>
12 */
13
14#ifndef _ASM_MICROBLAZE_STAT_H
15#define _ASM_MICROBLAZE_STAT_H
16
17#include <linux/posix_types.h>
18
19struct stat {
20 unsigned int st_dev;
21 unsigned long st_ino;
22 unsigned int st_mode;
23 unsigned int st_nlink;
24 unsigned int st_uid;
25 unsigned int st_gid;
26 unsigned int st_rdev;
27 unsigned long st_size;
28 unsigned long st_blksize;
29 unsigned long st_blocks;
30 unsigned long st_atime;
31 unsigned long __unused1; /* unsigned long st_atime_nsec */
32 unsigned long st_mtime;
33 unsigned long __unused2; /* unsigned long st_mtime_nsec */
34 unsigned long st_ctime;
35 unsigned long __unused3; /* unsigned long st_ctime_nsec */
36 unsigned long __unused4;
37 unsigned long __unused5;
38};
39
40struct stat64 {
41 unsigned long long st_dev;
42 unsigned long __unused1;
43
44 unsigned long long st_ino;
45
46 unsigned int st_mode;
47 unsigned int st_nlink;
48
49 unsigned int st_uid;
50 unsigned int st_gid;
51
52 unsigned long long st_rdev;
53 unsigned long __unused3;
54
55 long long st_size;
56 unsigned long st_blksize;
57
58 unsigned long st_blocks; /* No. of 512-byte blocks allocated */
59 unsigned long __unused4; /* future possible st_blocks high bits */
60
61 unsigned long st_atime;
62 unsigned long st_atime_nsec;
63
64 unsigned long st_mtime;
65 unsigned long st_mtime_nsec;
66
67 unsigned long st_ctime;
68 unsigned long st_ctime_nsec;
69
70 unsigned long __unused8;
71};
72
73#endif /* _ASM_MICROBLAZE_STAT_H */
diff --git a/arch/microblaze/include/asm/statfs.h b/arch/microblaze/include/asm/statfs.h
new file mode 100644
index 000000000000..0b91fe198c20
--- /dev/null
+++ b/arch/microblaze/include/asm/statfs.h
@@ -0,0 +1 @@
#include <asm-generic/statfs.h>
diff --git a/arch/microblaze/include/asm/string.h b/arch/microblaze/include/asm/string.h
new file mode 100644
index 000000000000..f7728c90fc18
--- /dev/null
+++ b/arch/microblaze/include/asm/string.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_STRING_H
10#define _ASM_MICROBLAZE_STRING_H
11
12#ifndef __KERNEL__
13
14#define __HAVE_ARCH_MEMSET
15#define __HAVE_ARCH_MEMCPY
16#define __HAVE_ARCH_MEMMOVE
17
18extern void *memset(void *, int, __kernel_size_t);
19extern void *memcpy(void *, const void *, __kernel_size_t);
20extern void *memmove(void *, const void *, __kernel_size_t);
21
22#endif /* __KERNEL__ */
23
24#endif /* _ASM_MICROBLAZE_STRING_H */
diff --git a/arch/microblaze/include/asm/swab.h b/arch/microblaze/include/asm/swab.h
new file mode 100644
index 000000000000..b375d7b65ad7
--- /dev/null
+++ b/arch/microblaze/include/asm/swab.h
@@ -0,0 +1,8 @@
1#ifndef _ASM_MICROBLAZE_SWAB_H
2#define _ASM_MICROBLAZE_SWAB_H
3
4#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
5#define __SWAB_64_THRU_32__
6#endif
7
8#endif /* _ASM_MICROBLAZE_SWAB_H */
diff --git a/arch/microblaze/include/asm/syscalls.h b/arch/microblaze/include/asm/syscalls.h
new file mode 100644
index 000000000000..9cb4ff0edeb2
--- /dev/null
+++ b/arch/microblaze/include/asm/syscalls.h
@@ -0,0 +1,45 @@
1#ifndef __ASM_MICROBLAZE_SYSCALLS_H
2#define __ASM_MICROBLAZE_SYSCALLS_H
3#ifdef __KERNEL__
4
5#include <linux/compiler.h>
6#include <linux/linkage.h>
7#include <linux/types.h>
8#include <linux/signal.h>
9
10/* FIXME will be removed */
11asmlinkage int sys_ipc(uint call, int first, int second,
12 int third, void *ptr, long fifth);
13
14struct pt_regs;
15asmlinkage int sys_vfork(struct pt_regs *regs);
16asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
17asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
18 char __user *__user *envp, struct pt_regs *regs);
19
20asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
21 unsigned long prot, unsigned long flags,
22 unsigned long fd, unsigned long pgoff);
23
24asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
25 unsigned long prot, unsigned long flags,
26 unsigned long fd, off_t offset);
27
28/* from signal.c */
29asmlinkage int sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs);
30
31asmlinkage int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
32 struct pt_regs *regs);
33
34asmlinkage int sys_sigaction(int sig, const struct old_sigaction *act,
35 struct old_sigaction *oact);
36
37asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
38 struct pt_regs *regs);
39
40asmlinkage int sys_sigreturn(struct pt_regs *regs);
41
42asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
43
44#endif /* __KERNEL__ */
45#endif /* __ASM_MICROBLAZE_SYSCALLS_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
new file mode 100644
index 000000000000..c4e308850b5d
--- /dev/null
+++ b/arch/microblaze/include/asm/system.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SYSTEM_H
10#define _ASM_MICROBLAZE_SYSTEM_H
11
12#include <asm/registers.h>
13#include <asm/setup.h>
14#include <asm/irqflags.h>
15
16struct task_struct;
17struct thread_info;
18
19extern struct task_struct *_switch_to(struct thread_info *prev,
20 struct thread_info *next);
21
22#define switch_to(prev, next, last) \
23 do { \
24 (last) = _switch_to(task_thread_info(prev), \
25 task_thread_info(next)); \
26 } while (0)
27
28#define smp_read_barrier_depends() do {} while (0)
29#define read_barrier_depends() do {} while (0)
30
31#define nop() asm volatile ("nop")
32#define mb() barrier()
33#define rmb() mb()
34#define wmb() mb()
35#define set_mb(var, value) do { var = value; mb(); } while (0)
36#define set_wmb(var, value) do { var = value; wmb(); } while (0)
37
38#define smp_mb() mb()
39#define smp_rmb() rmb()
40#define smp_wmb() wmb()
41
42void show_trace(struct task_struct *task, unsigned long *stack);
43void __bad_xchg(volatile void *ptr, int size);
44
45static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
46 int size)
47{
48 unsigned long ret;
49 unsigned long flags;
50
51 switch (size) {
52 case 1:
53 local_irq_save(flags);
54 ret = *(volatile unsigned char *)ptr;
55 *(volatile unsigned char *)ptr = x;
56 local_irq_restore(flags);
57 break;
58
59 case 4:
60 local_irq_save(flags);
61 ret = *(volatile unsigned long *)ptr;
62 *(volatile unsigned long *)ptr = x;
63 local_irq_restore(flags);
64 break;
65 default:
66 __bad_xchg(ptr, size), ret = 0;
67 break;
68 }
69
70 return ret;
71}
72
73void disable_hlt(void);
74void enable_hlt(void);
75void default_idle(void);
76
77#define xchg(ptr, x) \
78 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
79
80void free_init_pages(char *what, unsigned long begin, unsigned long end);
81void free_initmem(void);
82extern char *klimit;
83extern void ret_from_fork(void);
84
85#ifdef CONFIG_DEBUG_FS
86extern struct dentry *of_debugfs_root;
87#endif
88
89#define arch_align_stack(x) (x)
90
91#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/microblaze/include/asm/termbits.h b/arch/microblaze/include/asm/termbits.h
new file mode 100644
index 000000000000..a1b64bc4724a
--- /dev/null
+++ b/arch/microblaze/include/asm/termbits.h
@@ -0,0 +1,203 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TERMBITS_H
10#define _ASM_MICROBLAZE_TERMBITS_H
11
12#include <linux/posix_types.h>
13
14typedef unsigned char cc_t;
15typedef unsigned int speed_t;
16typedef unsigned int tcflag_t;
17
18#define NCCS 19
19struct termios {
20 tcflag_t c_iflag; /* input mode flags */
21 tcflag_t c_oflag; /* output mode flags */
22 tcflag_t c_cflag; /* control mode flags */
23 tcflag_t c_lflag; /* local mode flags */
24 cc_t c_line; /* line discipline */
25 cc_t c_cc[NCCS]; /* control characters */
26};
27
28struct ktermios {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
39/* c_cc characters */
40
41#define VINTR 0
42#define VQUIT 1
43#define VERASE 2
44#define VKILL 3
45#define VEOF 4
46#define VTIME 5
47#define VMIN 6
48#define VSWTC 7
49#define VSTART 8
50#define VSTOP 9
51#define VSUSP 10
52#define VEOL 11
53#define VREPRINT 12
54#define VDISCARD 13
55#define VWERASE 14
56#define VLNEXT 15
57#define VEOL2 16
58
59/* c_iflag bits */
60
61#define IGNBRK 0000001
62#define BRKINT 0000002
63#define IGNPAR 0000004
64#define PARMRK 0000010
65#define INPCK 0000020
66#define ISTRIP 0000040
67#define INLCR 0000100
68#define IGNCR 0000200
69#define ICRNL 0000400
70#define IUCLC 0001000
71#define IXON 0002000
72#define IXANY 0004000
73#define IXOFF 0010000
74#define IMAXBEL 0020000
75#define IUTF8 0040000
76
77/* c_oflag bits */
78
79#define OPOST 0000001
80#define OLCUC 0000002
81#define ONLCR 0000004
82#define OCRNL 0000010
83#define ONOCR 0000020
84#define ONLRET 0000040
85#define OFILL 0000100
86#define OFDEL 0000200
87#define NLDLY 0000400
88#define NL0 0000000
89#define NL1 0000400
90#define CRDLY 0003000
91#define CR0 0000000
92#define CR1 0001000
93#define CR2 0002000
94#define CR3 0003000
95#define TABDLY 0014000
96#define TAB0 0000000
97#define TAB1 0004000
98#define TAB2 0010000
99#define TAB3 0014000
100#define XTABS 0014000
101#define BSDLY 0020000
102#define BS0 0000000
103#define BS1 0020000
104#define VTDLY 0040000
105#define VT0 0000000
106#define VT1 0040000
107#define FFDLY 0100000
108#define FF0 0000000
109#define FF1 0100000
110
111/* c_cflag bit meaning */
112
113#define CBAUD 0010017
114#define B0 0000000 /* hang up */
115#define B50 0000001
116#define B75 0000002
117#define B110 0000003
118#define B134 0000004
119#define B150 0000005
120#define B200 0000006
121#define B300 0000007
122#define B600 0000010
123#define B1200 0000011
124#define B1800 0000012
125#define B2400 0000013
126#define B4800 0000014
127#define B9600 0000015
128#define B19200 0000016
129#define B38400 0000017
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0000060
133#define CS5 0000000
134#define CS6 0000020
135#define CS7 0000040
136#define CS8 0000060
137#define CSTOPB 0000100
138#define CREAD 0000200
139#define PARENB 0000400
140#define PARODD 0001000
141#define HUPCL 0002000
142#define CLOCAL 0004000
143#define CBAUDEX 0010000
144#define B57600 0010001
145#define B115200 0010002
146#define B230400 0010003
147#define B460800 0010004
148#define B500000 0010005
149#define B576000 0010006
150#define B921600 0010007
151#define BOTHER 0010000
152#define B1000000 0010010
153#define B1152000 0010011
154#define B1500000 0010012
155#define B2000000 0010013
156#define B2500000 0010014
157#define B3000000 0010015
158#define B3500000 0010016
159#define B4000000 0010017
160#define CIBAUD 002003600000 /* input baud rate (not used) */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
166/* c_lflag bits */
167
168#define ISIG 0000001
169#define ICANON 0000002
170#define XCASE 0000004
171#define ECHO 0000010
172#define ECHOE 0000020
173#define ECHOK 0000040
174#define ECHONL 0000100
175#define NOFLSH 0000200
176#define TOSTOP 0000400
177#define ECHOCTL 0001000
178#define ECHOPRT 0002000
179#define ECHOKE 0004000
180#define FLUSHO 0010000
181#define PENDIN 0040000
182#define IEXTEN 0100000
183
184/* tcflow() and TCXONC use these */
185
186#define TCOOFF 0
187#define TCOON 1
188#define TCIOFF 2
189#define TCION 3
190
191/* tcflush() and TCFLSH use these */
192
193#define TCIFLUSH 0
194#define TCOFLUSH 1
195#define TCIOFLUSH 2
196
197/* tcsetattr uses these */
198
199#define TCSANOW 0
200#define TCSADRAIN 1
201#define TCSAFLUSH 2
202
203#endif /* _ASM_MICROBLAZE_TERMBITS_H */
diff --git a/arch/microblaze/include/asm/termios.h b/arch/microblaze/include/asm/termios.h
new file mode 100644
index 000000000000..102d77258668
--- /dev/null
+++ b/arch/microblaze/include/asm/termios.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TERMIOS_H
10#define _ASM_MICROBLAZE_TERMIOS_H
11
12#include <linux/string.h>
13#include <asm/termbits.h>
14#include <asm/ioctls.h>
15
16struct winsize {
17 unsigned short ws_row;
18 unsigned short ws_col;
19 unsigned short ws_xpixel;
20 unsigned short ws_ypixel;
21};
22
23#define NCC 8
24struct termio {
25 unsigned short c_iflag; /* input mode flags */
26 unsigned short c_oflag; /* output mode flags */
27 unsigned short c_cflag; /* control mode flags */
28 unsigned short c_lflag; /* local mode flags */
29 unsigned char c_line; /* line discipline */
30 unsigned char c_cc[NCC]; /* control characters */
31};
32
33#ifdef __KERNEL__
34/* intr=^C quit=^| erase=del kill=^U
35 eof=^D vtime=\0 vmin=\1 sxtc=\0
36 start=^Q stop=^S susp=^Z eol=\0
37 reprint=^R discard=^U werase=^W lnext=^V
38 eol2=\0
39*/
40#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
41#endif
42
43/* Modem lines */
44
45#define TIOCM_LE 0x001
46#define TIOCM_DTR 0x002
47#define TIOCM_RTS 0x004
48#define TIOCM_ST 0x008
49#define TIOCM_SR 0x010
50#define TIOCM_CTS 0x020
51#define TIOCM_CAR 0x040
52#define TIOCM_RNG 0x080
53#define TIOCM_DSR 0x100
54#define TIOCM_CD TIOCM_CAR
55#define TIOCM_RI TIOCM_RNG
56#define TIOCM_OUT1 0x2000
57#define TIOCM_OUT2 0x4000
58#define TIOCM_LOOP 0x8000
59
60/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
61
62/* Line disciplines */
63
64#define N_TTY 0
65#define N_SLIP 1
66#define N_MOUSE 2
67#define N_PPP 3
68#define N_STRIP 4
69#define N_AX25 5
70#define N_X25 6 /* X.25 async */
71#define N_6PACK 7
72#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
73#define N_R3964 9 /* Reserved for Simatic R3964 module */
74#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
75#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
76#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards
77 about SMS messages */
78#define N_HDLC 13 /* synchronous HDLC */
79#define N_SYNC_PPP 14
80#define N_HCI 15 /* Bluetooth HCI UART */
81
82#ifdef __KERNEL__
83
84#include <asm-generic/termios.h>
85
86#endif /* __KERNEL__ */
87
88#endif /* _ASM_MICROBLAZE_TERMIOS_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
new file mode 100644
index 000000000000..4c3943e3f403
--- /dev/null
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -0,0 +1,159 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_THREAD_INFO_H
10#define _ASM_MICROBLAZE_THREAD_INFO_H
11
12#ifdef __KERNEL__
13
14/* we have 8k stack */
15#define THREAD_SHIFT 13
16#define THREAD_SIZE (1 << THREAD_SHIFT)
17#define THREAD_SIZE_ORDER 1
18
19#ifndef __ASSEMBLY__
20# include <linux/types.h>
21# include <asm/processor.h>
22# include <asm/segment.h>
23
24/*
25 * low level task data that entry.S needs immediate access to
26 * - this struct should fit entirely inside of one cache line
27 * - this struct shares the supervisor stack pages
28 * - if the contents of this structure are changed, the assembly constants
29 * must also be changed
30 */
31
32struct cpu_context {
33 __u32 r1; /* stack pointer */
34 __u32 r2;
35 /* dedicated registers */
36 __u32 r13;
37 __u32 r14;
38 __u32 r15;
39 __u32 r16;
40 __u32 r17;
41 __u32 r18;
42 /* non-volatile registers */
43 __u32 r19;
44 __u32 r20;
45 __u32 r21;
46 __u32 r22;
47 __u32 r23;
48 __u32 r24;
49 __u32 r25;
50 __u32 r26;
51 __u32 r27;
52 __u32 r28;
53 __u32 r29;
54 __u32 r30;
55 /* r31 is used as current task pointer */
56 /* special purpose registers */
57 __u32 msr;
58 __u32 ear;
59 __u32 esr;
60 __u32 fsr;
61};
62
63struct thread_info {
64 struct task_struct *task; /* main task structure */
65 struct exec_domain *exec_domain; /* execution domain */
66 unsigned long flags; /* low level flags */
67 unsigned long status; /* thread-synchronous flags */
68 __u32 cpu; /* current CPU */
69 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
70 mm_segment_t addr_limit; /* thread address space */
71 struct restart_block restart_block;
72
73 struct cpu_context cpu_context;
74};
75
76/*
77 * macros/functions for gaining access to the thread information structure
78 *
79 * preempt_count needs to be 1 initially, until the scheduler is functional.
80 */
81#define INIT_THREAD_INFO(tsk) \
82{ \
83 .task = &tsk, \
84 .exec_domain = &default_exec_domain, \
85 .flags = 0, \
86 .cpu = 0, \
87 .preempt_count = 1, \
88 .addr_limit = KERNEL_DS, \
89 .restart_block = { \
90 .fn = do_no_restart_syscall, \
91 }, \
92}
93
94#define init_thread_info (init_thread_union.thread_info)
95#define init_stack (init_thread_union.stack)
96
97/* how to get the thread information struct from C */
98static inline struct thread_info *current_thread_info(void)
99{
100 register unsigned long sp asm("r1");
101
102 return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
103}
104
105/* thread information allocation */
106#endif /* __ASSEMBLY__ */
107
108#define PREEMPT_ACTIVE 0x10000000
109
110/*
111 * thread information flags
112 * - these are process state flags that various assembly files may
113 * need to access
114 * - pending work-to-be-done flags are in LSW
115 * - other flags in MSW
116 */
117#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
118#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
119#define TIF_SIGPENDING 2 /* signal pending */
120#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
121/* restore singlestep on return to user mode */
122#define TIF_SINGLESTEP 4
123#define TIF_IRET 5 /* return with iret */
124#define TIF_MEMDIE 6
125#define TIF_FREEZE 14 /* Freezing for suspend */
126
127/* FIXME change in entry.S */
128#define TIF_KERNEL_TRACE 8 /* kernel trace active */
129
130/* true if poll_idle() is polling TIF_NEED_RESCHED */
131#define TIF_POLLING_NRFLAG 16
132
133#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
134#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
135#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
136#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
137#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
138#define _TIF_IRET (1<<TIF_IRET)
139#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
140#define _TIF_FREEZE (1<<TIF_FREEZE)
141#define _TIF_KERNEL_TRACE (1 << TIF_KERNEL_TRACE)
142
143/* work to do on interrupt/exception return */
144#define _TIF_WORK_MASK 0x0000FFFE
145/* work to do on any return to u-space */
146#define _TIF_ALLWORK_MASK 0x0000FFFF
147
148/*
149 * Thread-synchronous status.
150 *
151 * This is different from the flags in that nobody else
152 * ever touches our thread-synchronous status, so we don't
153 * have to worry about atomic accesses.
154 */
155/* FPU was used by this task this quantum (SMP) */
156#define TS_USEDFPU 0x0001
157
158#endif /* __KERNEL__ */
159#endif /* _ASM_MICROBLAZE_THREAD_INFO_H */
diff --git a/arch/microblaze/include/asm/timex.h b/arch/microblaze/include/asm/timex.h
new file mode 100644
index 000000000000..678525dc6d0b
--- /dev/null
+++ b/arch/microblaze/include/asm/timex.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TIMEX_H
10#define _ASM_MICROBLAZE_TIMEX_H
11
12#define CLOCK_TICK_RATE 1000 /* Timer input freq. */
13
14typedef unsigned long cycles_t;
15
16#define get_cycles() (0)
17
18#endif /* _ASM_TIMEX_H */
diff --git a/arch/microblaze/include/asm/tlb.h b/arch/microblaze/include/asm/tlb.h
new file mode 100644
index 000000000000..d1dfe3791127
--- /dev/null
+++ b/arch/microblaze/include/asm/tlb.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TLB_H
10#define _ASM_MICROBLAZE_TLB_H
11
12#define tlb_flush(tlb) do {} while (0)
13
14#include <asm-generic/tlb.h>
15
16#endif /* _ASM_MICROBLAZE_TLB_H */
diff --git a/arch/microblaze/include/asm/tlbflush.h b/arch/microblaze/include/asm/tlbflush.h
new file mode 100644
index 000000000000..d7fe7629001b
--- /dev/null
+++ b/arch/microblaze/include/asm/tlbflush.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TLBFLUSH_H
10#define _ASM_MICROBLAZE_TLBFLUSH_H
11
12#define flush_tlb() BUG()
13#define flush_tlb_all() BUG()
14#define flush_tlb_mm(mm) BUG()
15#define flush_tlb_page(vma, addr) BUG()
16#define flush_tlb_range(mm, start, end) BUG()
17#define flush_tlb_pgtables(mm, start, end) BUG()
18#define flush_tlb_kernel_range(start, end) BUG()
19
20#endif /* _ASM_MICROBLAZE_TLBFLUSH_H */
diff --git a/arch/microblaze/include/asm/topology.h b/arch/microblaze/include/asm/topology.h
new file mode 100644
index 000000000000..96bcea5a9920
--- /dev/null
+++ b/arch/microblaze/include/asm/topology.h
@@ -0,0 +1,11 @@
1#include <asm-generic/topology.h>
2
3#ifndef _ASM_MICROBLAZE_TOPOLOGY_H
4#define _ASM_MICROBLAZE_TOPOLOGY_H
5
6struct device_node;
7static inline int of_node_to_nid(struct device_node *device)
8{
9 return 0;
10}
11#endif /* _ASM_MICROBLAZE_TOPOLOGY_H */
diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h
new file mode 100644
index 000000000000..bebc018318f5
--- /dev/null
+++ b/arch/microblaze/include/asm/types.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TYPES_H
10#define _ASM_MICROBLAZE_TYPES_H
11
12/*
13 * This file is never included by application software unless
14 * explicitly requested (e.g., via linux/types.h) in which case the
15 * application is Linux specific so (user-) name space pollution is
16 * not a major issue. However, for interoperability, libraries still
17 * need to be careful to avoid a name clashes.
18 */
19
20#include <asm-generic/int-ll64.h>
21
22# ifndef __ASSEMBLY__
23
24typedef unsigned short umode_t;
25
26/*
27 * These aren't exported outside the kernel to avoid name space clashes
28 */
29# ifdef __KERNEL__
30# define BITS_PER_LONG 32
31
32/* Dma addresses are 32-bits wide. */
33
34typedef u32 dma_addr_t;
35
36# endif/* __KERNEL__ */
37# endif /* __ASSEMBLY__ */
38#endif /* _ASM_MICROBLAZE_TYPES_H */
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
new file mode 100644
index 000000000000..5a3ffc308e12
--- /dev/null
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -0,0 +1,134 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_UACCESS_H
10#define _ASM_MICROBLAZE_UACCESS_H
11
12#ifdef __KERNEL__
13#ifndef __ASSEMBLY__
14
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/sched.h> /* RLIMIT_FSIZE */
18#include <linux/mm.h>
19
20#include <asm/mmu.h>
21#include <asm/page.h>
22#include <asm/pgtable.h>
23#include <asm/segment.h>
24#include <linux/string.h>
25
26#define VERIFY_READ 0
27#define VERIFY_WRITE 1
28
29extern int ___range_ok(unsigned long addr, unsigned long size);
30
31#define __range_ok(addr, size) \
32 ___range_ok((unsigned long)(addr), (unsigned long)(size))
33
34#define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0)
35#define __access_ok(add, size) (__range_ok((addr), (size)) == 0)
36
37extern inline int bad_user_access_length(void)
38{
39 return 0;
40}
41/* FIXME this is function for optimalization -> memcpy */
42#define __get_user(var, ptr) \
43 ({ \
44 int __gu_err = 0; \
45 switch (sizeof(*(ptr))) { \
46 case 1: \
47 case 2: \
48 case 4: \
49 (var) = *(ptr); \
50 break; \
51 case 8: \
52 memcpy((void *) &(var), (ptr), 8); \
53 break; \
54 default: \
55 (var) = 0; \
56 __gu_err = __get_user_bad(); \
57 break; \
58 } \
59 __gu_err; \
60 })
61
62#define __get_user_bad() (bad_user_access_length(), (-EFAULT))
63
64#define __put_user(var, ptr) \
65 ({ \
66 int __pu_err = 0; \
67 switch (sizeof(*(ptr))) { \
68 case 1: \
69 case 2: \
70 case 4: \
71 *(ptr) = (var); \
72 break; \
73 case 8: { \
74 typeof(*(ptr)) __pu_val = var; \
75 memcpy(ptr, &__pu_val, sizeof(__pu_val));\
76 } \
77 break; \
78 default: \
79 __pu_err = __put_user_bad(); \
80 break; \
81 } \
82 __pu_err; \
83 })
84
85#define __put_user_bad() (bad_user_access_length(), (-EFAULT))
86
87#define put_user(x, ptr) __put_user(x, ptr)
88#define get_user(x, ptr) __get_user(x, ptr)
89
90#define copy_to_user(to, from, n) (memcpy(to, from, n), 0)
91#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)
92
93#define __copy_to_user(to, from, n) (copy_to_user(to, from, n))
94#define __copy_from_user(to, from, n) (copy_from_user(to, from, n))
95#define __copy_to_user_inatomic(to, from, n) (__copy_to_user(to, from, n))
96#define __copy_from_user_inatomic(to, from, n) (__copy_from_user(to, from, n))
97
98#define __clear_user(addr, n) (memset((void *)addr, 0, n), 0)
99
100static inline unsigned long clear_user(void *addr, unsigned long size)
101{
102 if (access_ok(VERIFY_WRITE, addr, size))
103 size = __clear_user(addr, size);
104 return size;
105}
106
107/* Returns 0 if exception not found and fixup otherwise. */
108extern unsigned long search_exception_table(unsigned long);
109
110
111extern long strncpy_from_user(char *dst, const char __user *src, long count);
112extern long strnlen_user(const char __user *src, long count);
113extern long __strncpy_from_user(char *dst, const char __user *src, long count);
114
115/*
116 * The exception table consists of pairs of addresses: the first is the
117 * address of an instruction that is allowed to fault, and the second is
118 * the address at which the program should continue. No registers are
119 * modified, so it is entirely up to the continuation code to figure out
120 * what to do.
121 *
122 * All the routines below use bits of fixup code that are out of line
123 * with the main instruction path. This means when everything is well,
124 * we don't even have to jump over them. Further, they do not intrude
125 * on our cache or tlb entries.
126 */
127struct exception_table_entry {
128 unsigned long insn, fixup;
129};
130
131#endif /* __ASSEMBLY__ */
132#endif /* __KERNEL__ */
133
134#endif /* _ASM_MICROBLAZE_UACCESS_H */
diff --git a/arch/microblaze/include/asm/ucontext.h b/arch/microblaze/include/asm/ucontext.h
new file mode 100644
index 000000000000..11f6bb3ae3a4
--- /dev/null
+++ b/arch/microblaze/include/asm/ucontext.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_UCONTEXT_H
10#define _ASM_MICROBLAZE_UCONTEXT_H
11
12#include <asm/sigcontext.h>
13
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 struct sigcontext uc_mcontext;
19 sigset_t uc_sigmask; /* mask last for extensibility */
20};
21
22#endif /* _ASM_MICROBLAZE_UCONTEXT_H */
diff --git a/arch/microblaze/include/asm/unaligned.h b/arch/microblaze/include/asm/unaligned.h
new file mode 100644
index 000000000000..9d66b640c910
--- /dev/null
+++ b/arch/microblaze/include/asm/unaligned.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_UNALIGNED_H
11#define _ASM_MICROBLAZE_UNALIGNED_H
12
13# ifdef __KERNEL__
14
15# include <linux/unaligned/access_ok.h>
16# include <linux/unaligned/generic.h>
17
18# define get_unaligned __get_unaligned_be
19# define put_unaligned __put_unaligned_be
20
21# endif /* __KERNEL__ */
22#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
new file mode 100644
index 000000000000..d9d3903fde3f
--- /dev/null
+++ b/arch/microblaze/include/asm/unistd.h
@@ -0,0 +1,421 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_UNISTD_H
11#define _ASM_MICROBLAZE_UNISTD_H
12
13#define __NR_restart_syscall 0 /* ok */
14#define __NR_exit 1 /* ok */
15#define __NR_fork 2 /* not for no MMU - weird */
16#define __NR_read 3 /* ok */
17#define __NR_write 4 /* ok */
18#define __NR_open 5 /* openat */
19#define __NR_close 6 /* ok */
20#define __NR_waitpid 7 /* waitid */
21#define __NR_creat 8 /* openat */
22#define __NR_link 9 /* linkat */
23#define __NR_unlink 10 /* unlinkat */
24#define __NR_execve 11 /* ok */
25#define __NR_chdir 12 /* ok */
26#define __NR_time 13 /* obsolete -> sys_gettimeofday */
27#define __NR_mknod 14 /* mknodat */
28#define __NR_chmod 15 /* fchmodat */
29#define __NR_lchown 16 /* ok */
30#define __NR_break 17 /* don't know */
31#define __NR_oldstat 18 /* remove */
32#define __NR_lseek 19 /* ok */
33#define __NR_getpid 20 /* ok */
34#define __NR_mount 21 /* ok */
35#define __NR_umount 22 /* ok */ /* use only umount2 */
36#define __NR_setuid 23 /* ok */
37#define __NR_getuid 24 /* ok */
38#define __NR_stime 25 /* obsolete -> sys_settimeofday */
39#define __NR_ptrace 26 /* ok */
40#define __NR_alarm 27 /* obsolete -> sys_setitimer */
41#define __NR_oldfstat 28 /* remove */
42#define __NR_pause 29 /* obsolete -> sys_rt_sigtimedwait */
43#define __NR_utime 30 /* obsolete -> sys_utimesat */
44#define __NR_stty 31 /* remove */
45#define __NR_gtty 32 /* remove */
46#define __NR_access 33 /* faccessat */
47/* can be implemented by sys_setpriority */
48#define __NR_nice 34
49#define __NR_ftime 35 /* remove */
50#define __NR_sync 36 /* ok */
51#define __NR_kill 37 /* ok */
52#define __NR_rename 38 /* renameat */
53#define __NR_mkdir 39 /* mkdirat */
54#define __NR_rmdir 40 /* unlinkat */
55#define __NR_dup 41 /* ok */
56#define __NR_pipe 42 /* ok */
57#define __NR_times 43 /* ok */
58#define __NR_prof 44 /* remove */
59#define __NR_brk 45 /* ok -mmu, nommu specific */
60#define __NR_setgid 46 /* ok */
61#define __NR_getgid 47 /* ok */
62#define __NR_signal 48 /* obsolete -> sys_rt_sigaction */
63#define __NR_geteuid 49 /* ok */
64#define __NR_getegid 50 /* ok */
65#define __NR_acct 51 /* add it and then I can disable it */
66#define __NR_umount2 52 /* remove */
67#define __NR_lock 53 /* remove */
68#define __NR_ioctl 54 /* ok */
69#define __NR_fcntl 55 /* ok -> 64bit version*/
70#define __NR_mpx 56 /* remove */
71#define __NR_setpgid 57 /* ok */
72#define __NR_ulimit 58 /* remove */
73#define __NR_oldolduname 59 /* remove */
74#define __NR_umask 60 /* ok */
75#define __NR_chroot 61 /* ok */
76#define __NR_ustat 62 /* obsolete -> statfs64 */
77#define __NR_dup2 63 /* ok */
78#define __NR_getppid 64 /* ok */
79#define __NR_getpgrp 65 /* obsolete -> sys_getpgid */
80#define __NR_setsid 66 /* ok */
81#define __NR_sigaction 67 /* obsolete -> rt_sigaction */
82#define __NR_sgetmask 68 /* obsolete -> sys_rt_sigprocmask */
83#define __NR_ssetmask 69 /* obsolete ->sys_rt_sigprocmask */
84#define __NR_setreuid 70 /* ok */
85#define __NR_setregid 71 /* ok */
86#define __NR_sigsuspend 72 /* obsolete -> rt_sigsuspend */
87#define __NR_sigpending 73 /* obsolete -> sys_rt_sigpending */
88#define __NR_sethostname 74 /* ok */
89#define __NR_setrlimit 75 /* ok */
90#define __NR_getrlimit 76 /* ok Back compatible 2G limited rlimit */
91#define __NR_getrusage 77 /* ok */
92#define __NR_gettimeofday 78 /* ok */
93#define __NR_settimeofday 79 /* ok */
94#define __NR_getgroups 80 /* ok */
95#define __NR_setgroups 81 /* ok */
96#define __NR_select 82 /* obsolete -> sys_pselect7 */
97#define __NR_symlink 83 /* symlinkat */
98#define __NR_oldlstat 84 /* remove */
99#define __NR_readlink 85 /* obsolete -> sys_readlinkat */
100#define __NR_uselib 86 /* remove */
101#define __NR_swapon 87 /* ok */
102#define __NR_reboot 88 /* ok */
103#define __NR_readdir 89 /* remove ? */
104#define __NR_mmap 90 /* obsolete -> sys_mmap2 */
105#define __NR_munmap 91 /* ok - mmu and nommu */
106#define __NR_truncate 92 /* ok or truncate64 */
107#define __NR_ftruncate 93 /* ok or ftruncate64 */
108#define __NR_fchmod 94 /* ok */
109#define __NR_fchown 95 /* ok */
110#define __NR_getpriority 96 /* ok */
111#define __NR_setpriority 97 /* ok */
112#define __NR_profil 98 /* remove */
113#define __NR_statfs 99 /* ok or statfs64 */
114#define __NR_fstatfs 100 /* ok or fstatfs64 */
115#define __NR_ioperm 101 /* remove */
116#define __NR_socketcall 102 /* remove */
117#define __NR_syslog 103 /* ok */
118#define __NR_setitimer 104 /* ok */
119#define __NR_getitimer 105 /* ok */
120#define __NR_stat 106 /* remove */
121#define __NR_lstat 107 /* remove */
122#define __NR_fstat 108 /* remove */
123#define __NR_olduname 109 /* remove */
124#define __NR_iopl 110 /* remove */
125#define __NR_vhangup 111 /* ok */
126#define __NR_idle 112 /* remove */
127#define __NR_vm86old 113 /* remove */
128#define __NR_wait4 114 /* obsolete -> waitid */
129#define __NR_swapoff 115 /* ok */
130#define __NR_sysinfo 116 /* ok */
131#define __NR_ipc 117 /* remove - direct call */
132#define __NR_fsync 118 /* ok */
133#define __NR_sigreturn 119 /* obsolete -> sys_rt_sigreturn */
134#define __NR_clone 120 /* ok */
135#define __NR_setdomainname 121 /* ok */
136#define __NR_uname 122 /* remove */
137#define __NR_modify_ldt 123 /* remove */
138#define __NR_adjtimex 124 /* ok */
139#define __NR_mprotect 125 /* remove */
140#define __NR_sigprocmask 126 /* obsolete -> sys_rt_sigprocmask */
141#define __NR_create_module 127 /* remove */
142#define __NR_init_module 128 /* ok */
143#define __NR_delete_module 129 /* ok */
144#define __NR_get_kernel_syms 130 /* remove */
145#define __NR_quotactl 131 /* ok */
146#define __NR_getpgid 132 /* ok */
147#define __NR_fchdir 133 /* ok */
148#define __NR_bdflush 134 /* remove */
149#define __NR_sysfs 135 /* needed for busybox */
150#define __NR_personality 136 /* ok */
151#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
152#define __NR_setfsuid 138 /* ok */
153#define __NR_setfsgid 139 /* ok */
154#define __NR__llseek 140 /* remove only lseek */
155#define __NR_getdents 141 /* ok or getdents64 */
156#define __NR__newselect 142 /* remove */
157#define __NR_flock 143 /* ok */
158#define __NR_msync 144 /* remove */
159#define __NR_readv 145 /* ok */
160#define __NR_writev 146 /* ok */
161#define __NR_getsid 147 /* ok */
162#define __NR_fdatasync 148 /* ok */
163#define __NR__sysctl 149 /* remove */
164#define __NR_mlock 150 /* ok - nommu or mmu */
165#define __NR_munlock 151 /* ok - nommu or mmu */
166#define __NR_mlockall 152 /* ok - nommu or mmu */
167#define __NR_munlockall 153 /* ok - nommu or mmu */
168#define __NR_sched_setparam 154 /* ok */
169#define __NR_sched_getparam 155 /* ok */
170#define __NR_sched_setscheduler 156 /* ok */
171#define __NR_sched_getscheduler 157 /* ok */
172#define __NR_sched_yield 158 /* ok */
173#define __NR_sched_get_priority_max 159 /* ok */
174#define __NR_sched_get_priority_min 160 /* ok */
175#define __NR_sched_rr_get_interval 161 /* ok */
176#define __NR_nanosleep 162 /* ok */
177#define __NR_mremap 163 /* ok - nommu or mmu */
178#define __NR_setresuid 164 /* ok */
179#define __NR_getresuid 165 /* ok */
180#define __NR_vm86 166 /* remove */
181#define __NR_query_module 167 /* ok */
182#define __NR_poll 168 /* obsolete -> sys_ppoll */
183#define __NR_nfsservctl 169 /* ok */
184#define __NR_setresgid 170 /* ok */
185#define __NR_getresgid 171 /* ok */
186#define __NR_prctl 172 /* ok */
187#define __NR_rt_sigreturn 173 /* ok */
188#define __NR_rt_sigaction 174 /* ok */
189#define __NR_rt_sigprocmask 175 /* ok */
190#define __NR_rt_sigpending 176 /* ok */
191#define __NR_rt_sigtimedwait 177 /* ok */
192#define __NR_rt_sigqueueinfo 178 /* ok */
193#define __NR_rt_sigsuspend 179 /* ok */
194#define __NR_pread64 180 /* ok */
195#define __NR_pwrite64 181 /* ok */
196#define __NR_chown 182 /* obsolete -> fchownat */
197#define __NR_getcwd 183 /* ok */
198#define __NR_capget 184 /* ok */
199#define __NR_capset 185 /* ok */
200#define __NR_sigaltstack 186 /* remove */
201#define __NR_sendfile 187 /* ok -> exist 64bit version*/
202#define __NR_getpmsg 188 /* remove */
203/* remove - some people actually want streams */
204#define __NR_putpmsg 189
205/* for noMMU - group with clone -> maybe remove */
206#define __NR_vfork 190
207#define __NR_ugetrlimit 191 /* remove - SuS compliant getrlimit */
208#define __NR_mmap2 192 /* ok */
209#define __NR_truncate64 193 /* ok */
210#define __NR_ftruncate64 194 /* ok */
211#define __NR_stat64 195 /* remove _ARCH_WANT_STAT64 */
212#define __NR_lstat64 196 /* remove _ARCH_WANT_STAT64 */
213#define __NR_fstat64 197 /* remove _ARCH_WANT_STAT64 */
214#define __NR_lchown32 198 /* ok - without 32 */
215#define __NR_getuid32 199 /* ok - without 32 */
216#define __NR_getgid32 200 /* ok - without 32 */
217#define __NR_geteuid32 201 /* ok - without 32 */
218#define __NR_getegid32 202 /* ok - without 32 */
219#define __NR_setreuid32 203 /* ok - without 32 */
220#define __NR_setregid32 204 /* ok - without 32 */
221#define __NR_getgroups32 205 /* ok - without 32 */
222#define __NR_setgroups32 206 /* ok - without 32 */
223#define __NR_fchown32 207 /* ok - without 32 */
224#define __NR_setresuid32 208 /* ok - without 32 */
225#define __NR_getresuid32 209 /* ok - without 32 */
226#define __NR_setresgid32 210 /* ok - without 32 */
227#define __NR_getresgid32 211 /* ok - without 32 */
228#define __NR_chown32 212 /* ok - without 32 -obsolete -> fchownat */
229#define __NR_setuid32 213 /* ok - without 32 */
230#define __NR_setgid32 214 /* ok - without 32 */
231#define __NR_setfsuid32 215 /* ok - without 32 */
232#define __NR_setfsgid32 216 /* ok - without 32 */
233#define __NR_pivot_root 217 /* ok */
234#define __NR_mincore 218 /* ok */
235#define __NR_madvise 219 /* ok */
236#define __NR_getdents64 220 /* ok */
237#define __NR_fcntl64 221 /* ok */
238/* 223 is unused */
239#define __NR_gettid 224 /* ok */
240#define __NR_readahead 225 /* ok */
241#define __NR_setxattr 226 /* ok */
242#define __NR_lsetxattr 227 /* ok */
243#define __NR_fsetxattr 228 /* ok */
244#define __NR_getxattr 229 /* ok */
245#define __NR_lgetxattr 230 /* ok */
246#define __NR_fgetxattr 231 /* ok */
247#define __NR_listxattr 232 /* ok */
248#define __NR_llistxattr 233 /* ok */
249#define __NR_flistxattr 234 /* ok */
250#define __NR_removexattr 235 /* ok */
251#define __NR_lremovexattr 236 /* ok */
252#define __NR_fremovexattr 237 /* ok */
253#define __NR_tkill 238 /* ok */
254#define __NR_sendfile64 239 /* ok */
255#define __NR_futex 240 /* ok */
256#define __NR_sched_setaffinity 241 /* ok */
257#define __NR_sched_getaffinity 242 /* ok */
258#define __NR_set_thread_area 243 /* remove */
259#define __NR_get_thread_area 244 /* remove */
260#define __NR_io_setup 245 /* ok */
261#define __NR_io_destroy 246 /* ok */
262#define __NR_io_getevents 247 /* ok */
263#define __NR_io_submit 248 /* ok */
264#define __NR_io_cancel 249 /* ok */
265#define __NR_fadvise64 250 /* remove -> sys_fadvise64_64 */
266/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
267#define __NR_exit_group 252 /* ok */
268#define __NR_lookup_dcookie 253 /* ok */
269#define __NR_epoll_create 254 /* ok */
270#define __NR_epoll_ctl 255 /* ok */
271#define __NR_epoll_wait 256 /* obsolete -> sys_epoll_pwait */
272#define __NR_remap_file_pages 257 /* only for mmu */
273#define __NR_set_tid_address 258 /* ok */
274#define __NR_timer_create 259 /* ok */
275#define __NR_timer_settime (__NR_timer_create+1) /* 260 */ /* ok */
276#define __NR_timer_gettime (__NR_timer_create+2) /* 261 */ /* ok */
277#define __NR_timer_getoverrun (__NR_timer_create+3) /* 262 */ /* ok */
278#define __NR_timer_delete (__NR_timer_create+4) /* 263 */ /* ok */
279#define __NR_clock_settime (__NR_timer_create+5) /* 264 */ /* ok */
280#define __NR_clock_gettime (__NR_timer_create+6) /* 265 */ /* ok */
281#define __NR_clock_getres (__NR_timer_create+7) /* 266 */ /* ok */
282#define __NR_clock_nanosleep (__NR_timer_create+8) /* 267 */ /* ok */
283#define __NR_statfs64 268 /* ok */
284#define __NR_fstatfs64 269 /* ok */
285#define __NR_tgkill 270 /* ok */
286#define __NR_utimes 271 /* obsolete -> sys_futimesat */
287#define __NR_fadvise64_64 272 /* ok */
288#define __NR_vserver 273 /* ok */
289#define __NR_mbind 274 /* only for mmu */
290#define __NR_get_mempolicy 275 /* only for mmu */
291#define __NR_set_mempolicy 276 /* only for mmu */
292#define __NR_mq_open 277 /* ok */
293#define __NR_mq_unlink (__NR_mq_open+1) /* 278 */ /* ok */
294#define __NR_mq_timedsend (__NR_mq_open+2) /* 279 */ /* ok */
295#define __NR_mq_timedreceive (__NR_mq_open+3) /* 280 */ /* ok */
296#define __NR_mq_notify (__NR_mq_open+4) /* 281 */ /* ok */
297#define __NR_mq_getsetattr (__NR_mq_open+5) /* 282 */ /* ok */
298#define __NR_kexec_load 283 /* ok */
299#define __NR_waitid 284 /* ok */
300/* #define __NR_sys_setaltroot 285 */
301#define __NR_add_key 286 /* ok */
302#define __NR_request_key 287 /* ok */
303#define __NR_keyctl 288 /* ok */
304#define __NR_ioprio_set 289 /* ok */
305#define __NR_ioprio_get 290 /* ok */
306#define __NR_inotify_init 291 /* ok */
307#define __NR_inotify_add_watch 292 /* ok */
308#define __NR_inotify_rm_watch 293 /* ok */
309#define __NR_migrate_pages 294 /* mmu */
310#define __NR_openat 295 /* ok */
311#define __NR_mkdirat 296 /* ok */
312#define __NR_mknodat 297 /* ok */
313#define __NR_fchownat 298 /* ok */
314#define __NR_futimesat 299 /* obsolete -> sys_utimesat */
315#define __NR_fstatat64 300 /* stat64 */
316#define __NR_unlinkat 301 /* ok */
317#define __NR_renameat 302 /* ok */
318#define __NR_linkat 303 /* ok */
319#define __NR_symlinkat 304 /* ok */
320#define __NR_readlinkat 305 /* ok */
321#define __NR_fchmodat 306 /* ok */
322#define __NR_faccessat 307 /* ok */
323#define __NR_pselect6 308 /* obsolete -> sys_pselect7 */
324#define __NR_ppoll 309 /* ok */
325#define __NR_unshare 310 /* ok */
326#define __NR_set_robust_list 311 /* ok */
327#define __NR_get_robust_list 312 /* ok */
328#define __NR_splice 313 /* ok */
329#define __NR_sync_file_range 314 /* ok */
330#define __NR_tee 315 /* ok */
331#define __NR_vmsplice 316 /* ok */
332#define __NR_move_pages 317 /* mmu */
333#define __NR_getcpu 318 /* ok */
334#define __NR_epoll_pwait 319 /* ok */
335#define __NR_utimensat 320 /* ok */
336#define __NR_signalfd 321 /* ok */
337#define __NR_timerfd_create 322 /* ok */
338#define __NR_eventfd 323 /* ok */
339#define __NR_fallocate 324 /* ok */
340#define __NR_semtimedop 325 /* ok - semaphore group */
341#define __NR_timerfd_settime 326 /* ok */
342#define __NR_timerfd_gettime 327 /* ok */
343/* sysv ipc syscalls */
344#define __NR_semctl 328 /* ok */
345#define __NR_semget 329 /* ok */
346#define __NR_semop 330 /* ok */
347#define __NR_msgctl 331 /* ok */
348#define __NR_msgget 332 /* ok */
349#define __NR_msgrcv 333 /* ok */
350#define __NR_msgsnd 334 /* ok */
351#define __NR_shmat 335 /* ok */
352#define __NR_shmctl 336 /* ok */
353#define __NR_shmdt 337 /* ok */
354#define __NR_shmget 338 /* ok */
355
356
357#define __NR_signalfd4 339 /* new */
358#define __NR_eventfd2 340 /* new */
359#define __NR_epoll_create1 341 /* new */
360#define __NR_dup3 342 /* new */
361#define __NR_pipe2 343 /* new */
362#define __NR_inotify_init1 344 /* new */
363#define __NR_socket 345 /* new */
364#define __NR_socketpair 346 /* new */
365#define __NR_bind 347 /* new */
366#define __NR_listen 348 /* new */
367#define __NR_accept 349 /* new */
368#define __NR_connect 350 /* new */
369#define __NR_getsockname 351 /* new */
370#define __NR_getpeername 352 /* new */
371#define __NR_sendto 353 /* new */
372#define __NR_send 354 /* new */
373#define __NR_recvfrom 355 /* new */
374#define __NR_recv 356 /* new */
375#define __NR_setsockopt 357 /* new */
376#define __NR_getsockopt 358 /* new */
377#define __NR_shutdown 359 /* new */
378#define __NR_sendmsg 360 /* new */
379#define __NR_recvmsg 361 /* new */
380#define __NR_accept04 362 /* new */
381
382#define __NR_syscalls 363
383
384#ifdef __KERNEL__
385#ifndef __ASSEMBLY__
386
387#define __ARCH_WANT_IPC_PARSE_VERSION
388/* #define __ARCH_WANT_OLD_READDIR */
389/* #define __ARCH_WANT_OLD_STAT */
390#define __ARCH_WANT_STAT64
391#define __ARCH_WANT_SYS_ALARM
392#define __ARCH_WANT_SYS_GETHOSTNAME
393#define __ARCH_WANT_SYS_PAUSE
394#define __ARCH_WANT_SYS_SGETMASK
395#define __ARCH_WANT_SYS_SIGNAL
396#define __ARCH_WANT_SYS_TIME
397#define __ARCH_WANT_SYS_UTIME
398#define __ARCH_WANT_SYS_WAITPID
399#define __ARCH_WANT_SYS_SOCKETCALL
400#define __ARCH_WANT_SYS_FADVISE64
401#define __ARCH_WANT_SYS_GETPGRP
402#define __ARCH_WANT_SYS_LLSEEK
403#define __ARCH_WANT_SYS_NICE
404/* #define __ARCH_WANT_SYS_OLD_GETRLIMIT */
405#define __ARCH_WANT_SYS_OLDUMOUNT
406#define __ARCH_WANT_SYS_SIGPENDING
407#define __ARCH_WANT_SYS_SIGPROCMASK
408#define __ARCH_WANT_SYS_RT_SIGACTION
409/* #define __ARCH_WANT_SYS_RT_SIGSUSPEND */
410
411/*
412 * "Conditional" syscalls
413 *
414 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
415 * but it doesn't work on all toolchains, so we just do it by hand
416 */
417#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
418
419#endif /* __ASSEMBLY__ */
420#endif /* __KERNEL__ */
421#endif /* _ASM_MICROBLAZE_UNISTD_H */
diff --git a/arch/microblaze/include/asm/user.h b/arch/microblaze/include/asm/user.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/user.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/vga.h b/arch/microblaze/include/asm/vga.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/vga.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/xor.h b/arch/microblaze/include/asm/xor.h
new file mode 100644
index 000000000000..c82eb12a5b18
--- /dev/null
+++ b/arch/microblaze/include/asm/xor.h
@@ -0,0 +1 @@
#include <asm-generic/xor.h>