From owner-p4-projects Fri Sep 20 22:13:33 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0D67B37B404; Fri, 20 Sep 2002 22:13:30 -0700 (PDT) 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 AF76037B401 for ; Fri, 20 Sep 2002 22:13:29 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C23443E6E for ; Fri, 20 Sep 2002 22:13:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8L5DTCo038203 for ; Fri, 20 Sep 2002 22:13:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8L5DTIM038200 for perforce@freebsd.org; Fri, 20 Sep 2002 22:13:29 -0700 (PDT) Date: Fri, 20 Sep 2002 22:13:29 -0700 (PDT) Message-Id: <200209210513.g8L5DTIM038200@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17831 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17831 Change 17831 by peter@peter_daintree on 2002/09/20 22:12:49 Gah, move some hairy code from asm to C. It has NO NEED to be in asm. We call it about 40 times during initialization and once if we have a fatal trap and are about to panic. (same is true on x86, but test it first!) The formats here change for 64 bit mode, which is why I noticed and I wasn't going to touch gross asm code if I could help it :-). Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#14 edit .. //depot/projects/hammer/sys/x86_64/x86_64/support.s#3 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#14 (text+ko) ==== @@ -820,6 +820,7 @@ struct segment_descriptor *sd; struct soft_segment_descriptor *ssd; { + ssd->ssd_base = (sd->sd_hibase << 24) | sd->sd_lobase; ssd->ssd_limit = (sd->sd_hilimit << 16) | sd->sd_lolimit; ssd->ssd_type = sd->sd_type; @@ -829,6 +830,24 @@ ssd->ssd_gran = sd->sd_gran; } +void +ssdtosd(ssd, sd) + struct soft_segment_descriptor *ssd; + struct segment_descriptor *sd; +{ + + sd->sd_lobase = (ssd->ssd_base) & 0xffffff; + sd->sd_hibase = (ssd->ssd_base >> 24) & 0xff + sd->sd_lolimit = (ssd->ssd_limit) & 0xffff; + sd->sd_hilimit = (ssd->ssd_limit >> 16) & 0xf; + sd->sd_type = ssd->ssd_type; + sd->sd_dpl = ssd->ssd_dpl; + sd->sd_p = ssd->ssd_p; + sd->sd_def32 = ssd->ssd_def32; + sd->sd_gran = ssd->ssd_gran; +} + + #define PHYSMAP_SIZE (2 * 8) /* ==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#3 (text+ko) ==== @@ -682,27 +682,6 @@ ltr 4(%esp) ret -/* ssdtosd(*ssdp,*sdp) */ -ENTRY(ssdtosd) - pushl %ebx - movl 8(%esp),%ecx - movl 8(%ecx),%ebx - shll $16,%ebx - movl (%ecx),%edx - roll $16,%edx - movb %dh,%bl - movb %dl,%bh - rorl $8,%ebx - movl 4(%ecx),%eax - movw %ax,%dx - andl $0xf0000,%eax - orl %eax,%ebx - movl 12(%esp),%ecx - movl %edx,(%ecx) - movl %ebx,4(%ecx) - popl %ebx - ret - /* void reset_dbregs() */ ENTRY(reset_dbregs) movl $0,%eax To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message