Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jul 2012 21:11:03 +0000 (UTC)
From:      "Cherry G. Mathew" <cherry@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r238150 - projects/amd64_xen_pv/sys/amd64/amd64
Message-ID:  <201207052111.q65LB3Gl018694@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cherry
Date: Thu Jul  5 21:11:03 2012
New Revision: 238150
URL: http://svn.freebsd.org/changeset/base/238150

Log:
  Cosmetic change: use macro TRAPF_USERMODE() where possible.
  
  Approved by:	gibbs (implicit)

Modified:
  projects/amd64_xen_pv/sys/amd64/amd64/trap.c

Modified: projects/amd64_xen_pv/sys/amd64/amd64/trap.c
==============================================================================
--- projects/amd64_xen_pv/sys/amd64/amd64/trap.c	Thu Jul  5 20:51:44 2012	(r238149)
+++ projects/amd64_xen_pv/sys/amd64/amd64/trap.c	Thu Jul  5 21:11:03 2012	(r238150)
@@ -280,7 +280,7 @@ trap(struct trapframe *frame)
 		 * interrupts disabled until they are accidentally
 		 * enabled later.
 		 */
-		if (ISPL(frame->tf_cs) == SEL_UPL)
+		if (TRAPF_USERMODE(frame))
 			uprintf(
 			    "pid %ld (%s): trap %d with interrupts disabled\n",
 			    (long)curproc->p_pid, curthread->td_name, type);
@@ -304,7 +304,7 @@ trap(struct trapframe *frame)
 
 	code = frame->tf_err;
 
-        if (ISPL(frame->tf_cs) == SEL_UPL) {
+        if (TRAPF_USERMODE(frame)) {
 		/* user trap */
 
 		td->td_pticks = 0;
@@ -793,7 +793,7 @@ trap_fatal(frame, eva)
 	else
 		msg = "UNKNOWN";
 	printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg,
-	    ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
+	    TRAPF_USERMODE(frame) ? "user" : "kernel");
 #ifdef SMP
 	/* two separate prints in case of a trap on an unmapped page */
 	printf("cpuid = %d; ", PCPU_GET(cpuid));
@@ -809,7 +809,7 @@ trap_fatal(frame, eva)
 	}
 	printf("instruction pointer	= 0x%lx:0x%lx\n",
 	       frame->tf_cs & 0xffff, frame->tf_rip);
-        if (ISPL(frame->tf_cs) == SEL_UPL) {
+        if (TRAPF_USERMODE(frame)) {
 		ss = frame->tf_ss & 0xffff;
 		esp = frame->tf_rsp;
 	} else {
@@ -945,7 +945,7 @@ amd64_syscall(struct thread *td, int tra
 	ksiginfo_t ksi;
 
 #ifdef DIAGNOSTIC
-	if (ISPL(td->td_frame->tf_cs) != SEL_UPL) {
+	if (!TRAPF_USERMODE(td->td_frame)) {
 		panic("syscall");
 		/* NOT REACHED */
 	}



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