view arch/svcint.S @ 95:cabcdc3727e3

arch: implemented swapcontext & fixed few minor issues
author Josef 'Jeff' Sipek <>
date Thu, 12 May 2011 15:56:46 -0400
parents 5f3618fbf9ae
line wrap: on
line source

#include "svcint.h"

	.align	4
.globl SVCINT
	.type	SVCINT, @function
	stmg	%r0,%r15,_PSA_GPRS

	xgr	%r2,%r2
	ic	%r2,_PSA_SVC_ID+3	# r2 = SVC
	lmg	%r3,%r6,_PSA_GPRS+16	# shift all the args
	xgr	%r7,%r7			# just to make sure accesses to more
					# than 4 args fail
	larl	%r15,_SVC_STACK
	lg	%r15,0(%r15)

	# call into C... f(svc, arg0, arg1, arg2, arg3)
	larl	%r14,_SVC_HANDLER
	lg	%r14,0(%r14)
	basr	%r14,%r14

	sr	%r1,%r1
	sr	%r3,%r3
	sigp	%r1,%r3,0x05

	.byte 0x00, 0x00, 0x00, 0x00