From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 24 08:04:30 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0786316A4E1; Mon, 24 Jul 2006 08:04:30 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1CD943D5A; Mon, 24 Jul 2006 08:04:16 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k6O84Apx039886 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 24 Jul 2006 10:04:10 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k6O84Acn039884; Mon, 24 Jul 2006 10:04:10 +0200 (CEST) Date: Mon, 24 Jul 2006 10:04:10 +0200 From: Divacky Roman To: Attilio Rao Message-ID: <20060724080410.GA39744@stud.fit.vutbr.cz> References: <20060723112332.GA83581@stud.fit.vutbr.cz> <3bbf2fe10607231418y58510d02ua208acbb44ea9f8c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bbf2fe10607231418y58510d02ua208acbb44ea9f8c@mail.gmail.com> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 Cc: freebsd-hackers@freebsd.org Subject: Re: i386 registers during a syscall X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2006 08:04:30 -0000 On Sun, Jul 23, 2006 at 11:18:56PM +0200, Attilio Rao wrote: > 2006/7/23, Divacky Roman : > >hi, > > > >I need to get content of %esi register as it was during a syscall. Should > >I get > >this info from td->td_pcb->pcb_esi or td->td_frame->tf_esi? > > > >Is it so that trapframe is "content of registers when entering a kernel" > >and > >pcb is "when leaving a kernel" ? > > > >thnx for info > > pcb and trapframe are used for very different purposes. > > The trapframe is built into the exception handler and it is used as > 'registers gate' from userspace/kernelspace. > > The pcb (process control block) is used to handle registers saving > during a context switch, so it seems completely ortogonal to your > problem. > > BTW, it's unclear to me what do you need... mov $123, %esi int $0x80 ; syscall I need the value of %esi (ie. 123) is td->td_frame->tf_esi what I need? thnx roman