Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Sep 2002 22:13:29 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17831 for review
Message-ID:  <200209210513.g8L5DTIM038200@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209210513.g8L5DTIM038200>