From owner-freebsd-questions@FreeBSD.ORG Tue Oct 7 04:05:53 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6EB7516A4B3 for ; Tue, 7 Oct 2003 04:05:53 -0700 (PDT) Received: from relay1.ntu-kpi.kiev.ua (oberon.ntu-kpi.kiev.ua [195.245.194.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8D6143FE9 for ; Tue, 7 Oct 2003 04:05:48 -0700 (PDT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (eth0.comsys.ntu-kpi.kiev.ua [10.0.1.184]) by relay1.ntu-kpi.kiev.ua (Postfix) with ESMTP id B8C2A1990D for ; Tue, 7 Oct 2003 14:05:42 +0300 (EEST) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) by comsys.ntu-kpi.kiev.ua (8.11.6/8.11.6) with ESMTP id h97BARi30830 for ; Tue, 7 Oct 2003 14:10:27 +0300 (EEST) Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 86EF328F; Tue, 7 Oct 2003 14:05:38 +0300 (EEST) Date: Tue, 7 Oct 2003 14:05:38 +0300 From: Andrey Simonenko To: freebsd-questions@freebsd.org Message-ID: <20031007110538.GB428@pm514-9.comsys.ntu-kpi.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: sys/i386/i386/exception.s RELENG_4 help to understand several lines X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Oct 2003 11:05:53 -0000 Hi, Help me to understand several lines from RELENG_4 src/sys/i386/i386/exception.s,v 1.65.2.3 file: 214 calltrap: 215 FAKE_MCOUNT(_btrap) /* init "from" _btrap -> calltrap */ 216 MPLOCKED incl _cnt+V_TRAP 217 MP_LOCK 218 movl _cpl,%ebx /* keep orig. cpl here during trap() */ 219 call _trap 220 /* 221 * Return via _doreti to handle ASTs. Have to change trap frame 222 * to interrupt frame. 223 */ 224 pushl %ebx /* cpl to restore */ 225 subl $4,%esp /* dummy unit to finish intr frame */ 226 incb _intr_nesting_level 227 MEXITCOUNT 228 jmp _doreti Is everything correct with 218, 219 and 224 lines (or comments are wrong)? I checked several places in exception.s and vm86bios.s in sys/i386/i386/ and in all places _cpl is saved in the stack, trap() need frame{} in the stack, so here we can't put _cpl into stack, but it is unclear for me how above listed lines works. How can %ebx contain saved _cpl after trap()? TIA