From owner-freebsd-arch Wed Feb 6 20:50: 6 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id D277837B428 for ; Wed, 6 Feb 2002 20:49:46 -0800 (PST) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.1/8.12.1) with ESMTP id g174njEj010722; Wed, 6 Feb 2002 23:49:46 -0500 (EST) Date: Wed, 6 Feb 2002 23:49:45 -0500 (EST) From: Daniel Eischen To: Peter Wemm Cc: Dan Eischen , arch@FreeBSD.ORG Subject: Re: getsetcontext system call In-Reply-To: <20020207032205.73E9239F1@overcee.wemm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 6 Feb 2002, Peter Wemm wrote: > Daniel Eischen wrote: > > On Wed, 6 Feb 2002, Peter Wemm wrote: > > > Dan Eischen wrote: > > > > > > > Diffs are at: > > > > > > > > http://people.freebsd.org/~deischen/ucontext/uc-sys.diffs > > > > http://people.freebsd.org/~deischen/ucontext/uc-libc.diffs > > > > [..] > > As to set_fpregs(), it looks like it wants to convert an x87 > > FPU state to an SSE FPU state. The opposite seems to be the > > case for fill_fpregs(). I'm not exactly sure how and why > > fill_fpregs() and set_fpregs() are used. Since we make struct > > fpreg large enough to hold either x87 or SSE FPU state, do we > > even care about converting between the two different formats > > any longer? > > I think we have to, because xmm state is a superset of the x87 state, and > we need to not f*ck up defined interface to ptrace(PT_SETFPREGS etc and > procfs where you supply an entire 'struct fpregs' to these calls. OK, what if we leave struct fpreg unchanged? > Imagine running a 4.x binary where it does a ptrace(PT_GETFPREGS, &fpregs); > where '&fpregs' points to the traditional sized structure. You cant just > change the size of it without doing things like assigning new syscall numbers > to ptrace(2) etc and adding some workaround glue to procfs. Right, I don't want to get into that now. Some time later we could add the format specifier in struct fpreg and teach consumers how to decipher it. How else could users of ptrace(PT_GETFPREGS, &fpregs) know what the FP format was? If the format was included in the struct, then they could figure out on their own which format to use. > We may need to do what linux does (SET/SET_FPXREGS) and maybe /proc/*/fpxregs. > Ugh. Anyway, I dont see that you can just change 'struct fpregs' that > easily. The union may have to be moved up higher for x86.. Is it OK to leave struct fpreg unchanged for now? -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message