From owner-p4-projects@FreeBSD.ORG Tue Jun 27 10:01:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9114716A404; Tue, 27 Jun 2006 10:01:18 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BB9F16A402 for ; Tue, 27 Jun 2006 10:01:18 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD3E843D69 for ; Tue, 27 Jun 2006 10:01:10 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5RA19RM018001 for ; Tue, 27 Jun 2006 10:01:09 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5RA19aY017998 for perforce@freebsd.org; Tue, 27 Jun 2006 10:01:09 GMT (envelope-from rdivacky@FreeBSD.org) Date: Tue, 27 Jun 2006 10:01:09 GMT Message-Id: <200606271001.k5RA19aY017998@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 100128 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 10:01:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=100128 Change 100128 by rdivacky@rdivacky_witten on 2006/06/27 10:00:32 Non-functional change - add some real args handler and comment to linux_set_thread_area(), note that this is actually a regression and WIP. Affected files ... .. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#5 edit Differences ... ==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#5 (text+ko) ==== @@ -848,11 +848,33 @@ int linux_set_thread_area(struct thread *td, struct linux_set_thread_area_args *args) { - /* - * Return an error code instead of raising a SIGSYS so that - * the caller will fall back to simpler LDT methods. + struct l_user_desc info; + int error; + int idx; + + error = copyin(args->desc, &info, sizeof(struct l_user_desc)); + if (error) + return (error); + + idx = info.entry_number; + /* Semantics of linux version: every thread in the system has array + * of 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This + * syscall loads one of the selected tls decriptors with a value + * and also loads GDT descriptors 6, 7 and 8 with the content of the per-thread + * descriptors. + * + * Semantics of fbsd version: I think we can ignore that linux has 3 per-thread + * descriptors and use just the 1st one (TODO: davidxu will report us where we get this). + * The tls_array[] is used only in set/get-thread_area() syscalls and for loading the + * GDT descriptors. In fbsd we use just one GDT descriptor for TLS so we will load + * just one. */ - return (ENOSYS); + + /* we support just GLIBC TLS now */ + if (idx != 6 && idx != -1) + return (EINVAL); + + return (0); } int