/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* Linux/PA-RISC Project (http://www.parisc-linux.org/)3*4* kernel entry points (interruptions, system call wrappers)5* Copyright (C) 1999,2000 Philipp Rumpf6* Copyright (C) 1999 SuSE GmbH Nuernberg7* Copyright (C) 2000 Hewlett-Packard (John Marvin)8* Copyright (C) 1999 Hewlett-Packard (Frank Rowand)9*/1011#include <asm/asm-offsets.h>1213/* we have the following possibilities to act on an interruption:14* - handle in assembly and use shadowed registers only15* - save registers to kernel stack and handle in assembly or C */161718#include <asm/psw.h>19#include <asm/cache.h> /* for L1_CACHE_SHIFT */20#include <asm/assembly.h> /* for LDREG/STREG defines */21#include <asm/signal.h>22#include <asm/unistd.h>23#include <asm/ldcw.h>24#include <asm/traps.h>25#include <asm/thread_info.h>26#include <asm/alternative.h>27#include <asm/spinlock_types.h>2829#include <linux/linkage.h>30#include <linux/pgtable.h>3132#ifdef CONFIG_64BIT33.level 2.0w34#else35.level 2.036#endif3738/*39* We need seven instructions after a TLB insert for it to take effect.40* The PA8800/PA8900 processors are an exception and need 12 instructions.41* The RFI changes both IAOQ_Back and IAOQ_Front, so it counts as one.42*/43#ifdef CONFIG_64BIT44#define NUM_PIPELINE_INSNS 1245#else46#define NUM_PIPELINE_INSNS 747#endif4849/* Insert num nops */50.macro insert_nops num51.rept \num52nop53.endr54.endm5556/* Get aligned page_table_lock address for this mm from cr28/tr4 */57.macro get_ptl reg58mfctl %cr28,\reg59.endm6061/* space_to_prot macro creates a prot id from a space id */6263#if (SPACEID_SHIFT) == 064.macro space_to_prot spc prot65depd,z \spc,62,31,\prot66.endm67#else68.macro space_to_prot spc prot69extrd,u \spc,(64 - (SPACEID_SHIFT)),32,\prot70.endm71#endif72/*73* The "get_stack" macros are responsible for determining the74* kernel stack value.75*76* If sr7 == 077* Already using a kernel stack, so call the78* get_stack_use_r30 macro to push a pt_regs structure79* on the stack, and store registers there.80* else81* Need to set up a kernel stack, so call the82* get_stack_use_cr30 macro to set up a pointer83* to the pt_regs structure contained within the84* task pointer pointed to by cr30. Load the stack85* pointer from the task structure.86*87* Note that we use shadowed registers for temps until88* we can save %r26 and %r29. %r26 is used to preserve89* %r8 (a shadowed register) which temporarily contained90* either the fault type ("code") or the eirr. We need91* to use a non-shadowed register to carry the value over92* the rfir in virt_map. We use %r26 since this value winds93* up being passed as the argument to either do_cpu_irq_mask94* or handle_interruption. %r29 is used to hold a pointer95* the register save area, and once again, it needs to96* be a non-shadowed register so that it survives the rfir.97*/9899.macro get_stack_use_cr30100101/* we save the registers in the task struct */102103copy %r30, %r17104mfctl %cr30, %r1105tophys %r1,%r9 /* task_struct */106LDREG TASK_STACK(%r9),%r30107ldo PT_SZ_ALGN(%r30),%r30108mtsp %r0,%sr7 /* clear sr7 after kernel stack was set! */109mtsp %r16,%sr3110ldo TASK_REGS(%r9),%r9111STREG %r17,PT_GR30(%r9)112STREG %r29,PT_GR29(%r9)113STREG %r26,PT_GR26(%r9)114STREG %r16,PT_SR7(%r9)115copy %r9,%r29116.endm117118.macro get_stack_use_r30119120/* we put a struct pt_regs on the stack and save the registers there */121122tophys %r30,%r9123copy %r30,%r1124ldo PT_SZ_ALGN(%r30),%r30125STREG %r1,PT_GR30(%r9)126STREG %r29,PT_GR29(%r9)127STREG %r26,PT_GR26(%r9)128STREG %r16,PT_SR7(%r9)129copy %r9,%r29130.endm131132.macro rest_stack133LDREG PT_GR1(%r29), %r1134LDREG PT_GR30(%r29),%r30135LDREG PT_GR29(%r29),%r29136.endm137138/* default interruption handler139* (calls traps.c:handle_interruption) */140.macro def code141b intr_save142ldi \code, %r8143.align 32144.endm145146/* Interrupt interruption handler147* (calls irq.c:do_cpu_irq_mask) */148.macro extint code149b intr_extint150mfsp %sr7,%r16151.align 32152.endm153154.import os_hpmc, code155156/* HPMC handler */157.macro hpmc code158nop /* must be a NOP, will be patched later */159load32 PA(os_hpmc), %r3160bv,n 0(%r3)161nop162.word 0 /* checksum (will be patched) */163.word 0 /* address of handler */164.word 0 /* length of handler */165.endm166167/*168* Performance Note: Instructions will be moved up into169* this part of the code later on, once we are sure170* that the tlb miss handlers are close to final form.171*/172173/* Register definitions for tlb miss handler macros */174175va = r8 /* virtual address for which the trap occurred */176spc = r24 /* space for which the trap occurred */177178#ifndef CONFIG_64BIT179180/*181* itlb miss interruption handler (parisc 1.1 - 32 bit)182*/183184.macro itlb_11 code185186mfctl %pcsq, spc187b itlb_miss_11188mfctl %pcoq, va189190.align 32191.endm192#endif193194/*195* itlb miss interruption handler (parisc 2.0)196*/197198.macro itlb_20 code199mfctl %pcsq, spc200#ifdef CONFIG_64BIT201b itlb_miss_20w202#else203b itlb_miss_20204#endif205mfctl %pcoq, va206207.align 32208.endm209210#ifndef CONFIG_64BIT211/*212* naitlb miss interruption handler (parisc 1.1 - 32 bit)213*/214215.macro naitlb_11 code216217mfctl %isr,spc218b naitlb_miss_11219mfctl %ior,va220221.align 32222.endm223#endif224225/*226* naitlb miss interruption handler (parisc 2.0)227*/228229.macro naitlb_20 code230231mfctl %isr,spc232#ifdef CONFIG_64BIT233b naitlb_miss_20w234#else235b naitlb_miss_20236#endif237mfctl %ior,va238239.align 32240.endm241242#ifndef CONFIG_64BIT243/*244* dtlb miss interruption handler (parisc 1.1 - 32 bit)245*/246247.macro dtlb_11 code248249mfctl %isr, spc250b dtlb_miss_11251mfctl %ior, va252253.align 32254.endm255#endif256257/*258* dtlb miss interruption handler (parisc 2.0)259*/260261.macro dtlb_20 code262263mfctl %isr, spc264#ifdef CONFIG_64BIT265b dtlb_miss_20w266#else267b dtlb_miss_20268#endif269mfctl %ior, va270271.align 32272.endm273274#ifndef CONFIG_64BIT275/* nadtlb miss interruption handler (parisc 1.1 - 32 bit) */276277.macro nadtlb_11 code278279mfctl %isr,spc280b nadtlb_miss_11281mfctl %ior,va282283.align 32284.endm285#endif286287/* nadtlb miss interruption handler (parisc 2.0) */288289.macro nadtlb_20 code290291mfctl %isr,spc292#ifdef CONFIG_64BIT293b nadtlb_miss_20w294#else295b nadtlb_miss_20296#endif297mfctl %ior,va298299.align 32300.endm301302#ifndef CONFIG_64BIT303/*304* dirty bit trap interruption handler (parisc 1.1 - 32 bit)305*/306307.macro dbit_11 code308309mfctl %isr,spc310b dbit_trap_11311mfctl %ior,va312313.align 32314.endm315#endif316317/*318* dirty bit trap interruption handler (parisc 2.0)319*/320321.macro dbit_20 code322323mfctl %isr,spc324#ifdef CONFIG_64BIT325b dbit_trap_20w326#else327b dbit_trap_20328#endif329mfctl %ior,va330331.align 32332.endm333334/* In LP64, the space contains part of the upper 32 bits of the335* fault. We have to extract this and place it in the va,336* zeroing the corresponding bits in the space register */337.macro space_adjust spc,va,tmp338#ifdef CONFIG_64BIT339extrd,u \spc,63,SPACEID_SHIFT,\tmp340depd %r0,63,SPACEID_SHIFT,\spc341depd \tmp,31,SPACEID_SHIFT,\va342#endif343.endm344345.import swapper_pg_dir,code346347/* Get the pgd. For faults on space zero (kernel space), this348* is simply swapper_pg_dir. For user space faults, the349* pgd is stored in %cr25 */350.macro get_pgd spc,reg351ldil L%PA(swapper_pg_dir),\reg352ldo R%PA(swapper_pg_dir)(\reg),\reg353or,COND(=) %r0,\spc,%r0354mfctl %cr25,\reg355.endm356357/*358space_check(spc,tmp,fault)359360spc - The space we saw the fault with.361tmp - The place to store the current space.362fault - Function to call on failure.363364Only allow faults on different spaces from the365currently active one if we're the kernel366367*/368.macro space_check spc,tmp,fault369mfsp %sr7,\tmp370/* check against %r0 which is same value as LINUX_GATEWAY_SPACE */371or,COND(<>) %r0,\spc,%r0 /* user may execute gateway page372* as kernel, so defeat the space373* check if it is */374copy \spc,\tmp375or,COND(=) %r0,\tmp,%r0 /* nullify if executing as kernel */376cmpb,COND(<>),n \tmp,\spc,\fault377.endm378379/* Look up a PTE in a 2-Level scheme (faulting at each380* level if the entry isn't present381*382* NOTE: we use ldw even for LP64, since the short pointers383* can address up to 1TB384*/385.macro L2_ptep pmd,pte,index,va,fault386#if CONFIG_PGTABLE_LEVELS == 3387extru_safe \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index388#else389extru_safe \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index390#endif391dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */392#if CONFIG_PGTABLE_LEVELS < 3393copy %r0,\pte394#endif395ldw,s \index(\pmd),\pmd396bb,>=,n \pmd,_PxD_PRESENT_BIT,\fault397dep %r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */398SHLREG \pmd,PxD_VALUE_SHIFT,\pmd399extru_safe \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index400dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */401shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd /* pmd is now pte */402.endm403404/* Look up PTE in a 3-Level scheme. */405.macro L3_ptep pgd,pte,index,va,fault406#if CONFIG_PGTABLE_LEVELS == 3407copy %r0,\pte408extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index409ldw,s \index(\pgd),\pgd410bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault411shld \pgd,PxD_VALUE_SHIFT,\pgd412#endif413L2_ptep \pgd,\pte,\index,\va,\fault414.endm415416/* Acquire page_table_lock and check page is present. */417.macro ptl_lock spc,ptp,pte,tmp,tmp1,fault418#ifdef CONFIG_TLB_PTLOCK41998: cmpib,COND(=),n 0,\spc,2f420get_ptl \tmp4211: LDCW 0(\tmp),\tmp1422cmpib,COND(=) 0,\tmp1,1b423nop424LDREG 0(\ptp),\pte425bb,<,n \pte,_PAGE_PRESENT_BIT,3f426b \fault427stw \tmp1,0(\tmp)42899: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP)429#endif4302: LDREG 0(\ptp),\pte431bb,>=,n \pte,_PAGE_PRESENT_BIT,\fault4323:433.endm434435/* Release page_table_lock if for user space. We use an ordered436store to ensure all prior accesses are performed prior to437releasing the lock. Note stw may not be executed, so we438provide one extra nop when CONFIG_TLB_PTLOCK is defined. */439.macro ptl_unlock spc,tmp,tmp2440#ifdef CONFIG_TLB_PTLOCK44198: get_ptl \tmp442ldi __ARCH_SPIN_LOCK_UNLOCKED_VAL, \tmp2443or,COND(=) %r0,\spc,%r0444stw,ma \tmp2,0(\tmp)44599: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP)446insert_nops NUM_PIPELINE_INSNS - 4447#else448insert_nops NUM_PIPELINE_INSNS - 1449#endif450.endm451452/* Set the _PAGE_ACCESSED bit of the PTE. Be clever and453* don't needlessly dirty the cache line if it was already set */454.macro update_accessed ptp,pte,tmp,tmp1455ldi _PAGE_ACCESSED,\tmp1456or \tmp1,\pte,\tmp457and,COND(<>) \tmp1,\pte,%r0458STREG \tmp,0(\ptp)459.endm460461/* Set the dirty bit (and accessed bit). No need to be462* clever, this is only used from the dirty fault */463.macro update_dirty ptp,pte,tmp464ldi _PAGE_ACCESSED|_PAGE_DIRTY,\tmp465or \tmp,\pte,\pte466STREG \pte,0(\ptp)467.endm468469/* We have (depending on the page size):470* - 38 to 52-bit Physical Page Number471* - 12 to 26-bit page offset472*/473/* bitshift difference between a PFN (based on kernel's PAGE_SIZE)474* to a CPU TLB 4k PFN (4k => 12 bits to shift) */475#define PAGE_ADD_SHIFT (PAGE_SHIFT-12)476#define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12)477#define PFN_START_BIT (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT)478479/* Drop prot bits and convert to page addr for iitlbt and idtlbt */480.macro convert_for_tlb_insert20 pte,tmp481#ifdef CONFIG_HUGETLB_PAGE482copy \pte,\tmp483extrd,u \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte484485depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\486(63-58)+PAGE_ADD_SHIFT,\pte487extrd,u,*= \tmp,_PAGE_HPAGE_BIT+32,1,%r0488depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\489(63-58)+PAGE_ADD_HUGE_SHIFT,\pte490#else /* Huge pages disabled */491extrd,u \pte,PFN_START_BIT,PFN_START_BIT+1,\pte492depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\493(63-58)+PAGE_ADD_SHIFT,\pte494#endif495.endm496497/* Convert the pte and prot to tlb insertion values. How498* this happens is quite subtle, read below */499.macro make_insert_tlb spc,pte,prot,tmp500space_to_prot \spc \prot /* create prot id from space */501502#if _PAGE_SPECIAL_BIT == _PAGE_DMB_BIT503/* need to drop DMB bit, as it's used as SPECIAL flag */504depi 0,_PAGE_SPECIAL_BIT,1,\pte505#endif506507/* The following is the real subtlety. This is depositing508* T <-> _PAGE_REFTRAP509* D <-> _PAGE_DIRTY510* B <-> _PAGE_DMB (memory break)511*512* Then incredible subtlety: The access rights are513* _PAGE_GATEWAY, _PAGE_EXEC and _PAGE_WRITE514* See 3-14 of the parisc 2.0 manual515*516* Finally, _PAGE_READ goes in the top bit of PL1 (so we517* trigger an access rights trap in user space if the user518* tries to read an unreadable page */519depd \pte,8,7,\prot520521/* PAGE_USER indicates the page can be read with user privileges,522* so deposit X1|11 to PL1|PL2 (remember the upper bit of PL1523* contains _PAGE_READ). While the kernel can't directly write524* user pages which have _PAGE_WRITE zero, it can read pages525* which have _PAGE_READ zero (PL <= PL1). Thus, the kernel526* exception fault handler doesn't trigger when reading pages527* that aren't user read accessible */528extrd,u,*= \pte,_PAGE_USER_BIT+32,1,%r0529depdi 7,11,3,\prot530531/* If we're a gateway page, drop PL2 back to zero for promotion532* to kernel privilege (so we can execute the page as kernel).533* Any privilege promotion page always denys read and write */534extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0535depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */536537/* Enforce uncacheable pages.538* This should ONLY be use for MMIO on PA 2.0 machines.539* Memory/DMA is cache coherent on all PA2.0 machines we support540* (that means T-class is NOT supported) and the memory controllers541* on most of those machines only handles cache transactions.542*/543extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0544depdi 1,12,1,\prot545546/* Drop prot bits and convert to page addr for iitlbt and idtlbt */547convert_for_tlb_insert20 \pte \tmp548.endm549550/* Identical macro to make_insert_tlb above, except it551* makes the tlb entry for the differently formatted pa11552* insertion instructions */553.macro make_insert_tlb_11 spc,pte,prot554#if _PAGE_SPECIAL_BIT == _PAGE_DMB_BIT555/* need to drop DMB bit, as it's used as SPECIAL flag */556depi 0,_PAGE_SPECIAL_BIT,1,\pte557#endif558zdep \spc,30,15,\prot559dep \pte,8,7,\prot560extru,= \pte,_PAGE_NO_CACHE_BIT,1,%r0561depi 1,12,1,\prot562extru,= \pte,_PAGE_USER_BIT,1,%r0563depi 7,11,3,\prot /* Set for user space (1 rsvd for read) */564extru,= \pte,_PAGE_GATEWAY_BIT,1,%r0565depi 0,11,2,\prot /* If Gateway, Set PL2 to 0 */566567/* Get rid of prot bits and convert to page addr for iitlba */568569depi 0,31,ASM_PFN_PTE_SHIFT,\pte570SHRREG \pte,(ASM_PFN_PTE_SHIFT-(31-26)),\pte571.endm572573/* This is for ILP32 PA2.0 only. The TLB insertion needs574* to extend into I/O space if the address is 0xfXXXXXXX575* so we extend the f's into the top word of the pte in576* this case */577.macro f_extend pte,tmp578extrd,s \pte,42,4,\tmp579addi,<> 1,\tmp,%r0580extrd,s \pte,63,25,\pte581.endm582583/* The alias region is comprised of a pair of 4 MB regions584* aligned to 8 MB. It is used to clear/copy/flush user pages585* using kernel virtual addresses congruent with the user586* virtual address.587*588* To use the alias page, you set %r26 up with the to TLB589* entry (identifying the physical page) and %r23 up with590* the from tlb entry (or nothing if only a to entry---for591* clear_user_page_asm) */592.macro do_alias spc,tmp,tmp1,va,pte,prot,fault,patype593cmpib,COND(<>),n 0,\spc,\fault594ldil L%(TMPALIAS_MAP_START),\tmp595copy \va,\tmp1596depi_safe 0,31,TMPALIAS_SIZE_BITS+1,\tmp1597cmpb,COND(<>),n \tmp,\tmp1,\fault598mfctl %cr19,\tmp /* iir */599/* get the opcode (first six bits) into \tmp */600extrw,u \tmp,5,6,\tmp601/*602* Only setting the T bit prevents data cache movein603* Setting access rights to zero prevents instruction cache movein604*605* Note subtlety here: _PAGE_GATEWAY, _PAGE_EXEC and _PAGE_WRITE go606* to type field and _PAGE_READ goes to top bit of PL1607*/608ldi (_PAGE_REFTRAP|_PAGE_READ|_PAGE_WRITE),\prot609/*610* so if the opcode is one (i.e. this is a memory management611* instruction) nullify the next load so \prot is only T.612* Otherwise this is a normal data operation613*/614cmpiclr,= 0x01,\tmp,%r0615ldi (_PAGE_DIRTY|_PAGE_READ|_PAGE_WRITE),\prot616.ifc \patype,20617depd,z \prot,8,7,\prot618.else619.ifc \patype,11620depw,z \prot,8,7,\prot621.else622.error "undefined PA type to do_alias"623.endif624.endif625/*626* OK, it is in the temp alias region, check whether "from" or "to".627* Check "subtle" note in pacache.S re: r23/r26.628*/629extrw,u,= \va,31-TMPALIAS_SIZE_BITS,1,%r0630or,COND(tr) %r23,%r0,\pte631or %r26,%r0,\pte632633/* convert phys addr in \pte (from r23 or r26) to tlb insert format */634SHRREG \pte,PAGE_SHIFT+PAGE_ADD_SHIFT-5, \pte635depi_safe _PAGE_SIZE_ENCODING_DEFAULT, 31,5, \pte636.endm637638639/*640* Fault_vectors are architecturally required to be aligned on a 2K641* boundary642*/643644.section .text.hot645.align 2048646647ENTRY(fault_vector_20)648/* First vector is invalid (0) */649.ascii "cows can fly"650.byte 0651.align 32652653hpmc 1654def 2655def 3656extint 4657def 5658itlb_20 PARISC_ITLB_TRAP659def 7660def 8661def 9662def 10663def 11664def 12665def 13666def 14667dtlb_20 15668naitlb_20 16669nadtlb_20 17670def 18671def 19672dbit_20 20673def 21674def 22675def 23676def 24677def 25678def 26679def 27680def 28681def 29682def 30683def 31684END(fault_vector_20)685686#ifndef CONFIG_64BIT687688.align 2048689690ENTRY(fault_vector_11)691/* First vector is invalid (0) */692.ascii "cows can fly"693.byte 0694.align 32695696hpmc 1697def 2698def 3699extint 4700def 5701itlb_11 PARISC_ITLB_TRAP702def 7703def 8704def 9705def 10706def 11707def 12708def 13709def 14710dtlb_11 15711naitlb_11 16712nadtlb_11 17713def 18714def 19715dbit_11 20716def 21717def 22718def 23719def 24720def 25721def 26722def 27723def 28724def 29725def 30726def 31727END(fault_vector_11)728729#endif730/* Fault vector is separately protected and *must* be on its own page */731.align PAGE_SIZE732733.import handle_interruption,code734.import do_cpu_irq_mask,code735736/*737* Child Returns here738*739* copy_thread moved args into task save area.740*/741742ENTRY(ret_from_kernel_thread)743/* Call schedule_tail first though */744BL schedule_tail, %r2745nop746747mfctl %cr30,%r1 /* task_struct */748LDREG TASK_PT_GR25(%r1), %r26749#ifdef CONFIG_64BIT750LDREG TASK_PT_GR27(%r1), %r27751#endif752LDREG TASK_PT_GR26(%r1), %r1753ble 0(%sr7, %r1)754copy %r31, %r2755b finish_child_return756nop757END(ret_from_kernel_thread)758759760/*761* struct task_struct *_switch_to(struct task_struct *prev,762* struct task_struct *next)763*764* switch kernel stacks and return prev */765ENTRY_CFI(_switch_to)766STREG %r2, -RP_OFFSET(%r30)767768callee_save_float769callee_save770771load32 _switch_to_ret, %r2772773STREG %r2, TASK_PT_KPC(%r26)774LDREG TASK_PT_KPC(%r25), %r2775776STREG %r30, TASK_PT_KSP(%r26)777LDREG TASK_PT_KSP(%r25), %r30778bv %r0(%r2)779mtctl %r25,%cr30780781ENTRY(_switch_to_ret)782mtctl %r0, %cr0 /* Needed for single stepping */783callee_rest784callee_rest_float785786LDREG -RP_OFFSET(%r30), %r2787bv %r0(%r2)788copy %r26, %r28789ENDPROC_CFI(_switch_to)790791/*792* Common rfi return path for interruptions, kernel execve, and793* sys_rt_sigreturn (sometimes). The sys_rt_sigreturn syscall will794* return via this path if the signal was received when the process795* was running; if the process was blocked on a syscall then the796* normal syscall_exit path is used. All syscalls for traced797* proceses exit via intr_restore.798*799* XXX If any syscalls that change a processes space id ever exit800* this way, then we will need to copy %sr3 in to PT_SR[3..7], and801* adjust IASQ[0..1].802*803*/804805.align PAGE_SIZE806807ENTRY_CFI(syscall_exit_rfi)808mfctl %cr30,%r16 /* task_struct */809ldo TASK_REGS(%r16),%r16810/* Force iaoq to userspace, as the user has had access to our current811* context via sigcontext. Also Filter the PSW for the same reason.812*/813LDREG PT_IAOQ0(%r16),%r19814depi PRIV_USER,31,2,%r19815STREG %r19,PT_IAOQ0(%r16)816LDREG PT_IAOQ1(%r16),%r19817depi PRIV_USER,31,2,%r19818STREG %r19,PT_IAOQ1(%r16)819LDREG PT_PSW(%r16),%r19820load32 USER_PSW_MASK,%r1821#ifdef CONFIG_64BIT822load32 USER_PSW_HI_MASK,%r20823depd %r20,31,32,%r1824#endif825and %r19,%r1,%r19 /* Mask out bits that user shouldn't play with */826load32 USER_PSW,%r1827or %r19,%r1,%r19 /* Make sure default USER_PSW bits are set */828STREG %r19,PT_PSW(%r16)829830/*831* If we aren't being traced, we never saved space registers832* (we don't store them in the sigcontext), so set them833* to "proper" values now (otherwise we'll wind up restoring834* whatever was last stored in the task structure, which might835* be inconsistent if an interrupt occurred while on the gateway836* page). Note that we may be "trashing" values the user put in837* them, but we don't support the user changing them.838*/839840STREG %r0,PT_SR2(%r16)841mfsp %sr3,%r19842STREG %r19,PT_SR0(%r16)843STREG %r19,PT_SR1(%r16)844STREG %r19,PT_SR3(%r16)845STREG %r19,PT_SR4(%r16)846STREG %r19,PT_SR5(%r16)847STREG %r19,PT_SR6(%r16)848STREG %r19,PT_SR7(%r16)849850ENTRY(intr_return)851/* check for reschedule */852mfctl %cr30,%r1853LDREG TASK_TI_FLAGS(%r1),%r19 /* sched.h: TIF_NEED_RESCHED */854bb,<,n %r19,31-TIF_NEED_RESCHED,intr_do_resched /* forward */855856.import do_notify_resume,code857intr_check_sig:858/* As above */859mfctl %cr30,%r1860LDREG TASK_TI_FLAGS(%r1),%r19861ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r20862and,COND(<>) %r19, %r20, %r0863b,n intr_restore /* skip past if we've nothing to do */864865/* This check is critical to having LWS866* working. The IASQ is zero on the gateway867* page and we cannot deliver any signals until868* we get off the gateway page.869*870* Only do signals if we are returning to user space871*/872LDREG PT_IASQ0(%r16), %r20873cmpib,COND(=),n LINUX_GATEWAY_SPACE, %r20, intr_restore /* forward */874LDREG PT_IASQ1(%r16), %r20875cmpib,COND(=),n LINUX_GATEWAY_SPACE, %r20, intr_restore /* forward */876877copy %r0, %r25 /* long in_syscall = 0 */878#ifdef CONFIG_64BIT879ldo -16(%r30),%r29 /* Reference param save area */880#endif881882/* NOTE: We need to enable interrupts if we have to deliver883* signals. We used to do this earlier but it caused kernel884* stack overflows. */885ssm PSW_SM_I, %r0886887BL do_notify_resume,%r2888copy %r16, %r26 /* struct pt_regs *regs */889890b,n intr_check_sig891892intr_restore:893copy %r16,%r29894ldo PT_FR31(%r29),%r1895rest_fp %r1896rest_general %r29897898/* inverse of virt_map */899pcxt_ssm_bug900rsm PSW_SM_QUIET,%r0 /* prepare for rfi */901tophys_r1 %r29902903/* Restore space id's and special cr's from PT_REGS904* structure pointed to by r29905*/906rest_specials %r29907908/* IMPORTANT: rest_stack restores r29 last (we are using it)!909* It also restores r1 and r30.910*/911rest_stack912913rfi914nop915916#ifndef CONFIG_PREEMPTION917# define intr_do_preempt intr_restore918#endif /* !CONFIG_PREEMPTION */919920.import schedule,code921intr_do_resched:922/* Only call schedule on return to userspace. If we're returning923* to kernel space, we may schedule if CONFIG_PREEMPTION, otherwise924* we jump back to intr_restore.925*/926LDREG PT_IASQ0(%r16), %r20927cmpib,COND(=) 0, %r20, intr_do_preempt928nop929LDREG PT_IASQ1(%r16), %r20930cmpib,COND(=) 0, %r20, intr_do_preempt931nop932933/* NOTE: We need to enable interrupts if we schedule. We used934* to do this earlier but it caused kernel stack overflows. */935ssm PSW_SM_I, %r0936937#ifdef CONFIG_64BIT938ldo -16(%r30),%r29 /* Reference param save area */939#endif940941ldil L%intr_check_sig, %r2942#ifndef CONFIG_64BIT943b schedule944#else945load32 schedule, %r20946bv %r0(%r20)947#endif948ldo R%intr_check_sig(%r2), %r2949950/* preempt the current task on returning to kernel951* mode from an interrupt, iff need_resched is set,952* and preempt_count is 0. otherwise, we continue on953* our merry way back to the current running task.954*/955#ifdef CONFIG_PREEMPTION956.import preempt_schedule_irq,code957intr_do_preempt:958rsm PSW_SM_I, %r0 /* disable interrupts */959960/* current_thread_info()->preempt_count */961mfctl %cr30, %r1962ldw TI_PRE_COUNT(%r1), %r19963cmpib,<> 0, %r19, intr_restore /* if preempt_count > 0 */964nop /* prev insn branched backwards */965966/* check if we interrupted a critical path */967LDREG PT_PSW(%r16), %r20968bb,<,n %r20, 31 - PSW_SM_I, intr_restore969nop970971/* ssm PSW_SM_I done later in intr_restore */972#ifdef CONFIG_MLONGCALLS973ldil L%intr_restore, %r2974load32 preempt_schedule_irq, %r1975bv %r0(%r1)976ldo R%intr_restore(%r2), %r2977#else978ldil L%intr_restore, %r1979BL preempt_schedule_irq, %r2980ldo R%intr_restore(%r1), %r2981#endif982#endif /* CONFIG_PREEMPTION */983984/*985* External interrupts.986*/987988intr_extint:989cmpib,COND(=),n 0,%r16,1f990991get_stack_use_cr30992b,n 2f9939941:995get_stack_use_r309962:997save_specials %r29998virt_map999save_general %r2910001001ldo PT_FR0(%r29), %r241002save_fp %r2410031004loadgp10051006copy %r29, %r26 /* arg0 is pt_regs */1007copy %r29, %r16 /* save pt_regs */10081009ldil L%intr_return, %r210101011#ifdef CONFIG_64BIT1012ldo -16(%r30),%r29 /* Reference param save area */1013#endif10141015b do_cpu_irq_mask1016ldo R%intr_return(%r2), %r2 /* return to intr_return, not here */1017ENDPROC_CFI(syscall_exit_rfi)101810191020/* Generic interruptions (illegal insn, unaligned, page fault, etc) */10211022ENTRY_CFI(intr_save) /* for os_hpmc */1023mfsp %sr7,%r161024cmpib,COND(=),n 0,%r16,1f1025get_stack_use_cr301026b 2f1027copy %r8,%r26102810291:1030get_stack_use_r301031copy %r8,%r26103210332:1034save_specials %r2910351036/* If this trap is a itlb miss, skip saving/adjusting isr/ior */1037cmpib,COND(=),n PARISC_ITLB_TRAP,%r26,skip_save_ior103810391040mfctl %isr, %r161041nop /* serialize mfctl on PA 2.0 to avoid 4 cycle penalty */1042mfctl %ior, %r17104310441045#ifdef CONFIG_64BIT1046/*1047* If the interrupted code was running with W bit off (32 bit),1048* clear the b bits (bits 0 & 1) in the ior.1049* save_specials left ipsw value in r8 for us to test.1050*/1051extrd,u,*<> %r8,PSW_W_BIT,1,%r01052depdi 0,1,2,%r1710531054/* adjust isr/ior: get high bits from isr and deposit in ior */1055space_adjust %r16,%r17,%r11056#endif1057STREG %r16, PT_ISR(%r29)1058STREG %r17, PT_IOR(%r29)10591060#if defined(CONFIG_64BIT)1061b,n intr_save210621063skip_save_ior:1064/* We have a itlb miss, and when executing code above 4 Gb on ILP64, we1065* need to adjust iasq/iaoq here in the same way we adjusted isr/ior1066* above.1067*/1068bb,COND(>=),n %r8,PSW_W_BIT,intr_save21069LDREG PT_IASQ0(%r29), %r161070LDREG PT_IAOQ0(%r29), %r171071/* adjust iasq/iaoq */1072space_adjust %r16,%r17,%r11073STREG %r16, PT_IASQ0(%r29)1074STREG %r17, PT_IAOQ0(%r29)1075#else1076skip_save_ior:1077#endif10781079intr_save2:1080virt_map1081save_general %r2910821083ldo PT_FR0(%r29), %r251084save_fp %r2510851086loadgp10871088copy %r29, %r25 /* arg1 is pt_regs */1089#ifdef CONFIG_64BIT1090ldo -16(%r30),%r29 /* Reference param save area */1091#endif10921093ldil L%intr_check_sig, %r21094copy %r25, %r16 /* save pt_regs */10951096b handle_interruption1097ldo R%intr_check_sig(%r2), %r21098ENDPROC_CFI(intr_save)109911001101/*1102* Note for all tlb miss handlers:1103*1104* cr24 contains a pointer to the kernel address space1105* page directory.1106*1107* cr25 contains a pointer to the current user address1108* space page directory.1109*1110* sr3 will contain the space id of the user address space1111* of the current running thread while that thread is1112* running in the kernel.1113*/11141115/*1116* register number allocations. Note that these are all1117* in the shadowed registers1118*/11191120t0 = r1 /* temporary register 0 */1121va = r8 /* virtual address for which the trap occurred */1122t1 = r9 /* temporary register 1 */1123pte = r16 /* pte/phys page # */1124prot = r17 /* prot bits */1125spc = r24 /* space for which the trap occurred */1126ptp = r25 /* page directory/page table pointer */11271128#ifdef CONFIG_64BIT11291130dtlb_miss_20w:1131space_adjust spc,va,t01132get_pgd spc,ptp1133space_check spc,t0,dtlb_fault11341135L3_ptep ptp,pte,t0,va,dtlb_check_alias_20w11361137ptl_lock spc,ptp,pte,t0,t1,dtlb_check_alias_20w1138update_accessed ptp,pte,t0,t111391140make_insert_tlb spc,pte,prot,t111411142idtlbt pte,prot11431144ptl_unlock spc,t0,t11145rfir1146nop11471148dtlb_check_alias_20w:1149do_alias spc,t0,t1,va,pte,prot,dtlb_fault,2011501151idtlbt pte,prot11521153insert_nops NUM_PIPELINE_INSNS - 11154rfir1155nop11561157nadtlb_miss_20w:1158space_adjust spc,va,t01159get_pgd spc,ptp1160space_check spc,t0,nadtlb_fault11611162L3_ptep ptp,pte,t0,va,nadtlb_check_alias_20w11631164ptl_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_20w1165update_accessed ptp,pte,t0,t111661167make_insert_tlb spc,pte,prot,t111681169idtlbt pte,prot11701171ptl_unlock spc,t0,t11172rfir1173nop11741175nadtlb_check_alias_20w:1176do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,2011771178idtlbt pte,prot11791180insert_nops NUM_PIPELINE_INSNS - 11181rfir1182nop11831184#else11851186dtlb_miss_11:1187get_pgd spc,ptp11881189space_check spc,t0,dtlb_fault11901191L2_ptep ptp,pte,t0,va,dtlb_check_alias_1111921193ptl_lock spc,ptp,pte,t0,t1,dtlb_check_alias_111194update_accessed ptp,pte,t0,t111951196make_insert_tlb_11 spc,pte,prot11971198mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */1199mtsp spc,%sr112001201idtlba pte,(%sr1,va)1202idtlbp prot,(%sr1,va)12031204mtsp t1, %sr1 /* Restore sr1 */12051206ptl_unlock spc,t0,t11207rfir1208nop12091210dtlb_check_alias_11:1211do_alias spc,t0,t1,va,pte,prot,dtlb_fault,1112121213idtlba pte,(va)1214idtlbp prot,(va)12151216insert_nops NUM_PIPELINE_INSNS - 11217rfir1218nop12191220nadtlb_miss_11:1221get_pgd spc,ptp12221223space_check spc,t0,nadtlb_fault12241225L2_ptep ptp,pte,t0,va,nadtlb_check_alias_1112261227ptl_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_111228update_accessed ptp,pte,t0,t112291230make_insert_tlb_11 spc,pte,prot12311232mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */1233mtsp spc,%sr112341235idtlba pte,(%sr1,va)1236idtlbp prot,(%sr1,va)12371238mtsp t1, %sr1 /* Restore sr1 */12391240ptl_unlock spc,t0,t11241rfir1242nop12431244nadtlb_check_alias_11:1245do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,1112461247idtlba pte,(va)1248idtlbp prot,(va)12491250insert_nops NUM_PIPELINE_INSNS - 11251rfir1252nop12531254dtlb_miss_20:1255space_adjust spc,va,t01256get_pgd spc,ptp1257space_check spc,t0,dtlb_fault12581259L2_ptep ptp,pte,t0,va,dtlb_check_alias_2012601261ptl_lock spc,ptp,pte,t0,t1,dtlb_check_alias_201262update_accessed ptp,pte,t0,t112631264make_insert_tlb spc,pte,prot,t112651266f_extend pte,t112671268idtlbt pte,prot12691270ptl_unlock spc,t0,t11271rfir1272nop12731274dtlb_check_alias_20:1275do_alias spc,t0,t1,va,pte,prot,dtlb_fault,2012761277idtlbt pte,prot12781279insert_nops NUM_PIPELINE_INSNS - 11280rfir1281nop12821283nadtlb_miss_20:1284get_pgd spc,ptp12851286space_check spc,t0,nadtlb_fault12871288L2_ptep ptp,pte,t0,va,nadtlb_check_alias_2012891290ptl_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_201291update_accessed ptp,pte,t0,t112921293make_insert_tlb spc,pte,prot,t112941295f_extend pte,t112961297idtlbt pte,prot12981299ptl_unlock spc,t0,t11300rfir1301nop13021303nadtlb_check_alias_20:1304do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,2013051306idtlbt pte,prot13071308insert_nops NUM_PIPELINE_INSNS - 11309rfir1310nop13111312#endif13131314nadtlb_emulate:13151316/*1317* Non-access misses can be caused by fdc,fic,pdc,lpa,probe and1318* probei instructions. The kernel no longer faults doing flushes.1319* Use of lpa and probe instructions is rare. Given the issue1320* with shadow registers, we defer everything to the "slow" path.1321*/1322b,n nadtlb_fault13231324#ifdef CONFIG_64BIT1325itlb_miss_20w:13261327/*1328* I miss is a little different, since we allow users to fault1329* on the gateway page which is in the kernel address space.1330*/13311332space_adjust spc,va,t01333get_pgd spc,ptp1334space_check spc,t0,itlb_fault13351336L3_ptep ptp,pte,t0,va,itlb_fault13371338ptl_lock spc,ptp,pte,t0,t1,itlb_fault1339update_accessed ptp,pte,t0,t113401341make_insert_tlb spc,pte,prot,t113421343iitlbt pte,prot13441345ptl_unlock spc,t0,t11346rfir1347nop13481349naitlb_miss_20w:13501351/*1352* I miss is a little different, since we allow users to fault1353* on the gateway page which is in the kernel address space.1354*/13551356space_adjust spc,va,t01357get_pgd spc,ptp1358space_check spc,t0,naitlb_fault13591360L3_ptep ptp,pte,t0,va,naitlb_check_alias_20w13611362ptl_lock spc,ptp,pte,t0,t1,naitlb_check_alias_20w1363update_accessed ptp,pte,t0,t113641365make_insert_tlb spc,pte,prot,t113661367iitlbt pte,prot13681369ptl_unlock spc,t0,t11370rfir1371nop13721373naitlb_check_alias_20w:1374do_alias spc,t0,t1,va,pte,prot,naitlb_fault,2013751376iitlbt pte,prot13771378insert_nops NUM_PIPELINE_INSNS - 11379rfir1380nop13811382#else13831384itlb_miss_11:1385get_pgd spc,ptp13861387space_check spc,t0,itlb_fault13881389L2_ptep ptp,pte,t0,va,itlb_fault13901391ptl_lock spc,ptp,pte,t0,t1,itlb_fault1392update_accessed ptp,pte,t0,t113931394make_insert_tlb_11 spc,pte,prot13951396mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */1397mtsp spc,%sr113981399iitlba pte,(%sr1,va)1400iitlbp prot,(%sr1,va)14011402mtsp t1, %sr1 /* Restore sr1 */14031404ptl_unlock spc,t0,t11405rfir1406nop14071408naitlb_miss_11:1409get_pgd spc,ptp14101411space_check spc,t0,naitlb_fault14121413L2_ptep ptp,pte,t0,va,naitlb_check_alias_1114141415ptl_lock spc,ptp,pte,t0,t1,naitlb_check_alias_111416update_accessed ptp,pte,t0,t114171418make_insert_tlb_11 spc,pte,prot14191420mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */1421mtsp spc,%sr114221423iitlba pte,(%sr1,va)1424iitlbp prot,(%sr1,va)14251426mtsp t1, %sr1 /* Restore sr1 */14271428ptl_unlock spc,t0,t11429rfir1430nop14311432naitlb_check_alias_11:1433do_alias spc,t0,t1,va,pte,prot,itlb_fault,1114341435iitlba pte,(%sr0, va)1436iitlbp prot,(%sr0, va)14371438insert_nops NUM_PIPELINE_INSNS - 11439rfir1440nop144114421443itlb_miss_20:1444get_pgd spc,ptp14451446space_check spc,t0,itlb_fault14471448L2_ptep ptp,pte,t0,va,itlb_fault14491450ptl_lock spc,ptp,pte,t0,t1,itlb_fault1451update_accessed ptp,pte,t0,t114521453make_insert_tlb spc,pte,prot,t114541455f_extend pte,t114561457iitlbt pte,prot14581459ptl_unlock spc,t0,t11460rfir1461nop14621463naitlb_miss_20:1464get_pgd spc,ptp14651466space_check spc,t0,naitlb_fault14671468L2_ptep ptp,pte,t0,va,naitlb_check_alias_2014691470ptl_lock spc,ptp,pte,t0,t1,naitlb_check_alias_201471update_accessed ptp,pte,t0,t114721473make_insert_tlb spc,pte,prot,t114741475f_extend pte,t114761477iitlbt pte,prot14781479ptl_unlock spc,t0,t11480rfir1481nop14821483naitlb_check_alias_20:1484do_alias spc,t0,t1,va,pte,prot,naitlb_fault,2014851486iitlbt pte,prot14871488insert_nops NUM_PIPELINE_INSNS - 11489rfir1490nop14911492#endif14931494#ifdef CONFIG_64BIT14951496dbit_trap_20w:1497space_adjust spc,va,t01498get_pgd spc,ptp1499space_check spc,t0,dbit_fault15001501L3_ptep ptp,pte,t0,va,dbit_fault15021503ptl_lock spc,ptp,pte,t0,t1,dbit_fault1504update_dirty ptp,pte,t115051506make_insert_tlb spc,pte,prot,t115071508idtlbt pte,prot15091510ptl_unlock spc,t0,t11511rfir1512nop1513#else15141515dbit_trap_11:15161517get_pgd spc,ptp15181519space_check spc,t0,dbit_fault15201521L2_ptep ptp,pte,t0,va,dbit_fault15221523ptl_lock spc,ptp,pte,t0,t1,dbit_fault1524update_dirty ptp,pte,t115251526make_insert_tlb_11 spc,pte,prot15271528mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */1529mtsp spc,%sr115301531idtlba pte,(%sr1,va)1532idtlbp prot,(%sr1,va)15331534mtsp t1, %sr1 /* Restore sr1 */15351536ptl_unlock spc,t0,t11537rfir1538nop15391540dbit_trap_20:1541get_pgd spc,ptp15421543space_check spc,t0,dbit_fault15441545L2_ptep ptp,pte,t0,va,dbit_fault15461547ptl_lock spc,ptp,pte,t0,t1,dbit_fault1548update_dirty ptp,pte,t115491550make_insert_tlb spc,pte,prot,t115511552f_extend pte,t115531554idtlbt pte,prot15551556ptl_unlock spc,t0,t11557rfir1558nop1559#endif15601561.import handle_interruption,code15621563kernel_bad_space:1564b intr_save1565ldi 31,%r8 /* Use an unused code */15661567dbit_fault:1568b intr_save1569ldi 20,%r815701571itlb_fault:1572b intr_save1573ldi PARISC_ITLB_TRAP,%r815741575nadtlb_fault:1576b intr_save1577ldi 17,%r815781579naitlb_fault:1580b intr_save1581ldi 16,%r815821583dtlb_fault:1584b intr_save1585ldi 15,%r815861587/* Register saving semantics for system calls:15881589%r1 clobbered by system call macro in userspace1590%r2 saved in PT_REGS by gateway page1591%r3 - %r18 preserved by C code (saved by signal code)1592%r19 - %r20 saved in PT_REGS by gateway page1593%r21 - %r22 non-standard syscall args1594stored in kernel stack by gateway page1595%r23 - %r26 arg3-arg0, saved in PT_REGS by gateway page1596%r27 - %r30 saved in PT_REGS by gateway page1597%r31 syscall return pointer1598*/15991600/* Floating point registers (FIXME: what do we do with these?)16011602%fr0 - %fr3 status/exception, not preserved1603%fr4 - %fr7 arguments1604%fr8 - %fr11 not preserved by C code1605%fr12 - %fr21 preserved by C code1606%fr22 - %fr31 not preserved by C code1607*/16081609.macro reg_save regs1610STREG %r3, PT_GR3(\regs)1611STREG %r4, PT_GR4(\regs)1612STREG %r5, PT_GR5(\regs)1613STREG %r6, PT_GR6(\regs)1614STREG %r7, PT_GR7(\regs)1615STREG %r8, PT_GR8(\regs)1616STREG %r9, PT_GR9(\regs)1617STREG %r10,PT_GR10(\regs)1618STREG %r11,PT_GR11(\regs)1619STREG %r12,PT_GR12(\regs)1620STREG %r13,PT_GR13(\regs)1621STREG %r14,PT_GR14(\regs)1622STREG %r15,PT_GR15(\regs)1623STREG %r16,PT_GR16(\regs)1624STREG %r17,PT_GR17(\regs)1625STREG %r18,PT_GR18(\regs)1626.endm16271628.macro reg_restore regs1629LDREG PT_GR3(\regs), %r31630LDREG PT_GR4(\regs), %r41631LDREG PT_GR5(\regs), %r51632LDREG PT_GR6(\regs), %r61633LDREG PT_GR7(\regs), %r71634LDREG PT_GR8(\regs), %r81635LDREG PT_GR9(\regs), %r91636LDREG PT_GR10(\regs),%r101637LDREG PT_GR11(\regs),%r111638LDREG PT_GR12(\regs),%r121639LDREG PT_GR13(\regs),%r131640LDREG PT_GR14(\regs),%r141641LDREG PT_GR15(\regs),%r151642LDREG PT_GR16(\regs),%r161643LDREG PT_GR17(\regs),%r171644LDREG PT_GR18(\regs),%r181645.endm16461647.macro fork_like name1648ENTRY_CFI(sys_\name\()_wrapper)1649mfctl %cr30,%r11650ldo TASK_REGS(%r1),%r11651reg_save %r11652mfctl %cr27, %r281653ldil L%sys_\name, %r311654be R%sys_\name(%sr4,%r31)1655STREG %r28, PT_CR27(%r1)1656ENDPROC_CFI(sys_\name\()_wrapper)1657.endm16581659fork_like clone1660fork_like clone31661fork_like fork1662fork_like vfork16631664/* Set the return value for the child */1665ENTRY(child_return)1666BL schedule_tail, %r21667nop1668finish_child_return:1669mfctl %cr30,%r11670ldo TASK_REGS(%r1),%r1 /* get pt regs */16711672LDREG PT_CR27(%r1), %r31673mtctl %r3, %cr271674reg_restore %r11675b syscall_exit1676copy %r0,%r281677END(child_return)16781679ENTRY_CFI(sys_rt_sigreturn_wrapper)1680mfctl %cr30,%r261681ldo TASK_REGS(%r26),%r26 /* get pt regs */1682/* Don't save regs, we are going to restore them from sigcontext. */1683STREG %r2, -RP_OFFSET(%r30)1684#ifdef CONFIG_64BIT1685ldo FRAME_SIZE(%r30), %r301686BL sys_rt_sigreturn,%r21687ldo -16(%r30),%r29 /* Reference param save area */1688#else1689BL sys_rt_sigreturn,%r21690ldo FRAME_SIZE(%r30), %r301691#endif16921693ldo -FRAME_SIZE(%r30), %r301694LDREG -RP_OFFSET(%r30), %r216951696/* FIXME: I think we need to restore a few more things here. */1697mfctl %cr30,%r11698ldo TASK_REGS(%r1),%r1 /* get pt regs */1699reg_restore %r117001701/* If the signal was received while the process was blocked on a1702* syscall, then r2 will take us to syscall_exit; otherwise r2 will1703* take us to syscall_exit_rfi and on to intr_return.1704*/1705bv %r0(%r2)1706LDREG PT_GR28(%r1),%r28 /* reload original r28 for syscall_exit */1707ENDPROC_CFI(sys_rt_sigreturn_wrapper)17081709ENTRY(syscall_exit)1710/* NOTE: Not all syscalls exit this way. rt_sigreturn will exit1711* via syscall_exit_rfi if the signal was received while the process1712* was running.1713*/17141715/* save return value now */1716mfctl %cr30, %r11717STREG %r28,TASK_PT_GR28(%r1)17181719/* Seems to me that dp could be wrong here, if the syscall involved1720* calling a module, and nothing got round to restoring dp on return.1721*/1722loadgp17231724syscall_check_resched:17251726/* check for reschedule */1727mfctl %cr30,%r191728LDREG TASK_TI_FLAGS(%r19),%r19 /* long */1729bb,<,n %r19, 31-TIF_NEED_RESCHED, syscall_do_resched /* forward */17301731.import do_signal,code1732syscall_check_sig:1733mfctl %cr30,%r191734LDREG TASK_TI_FLAGS(%r19),%r191735ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r261736and,COND(<>) %r19, %r26, %r01737b,n syscall_restore /* skip past if we've nothing to do */17381739syscall_do_signal:1740/* Save callee-save registers (for sigcontext).1741* FIXME: After this point the process structure should be1742* consistent with all the relevant state of the process1743* before the syscall. We need to verify this.1744*/1745mfctl %cr30,%r11746ldo TASK_REGS(%r1), %r26 /* struct pt_regs *regs */1747reg_save %r2617481749#ifdef CONFIG_64BIT1750ldo -16(%r30),%r29 /* Reference param save area */1751#endif17521753BL do_notify_resume,%r21754ldi 1, %r25 /* long in_syscall = 1 */17551756mfctl %cr30,%r11757ldo TASK_REGS(%r1), %r20 /* reload pt_regs */1758reg_restore %r2017591760b,n syscall_check_sig17611762syscall_restore:1763mfctl %cr30,%r117641765/* Are we being ptraced? */1766LDREG TASK_TI_FLAGS(%r1),%r191767ldi _TIF_SINGLESTEP|_TIF_BLOCKSTEP,%r21768and,COND(=) %r19,%r2,%r01769b,n syscall_restore_rfi17701771ldo TASK_PT_FR31(%r1),%r19 /* reload fpregs */1772rest_fp %r1917731774LDREG TASK_PT_SAR(%r1),%r19 /* restore SAR */1775mtsar %r1917761777LDREG TASK_PT_GR2(%r1),%r2 /* restore user rp */1778LDREG TASK_PT_GR19(%r1),%r191779LDREG TASK_PT_GR20(%r1),%r201780LDREG TASK_PT_GR21(%r1),%r211781LDREG TASK_PT_GR22(%r1),%r221782LDREG TASK_PT_GR23(%r1),%r231783LDREG TASK_PT_GR24(%r1),%r241784LDREG TASK_PT_GR25(%r1),%r251785LDREG TASK_PT_GR26(%r1),%r261786LDREG TASK_PT_GR27(%r1),%r27 /* restore user dp */1787LDREG TASK_PT_GR28(%r1),%r28 /* syscall return value */1788LDREG TASK_PT_GR29(%r1),%r291789LDREG TASK_PT_GR31(%r1),%r31 /* restore syscall rp */17901791/* NOTE: We use rsm/ssm pair to make this operation atomic */1792LDREG TASK_PT_GR30(%r1),%r1 /* Get user sp */1793rsm PSW_SM_I, %r01794copy %r1,%r30 /* Restore user sp */1795mfsp %sr3,%r1 /* Get user space id */1796mtsp %r1,%sr7 /* Restore sr7 */1797ssm PSW_SM_I, %r017981799/* Set sr2 to zero for userspace syscalls to work. */1800mtsp %r0,%sr21801mtsp %r1,%sr4 /* Restore sr4 */1802mtsp %r1,%sr5 /* Restore sr5 */1803mtsp %r1,%sr6 /* Restore sr6 */18041805depi PRIV_USER,31,2,%r31 /* ensure return to user mode. */18061807#ifdef CONFIG_64BIT1808/* decide whether to reset the wide mode bit1809*1810* For a syscall, the W bit is stored in the lowest bit1811* of sp. Extract it and reset W if it is zero */1812extrd,u,*<> %r30,63,1,%r11813rsm PSW_SM_W, %r01814/* now reset the lowest bit of sp if it was set */1815xor %r30,%r1,%r301816#endif1817be,n 0(%sr3,%r31) /* return to user space */18181819/* We have to return via an RFI, so that PSW T and R bits can be set1820* appropriately.1821* This sets up pt_regs so we can return via intr_restore, which is not1822* the most efficient way of doing things, but it works.1823*/1824syscall_restore_rfi:1825ldo -1(%r0),%r2 /* Set recovery cntr to -1 */1826mtctl %r2,%cr0 /* for immediate trap */1827LDREG TASK_PT_PSW(%r1),%r2 /* Get old PSW */1828ldi 0x0b,%r20 /* Create new PSW */1829depi -1,13,1,%r20 /* C, Q, D, and I bits */18301831/* The values of SINGLESTEP_BIT and BLOCKSTEP_BIT are1832* set in thread_info.h and converted to PA bitmap1833* numbers in asm-offsets.c */18341835/* if ((%r19.SINGLESTEP_BIT)) { %r20.27=1} */1836extru,= %r19,TIF_SINGLESTEP_PA_BIT,1,%r01837depi -1,27,1,%r20 /* R bit */18381839/* if ((%r19.BLOCKSTEP_BIT)) { %r20.7=1} */1840extru,= %r19,TIF_BLOCKSTEP_PA_BIT,1,%r01841depi -1,7,1,%r20 /* T bit */18421843STREG %r20,TASK_PT_PSW(%r1)18441845/* Always store space registers, since sr3 can be changed (e.g. fork) */18461847mfsp %sr3,%r251848STREG %r25,TASK_PT_SR3(%r1)1849STREG %r25,TASK_PT_SR4(%r1)1850STREG %r25,TASK_PT_SR5(%r1)1851STREG %r25,TASK_PT_SR6(%r1)1852STREG %r25,TASK_PT_SR7(%r1)1853STREG %r25,TASK_PT_IASQ0(%r1)1854STREG %r25,TASK_PT_IASQ1(%r1)18551856/* XXX W bit??? */1857/* Now if old D bit is clear, it means we didn't save all registers1858* on syscall entry, so do that now. This only happens on TRACEME1859* calls, or if someone attached to us while we were on a syscall.1860* We could make this more efficient by not saving r3-r18, but1861* then we wouldn't be able to use the common intr_restore path.1862* It is only for traced processes anyway, so performance is not1863* an issue.1864*/1865bb,< %r2,30,pt_regs_ok /* Branch if D set */1866ldo TASK_REGS(%r1),%r251867reg_save %r25 /* Save r3 to r18 */18681869/* Save the current sr */1870mfsp %sr0,%r21871STREG %r2,TASK_PT_SR0(%r1)18721873/* Save the scratch sr */1874mfsp %sr1,%r21875STREG %r2,TASK_PT_SR1(%r1)18761877/* sr2 should be set to zero for userspace syscalls */1878STREG %r0,TASK_PT_SR2(%r1)18791880LDREG TASK_PT_GR31(%r1),%r21881depi PRIV_USER,31,2,%r2 /* ensure return to user mode. */1882STREG %r2,TASK_PT_IAOQ0(%r1)1883ldo 4(%r2),%r21884STREG %r2,TASK_PT_IAOQ1(%r1)1885b intr_restore1886copy %r25,%r1618871888pt_regs_ok:1889LDREG TASK_PT_IAOQ0(%r1),%r21890depi PRIV_USER,31,2,%r2 /* ensure return to user mode. */1891STREG %r2,TASK_PT_IAOQ0(%r1)1892LDREG TASK_PT_IAOQ1(%r1),%r21893depi PRIV_USER,31,2,%r21894STREG %r2,TASK_PT_IAOQ1(%r1)1895b intr_restore1896copy %r25,%r1618971898syscall_do_resched:1899load32 syscall_check_resched,%r2 /* if resched, we start over again */1900load32 schedule,%r191901bv %r0(%r19) /* jumps to schedule() */1902#ifdef CONFIG_64BIT1903ldo -16(%r30),%r29 /* Reference param save area */1904#else1905nop1906#endif1907END(syscall_exit)190819091910#ifdef CONFIG_FUNCTION_TRACER19111912.import ftrace_function_trampoline,code1913.align L1_CACHE_BYTES1914ENTRY_CFI(mcount, caller)1915_mcount:1916.export _mcount,data1917/*1918* The 64bit mcount() function pointer needs 4 dwords, of which the1919* first two are free. We optimize it here and put 2 instructions for1920* calling mcount(), and 2 instructions for ftrace_stub(). That way we1921* have all on one L1 cacheline.1922*/1923ldi 0, %arg31924b ftrace_function_trampoline1925copy %r3, %arg2 /* caller original %sp */1926ftrace_stub:1927.globl ftrace_stub1928.type ftrace_stub, @function1929#ifdef CONFIG_64BIT1930bve (%rp)1931#else1932bv %r0(%rp)1933#endif1934nop1935#ifdef CONFIG_64BIT1936.dword mcount1937.dword 0 /* code in head.S puts value of global gp here */1938#endif1939ENDPROC_CFI(mcount)19401941#ifdef CONFIG_DYNAMIC_FTRACE19421943#ifdef CONFIG_64BIT1944#define FTRACE_FRAME_SIZE (2*FRAME_SIZE)1945#else1946#define FTRACE_FRAME_SIZE FRAME_SIZE1947#endif1948ENTRY_CFI(ftrace_caller, caller,frame=FTRACE_FRAME_SIZE,CALLS,SAVE_RP,SAVE_SP)1949ftrace_caller:1950.global ftrace_caller19511952STREG %r3, -FTRACE_FRAME_SIZE+1*REG_SZ(%sp)1953ldo -FTRACE_FRAME_SIZE(%sp), %r31954STREG %rp, -RP_OFFSET(%r3)19551956/* Offset 0 is already allocated for %r1 */1957STREG %r23, 2*REG_SZ(%r3)1958STREG %r24, 3*REG_SZ(%r3)1959STREG %r25, 4*REG_SZ(%r3)1960STREG %r26, 5*REG_SZ(%r3)1961STREG %r28, 6*REG_SZ(%r3)1962STREG %r29, 7*REG_SZ(%r3)1963#ifdef CONFIG_64BIT1964STREG %r19, 8*REG_SZ(%r3)1965STREG %r20, 9*REG_SZ(%r3)1966STREG %r21, 10*REG_SZ(%r3)1967STREG %r22, 11*REG_SZ(%r3)1968STREG %r27, 12*REG_SZ(%r3)1969STREG %r31, 13*REG_SZ(%r3)1970loadgp1971ldo -16(%sp),%r291972#endif1973LDREG 0(%r3), %r251974copy %rp, %r261975ldo -8(%r25), %r251976ldi 0, %r23 /* no pt_regs */1977b,l ftrace_function_trampoline, %rp1978copy %r3, %r2419791980LDREG -RP_OFFSET(%r3), %rp1981LDREG 2*REG_SZ(%r3), %r231982LDREG 3*REG_SZ(%r3), %r241983LDREG 4*REG_SZ(%r3), %r251984LDREG 5*REG_SZ(%r3), %r261985LDREG 6*REG_SZ(%r3), %r281986LDREG 7*REG_SZ(%r3), %r291987#ifdef CONFIG_64BIT1988LDREG 8*REG_SZ(%r3), %r191989LDREG 9*REG_SZ(%r3), %r201990LDREG 10*REG_SZ(%r3), %r211991LDREG 11*REG_SZ(%r3), %r221992LDREG 12*REG_SZ(%r3), %r271993LDREG 13*REG_SZ(%r3), %r311994#endif1995LDREG 1*REG_SZ(%r3), %r319961997LDREGM -FTRACE_FRAME_SIZE(%sp), %r11998/* Adjust return point to jump back to beginning of traced function */1999ldo -4(%r1), %r12000bv,n (%r1)20012002ENDPROC_CFI(ftrace_caller)20032004#ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS2005ENTRY_CFI(ftrace_regs_caller,caller,frame=FTRACE_FRAME_SIZE+PT_SZ_ALGN,2006CALLS,SAVE_RP,SAVE_SP)2007ftrace_regs_caller:2008.global ftrace_regs_caller20092010ldo -FTRACE_FRAME_SIZE(%sp), %r12011STREG %rp, -RP_OFFSET(%r1)20122013copy %sp, %r12014ldo PT_SZ_ALGN(%sp), %sp20152016STREG %rp, PT_GR2(%r1)2017STREG %r3, PT_GR3(%r1)2018STREG %r4, PT_GR4(%r1)2019STREG %r5, PT_GR5(%r1)2020STREG %r6, PT_GR6(%r1)2021STREG %r7, PT_GR7(%r1)2022STREG %r8, PT_GR8(%r1)2023STREG %r9, PT_GR9(%r1)2024STREG %r10, PT_GR10(%r1)2025STREG %r11, PT_GR11(%r1)2026STREG %r12, PT_GR12(%r1)2027STREG %r13, PT_GR13(%r1)2028STREG %r14, PT_GR14(%r1)2029STREG %r15, PT_GR15(%r1)2030STREG %r16, PT_GR16(%r1)2031STREG %r17, PT_GR17(%r1)2032STREG %r18, PT_GR18(%r1)2033STREG %r19, PT_GR19(%r1)2034STREG %r20, PT_GR20(%r1)2035STREG %r21, PT_GR21(%r1)2036STREG %r22, PT_GR22(%r1)2037STREG %r23, PT_GR23(%r1)2038STREG %r24, PT_GR24(%r1)2039STREG %r25, PT_GR25(%r1)2040STREG %r26, PT_GR26(%r1)2041STREG %r27, PT_GR27(%r1)2042STREG %r28, PT_GR28(%r1)2043STREG %r29, PT_GR29(%r1)2044STREG %r30, PT_GR30(%r1)2045STREG %r31, PT_GR31(%r1)2046mfctl %cr11, %r262047STREG %r26, PT_SAR(%r1)20482049copy %rp, %r262050LDREG -FTRACE_FRAME_SIZE-PT_SZ_ALGN(%sp), %r252051ldo -8(%r25), %r252052ldo -FTRACE_FRAME_SIZE(%r1), %arg22053b,l ftrace_function_trampoline, %rp2054copy %r1, %arg3 /* struct pt_regs */20552056ldo -PT_SZ_ALGN(%sp), %r120572058LDREG PT_SAR(%r1), %rp2059mtctl %rp, %cr1120602061LDREG PT_GR2(%r1), %rp2062LDREG PT_GR3(%r1), %r32063LDREG PT_GR4(%r1), %r42064LDREG PT_GR5(%r1), %r52065LDREG PT_GR6(%r1), %r62066LDREG PT_GR7(%r1), %r72067LDREG PT_GR8(%r1), %r82068LDREG PT_GR9(%r1), %r92069LDREG PT_GR10(%r1),%r102070LDREG PT_GR11(%r1),%r112071LDREG PT_GR12(%r1),%r122072LDREG PT_GR13(%r1),%r132073LDREG PT_GR14(%r1),%r142074LDREG PT_GR15(%r1),%r152075LDREG PT_GR16(%r1),%r162076LDREG PT_GR17(%r1),%r172077LDREG PT_GR18(%r1),%r182078LDREG PT_GR19(%r1),%r192079LDREG PT_GR20(%r1),%r202080LDREG PT_GR21(%r1),%r212081LDREG PT_GR22(%r1),%r222082LDREG PT_GR23(%r1),%r232083LDREG PT_GR24(%r1),%r242084LDREG PT_GR25(%r1),%r252085LDREG PT_GR26(%r1),%r262086LDREG PT_GR27(%r1),%r272087LDREG PT_GR28(%r1),%r282088LDREG PT_GR29(%r1),%r292089LDREG PT_GR30(%r1),%r302090LDREG PT_GR31(%r1),%r3120912092ldo -PT_SZ_ALGN(%sp), %sp2093LDREGM -FTRACE_FRAME_SIZE(%sp), %r12094/* Adjust return point to jump back to beginning of traced function */2095ldo -4(%r1), %r12096bv,n (%r1)20972098ENDPROC_CFI(ftrace_regs_caller)20992100#endif2101#endif21022103#ifdef CONFIG_FUNCTION_GRAPH_TRACER2104.align 82105ENTRY_CFI(return_to_handler, caller,frame=FRAME_SIZE)2106.export parisc_return_to_handler,data2107parisc_return_to_handler:2108copy %r3,%r12109STREG %r0,-RP_OFFSET(%sp) /* store 0 as %rp */2110copy %sp,%r32111STREGM %r1,FRAME_SIZE(%sp)2112STREG %ret0,8(%r3)2113STREG %ret1,16(%r3)21142115#ifdef CONFIG_64BIT2116loadgp2117#endif21182119/* call ftrace_return_to_handler(0) */2120.import ftrace_return_to_handler,code2121load32 ftrace_return_to_handler,%ret02122load32 .Lftrace_ret,%r22123#ifdef CONFIG_64BIT2124ldo -16(%sp),%ret1 /* Reference param save area */2125bve (%ret0)2126#else2127bv %r0(%ret0)2128#endif2129ldi 0,%r262130.Lftrace_ret:2131copy %ret0,%rp21322133/* restore original return values */2134LDREG 8(%r3),%ret02135LDREG 16(%r3),%ret121362137/* return from function */2138#ifdef CONFIG_64BIT2139bve (%rp)2140#else2141bv %r0(%rp)2142#endif2143LDREGM -FRAME_SIZE(%sp),%r32144ENDPROC_CFI(return_to_handler)21452146#endif /* CONFIG_FUNCTION_GRAPH_TRACER */21472148#endif /* CONFIG_FUNCTION_TRACER */21492150#ifdef CONFIG_IRQSTACKS2151/* void call_on_stack(unsigned long param1, void *func,2152unsigned long new_stack) */2153ENTRY_CFI(call_on_stack, FRAME=2*FRAME_SIZE,CALLS,SAVE_RP,SAVE_SP)2154ENTRY(_call_on_stack)2155copy %sp, %r121562157/* Regarding the HPPA calling conventions for function pointers,2158we assume the PIC register is not changed across call. For2159CONFIG_64BIT, the argument pointer is left to point at the2160argument region allocated for the call to call_on_stack. */21612162/* Switch to new stack. We allocate two frames. */2163ldo 2*FRAME_SIZE(%arg2), %sp2164# ifdef CONFIG_64BIT2165/* Save previous stack pointer and return pointer in frame marker */2166STREG %rp, -FRAME_SIZE-RP_OFFSET(%sp)2167/* Calls always use function descriptor */2168LDREG 16(%arg1), %arg12169bve,l (%arg1), %rp2170STREG %r1, -FRAME_SIZE-REG_SZ(%sp)2171LDREG -FRAME_SIZE-RP_OFFSET(%sp), %rp2172bve (%rp)2173LDREG -FRAME_SIZE-REG_SZ(%sp), %sp2174# else2175/* Save previous stack pointer and return pointer in frame marker */2176STREG %r1, -FRAME_SIZE-REG_SZ(%sp)2177STREG %rp, -FRAME_SIZE-RP_OFFSET(%sp)2178/* Calls use function descriptor if PLABEL bit is set */2179bb,>=,n %arg1, 30, 1f2180depwi 0,31,2, %arg12181LDREG 0(%arg1), %arg121821:2183be,l 0(%sr4,%arg1), %sr0, %r312184copy %r31, %rp2185LDREG -FRAME_SIZE-RP_OFFSET(%sp), %rp2186bv (%rp)2187LDREG -FRAME_SIZE-REG_SZ(%sp), %sp2188# endif /* CONFIG_64BIT */2189ENDPROC_CFI(call_on_stack)2190#endif /* CONFIG_IRQSTACKS */21912192ENTRY_CFI(get_register)2193/*2194* get_register is used by the non access tlb miss handlers to2195* copy the value of the general register specified in r8 into2196* r1. This routine can't be used for shadowed registers, since2197* the rfir will restore the original value. So, for the shadowed2198* registers we put a -1 into r1 to indicate that the register2199* should not be used (the register being copied could also have2200* a -1 in it, but that is OK, it just means that we will have2201* to use the slow path instead).2202*/2203blr %r8,%r02204nop2205bv %r0(%r25) /* r0 */2206copy %r0,%r12207bv %r0(%r25) /* r1 - shadowed */2208ldi -1,%r12209bv %r0(%r25) /* r2 */2210copy %r2,%r12211bv %r0(%r25) /* r3 */2212copy %r3,%r12213bv %r0(%r25) /* r4 */2214copy %r4,%r12215bv %r0(%r25) /* r5 */2216copy %r5,%r12217bv %r0(%r25) /* r6 */2218copy %r6,%r12219bv %r0(%r25) /* r7 */2220copy %r7,%r12221bv %r0(%r25) /* r8 - shadowed */2222ldi -1,%r12223bv %r0(%r25) /* r9 - shadowed */2224ldi -1,%r12225bv %r0(%r25) /* r10 */2226copy %r10,%r12227bv %r0(%r25) /* r11 */2228copy %r11,%r12229bv %r0(%r25) /* r12 */2230copy %r12,%r12231bv %r0(%r25) /* r13 */2232copy %r13,%r12233bv %r0(%r25) /* r14 */2234copy %r14,%r12235bv %r0(%r25) /* r15 */2236copy %r15,%r12237bv %r0(%r25) /* r16 - shadowed */2238ldi -1,%r12239bv %r0(%r25) /* r17 - shadowed */2240ldi -1,%r12241bv %r0(%r25) /* r18 */2242copy %r18,%r12243bv %r0(%r25) /* r19 */2244copy %r19,%r12245bv %r0(%r25) /* r20 */2246copy %r20,%r12247bv %r0(%r25) /* r21 */2248copy %r21,%r12249bv %r0(%r25) /* r22 */2250copy %r22,%r12251bv %r0(%r25) /* r23 */2252copy %r23,%r12253bv %r0(%r25) /* r24 - shadowed */2254ldi -1,%r12255bv %r0(%r25) /* r25 - shadowed */2256ldi -1,%r12257bv %r0(%r25) /* r26 */2258copy %r26,%r12259bv %r0(%r25) /* r27 */2260copy %r27,%r12261bv %r0(%r25) /* r28 */2262copy %r28,%r12263bv %r0(%r25) /* r29 */2264copy %r29,%r12265bv %r0(%r25) /* r30 */2266copy %r30,%r12267bv %r0(%r25) /* r31 */2268copy %r31,%r12269ENDPROC_CFI(get_register)227022712272ENTRY_CFI(set_register)2273/*2274* set_register is used by the non access tlb miss handlers to2275* copy the value of r1 into the general register specified in2276* r8.2277*/2278blr %r8,%r02279nop2280bv %r0(%r25) /* r0 (silly, but it is a place holder) */2281copy %r1,%r02282bv %r0(%r25) /* r1 */2283copy %r1,%r12284bv %r0(%r25) /* r2 */2285copy %r1,%r22286bv %r0(%r25) /* r3 */2287copy %r1,%r32288bv %r0(%r25) /* r4 */2289copy %r1,%r42290bv %r0(%r25) /* r5 */2291copy %r1,%r52292bv %r0(%r25) /* r6 */2293copy %r1,%r62294bv %r0(%r25) /* r7 */2295copy %r1,%r72296bv %r0(%r25) /* r8 */2297copy %r1,%r82298bv %r0(%r25) /* r9 */2299copy %r1,%r92300bv %r0(%r25) /* r10 */2301copy %r1,%r102302bv %r0(%r25) /* r11 */2303copy %r1,%r112304bv %r0(%r25) /* r12 */2305copy %r1,%r122306bv %r0(%r25) /* r13 */2307copy %r1,%r132308bv %r0(%r25) /* r14 */2309copy %r1,%r142310bv %r0(%r25) /* r15 */2311copy %r1,%r152312bv %r0(%r25) /* r16 */2313copy %r1,%r162314bv %r0(%r25) /* r17 */2315copy %r1,%r172316bv %r0(%r25) /* r18 */2317copy %r1,%r182318bv %r0(%r25) /* r19 */2319copy %r1,%r192320bv %r0(%r25) /* r20 */2321copy %r1,%r202322bv %r0(%r25) /* r21 */2323copy %r1,%r212324bv %r0(%r25) /* r22 */2325copy %r1,%r222326bv %r0(%r25) /* r23 */2327copy %r1,%r232328bv %r0(%r25) /* r24 */2329copy %r1,%r242330bv %r0(%r25) /* r25 */2331copy %r1,%r252332bv %r0(%r25) /* r26 */2333copy %r1,%r262334bv %r0(%r25) /* r27 */2335copy %r1,%r272336bv %r0(%r25) /* r28 */2337copy %r1,%r282338bv %r0(%r25) /* r29 */2339copy %r1,%r292340bv %r0(%r25) /* r30 */2341copy %r1,%r302342bv %r0(%r25) /* r31 */2343copy %r1,%r312344ENDPROC_CFI(set_register)2345234623472348