Path: cygnus.com!enews.sgi.com!newsfeed.mathworks.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!news.chips.ibm.com!newsfeed.btv.ibm.com!news.btv.ibm.com!hack From: hack@watson.ibm.com (hack) Newsgroups: comp.lang.asm370 Subject: Re: 2 questions: diag 68 and calling convention Date: 7 Mar 2002 16:58:15 GMT Organization: IBM_Research Message-ID: References: NNTP-Posting-Host: starcraft.watson.ibm.com In article , Pete Zaitcev wrote: >Hello, > >I am looking at Linux souce code and came up with two questions. > >A kernel spinlock is implemented in the following fashion: > >! Lock address is in r7, for instance. > bras 1,x1 >x0: diag 0,0,68 >x1: slr 0,0 > cs 0,1,0(r7) > jl x0 > >It seems obvious what compare-and-swap does, but what is the >function of the diag 68? How does it work on a bare hardware >(not under VM)? > >Other question is very basic: where is the calling convention >documented? For instance, arguments are passed starting from >r2 and not r0. Why? I assume that Linux is not using some >unusual calling convention. > >-- Pete Decimal 68 = hex 44 Diagnose X'44' is the "Yield" diagnose, supported by both VM and by PR/SM. It is a logical no-op, but tells a hypervisor that the current thread is in a spin loop, so if the hypervisor has something better to do, now is the time to dispatch something else. On a dedicated LPAR processor is is indeed a no-op since there is nothing else to dispatch. Michel. P.S. Diagnose X'68' is indeed a VM diagnose: VMCF (e.g. as used to communicate with a VMTCPIP virtual machine).