Path: blob/master/arch/unicore32/kernel/hibernate_asm.S
10817 views
/*1* linux/arch/unicore32/kernel/hibernate_asm.S2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Maintained by GUAN Xue-tao <[email protected]>6* Copyright (C) 2001-2010 Guan Xuetao7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License version 2 as10* published by the Free Software Foundation.11*/1213#include <linux/sys.h>14#include <linux/errno.h>15#include <linux/linkage.h>16#include <generated/asm-offsets.h>17#include <asm/page.h>18#include <asm/pgtable.h>19#include <asm/assembler.h>2021@ restore_image(pgd_t *resume_pg_dir, struct pbe *restore_pblist)22@ r0: resume_pg_dir23@ r1: restore_pblist24@ copy restore_pblist pages25@ restore registers from swsusp_arch_regs_cpu026@27ENTRY(restore_image)28sub r0, r0, #PAGE_OFFSET29mov r5, #030movc p0.c6, r5, #6 @invalidate ITLB & DTLB31movc p0.c2, r0, #032nop33nop34nop35nop36nop37nop38nop3940.p2align 4,,741101:42csub.a r1, #043beq 109f4445ldw r6, [r1+], #PBE_ADDRESS46ldw r7, [r1+], #PBE_ORIN_ADDRESS4748movl ip, #12849102: ldm.w (r8 - r15), [r6]+50stm.w (r8 - r15), [r7]+51sub.a ip, ip, #152bne 102b5354ldw r1, [r1+], #PBE_NEXT55b 101b5657.p2align 4,,758109:59/* go back to the original page tables */60ldw r0, =swapper_pg_dir61sub r0, r0, #PAGE_OFFSET62mov r5, #063movc p0.c6, r5, #664movc p0.c2, r0, #065nop66nop67nop68nop69nop70nop71nop7273#ifdef CONFIG_UNICORE_FPU_F6474ldw ip, 1f75add ip, ip, #SWSUSP_FPSTATE76lfm.w (f0 - f7 ), [ip]+77lfm.w (f8 - f15), [ip]+78lfm.w (f16 - f23), [ip]+79lfm.w (f24 - f31), [ip]+80ldw r4, [ip]81ctf r4, s3182#endif83mov r0, #0x084ldw ip, 1f85add ip, ip, #SWSUSP_CPU86ldm.w (r4 - r15), [ip]+87ldm (r16 - r27, sp, pc), [ip]+ @ Load all regs saved previously8889.align 2901: .long swsusp_arch_regs_cpu0919293@ swsusp_arch_suspend()94@ - prepare pc for resume, return from function without swsusp_save on resume95@ - save registers in swsusp_arch_regs_cpu096@ - call swsusp_save write suspend image9798ENTRY(swsusp_arch_suspend)99ldw ip, 1f100add ip, ip, #SWSUSP_CPU101stm.w (r4 - r15), [ip]+102stm.w (r16 - r27, sp, lr), [ip]+103104#ifdef CONFIG_UNICORE_FPU_F64105ldw ip, 1f106add ip, ip, #SWSUSP_FPSTATE107sfm.w (f0 - f7 ), [ip]+108sfm.w (f8 - f15), [ip]+109sfm.w (f16 - f23), [ip]+110sfm.w (f24 - f31), [ip]+111cff r4, s31112stw r4, [ip]113#endif114b swsusp_save @ no return1151161: .long swsusp_arch_regs_cpu0117118119