~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arc/kernel/ctx_sw_asm.S

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  4  *
  5  * Vineetg: Aug 2009
  6  *  -Moved core context switch macro out of entry.S into this file.
  7  *  -This is the more "natural" hand written assembler
  8  */
  9 
 10 #include <linux/linkage.h>
 11 #include <asm/entry.h>       /* For the SAVE_* macros */
 12 #include <asm/asm-offsets.h>
 13 
 14 ; IN
 15 ;  - r0: prev task (also current)
 16 ;  - r1: next task
 17 ; OUT
 18 ;  - r0: prev task (so r0 not touched)
 19 
 20         .section .sched.text,"ax",@progbits
 21 ENTRY_CFI(__switch_to)
 22 
 23         /* save kernel stack frame regs of @prev task */
 24         push    blink
 25         CFI_DEF_CFA_OFFSET 4
 26         CFI_OFFSET r31, -4
 27 
 28         push    fp
 29         CFI_DEF_CFA_OFFSET 8
 30         CFI_OFFSET r27, -8
 31 
 32         mov     fp, sp
 33         CFI_DEF_CFA_REGISTER r27
 34 
 35         /* kernel mode callee regs of @prev */
 36         SAVE_CALLEE_SAVED_KERNEL
 37 
 38         /*
 39          * save final SP to @prev->thread_info.ksp
 40          * @prev is "current" so thread_info derived from SP
 41          */
 42         GET_CURR_THR_INFO_FROM_SP  r10
 43         st      sp,  [r10, THREAD_INFO_KSP]
 44 
 45         /* update @next in _current_task[] and GP register caching it */
 46         SET_CURR_TASK_ON_CPU  r1, r10
 47 
 48         /* load SP from @next->thread_info.ksp */
 49         ld      r10, [r1, TASK_THREAD_INFO]
 50         ld      sp,  [r10, THREAD_INFO_KSP]
 51 
 52         /* restore callee regs, stack frame regs of @next */
 53         RESTORE_CALLEE_SAVED_KERNEL
 54 
 55         pop     fp
 56         CFI_RESTORE r27
 57         CFI_DEF_CFA r28, 4
 58 
 59         pop     blink
 60         CFI_RESTORE r31
 61         CFI_DEF_CFA_OFFSET 0
 62 
 63         j      [blink]
 64 END_CFI(__switch_to)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php