From: Daniel =?iso-8859-1?Q?Engstr=F6m?= Date: Wed, 20 Nov 2002 15:18:39 +0100 Subject: [U-Boot-Users] Re: The i386 patch In-Reply-To: <20021120140652.EB95711768@denx.denx.de>; from wd@denx.de on ons, nov 20, 2002 at 15:06:47 +0100 References: <200211201114.gAKBEss01326@dagobert.svc.sysgo.de> <20021120140652.EB95711768@denx.denx.de> Message-ID: <20021120151839.A813@jupiter.omicron.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2002.11.20 15:06 Wolfgang Denk wrote: > In message <200211201114.gAKBEss01326@dagobert.svc.sysgo.de> you wrote: > You may remember that we used a jump table attached to the global > data in early versions of PPCBoot. I didn't like this. The nice thing > about the syscall trap on PPC is that you can easily put a "jump > table" at a well-known location, so that a standalone application can > access certain services (those explicitely exported by U-Boot using > the syscall interface) without depending on a special software > version. > > I have to admit that I did not think about other architectures at the > time we implemented this. The i386 can do indirect calls on the ebp register. So we could let the application know the location of the syscall table by providing it in a register on entry. The applications initialization code can then store it in a suitable location (called syscall_table below). The syscall would than be done like this: movl $SYSCALL_NR, %eax movl syscall_table, %ebp shll $2, %eax addl %eax, %ebp call *%ebp ret /Daniel