Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/xtensa/kernel/process.c |
| 3 | * |
| 4 | * Xtensa Processor version. |
| 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 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
| 11 | * |
| 12 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> |
| 13 | * Chris Zankel <chris@zankel.net> |
| 14 | * Marc Gauthier <marc@tensilica.com, marc@alumni.uwaterloo.ca> |
| 15 | * Kevin Chea |
| 16 | */ |
| 17 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 18 | #include <linux/errno.h> |
| 19 | #include <linux/sched.h> |
| 20 | #include <linux/kernel.h> |
| 21 | #include <linux/mm.h> |
| 22 | #include <linux/smp.h> |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 23 | #include <linux/stddef.h> |
| 24 | #include <linux/unistd.h> |
| 25 | #include <linux/ptrace.h> |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 26 | #include <linux/elf.h> |
| 27 | #include <linux/init.h> |
| 28 | #include <linux/prctl.h> |
| 29 | #include <linux/init_task.h> |
| 30 | #include <linux/module.h> |
| 31 | #include <linux/mqueue.h> |
Chris Zankel | 73089cb | 2007-08-04 09:27:30 -0700 | [diff] [blame] | 32 | #include <linux/fs.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 33 | #include <linux/slab.h> |
Frederic Weisbecker | 11ad47a | 2012-08-22 17:27:34 +0200 | [diff] [blame] | 34 | #include <linux/rcupdate.h> |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 35 | |
| 36 | #include <asm/pgtable.h> |
| 37 | #include <asm/uaccess.h> |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 38 | #include <asm/io.h> |
| 39 | #include <asm/processor.h> |
| 40 | #include <asm/platform.h> |
| 41 | #include <asm/mmu.h> |
| 42 | #include <asm/irq.h> |
Arun Sharma | 60063497 | 2011-07-26 16:09:06 -0700 | [diff] [blame] | 43 | #include <linux/atomic.h> |
Sam Ravnborg | 0013a85 | 2005-09-09 20:57:26 +0200 | [diff] [blame] | 44 | #include <asm/asm-offsets.h> |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 45 | #include <asm/regs.h> |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 46 | |
| 47 | extern void ret_from_fork(void); |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 48 | extern void ret_from_kernel_thread(void); |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 49 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 50 | struct task_struct *current_set[NR_CPUS] = {&init_task, }; |
| 51 | |
Adrian Bunk | 47f3fc9 | 2006-03-06 15:42:47 -0800 | [diff] [blame] | 52 | void (*pm_power_off)(void) = NULL; |
| 53 | EXPORT_SYMBOL(pm_power_off); |
| 54 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 55 | |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 56 | #if XTENSA_HAVE_COPROCESSORS |
| 57 | |
| 58 | void coprocessor_release_all(struct thread_info *ti) |
| 59 | { |
| 60 | unsigned long cpenable; |
| 61 | int i; |
| 62 | |
| 63 | /* Make sure we don't switch tasks during this operation. */ |
| 64 | |
| 65 | preempt_disable(); |
| 66 | |
| 67 | /* Walk through all cp owners and release it for the requested one. */ |
| 68 | |
| 69 | cpenable = ti->cpenable; |
| 70 | |
| 71 | for (i = 0; i < XCHAL_CP_MAX; i++) { |
| 72 | if (coprocessor_owner[i] == ti) { |
| 73 | coprocessor_owner[i] = 0; |
| 74 | cpenable &= ~(1 << i); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | ti->cpenable = cpenable; |
| 79 | coprocessor_clear_cpenable(); |
| 80 | |
| 81 | preempt_enable(); |
| 82 | } |
| 83 | |
| 84 | void coprocessor_flush_all(struct thread_info *ti) |
| 85 | { |
| 86 | unsigned long cpenable; |
| 87 | int i; |
| 88 | |
| 89 | preempt_disable(); |
| 90 | |
| 91 | cpenable = ti->cpenable; |
| 92 | |
| 93 | for (i = 0; i < XCHAL_CP_MAX; i++) { |
| 94 | if ((cpenable & 1) != 0 && coprocessor_owner[i] == ti) |
| 95 | coprocessor_flush(ti, i); |
| 96 | cpenable >>= 1; |
| 97 | } |
| 98 | |
| 99 | preempt_enable(); |
| 100 | } |
| 101 | |
| 102 | #endif |
| 103 | |
| 104 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 105 | /* |
| 106 | * Powermanagement idle function, if any is provided by the platform. |
| 107 | */ |
Thomas Gleixner | f4e2e9a | 2013-03-21 22:50:04 +0100 | [diff] [blame] | 108 | void arch_cpu_idle(void) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 109 | { |
Thomas Gleixner | f4e2e9a | 2013-03-21 22:50:04 +0100 | [diff] [blame] | 110 | platform_idle(); |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | /* |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 114 | * This is called when the thread calls exit(). |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 115 | */ |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 116 | void exit_thread(void) |
| 117 | { |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 118 | #if XTENSA_HAVE_COPROCESSORS |
| 119 | coprocessor_release_all(current_thread_info()); |
| 120 | #endif |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 121 | } |
| 122 | |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 123 | /* |
| 124 | * Flush thread state. This is called when a thread does an execve() |
| 125 | * Note that we flush coprocessor registers for the case execve fails. |
| 126 | */ |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 127 | void flush_thread(void) |
| 128 | { |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 129 | #if XTENSA_HAVE_COPROCESSORS |
| 130 | struct thread_info *ti = current_thread_info(); |
| 131 | coprocessor_flush_all(ti); |
| 132 | coprocessor_release_all(ti); |
| 133 | #endif |
| 134 | } |
| 135 | |
| 136 | /* |
Suresh Siddha | 55ccf3f | 2012-05-16 15:03:51 -0700 | [diff] [blame] | 137 | * this gets called so that we can store coprocessor state into memory and |
| 138 | * copy the current task into the new thread. |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 139 | */ |
Suresh Siddha | 55ccf3f | 2012-05-16 15:03:51 -0700 | [diff] [blame] | 140 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 141 | { |
| 142 | #if XTENSA_HAVE_COPROCESSORS |
Suresh Siddha | 55ccf3f | 2012-05-16 15:03:51 -0700 | [diff] [blame] | 143 | coprocessor_flush_all(task_thread_info(src)); |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 144 | #endif |
Suresh Siddha | 55ccf3f | 2012-05-16 15:03:51 -0700 | [diff] [blame] | 145 | *dst = *src; |
| 146 | return 0; |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | /* |
| 150 | * Copy thread. |
| 151 | * |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 152 | * There are two modes in which this function is called: |
| 153 | * 1) Userspace thread creation, |
| 154 | * regs != NULL, usp_thread_fn is userspace stack pointer. |
| 155 | * It is expected to copy parent regs (in case CLONE_VM is not set |
| 156 | * in the clone_flags) and set up passed usp in the childregs. |
| 157 | * 2) Kernel thread creation, |
| 158 | * regs == NULL, usp_thread_fn is the function to run in the new thread |
| 159 | * and thread_fn_arg is its parameter. |
| 160 | * childregs are not used for the kernel threads. |
| 161 | * |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 162 | * The stack layout for the new thread looks like this: |
| 163 | * |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 164 | * +------------------------+ |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 165 | * | childregs | |
| 166 | * +------------------------+ <- thread.sp = sp in dummy-frame |
| 167 | * | dummy-frame | (saved in dummy-frame spill-area) |
| 168 | * +------------------------+ |
| 169 | * |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 170 | * We create a dummy frame to return to either ret_from_fork or |
| 171 | * ret_from_kernel_thread: |
| 172 | * a0 points to ret_from_fork/ret_from_kernel_thread (simulating a call4) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 173 | * sp points to itself (thread.sp) |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 174 | * a2, a3 are unused for userspace threads, |
| 175 | * a2 points to thread_fn, a3 holds thread_fn arg for kernel threads. |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 176 | * |
| 177 | * Note: This is a pristine frame, so we don't need any spill region on top of |
| 178 | * childregs. |
Marc Gauthier | 84ed305 | 2012-10-15 03:55:35 +0400 | [diff] [blame] | 179 | * |
| 180 | * The fun part: if we're keeping the same VM (i.e. cloning a thread, |
| 181 | * not an entire process), we're normally given a new usp, and we CANNOT share |
| 182 | * any live address register windows. If we just copy those live frames over, |
| 183 | * the two threads (parent and child) will overflow the same frames onto the |
| 184 | * parent stack at different times, likely corrupting the parent stack (esp. |
| 185 | * if the parent returns from functions that called clone() and calls new |
| 186 | * ones, before the child overflows its now old copies of its parent windows). |
| 187 | * One solution is to spill windows to the parent stack, but that's fairly |
| 188 | * involved. Much simpler to just not copy those live frames across. |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 189 | */ |
| 190 | |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 191 | int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn, |
Al Viro | afa86fc | 2012-10-22 22:51:14 -0400 | [diff] [blame] | 192 | unsigned long thread_fn_arg, struct task_struct *p) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 193 | { |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 194 | struct pt_regs *childregs = task_pt_regs(p); |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 195 | |
Chris Zankel | 39070cb | 2012-10-17 23:08:20 -0700 | [diff] [blame] | 196 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) |
| 197 | struct thread_info *ti; |
| 198 | #endif |
| 199 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 200 | /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */ |
| 201 | *((int*)childregs - 3) = (unsigned long)childregs; |
| 202 | *((int*)childregs - 4) = 0; |
| 203 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 204 | p->thread.sp = (unsigned long)childregs; |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 205 | |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 206 | if (!(p->flags & PF_KTHREAD)) { |
| 207 | struct pt_regs *regs = current_pt_regs(); |
| 208 | unsigned long usp = usp_thread_fn ? |
| 209 | usp_thread_fn : regs->areg[1]; |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 210 | |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 211 | p->thread.ra = MAKE_RA_FOR_CALL( |
| 212 | (unsigned long)ret_from_fork, 0x1); |
| 213 | |
| 214 | /* This does not copy all the regs. |
| 215 | * In a bout of brilliance or madness, |
| 216 | * ARs beyond a0-a15 exist past the end of the struct. |
| 217 | */ |
| 218 | *childregs = *regs; |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 219 | childregs->areg[1] = usp; |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 220 | childregs->areg[2] = 0; |
Chris Zankel | 6ebe7da | 2012-10-24 13:15:21 -0700 | [diff] [blame] | 221 | |
| 222 | /* When sharing memory with the parent thread, the child |
| 223 | usually starts on a pristine stack, so we have to reset |
| 224 | windowbase, windowstart and wmask. |
| 225 | (Note that such a new thread is required to always create |
| 226 | an initial call4 frame) |
| 227 | The exception is vfork, where the new thread continues to |
| 228 | run on the parent's stack until it calls execve. This could |
| 229 | be a call8 or call12, which requires a legal stack frame |
| 230 | of the previous caller for the overflow handlers to work. |
| 231 | (Note that it's always legal to overflow live registers). |
| 232 | In this case, ensure to spill at least the stack pointer |
| 233 | of that frame. */ |
| 234 | |
Marc Gauthier | 84ed305 | 2012-10-15 03:55:35 +0400 | [diff] [blame] | 235 | if (clone_flags & CLONE_VM) { |
Chris Zankel | 6ebe7da | 2012-10-24 13:15:21 -0700 | [diff] [blame] | 236 | /* check that caller window is live and same stack */ |
| 237 | int len = childregs->wmask & ~0xf; |
| 238 | if (regs->areg[1] == usp && len != 0) { |
| 239 | int callinc = (regs->areg[0] >> 30) & 3; |
| 240 | int caller_ars = XCHAL_NUM_AREGS - callinc * 4; |
| 241 | put_user(regs->areg[caller_ars+1], |
| 242 | (unsigned __user*)(usp - 12)); |
| 243 | } |
| 244 | childregs->wmask = 1; |
| 245 | childregs->windowstart = 1; |
| 246 | childregs->windowbase = 0; |
Marc Gauthier | 84ed305 | 2012-10-15 03:55:35 +0400 | [diff] [blame] | 247 | } else { |
| 248 | int len = childregs->wmask & ~0xf; |
| 249 | memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4], |
| 250 | ®s->areg[XCHAL_NUM_AREGS - len/4], len); |
| 251 | } |
Chris Zankel | c50842d | 2013-02-23 19:35:57 -0800 | [diff] [blame] | 252 | |
| 253 | /* The thread pointer is passed in the '4th argument' (= a5) */ |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 254 | if (clone_flags & CLONE_SETTLS) |
Chris Zankel | c50842d | 2013-02-23 19:35:57 -0800 | [diff] [blame] | 255 | childregs->threadptr = childregs->areg[5]; |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 256 | } else { |
Max Filippov | 3306a72 | 2012-10-25 11:10:50 +0400 | [diff] [blame] | 257 | p->thread.ra = MAKE_RA_FOR_CALL( |
| 258 | (unsigned long)ret_from_kernel_thread, 1); |
| 259 | |
| 260 | /* pass parameters to ret_from_kernel_thread: |
| 261 | * a2 = thread_fn, a3 = thread_fn arg |
| 262 | */ |
| 263 | *((int *)childregs - 1) = thread_fn_arg; |
| 264 | *((int *)childregs - 2) = usp_thread_fn; |
| 265 | |
| 266 | /* Childregs are only used when we're going to userspace |
| 267 | * in which case start_thread will set them up. |
| 268 | */ |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 269 | } |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 270 | |
| 271 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) |
| 272 | ti = task_thread_info(p); |
| 273 | ti->cpenable = 0; |
| 274 | #endif |
| 275 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 276 | return 0; |
| 277 | } |
| 278 | |
| 279 | |
| 280 | /* |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 281 | * These bracket the sleeping functions.. |
| 282 | */ |
| 283 | |
| 284 | unsigned long get_wchan(struct task_struct *p) |
| 285 | { |
| 286 | unsigned long sp, pc; |
Al Viro | 04fe6fa | 2006-01-12 01:05:50 -0800 | [diff] [blame] | 287 | unsigned long stack_page = (unsigned long) task_stack_page(p); |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 288 | int count = 0; |
| 289 | |
| 290 | if (!p || p == current || p->state == TASK_RUNNING) |
| 291 | return 0; |
| 292 | |
| 293 | sp = p->thread.sp; |
| 294 | pc = MAKE_PC_FROM_RA(p->thread.ra, p->thread.sp); |
| 295 | |
| 296 | do { |
| 297 | if (sp < stack_page + sizeof(struct task_struct) || |
| 298 | sp >= (stack_page + THREAD_SIZE) || |
| 299 | pc == 0) |
| 300 | return 0; |
| 301 | if (!in_sched_functions(pc)) |
| 302 | return pc; |
| 303 | |
| 304 | /* Stack layout: sp-4: ra, sp-3: sp' */ |
| 305 | |
| 306 | pc = MAKE_PC_FROM_RA(*(unsigned long*)sp - 4, sp); |
| 307 | sp = *(unsigned long *)sp - 3; |
| 308 | } while (count++ < 16); |
| 309 | return 0; |
| 310 | } |
| 311 | |
| 312 | /* |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 313 | * xtensa_gregset_t and 'struct pt_regs' are vastly different formats |
| 314 | * of processor registers. Besides different ordering, |
| 315 | * xtensa_gregset_t contains non-live register information that |
| 316 | * 'struct pt_regs' does not. Exception handling (primarily) uses |
| 317 | * 'struct pt_regs'. Core files and ptrace use xtensa_gregset_t. |
| 318 | * |
| 319 | */ |
| 320 | |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 321 | void xtensa_elf_core_copy_regs (xtensa_gregset_t *elfregs, struct pt_regs *regs) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 322 | { |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 323 | unsigned long wb, ws, wm; |
| 324 | int live, last; |
| 325 | |
| 326 | wb = regs->windowbase; |
| 327 | ws = regs->windowstart; |
| 328 | wm = regs->wmask; |
| 329 | ws = ((ws >> wb) | (ws << (WSBITS - wb))) & ((1 << WSBITS) - 1); |
| 330 | |
| 331 | /* Don't leak any random bits. */ |
| 332 | |
Alan Cox | 688bb41 | 2012-07-11 14:02:50 -0700 | [diff] [blame] | 333 | memset(elfregs, 0, sizeof(*elfregs)); |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 334 | |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 335 | /* Note: PS.EXCM is not set while user task is running; its |
| 336 | * being set in regs->ps is for exception handling convenience. |
| 337 | */ |
| 338 | |
| 339 | elfregs->pc = regs->pc; |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 340 | elfregs->ps = (regs->ps & ~(1 << PS_EXCM_BIT)); |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 341 | elfregs->lbeg = regs->lbeg; |
| 342 | elfregs->lend = regs->lend; |
| 343 | elfregs->lcount = regs->lcount; |
| 344 | elfregs->sar = regs->sar; |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 345 | elfregs->windowstart = ws; |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 346 | |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 347 | live = (wm & 2) ? 4 : (wm & 4) ? 8 : (wm & 8) ? 12 : 16; |
| 348 | last = XCHAL_NUM_AREGS - (wm >> 4) * 4; |
| 349 | memcpy(elfregs->a, regs->areg, live * 4); |
| 350 | memcpy(elfregs->a + last, regs->areg + last, (wm >> 4) * 16); |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 351 | } |
| 352 | |
Chris Zankel | c658eac | 2008-02-12 13:17:07 -0800 | [diff] [blame] | 353 | int dump_fpu(void) |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 354 | { |
Chris Zankel | 5a0015d | 2005-06-23 22:01:16 -0700 | [diff] [blame] | 355 | return 0; |
| 356 | } |