arch/sh/kernel/cpu/sh3/swsusp.S

Source file repositories/reference/linux-study-clean/arch/sh/kernel/cpu/sh3/swsusp.S

File Facts

System
Linux kernel
Corpus path
arch/sh/kernel/cpu/sh3/swsusp.S
Extension
.S
Size
2869 bytes
Lines
145
Domain
Architecture Layer
Bucket
arch/sh
Inferred role
Architecture Layer: arch/sh
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/sys.h>
#include <linux/errno.h>
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/page.h>

#define k0	r0
#define k1	r1
#define k2	r2
#define k3	r3
#define k4	r4

! swsusp_arch_resume()
! - copy restore_pblist pages
! - restore registers from swsusp_arch_regs_cpu0

ENTRY(swsusp_arch_resume)
	mov.l	1f, r15
	mov.l	2f, r4
	mov.l	@r4, r4

swsusp_copy_loop:
	mov	r4, r0
	cmp/eq	#0, r0
	bt	swsusp_restore_regs

	mov.l	@(PBE_ADDRESS, r4), r2
	mov.l	@(PBE_ORIG_ADDRESS, r4), r5

	mov	#(PAGE_SIZE >> 10), r3
	shll8	r3
	shlr2	r3 /* PAGE_SIZE / 16 */
swsusp_copy_page:
	dt	r3
	mov.l	@r2+,r1   /*  16n+0 */
	mov.l	r1,@r5
	add	#4,r5
	mov.l	@r2+,r1	  /*  16n+4 */
	mov.l	r1,@r5
	add	#4,r5
	mov.l	@r2+,r1   /*  16n+8 */
	mov.l	r1,@r5
	add	#4,r5
	mov.l	@r2+,r1   /*  16n+12 */
	mov.l	r1,@r5
	bf/s	swsusp_copy_page
	 add	#4,r5

	bra	swsusp_copy_loop
	 mov.l	@(PBE_NEXT, r4), r4

swsusp_restore_regs:
	! BL=0: R7->R0 is bank0
	mov.l	3f, r8
	mov.l	4f, r5
	jsr	@r5
	 nop

	! BL=1: R7->R0 is bank1
	lds	k2, pr
	ldc	k3, ssr

	mov.l	@r15+, r0
	mov.l	@r15+, r1
	mov.l	@r15+, r2
	mov.l	@r15+, r3
	mov.l	@r15+, r4
	mov.l	@r15+, r5
	mov.l	@r15+, r6
	mov.l	@r15+, r7

Annotation

Implementation Notes