[hppa-linux] Gateway instructions

Kumar kumar@ix.netcom.com
Fri, 19 Mar 1999 07:40:09 -0800 (PST)


> > The B bit is not a problem as long as the delay slot of the branch to the
> > gateway is either nullified or filled in with a non-branch instruction.
> > For example,
> > 
> >     LDIL L'GATEWAY,%r1
> >     BLE  R'GATEWAY(%sr7,%r1)
> >     LDO  sycallnum,%r22

	Branch to space in %sr7 and offset contained in %r1,
	also load the syscall number in %r22 in the delay slot of BLE.
	I guess the assumption here is that %sr7 points to system space.
	Value of GATEWAY can be replaced by 0xc0000000 or whatever.	
	
	A equivalent 80386 sequence to make syscall:

	movl	$1, %eax	; load syscall num in %eax. in this case
						"exit"
	int	$0x80		; syscall trap in to kernel

	The number 80 is OS dependent and no magic number. Its just that
	Linux 80386 goes through trap gate 128 (0x80) for syscalls.


						pkd
> 
> Someday (maybe today, if I get all my work done =) ), I'll learn to read
> that.
> 
> Mike
> 
> --