Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 2003 00:14:49 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 29106 for review
Message-ID:  <200304170714.h3H7En1q072449@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29106

Change 29106 by marcel@marcel_nfs on 2003/04/17 00:14:14

	Use ar.k5 and not ar.k3 to pass the EPC gateway page to userland.
	Using ar.k3 is slightly less optimal in that we have to make sure
	ar.k3 is defined is we jump into user space because it can be
	clobbered by PAL code on exception. By using ar.k5 we make it an
	invariant register, which means we don't have to worry about it.
	Of course, using ar.k5 takes up one of the preserved kernel regs,
	which means that we don't have any left. I tried to avoid that,
	but the reduced complexity is slightly more pleasing now...
	
	Oh: minor style change (initialize ar.k4 immediately after we
	define pcpup) and remove a space.

Affected files ...

.. //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#12 edit

Differences ...

==== //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#12 (text+ko) ====

@@ -389,8 +389,8 @@
 	__asm __volatile("mov	psr.l=%0" :: "r" (psr));
 	__asm __volatile("srlz.i");
 
-	/* Expose the mapping to userland in ar.k3 */
-	ia64_set_k3(VM_MAX_ADDRESS);
+	/* Expose the mapping to userland in ar.k5 */
+	ia64_set_k5(VM_MAX_ADDRESS);
 }
 
 static void
@@ -715,9 +715,9 @@
 	/*
 	 * Setup the global data for the bootstrap cpu.
 	 */
-	pcpup = (struct pcpu *) pmap_steal_memory(PAGE_SIZE);
+	pcpup = (struct pcpu *)pmap_steal_memory(PAGE_SIZE);
+	ia64_set_k4((u_int64_t)pcpup);
 	pcpu_init(pcpup, 0, PAGE_SIZE);
-	ia64_set_k4((u_int64_t) pcpup);
 	PCPU_SET(curthread, &thread0);
 
 	/*



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