aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/hexagon/include')
-rw-r--r--arch/hexagon/include/asm/Kbuild2
-rw-r--r--arch/hexagon/include/asm/atomic.h22
-rw-r--r--arch/hexagon/include/asm/elf.h23
-rw-r--r--arch/hexagon/include/asm/hexagon_vm.h56
-rw-r--r--arch/hexagon/include/asm/io.h16
-rw-r--r--arch/hexagon/include/asm/mem-layout.h28
-rw-r--r--arch/hexagon/include/asm/page.h12
-rw-r--r--arch/hexagon/include/asm/processor.h51
-rw-r--r--arch/hexagon/include/asm/vm_mmu.h11
-rw-r--r--arch/hexagon/include/uapi/asm/ptrace.h5
-rw-r--r--arch/hexagon/include/uapi/asm/registers.h17
-rw-r--r--arch/hexagon/include/uapi/asm/signal.h4
-rw-r--r--arch/hexagon/include/uapi/asm/unistd.h3
-rw-r--r--arch/hexagon/include/uapi/asm/user.h6
14 files changed, 183 insertions, 73 deletions
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index bdb54ceb53bc..1da17caac23c 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -25,7 +25,6 @@ generic-y += kdebug.h
25generic-y += kmap_types.h 25generic-y += kmap_types.h
26generic-y += local64.h 26generic-y += local64.h
27generic-y += local.h 27generic-y += local.h
28generic-y += local.h
29generic-y += mman.h 28generic-y += mman.h
30generic-y += msgbuf.h 29generic-y += msgbuf.h
31generic-y += pci.h 30generic-y += pci.h
@@ -41,6 +40,7 @@ generic-y += sembuf.h
41generic-y += shmbuf.h 40generic-y += shmbuf.h
42generic-y += shmparam.h 41generic-y += shmparam.h
43generic-y += siginfo.h 42generic-y += siginfo.h
43generic-y += sizes.h
44generic-y += socket.h 44generic-y += socket.h
45generic-y += sockios.h 45generic-y += sockios.h
46generic-y += statfs.h 46generic-y += statfs.h
diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h
index 468fbb0781cd..8a64ff2337f6 100644
--- a/arch/hexagon/include/asm/atomic.h
+++ b/arch/hexagon/include/asm/atomic.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Atomic operations for the Hexagon architecture 2 * Atomic operations for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
5 * 5 *
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -117,35 +117,37 @@ static inline int atomic_sub_return(int i, atomic_t *v)
117#define atomic_sub(i, v) atomic_sub_return(i, (v)) 117#define atomic_sub(i, v) atomic_sub_return(i, (v))
118 118
119/** 119/**
120 * atomic_add_unless - add unless the number is a given value 120 * __atomic_add_unless - add unless the number is a given value
121 * @v: pointer to value 121 * @v: pointer to value
122 * @a: amount to add 122 * @a: amount to add
123 * @u: unless value is equal to u 123 * @u: unless value is equal to u
124 * 124 *
125 * Returns 1 if the add happened, 0 if it didn't. 125 * Returns old value.
126 *
126 */ 127 */
128
127static inline int __atomic_add_unless(atomic_t *v, int a, int u) 129static inline int __atomic_add_unless(atomic_t *v, int a, int u)
128{ 130{
129 int output, __oldval; 131 int __oldval;
132 register int tmp;
133
130 asm volatile( 134 asm volatile(
131 "1: %0 = memw_locked(%2);" 135 "1: %0 = memw_locked(%2);"
132 " {" 136 " {"
133 " p3 = cmp.eq(%0, %4);" 137 " p3 = cmp.eq(%0, %4);"
134 " if (p3.new) jump:nt 2f;" 138 " if (p3.new) jump:nt 2f;"
135 " %0 = add(%0, %3);" 139 " %1 = add(%0, %3);"
136 " %1 = #0;"
137 " }" 140 " }"
138 " memw_locked(%2, p3) = %0;" 141 " memw_locked(%2, p3) = %1;"
139 " {" 142 " {"
140 " if !p3 jump 1b;" 143 " if !p3 jump 1b;"
141 " %1 = #1;"
142 " }" 144 " }"
143 "2:" 145 "2:"
144 : "=&r" (__oldval), "=&r" (output) 146 : "=&r" (__oldval), "=&r" (tmp)
145 : "r" (v), "r" (a), "r" (u) 147 : "r" (v), "r" (a), "r" (u)
146 : "memory", "p3" 148 : "memory", "p3"
147 ); 149 );
148 return output; 150 return __oldval;
149} 151}
150 152
151#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 153#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h
index 1f14e082588e..e1b933a0e121 100644
--- a/arch/hexagon/include/asm/elf.h
+++ b/arch/hexagon/include/asm/elf.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * ELF definitions for the Hexagon architecture 2 * ELF definitions for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -104,6 +104,16 @@ typedef unsigned long elf_fpregset_t;
104 * Bypass the whole "regsets" thing for now and use the define. 104 * Bypass the whole "regsets" thing for now and use the define.
105 */ 105 */
106 106
107#if CONFIG_HEXAGON_ARCH_VERSION >= 4
108#define CS_COPYREGS(DEST,REGS) \
109do {\
110 DEST.cs0 = REGS->cs0;\
111 DEST.cs1 = REGS->cs1;\
112} while (0)
113#else
114#define CS_COPYREGS(DEST,REGS)
115#endif
116
107#define ELF_CORE_COPY_REGS(DEST, REGS) \ 117#define ELF_CORE_COPY_REGS(DEST, REGS) \
108do { \ 118do { \
109 DEST.r0 = REGS->r00; \ 119 DEST.r0 = REGS->r00; \
@@ -148,13 +158,12 @@ do { \
148 DEST.p3_0 = REGS->preds; \ 158 DEST.p3_0 = REGS->preds; \
149 DEST.gp = REGS->gp; \ 159 DEST.gp = REGS->gp; \
150 DEST.ugp = REGS->ugp; \ 160 DEST.ugp = REGS->ugp; \
151 DEST.pc = pt_elr(REGS); \ 161 CS_COPYREGS(DEST,REGS); \
162 DEST.pc = pt_elr(REGS); \
152 DEST.cause = pt_cause(REGS); \ 163 DEST.cause = pt_cause(REGS); \
153 DEST.badva = pt_badva(REGS); \ 164 DEST.badva = pt_badva(REGS); \
154} while (0); 165} while (0);
155 166
156
157
158/* 167/*
159 * This is used to ensure we don't load something for the wrong architecture. 168 * This is used to ensure we don't load something for the wrong architecture.
160 * Checks the machine and ABI type. 169 * Checks the machine and ABI type.
@@ -168,15 +177,15 @@ do { \
168#define ELF_DATA ELFDATA2LSB 177#define ELF_DATA ELFDATA2LSB
169#define ELF_ARCH EM_HEXAGON 178#define ELF_ARCH EM_HEXAGON
170 179
171#ifdef CONFIG_HEXAGON_ARCH_V2 180#if CONFIG_HEXAGON_ARCH_VERSION == 2
172#define ELF_CORE_EFLAGS 0x1 181#define ELF_CORE_EFLAGS 0x1
173#endif 182#endif
174 183
175#ifdef CONFIG_HEXAGON_ARCH_V3 184#if CONFIG_HEXAGON_ARCH_VERSION == 3
176#define ELF_CORE_EFLAGS 0x2 185#define ELF_CORE_EFLAGS 0x2
177#endif 186#endif
178 187
179#ifdef CONFIG_HEXAGON_ARCH_V4 188#if CONFIG_HEXAGON_ARCH_VERSION == 4
180#define ELF_CORE_EFLAGS 0x3 189#define ELF_CORE_EFLAGS 0x3
181#endif 190#endif
182 191
diff --git a/arch/hexagon/include/asm/hexagon_vm.h b/arch/hexagon/include/asm/hexagon_vm.h
index c144bee6cabe..67bb6d6f3337 100644
--- a/arch/hexagon/include/asm/hexagon_vm.h
+++ b/arch/hexagon/include/asm/hexagon_vm.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Declarations for to Hexagon Virtal Machine. 2 * Declarations for to Hexagon Virtal Machine.
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -31,10 +31,26 @@
31 * for tracing/debugging. 31 * for tracing/debugging.
32 */ 32 */
33 33
34/* 34#define HVM_TRAP1_VMVERSION 0
35 * Lets make this stuff visible only if configured, 35#define HVM_TRAP1_VMRTE 1
36 * so we can unconditionally include the file. 36#define HVM_TRAP1_VMSETVEC 2
37 */ 37#define HVM_TRAP1_VMSETIE 3
38#define HVM_TRAP1_VMGETIE 4
39#define HVM_TRAP1_VMINTOP 5
40#define HVM_TRAP1_VMCLRMAP 10
41#define HVM_TRAP1_VMNEWMAP 11
42#define HVM_TRAP1_FORMERLY_VMWIRE 12
43#define HVM_TRAP1_VMCACHE 13
44#define HVM_TRAP1_VMGETTIME 14
45#define HVM_TRAP1_VMSETTIME 15
46#define HVM_TRAP1_VMWAIT 16
47#define HVM_TRAP1_VMYIELD 17
48#define HVM_TRAP1_VMSTART 18
49#define HVM_TRAP1_VMSTOP 19
50#define HVM_TRAP1_VMVPID 20
51#define HVM_TRAP1_VMSETREGS 21
52#define HVM_TRAP1_VMGETREGS 22
53#define HVM_TRAP1_VMTIMEROP 24
38 54
39#ifndef __ASSEMBLY__ 55#ifndef __ASSEMBLY__
40 56
@@ -175,31 +191,19 @@ static inline long __vmintop_clear(long i)
175 191
176#else /* Only assembly code should reference these */ 192#else /* Only assembly code should reference these */
177 193
178#define HVM_TRAP1_VMRTE 1
179#define HVM_TRAP1_VMSETVEC 2
180#define HVM_TRAP1_VMSETIE 3
181#define HVM_TRAP1_VMGETIE 4
182#define HVM_TRAP1_VMINTOP 5
183#define HVM_TRAP1_VMCLRMAP 10
184#define HVM_TRAP1_VMNEWMAP 11
185#define HVM_TRAP1_FORMERLY_VMWIRE 12
186#define HVM_TRAP1_VMCACHE 13
187#define HVM_TRAP1_VMGETTIME 14
188#define HVM_TRAP1_VMSETTIME 15
189#define HVM_TRAP1_VMWAIT 16
190#define HVM_TRAP1_VMYIELD 17
191#define HVM_TRAP1_VMSTART 18
192#define HVM_TRAP1_VMSTOP 19
193#define HVM_TRAP1_VMVPID 20
194#define HVM_TRAP1_VMSETREGS 21
195#define HVM_TRAP1_VMGETREGS 22
196
197#endif /* __ASSEMBLY__ */ 194#endif /* __ASSEMBLY__ */
198 195
199/* 196/*
200 * Constants for virtual instruction parameters and return values 197 * Constants for virtual instruction parameters and return values
201 */ 198 */
202 199
200/* vmnewmap arguments */
201
202#define VM_TRANS_TYPE_LINEAR 0
203#define VM_TRANS_TYPE_TABLE 1
204#define VM_TLB_INVALIDATE_FALSE 0
205#define VM_TLB_INVALIDATE_TRUE 1
206
203/* vmsetie arguments */ 207/* vmsetie arguments */
204 208
205#define VM_INT_DISABLE 0 209#define VM_INT_DISABLE 0
@@ -224,6 +228,8 @@ static inline long __vmintop_clear(long i)
224#define HVM_VMEST_UM_MSK 1 228#define HVM_VMEST_UM_MSK 1
225#define HVM_VMEST_IE_SFT 30 229#define HVM_VMEST_IE_SFT 30
226#define HVM_VMEST_IE_MSK 1 230#define HVM_VMEST_IE_MSK 1
231#define HVM_VMEST_SS_SFT 29
232#define HVM_VMEST_SS_MSK 1
227#define HVM_VMEST_EVENTNUM_SFT 16 233#define HVM_VMEST_EVENTNUM_SFT 16
228#define HVM_VMEST_EVENTNUM_MSK 0xff 234#define HVM_VMEST_EVENTNUM_MSK 0xff
229#define HVM_VMEST_CAUSE_SFT 0 235#define HVM_VMEST_CAUSE_SFT 0
@@ -260,6 +266,8 @@ static inline long __vmintop_clear(long i)
260#define HVM_GE_C_INVI 0x15 266#define HVM_GE_C_INVI 0x15
261#define HVM_GE_C_PRIVI 0x1B 267#define HVM_GE_C_PRIVI 0x1B
262#define HVM_GE_C_XMAL 0x1C 268#define HVM_GE_C_XMAL 0x1C
269#define HVM_GE_C_WREG 0x1D
270#define HVM_GE_C_PCAL 0x1E
263#define HVM_GE_C_RMAL 0x20 271#define HVM_GE_C_RMAL 0x20
264#define HVM_GE_C_WMAL 0x21 272#define HVM_GE_C_WMAL 0x21
265#define HVM_GE_C_RPROT 0x22 273#define HVM_GE_C_RPROT 0x22
diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index e527cfeff5ba..1b7698e19139 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * IO definitions for the Hexagon architecture 2 * IO definitions for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -40,6 +40,8 @@
40#define IO_SPACE_LIMIT 0xffff 40#define IO_SPACE_LIMIT 0xffff
41#define _IO_BASE ((void __iomem *)0xfe000000) 41#define _IO_BASE ((void __iomem *)0xfe000000)
42 42
43#define IOMEM(x) ((void __force __iomem *)(x))
44
43extern int remap_area_pages(unsigned long start, unsigned long phys_addr, 45extern int remap_area_pages(unsigned long start, unsigned long phys_addr,
44 unsigned long end, unsigned long flags); 46 unsigned long end, unsigned long flags);
45 47
@@ -176,6 +178,18 @@ static inline void writel(u32 data, volatile void __iomem *addr)
176#define __raw_readl readl 178#define __raw_readl readl
177 179
178/* 180/*
181 * http://comments.gmane.org/gmane.linux.ports.arm.kernel/117626
182 */
183
184#define readb_relaxed __raw_readb
185#define readw_relaxed __raw_readw
186#define readl_relaxed __raw_readl
187
188#define writeb_relaxed __raw_writeb
189#define writew_relaxed __raw_writew
190#define writel_relaxed __raw_writel
191
192/*
179 * Need an mtype somewhere in here, for cache type deals? 193 * Need an mtype somewhere in here, for cache type deals?
180 * This is probably too long for an inline. 194 * This is probably too long for an inline.
181 */ 195 */
diff --git a/arch/hexagon/include/asm/mem-layout.h b/arch/hexagon/include/asm/mem-layout.h
index af16e977c55e..60556f8c45d8 100644
--- a/arch/hexagon/include/asm/mem-layout.h
+++ b/arch/hexagon/include/asm/mem-layout.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Memory layout definitions for the Hexagon architecture 2 * Memory layout definitions for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -32,16 +32,25 @@
32#define PAGE_OFFSET _AC(0xc0000000, UL) 32#define PAGE_OFFSET _AC(0xc0000000, UL)
33 33
34/* 34/*
35 * LOAD_ADDRESS is the physical/linear address of where in memory 35 * Compiling for a platform that needs a crazy physical offset
36 * the kernel gets loaded. The 12 least significant bits must be zero (0) 36 * (like if the memory starts at 1GB and up) means we need
37 * due to limitations on setting the EVB 37 * an actual PHYS_OFFSET. Should be set up in head.S.
38 *
39 */ 38 */
40 39
41#ifndef LOAD_ADDRESS 40#ifdef CONFIG_HEXAGON_PHYS_OFFSET
42#define LOAD_ADDRESS 0x00000000 41#ifndef __ASSEMBLY__
42extern unsigned long __phys_offset;
43#endif
44#define PHYS_OFFSET __phys_offset
45#endif
46
47#ifndef PHYS_OFFSET
48#define PHYS_OFFSET 0
43#endif 49#endif
44 50
51#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
52#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
53
45#define TASK_SIZE (PAGE_OFFSET) 54#define TASK_SIZE (PAGE_OFFSET)
46 55
47/* not sure how these are used yet */ 56/* not sure how these are used yet */
@@ -55,7 +64,7 @@ enum fixed_addresses {
55 __end_of_fixed_addresses 64 __end_of_fixed_addresses
56}; 65};
57 66
58#define MIN_KERNEL_SEG 0x300 /* From 0xc0000000 */ 67#define MIN_KERNEL_SEG (PAGE_OFFSET >> PGDIR_SHIFT) /* L1 shift is 22 bits */
59extern int max_kernel_seg; 68extern int max_kernel_seg;
60 69
61/* 70/*
@@ -63,8 +72,7 @@ extern int max_kernel_seg;
63 * supposed to be based on the amount of physical memory available 72 * supposed to be based on the amount of physical memory available
64 */ 73 */
65 74
66#define VMALLOC_START (PAGE_OFFSET + VMALLOC_OFFSET + \ 75#define VMALLOC_START ((unsigned long) __va(high_memory + VMALLOC_OFFSET))
67 (unsigned long)high_memory)
68 76
69/* Gap between physical ram and vmalloc space for guard purposes. */ 77/* Gap between physical ram and vmalloc space for guard purposes. */
70#define VMALLOC_OFFSET PAGE_SIZE 78#define VMALLOC_OFFSET PAGE_SIZE
diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
index 692adc213429..93f5669b4aa1 100644
--- a/arch/hexagon/include/asm/page.h
+++ b/arch/hexagon/include/asm/page.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Page management definitions for the Hexagon architecture 2 * Page management definitions for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -96,8 +96,8 @@ typedef struct page *pgtable_t;
96 * MIPS says they're only used during mem_init. 96 * MIPS says they're only used during mem_init.
97 * also, check if we need a PHYS_OFFSET. 97 * also, check if we need a PHYS_OFFSET.
98 */ 98 */
99#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) 99#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
100#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) 100#define __va(x) ((void *)((unsigned long)(x) - PHYS_OFFSET + PAGE_OFFSET))
101 101
102/* The "page frame" descriptor is defined in linux/mm.h */ 102/* The "page frame" descriptor is defined in linux/mm.h */
103struct page; 103struct page;
@@ -140,6 +140,11 @@ static inline void clear_page(void *page)
140 */ 140 */
141#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 141#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
142 142
143#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
144#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
145
146#define page_to_virt(page) __va(page_to_phys(page))
147
143/* 148/*
144 * For port to Hexagon Virtual Machine, MAYBE we check for attempts 149 * For port to Hexagon Virtual Machine, MAYBE we check for attempts
145 * to reference reserved HVM space, but in any case, the VM will be 150 * to reference reserved HVM space, but in any case, the VM will be
@@ -147,6 +152,7 @@ static inline void clear_page(void *page)
147 */ 152 */
148#define kern_addr_valid(addr) (1) 153#define kern_addr_valid(addr) (1)
149 154
155#include <asm/mem-layout.h>
150#include <asm-generic/memory_model.h> 156#include <asm-generic/memory_model.h>
151/* XXX Todo: implement assembly-optimized version of getorder. */ 157/* XXX Todo: implement assembly-optimized version of getorder. */
152#include <asm-generic/getorder.h> 158#include <asm-generic/getorder.h>
diff --git a/arch/hexagon/include/asm/processor.h b/arch/hexagon/include/asm/processor.h
index 6dd5d3706869..45a825402f63 100644
--- a/arch/hexagon/include/asm/processor.h
+++ b/arch/hexagon/include/asm/processor.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Process/processor support for the Hexagon architecture 2 * Process/processor support for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -100,12 +100,49 @@ extern unsigned long get_wchan(struct task_struct *p);
100 */ 100 */
101 101
102struct hexagon_switch_stack { 102struct hexagon_switch_stack {
103 unsigned long long r1716; 103 union {
104 unsigned long long r1918; 104 struct {
105 unsigned long long r2120; 105 unsigned long r16;
106 unsigned long long r2322; 106 unsigned long r17;
107 unsigned long long r2524; 107 };
108 unsigned long long r2726; 108 unsigned long long r1716;
109 };
110 union {
111 struct {
112 unsigned long r18;
113 unsigned long r19;
114 };
115 unsigned long long r1918;
116 };
117 union {
118 struct {
119 unsigned long r20;
120 unsigned long r21;
121 };
122 unsigned long long r2120;
123 };
124 union {
125 struct {
126 unsigned long r22;
127 unsigned long r23;
128 };
129 unsigned long long r2322;
130 };
131 union {
132 struct {
133 unsigned long r24;
134 unsigned long r25;
135 };
136 unsigned long long r2524;
137 };
138 union {
139 struct {
140 unsigned long r26;
141 unsigned long r27;
142 };
143 unsigned long long r2726;
144 };
145
109 unsigned long fp; 146 unsigned long fp;
110 unsigned long lr; 147 unsigned long lr;
111}; 148};
diff --git a/arch/hexagon/include/asm/vm_mmu.h b/arch/hexagon/include/asm/vm_mmu.h
index 9a94de7969bb..096537d8f4c5 100644
--- a/arch/hexagon/include/asm/vm_mmu.h
+++ b/arch/hexagon/include/asm/vm_mmu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Hexagon VM page table entry definitions 2 * Hexagon VM page table entry definitions
3 * 3 *
4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2011,2013 The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -68,14 +68,13 @@
68 68
69#define __HEXAGON_C_WB 0x0 /* Write-back, no L2 */ 69#define __HEXAGON_C_WB 0x0 /* Write-back, no L2 */
70#define __HEXAGON_C_WT 0x1 /* Write-through, no L2 */ 70#define __HEXAGON_C_WT 0x1 /* Write-through, no L2 */
71#define __HEXAGON_C_UNC 0x6 /* Uncached memory */
72#if CONFIG_HEXAGON_ARCH_VERSION >= 2
71#define __HEXAGON_C_DEV 0x4 /* Device register space */ 73#define __HEXAGON_C_DEV 0x4 /* Device register space */
72#define __HEXAGON_C_WT_L2 0x5 /* Write-through, with L2 */
73/* this really should be #if CONFIG_HEXAGON_ARCH = 2 but that's not defined */
74#if defined(CONFIG_HEXAGON_COMET) || defined(CONFIG_QDSP6_ST1)
75#define __HEXAGON_C_UNC __HEXAGON_C_DEV
76#else 74#else
77#define __HEXAGON_C_UNC 0x6 /* Uncached memory */ 75#define __HEXAGON_C_DEV __HEXAGON_C_UNC
78#endif 76#endif
77#define __HEXAGON_C_WT_L2 0x5 /* Write-through, with L2 */
79#define __HEXAGON_C_WB_L2 0x7 /* Write-back, with L2 */ 78#define __HEXAGON_C_WB_L2 0x7 /* Write-back, with L2 */
80 79
81/* 80/*
diff --git a/arch/hexagon/include/uapi/asm/ptrace.h b/arch/hexagon/include/uapi/asm/ptrace.h
index 1ffce0c6ee07..065e5b32313f 100644
--- a/arch/hexagon/include/uapi/asm/ptrace.h
+++ b/arch/hexagon/include/uapi/asm/ptrace.h
@@ -36,4 +36,9 @@ extern const char *regs_query_register_name(unsigned int offset);
36 ((struct pt_regs *) \ 36 ((struct pt_regs *) \
37 ((unsigned long)current_thread_info() + THREAD_SIZE) - 1) 37 ((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
38 38
39#if CONFIG_HEXAGON_ARCH_VERSION >= 4
40#define arch_has_single_step() (1)
41#endif
42
43
39#endif 44#endif
diff --git a/arch/hexagon/include/uapi/asm/registers.h b/arch/hexagon/include/uapi/asm/registers.h
index c20406f63b5c..487d6ceca5e7 100644
--- a/arch/hexagon/include/uapi/asm/registers.h
+++ b/arch/hexagon/include/uapi/asm/registers.h
@@ -57,10 +57,17 @@ struct pt_regs {
57 }; 57 };
58 union { 58 union {
59 struct { 59 struct {
60 unsigned long gp;
61 unsigned long ugp; 60 unsigned long ugp;
61 unsigned long gp;
62 }; 62 };
63 long long int ugpgp; 63 long long int gpugp;
64 };
65 union {
66 struct {
67 unsigned long cs0;
68 unsigned long cs1;
69 };
70 long long int cs1cs0;
64 }; 71 };
65 /* 72 /*
66 * Be extremely careful with rearranging these, if at all. Some code 73 * Be extremely careful with rearranging these, if at all. Some code
@@ -204,9 +211,11 @@ struct pt_regs {
204#define pt_psp(regs) ((regs)->hvmer.vmpsp) 211#define pt_psp(regs) ((regs)->hvmer.vmpsp)
205#define pt_badva(regs) ((regs)->hvmer.vmbadva) 212#define pt_badva(regs) ((regs)->hvmer.vmbadva)
206 213
214#define pt_set_singlestep(regs) ((regs)->hvmer.vmest |= (1<<HVM_VMEST_SS_SFT))
215#define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<<HVM_VMEST_SS_SFT))
216
207#define pt_set_rte_sp(regs, sp) do {\ 217#define pt_set_rte_sp(regs, sp) do {\
208 pt_psp(regs) = (sp);\ 218 pt_psp(regs) = (regs)->SP = (sp);\
209 (regs)->SP = (unsigned long) &((regs)->hvmer);\
210 } while (0) 219 } while (0)
211 220
212#define pt_set_kmode(regs) \ 221#define pt_set_kmode(regs) \
diff --git a/arch/hexagon/include/uapi/asm/signal.h b/arch/hexagon/include/uapi/asm/signal.h
index 939556817d34..98106e55ad4f 100644
--- a/arch/hexagon/include/uapi/asm/signal.h
+++ b/arch/hexagon/include/uapi/asm/signal.h
@@ -19,8 +19,12 @@
19#ifndef _ASM_SIGNAL_H 19#ifndef _ASM_SIGNAL_H
20#define _ASM_SIGNAL_H 20#define _ASM_SIGNAL_H
21 21
22#include <uapi/asm/registers.h>
23
22extern unsigned long __rt_sigtramp_template[2]; 24extern unsigned long __rt_sigtramp_template[2];
23 25
26void do_signal(struct pt_regs *regs);
27
24#include <asm-generic/signal.h> 28#include <asm-generic/signal.h>
25 29
26#endif 30#endif
diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h
index 4a87cc47075c..ffee405d6803 100644
--- a/arch/hexagon/include/uapi/asm/unistd.h
+++ b/arch/hexagon/include/uapi/asm/unistd.h
@@ -27,6 +27,9 @@
27 */ 27 */
28 28
29#define sys_mmap2 sys_mmap_pgoff 29#define sys_mmap2 sys_mmap_pgoff
30#define __ARCH_WANT_SYS_EXECVE
30#define __ARCH_WANT_SYS_CLONE 31#define __ARCH_WANT_SYS_CLONE
32#define __ARCH_WANT_SYS_VFORK
33#define __ARCH_WANT_SYS_FORK
31 34
32#include <asm-generic/unistd.h> 35#include <asm-generic/unistd.h>
diff --git a/arch/hexagon/include/uapi/asm/user.h b/arch/hexagon/include/uapi/asm/user.h
index cef13ee1413f..3dae94d9ced7 100644
--- a/arch/hexagon/include/uapi/asm/user.h
+++ b/arch/hexagon/include/uapi/asm/user.h
@@ -55,9 +55,15 @@ struct user_regs_struct {
55 unsigned long pc; 55 unsigned long pc;
56 unsigned long cause; 56 unsigned long cause;
57 unsigned long badva; 57 unsigned long badva;
58#if CONFIG_HEXAGON_ARCH_VERSION < 4
58 unsigned long pad1; /* pad out to 48 words total */ 59 unsigned long pad1; /* pad out to 48 words total */
59 unsigned long pad2; /* pad out to 48 words total */ 60 unsigned long pad2; /* pad out to 48 words total */
60 unsigned long pad3; /* pad out to 48 words total */ 61 unsigned long pad3; /* pad out to 48 words total */
62#else
63 unsigned long cs0;
64 unsigned long cs1;
65 unsigned long pad1; /* pad out to 48 words total */
66#endif
61}; 67};
62 68
63#endif 69#endif