diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/unicore32/include/asm | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'arch/unicore32/include/asm')
-rw-r--r-- | arch/unicore32/include/asm/Kbuild | 5 | ||||
-rw-r--r-- | arch/unicore32/include/asm/barrier.h | 28 | ||||
-rw-r--r-- | arch/unicore32/include/asm/bitops.h | 12 | ||||
-rw-r--r-- | arch/unicore32/include/asm/bug.h | 22 | ||||
-rw-r--r-- | arch/unicore32/include/asm/cmpxchg.h | 61 | ||||
-rw-r--r-- | arch/unicore32/include/asm/dma-mapping.h | 18 | ||||
-rw-r--r-- | arch/unicore32/include/asm/hwdef-copro.h | 48 | ||||
-rw-r--r-- | arch/unicore32/include/asm/io.h | 11 | ||||
-rw-r--r-- | arch/unicore32/include/asm/pci.h | 6 | ||||
-rw-r--r-- | arch/unicore32/include/asm/processor.h | 9 | ||||
-rw-r--r-- | arch/unicore32/include/asm/ptrace.h | 77 | ||||
-rw-r--r-- | arch/unicore32/include/asm/switch_to.h | 30 | ||||
-rw-r--r-- | arch/unicore32/include/asm/thread_info.h | 6 | ||||
-rw-r--r-- | arch/unicore32/include/asm/uaccess.h | 1 |
14 files changed, 117 insertions, 217 deletions
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 89d8b6c4e39..ca113d6999c 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild | |||
@@ -1,16 +1,16 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
1 | 2 | ||
2 | generic-y += atomic.h | 3 | generic-y += atomic.h |
3 | generic-y += auxvec.h | 4 | generic-y += auxvec.h |
4 | generic-y += bitsperlong.h | 5 | generic-y += bitsperlong.h |
6 | generic-y += bug.h | ||
5 | generic-y += bugs.h | 7 | generic-y += bugs.h |
6 | generic-y += clkdev.h | ||
7 | generic-y += cputime.h | 8 | generic-y += cputime.h |
8 | generic-y += current.h | 9 | generic-y += current.h |
9 | generic-y += device.h | 10 | generic-y += device.h |
10 | generic-y += div64.h | 11 | generic-y += div64.h |
11 | generic-y += emergency-restart.h | 12 | generic-y += emergency-restart.h |
12 | generic-y += errno.h | 13 | generic-y += errno.h |
13 | generic-y += exec.h | ||
14 | generic-y += fb.h | 14 | generic-y += fb.h |
15 | generic-y += fcntl.h | 15 | generic-y += fcntl.h |
16 | generic-y += ftrace.h | 16 | generic-y += ftrace.h |
@@ -53,7 +53,6 @@ generic-y += syscalls.h | |||
53 | generic-y += termbits.h | 53 | generic-y += termbits.h |
54 | generic-y += termios.h | 54 | generic-y += termios.h |
55 | generic-y += topology.h | 55 | generic-y += topology.h |
56 | generic-y += trace_clock.h | ||
57 | generic-y += types.h | 56 | generic-y += types.h |
58 | generic-y += ucontext.h | 57 | generic-y += ucontext.h |
59 | generic-y += unaligned.h | 58 | generic-y += unaligned.h |
diff --git a/arch/unicore32/include/asm/barrier.h b/arch/unicore32/include/asm/barrier.h deleted file mode 100644 index a6620e5336b..00000000000 --- a/arch/unicore32/include/asm/barrier.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * Memory barrier implementations for PKUnity SoC and UniCore ISA | ||
3 | * | ||
4 | * Copyright (C) 2001-2012 GUAN Xue-tao | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __UNICORE_BARRIER_H__ | ||
11 | #define __UNICORE_BARRIER_H__ | ||
12 | |||
13 | #define isb() __asm__ __volatile__ ("" : : : "memory") | ||
14 | #define dsb() __asm__ __volatile__ ("" : : : "memory") | ||
15 | #define dmb() __asm__ __volatile__ ("" : : : "memory") | ||
16 | |||
17 | #define mb() barrier() | ||
18 | #define rmb() barrier() | ||
19 | #define wmb() barrier() | ||
20 | #define smp_mb() barrier() | ||
21 | #define smp_rmb() barrier() | ||
22 | #define smp_wmb() barrier() | ||
23 | #define read_barrier_depends() do { } while (0) | ||
24 | #define smp_read_barrier_depends() do { } while (0) | ||
25 | |||
26 | #define set_mb(var, value) do { var = value; smp_mb(); } while (0) | ||
27 | |||
28 | #endif /* __UNICORE_BARRIER_H__ */ | ||
diff --git a/arch/unicore32/include/asm/bitops.h b/arch/unicore32/include/asm/bitops.h index 401f597bc38..1628a632899 100644 --- a/arch/unicore32/include/asm/bitops.h +++ b/arch/unicore32/include/asm/bitops.h | |||
@@ -13,6 +13,12 @@ | |||
13 | #ifndef __UNICORE_BITOPS_H__ | 13 | #ifndef __UNICORE_BITOPS_H__ |
14 | #define __UNICORE_BITOPS_H__ | 14 | #define __UNICORE_BITOPS_H__ |
15 | 15 | ||
16 | #define find_next_bit __uc32_find_next_bit | ||
17 | #define find_next_zero_bit __uc32_find_next_zero_bit | ||
18 | |||
19 | #define find_first_bit __uc32_find_first_bit | ||
20 | #define find_first_zero_bit __uc32_find_first_zero_bit | ||
21 | |||
16 | #define _ASM_GENERIC_BITOPS_FLS_H_ | 22 | #define _ASM_GENERIC_BITOPS_FLS_H_ |
17 | #define _ASM_GENERIC_BITOPS___FLS_H_ | 23 | #define _ASM_GENERIC_BITOPS___FLS_H_ |
18 | #define _ASM_GENERIC_BITOPS_FFS_H_ | 24 | #define _ASM_GENERIC_BITOPS_FFS_H_ |
@@ -38,10 +44,4 @@ static inline int fls(int x) | |||
38 | 44 | ||
39 | #include <asm-generic/bitops.h> | 45 | #include <asm-generic/bitops.h> |
40 | 46 | ||
41 | /* following definitions: to avoid using codes in lib/find_*.c */ | ||
42 | #define find_next_bit find_next_bit | ||
43 | #define find_next_zero_bit find_next_zero_bit | ||
44 | #define find_first_bit find_first_bit | ||
45 | #define find_first_zero_bit find_first_zero_bit | ||
46 | |||
47 | #endif /* __UNICORE_BITOPS_H__ */ | 47 | #endif /* __UNICORE_BITOPS_H__ */ |
diff --git a/arch/unicore32/include/asm/bug.h b/arch/unicore32/include/asm/bug.h deleted file mode 100644 index 93a56f3e234..00000000000 --- a/arch/unicore32/include/asm/bug.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Bug handling for PKUnity SoC and UniCore ISA | ||
3 | * | ||
4 | * Copyright (C) 2001-2012 GUAN Xue-tao | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __UNICORE_BUG_H__ | ||
11 | #define __UNICORE_BUG_H__ | ||
12 | |||
13 | #include <asm-generic/bug.h> | ||
14 | |||
15 | struct pt_regs; | ||
16 | struct siginfo; | ||
17 | |||
18 | extern void die(const char *msg, struct pt_regs *regs, int err); | ||
19 | extern void uc32_notify_die(const char *str, struct pt_regs *regs, | ||
20 | struct siginfo *info, unsigned long err, unsigned long trap); | ||
21 | |||
22 | #endif /* __UNICORE_BUG_H__ */ | ||
diff --git a/arch/unicore32/include/asm/cmpxchg.h b/arch/unicore32/include/asm/cmpxchg.h deleted file mode 100644 index 8e797ad4fa2..00000000000 --- a/arch/unicore32/include/asm/cmpxchg.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * Atomics xchg/cmpxchg for PKUnity SoC and UniCore ISA | ||
3 | * | ||
4 | * Copyright (C) 2001-2012 GUAN Xue-tao | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __UNICORE_CMPXCHG_H__ | ||
11 | #define __UNICORE_CMPXCHG_H__ | ||
12 | |||
13 | /* | ||
14 | * Generate a link failure on undefined symbol if the pointer points to a value | ||
15 | * of unsupported size. | ||
16 | */ | ||
17 | extern void __xchg_bad_pointer(void); | ||
18 | |||
19 | static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | ||
20 | int size) | ||
21 | { | ||
22 | unsigned long ret; | ||
23 | |||
24 | switch (size) { | ||
25 | case 1: | ||
26 | asm volatile("swapb %0, %1, [%2]" | ||
27 | : "=&r" (ret) | ||
28 | : "r" (x), "r" (ptr) | ||
29 | : "memory", "cc"); | ||
30 | break; | ||
31 | case 4: | ||
32 | asm volatile("swapw %0, %1, [%2]" | ||
33 | : "=&r" (ret) | ||
34 | : "r" (x), "r" (ptr) | ||
35 | : "memory", "cc"); | ||
36 | break; | ||
37 | default: | ||
38 | __xchg_bad_pointer(); | ||
39 | } | ||
40 | |||
41 | return ret; | ||
42 | } | ||
43 | |||
44 | #define xchg(ptr, x) \ | ||
45 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) | ||
46 | |||
47 | #include <asm-generic/cmpxchg-local.h> | ||
48 | |||
49 | /* | ||
50 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
51 | * them available. | ||
52 | */ | ||
53 | #define cmpxchg_local(ptr, o, n) \ | ||
54 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \ | ||
55 | (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr)))) | ||
56 | #define cmpxchg64_local(ptr, o, n) \ | ||
57 | __cmpxchg64_local_generic((ptr), (o), (n)) | ||
58 | |||
59 | #include <asm-generic/cmpxchg.h> | ||
60 | |||
61 | #endif /* __UNICORE_CMPXCHG_H__ */ | ||
diff --git a/arch/unicore32/include/asm/dma-mapping.h b/arch/unicore32/include/asm/dma-mapping.h index 366460a8179..9258e592f41 100644 --- a/arch/unicore32/include/asm/dma-mapping.h +++ b/arch/unicore32/include/asm/dma-mapping.h | |||
@@ -82,26 +82,20 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) | 85 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
86 | 86 | dma_addr_t *dma_handle, gfp_t flag) | |
87 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
88 | dma_addr_t *dma_handle, gfp_t flag, | ||
89 | struct dma_attrs *attrs) | ||
90 | { | 87 | { |
91 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 88 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
92 | 89 | ||
93 | return dma_ops->alloc(dev, size, dma_handle, flag, attrs); | 90 | return dma_ops->alloc_coherent(dev, size, dma_handle, flag); |
94 | } | 91 | } |
95 | 92 | ||
96 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) | 93 | static inline void dma_free_coherent(struct device *dev, size_t size, |
97 | 94 | void *cpu_addr, dma_addr_t dma_handle) | |
98 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
99 | void *cpu_addr, dma_addr_t dma_handle, | ||
100 | struct dma_attrs *attrs) | ||
101 | { | 95 | { |
102 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 96 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
103 | 97 | ||
104 | dma_ops->free(dev, size, cpu_addr, dma_handle, attrs); | 98 | dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); |
105 | } | 99 | } |
106 | 100 | ||
107 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 101 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
diff --git a/arch/unicore32/include/asm/hwdef-copro.h b/arch/unicore32/include/asm/hwdef-copro.h deleted file mode 100644 index a3292f039a6..00000000000 --- a/arch/unicore32/include/asm/hwdef-copro.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Co-processor register definitions for PKUnity SoC and UniCore ISA | ||
3 | * | ||
4 | * Copyright (C) 2001-2012 GUAN Xue-tao | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __UNICORE_HWDEF_COPRO_H__ | ||
11 | #define __UNICORE_HWDEF_COPRO_H__ | ||
12 | |||
13 | /* | ||
14 | * Control Register bits (CP#0 CR1) | ||
15 | */ | ||
16 | #define CR_M (1 << 0) /* MMU enable */ | ||
17 | #define CR_A (1 << 1) /* Alignment abort enable */ | ||
18 | #define CR_D (1 << 2) /* Dcache enable */ | ||
19 | #define CR_I (1 << 3) /* Icache enable */ | ||
20 | #define CR_B (1 << 4) /* Dcache write mechanism: write back */ | ||
21 | #define CR_T (1 << 5) /* Burst enable */ | ||
22 | #define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */ | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | #define vectors_high() (cr_alignment & CR_V) | ||
27 | |||
28 | extern unsigned long cr_no_alignment; /* defined in entry.S */ | ||
29 | extern unsigned long cr_alignment; /* defined in entry.S */ | ||
30 | |||
31 | static inline unsigned int get_cr(void) | ||
32 | { | ||
33 | unsigned int val; | ||
34 | asm("movc %0, p0.c1, #0" : "=r" (val) : : "cc"); | ||
35 | return val; | ||
36 | } | ||
37 | |||
38 | static inline void set_cr(unsigned int val) | ||
39 | { | ||
40 | asm volatile("movc p0.c1, %0, #0" : : "r" (val) : "cc"); | ||
41 | isb(); | ||
42 | } | ||
43 | |||
44 | extern void adjust_cr(unsigned long mask, unsigned long set); | ||
45 | |||
46 | #endif /* __ASSEMBLY__ */ | ||
47 | |||
48 | #endif /* __UNICORE_HWDEF_COPRO_H__ */ | ||
diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include/asm/io.h index 39decb6e6f5..4bd87f3d13d 100644 --- a/arch/unicore32/include/asm/io.h +++ b/arch/unicore32/include/asm/io.h | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <asm/byteorder.h> | 17 | #include <asm/byteorder.h> |
18 | #include <asm/memory.h> | 18 | #include <asm/memory.h> |
19 | #include <asm/system.h> | ||
19 | 20 | ||
20 | #define PCI_IOBASE PKUNITY_PCILIO_BASE | 21 | #define PCI_IOBASE PKUNITY_PCILIO_BASE |
21 | #include <asm-generic/io.h> | 22 | #include <asm-generic/io.h> |
@@ -31,14 +32,20 @@ extern void __uc32_iounmap(volatile void __iomem *addr); | |||
31 | * ioremap and friends. | 32 | * ioremap and friends. |
32 | * | 33 | * |
33 | * ioremap takes a PCI memory address, as specified in | 34 | * ioremap takes a PCI memory address, as specified in |
34 | * Documentation/io-mapping.txt. | 35 | * Documentation/IO-mapping.txt. |
35 | * | 36 | * |
36 | */ | 37 | */ |
37 | #define ioremap(cookie, size) __uc32_ioremap(cookie, size) | 38 | #define ioremap(cookie, size) __uc32_ioremap(cookie, size) |
38 | #define ioremap_cached(cookie, size) __uc32_ioremap_cached(cookie, size) | 39 | #define ioremap_cached(cookie, size) __uc32_ioremap_cached(cookie, size) |
39 | #define ioremap_nocache(cookie, size) __uc32_ioremap(cookie, size) | ||
40 | #define iounmap(cookie) __uc32_iounmap(cookie) | 40 | #define iounmap(cookie) __uc32_iounmap(cookie) |
41 | 41 | ||
42 | /* | ||
43 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | ||
44 | * access | ||
45 | */ | ||
46 | #undef xlate_dev_mem_ptr | ||
47 | #define xlate_dev_mem_ptr(p) __va(p) | ||
48 | |||
42 | #define HAVE_ARCH_PIO_SIZE | 49 | #define HAVE_ARCH_PIO_SIZE |
43 | #define PIO_OFFSET (unsigned int)(PCI_IOBASE) | 50 | #define PIO_OFFSET (unsigned int)(PCI_IOBASE) |
44 | #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) | 51 | #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) |
diff --git a/arch/unicore32/include/asm/pci.h b/arch/unicore32/include/asm/pci.h index f5e108f4a15..c5b28b45953 100644 --- a/arch/unicore32/include/asm/pci.h +++ b/arch/unicore32/include/asm/pci.h | |||
@@ -14,10 +14,14 @@ | |||
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | #include <asm-generic/pci-dma-compat.h> | 16 | #include <asm-generic/pci-dma-compat.h> |
17 | #include <asm-generic/pci-bridge.h> | ||
18 | #include <asm-generic/pci.h> | 17 | #include <asm-generic/pci.h> |
19 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ | 18 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ |
20 | 19 | ||
20 | static inline void pcibios_set_master(struct pci_dev *dev) | ||
21 | { | ||
22 | /* No special bus mastering setup handling */ | ||
23 | } | ||
24 | |||
21 | static inline void pcibios_penalize_isa_irq(int irq, int active) | 25 | static inline void pcibios_penalize_isa_irq(int irq, int active) |
22 | { | 26 | { |
23 | /* We don't do dynamic PCI IRQ allocation */ | 27 | /* We don't do dynamic PCI IRQ allocation */ |
diff --git a/arch/unicore32/include/asm/processor.h b/arch/unicore32/include/asm/processor.h index 4eaa4216766..e11cb078657 100644 --- a/arch/unicore32/include/asm/processor.h +++ b/arch/unicore32/include/asm/processor.h | |||
@@ -53,6 +53,7 @@ struct thread_struct { | |||
53 | #define start_thread(regs, pc, sp) \ | 53 | #define start_thread(regs, pc, sp) \ |
54 | ({ \ | 54 | ({ \ |
55 | unsigned long *stack = (unsigned long *)sp; \ | 55 | unsigned long *stack = (unsigned long *)sp; \ |
56 | set_fs(USER_DS); \ | ||
56 | memset(regs->uregs, 0, sizeof(regs->uregs)); \ | 57 | memset(regs->uregs, 0, sizeof(regs->uregs)); \ |
57 | regs->UCreg_asr = USER_MODE; \ | 58 | regs->UCreg_asr = USER_MODE; \ |
58 | regs->UCreg_pc = pc & ~1; /* pc */ \ | 59 | regs->UCreg_pc = pc & ~1; /* pc */ \ |
@@ -68,10 +69,18 @@ struct task_struct; | |||
68 | /* Free all resources held by a thread. */ | 69 | /* Free all resources held by a thread. */ |
69 | extern void release_thread(struct task_struct *); | 70 | extern void release_thread(struct task_struct *); |
70 | 71 | ||
72 | /* Prepare to copy thread state - unlazy all lazy status */ | ||
73 | #define prepare_to_copy(tsk) do { } while (0) | ||
74 | |||
71 | unsigned long get_wchan(struct task_struct *p); | 75 | unsigned long get_wchan(struct task_struct *p); |
72 | 76 | ||
73 | #define cpu_relax() barrier() | 77 | #define cpu_relax() barrier() |
74 | 78 | ||
79 | /* | ||
80 | * Create a new kernel thread | ||
81 | */ | ||
82 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | ||
83 | |||
75 | #define task_pt_regs(p) \ | 84 | #define task_pt_regs(p) \ |
76 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) | 85 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) |
77 | 86 | ||
diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h index 9df53d991c7..b9caf9b0997 100644 --- a/arch/unicore32/include/asm/ptrace.h +++ b/arch/unicore32/include/asm/ptrace.h | |||
@@ -12,10 +12,80 @@ | |||
12 | #ifndef __UNICORE_PTRACE_H__ | 12 | #ifndef __UNICORE_PTRACE_H__ |
13 | #define __UNICORE_PTRACE_H__ | 13 | #define __UNICORE_PTRACE_H__ |
14 | 14 | ||
15 | #include <uapi/asm/ptrace.h> | 15 | #define PTRACE_GET_THREAD_AREA 22 |
16 | |||
17 | /* | ||
18 | * PSR bits | ||
19 | */ | ||
20 | #define USER_MODE 0x00000010 | ||
21 | #define REAL_MODE 0x00000011 | ||
22 | #define INTR_MODE 0x00000012 | ||
23 | #define PRIV_MODE 0x00000013 | ||
24 | #define ABRT_MODE 0x00000017 | ||
25 | #define EXTN_MODE 0x0000001b | ||
26 | #define SUSR_MODE 0x0000001f | ||
27 | #define MODE_MASK 0x0000001f | ||
28 | #define PSR_R_BIT 0x00000040 | ||
29 | #define PSR_I_BIT 0x00000080 | ||
30 | #define PSR_V_BIT 0x10000000 | ||
31 | #define PSR_C_BIT 0x20000000 | ||
32 | #define PSR_Z_BIT 0x40000000 | ||
33 | #define PSR_S_BIT 0x80000000 | ||
34 | |||
35 | /* | ||
36 | * Groups of PSR bits | ||
37 | */ | ||
38 | #define PSR_f 0xff000000 /* Flags */ | ||
39 | #define PSR_c 0x000000ff /* Control */ | ||
16 | 40 | ||
17 | #ifndef __ASSEMBLY__ | 41 | #ifndef __ASSEMBLY__ |
18 | 42 | ||
43 | /* | ||
44 | * This struct defines the way the registers are stored on the | ||
45 | * stack during a system call. Note that sizeof(struct pt_regs) | ||
46 | * has to be a multiple of 8. | ||
47 | */ | ||
48 | struct pt_regs { | ||
49 | unsigned long uregs[34]; | ||
50 | }; | ||
51 | |||
52 | #define UCreg_asr uregs[32] | ||
53 | #define UCreg_pc uregs[31] | ||
54 | #define UCreg_lr uregs[30] | ||
55 | #define UCreg_sp uregs[29] | ||
56 | #define UCreg_ip uregs[28] | ||
57 | #define UCreg_fp uregs[27] | ||
58 | #define UCreg_26 uregs[26] | ||
59 | #define UCreg_25 uregs[25] | ||
60 | #define UCreg_24 uregs[24] | ||
61 | #define UCreg_23 uregs[23] | ||
62 | #define UCreg_22 uregs[22] | ||
63 | #define UCreg_21 uregs[21] | ||
64 | #define UCreg_20 uregs[20] | ||
65 | #define UCreg_19 uregs[19] | ||
66 | #define UCreg_18 uregs[18] | ||
67 | #define UCreg_17 uregs[17] | ||
68 | #define UCreg_16 uregs[16] | ||
69 | #define UCreg_15 uregs[15] | ||
70 | #define UCreg_14 uregs[14] | ||
71 | #define UCreg_13 uregs[13] | ||
72 | #define UCreg_12 uregs[12] | ||
73 | #define UCreg_11 uregs[11] | ||
74 | #define UCreg_10 uregs[10] | ||
75 | #define UCreg_09 uregs[9] | ||
76 | #define UCreg_08 uregs[8] | ||
77 | #define UCreg_07 uregs[7] | ||
78 | #define UCreg_06 uregs[6] | ||
79 | #define UCreg_05 uregs[5] | ||
80 | #define UCreg_04 uregs[4] | ||
81 | #define UCreg_03 uregs[3] | ||
82 | #define UCreg_02 uregs[2] | ||
83 | #define UCreg_01 uregs[1] | ||
84 | #define UCreg_00 uregs[0] | ||
85 | #define UCreg_ORIG_00 uregs[33] | ||
86 | |||
87 | #ifdef __KERNEL__ | ||
88 | |||
19 | #define user_mode(regs) \ | 89 | #define user_mode(regs) \ |
20 | (processor_mode(regs) == USER_MODE) | 90 | (processor_mode(regs) == USER_MODE) |
21 | 91 | ||
@@ -54,7 +124,10 @@ static inline int valid_user_regs(struct pt_regs *regs) | |||
54 | } | 124 | } |
55 | 125 | ||
56 | #define instruction_pointer(regs) ((regs)->UCreg_pc) | 126 | #define instruction_pointer(regs) ((regs)->UCreg_pc) |
57 | #define user_stack_pointer(regs) ((regs)->UCreg_sp) | 127 | |
128 | #endif /* __KERNEL__ */ | ||
58 | 129 | ||
59 | #endif /* __ASSEMBLY__ */ | 130 | #endif /* __ASSEMBLY__ */ |
131 | |||
60 | #endif | 132 | #endif |
133 | |||
diff --git a/arch/unicore32/include/asm/switch_to.h b/arch/unicore32/include/asm/switch_to.h deleted file mode 100644 index 39572d2bd69..00000000000 --- a/arch/unicore32/include/asm/switch_to.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * Task switching for PKUnity SoC and UniCore ISA | ||
3 | * | ||
4 | * Copyright (C) 2001-2012 GUAN Xue-tao | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __UNICORE_SWITCH_TO_H__ | ||
11 | #define __UNICORE_SWITCH_TO_H__ | ||
12 | |||
13 | struct task_struct; | ||
14 | struct thread_info; | ||
15 | |||
16 | /* | ||
17 | * switch_to(prev, next) should switch from task `prev' to `next' | ||
18 | * `prev' will never be the same as `next'. schedule() itself | ||
19 | * contains the memory barrier to tell GCC not to cache `current'. | ||
20 | */ | ||
21 | extern struct task_struct *__switch_to(struct task_struct *, | ||
22 | struct thread_info *, struct thread_info *); | ||
23 | |||
24 | #define switch_to(prev, next, last) \ | ||
25 | do { \ | ||
26 | last = __switch_to(prev, task_thread_info(prev), \ | ||
27 | task_thread_info(next)); \ | ||
28 | } while (0) | ||
29 | |||
30 | #endif /* __UNICORE_SWITCH_TO_H__ */ | ||
diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h index 818b4a1edb5..c270e9e0486 100644 --- a/arch/unicore32/include/asm/thread_info.h +++ b/arch/unicore32/include/asm/thread_info.h | |||
@@ -135,18 +135,20 @@ static inline struct thread_info *current_thread_info(void) | |||
135 | #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ | 135 | #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ |
136 | #define TIF_SYSCALL_TRACE 8 | 136 | #define TIF_SYSCALL_TRACE 8 |
137 | #define TIF_MEMDIE 18 | 137 | #define TIF_MEMDIE 18 |
138 | #define TIF_FREEZE 19 | ||
138 | #define TIF_RESTORE_SIGMASK 20 | 139 | #define TIF_RESTORE_SIGMASK 20 |
139 | 140 | ||
140 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 141 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
141 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 142 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
142 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 143 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
143 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 144 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
145 | #define _TIF_FREEZE (1 << TIF_FREEZE) | ||
146 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
144 | 147 | ||
145 | /* | 148 | /* |
146 | * Change these and you break ASM code in entry-common.S | 149 | * Change these and you break ASM code in entry-common.S |
147 | */ | 150 | */ |
148 | #define _TIF_WORK_MASK \ | 151 | #define _TIF_WORK_MASK 0x000000ff |
149 | (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_NOTIFY_RESUME) | ||
150 | 152 | ||
151 | #endif /* __KERNEL__ */ | 153 | #endif /* __KERNEL__ */ |
152 | #endif /* __UNICORE_THREAD_INFO_H__ */ | 154 | #endif /* __UNICORE_THREAD_INFO_H__ */ |
diff --git a/arch/unicore32/include/asm/uaccess.h b/arch/unicore32/include/asm/uaccess.h index 897e11ad812..2acda503a6d 100644 --- a/arch/unicore32/include/asm/uaccess.h +++ b/arch/unicore32/include/asm/uaccess.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | 17 | ||
18 | #include <asm/memory.h> | 18 | #include <asm/memory.h> |
19 | #include <asm/system.h> | ||
19 | 20 | ||
20 | #define __copy_from_user __copy_from_user | 21 | #define __copy_from_user __copy_from_user |
21 | #define __copy_to_user __copy_to_user | 22 | #define __copy_to_user __copy_to_user |