Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2012 21:03:01 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237027 - in head/sys: amd64/amd64 amd64/include i386/acpica i386/i386 i386/include
Message-ID:  <201206132103.q5DL31LK048643@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Jun 13 21:03:01 2012
New Revision: 237027
URL: http://svn.freebsd.org/changeset/base/237027

Log:
  - Fix resumectx() prototypes to reflect reality.
  - For i386, simply jump to resumectx() with PCB in %ecx.
  - Fix a style(9) nit while I am here.

Modified:
  head/sys/amd64/amd64/cpu_switch.S
  head/sys/amd64/include/pcb.h
  head/sys/i386/acpica/acpi_wakecode.S
  head/sys/i386/i386/swtch.s
  head/sys/i386/include/pcb.h

Modified: head/sys/amd64/amd64/cpu_switch.S
==============================================================================
--- head/sys/amd64/amd64/cpu_switch.S	Wed Jun 13 20:43:59 2012	(r237026)
+++ head/sys/amd64/amd64/cpu_switch.S	Wed Jun 13 21:03:01 2012	(r237027)
@@ -394,7 +394,7 @@ ENTRY(savectx)
 END(savectx)
 
 /*
- * resumectx(pcb in %rdi, cr3 in %rsi)
+ * resumectx(pcb, cr3)
  * Resuming processor state from pcb.
  */     
 ENTRY(resumectx)

Modified: head/sys/amd64/include/pcb.h
==============================================================================
--- head/sys/amd64/include/pcb.h	Wed Jun 13 20:43:59 2012	(r237026)
+++ head/sys/amd64/include/pcb.h	Wed Jun 13 21:03:01 2012	(r237027)
@@ -100,7 +100,7 @@ struct pcb {
 	register_t	pcb_xsmask;
 
 	/* fpu context for suspend/resume */
-	void *		pcb_fpususpend;
+	void		*pcb_fpususpend;
 
 	struct savefpu	*pcb_save;
 
@@ -142,7 +142,7 @@ clear_pcb_flags(struct pcb *pcb, const u
 
 void	makectx(struct trapframe *, struct pcb *);
 int	savectx(struct pcb *) __returns_twice;
-void	resumectx(struct pcb *);
+void	resumectx(struct pcb *, register_t);
 
 #endif
 

Modified: head/sys/i386/acpica/acpi_wakecode.S
==============================================================================
--- head/sys/i386/acpica/acpi_wakecode.S	Wed Jun 13 20:43:59 2012	(r237026)
+++ head/sys/i386/acpica/acpi_wakecode.S	Wed Jun 13 21:03:01 2012	(r237027)
@@ -142,8 +142,8 @@ wakeup_32:
 	mov	%ax, %ds
 
 	/* Get PCB and return address. */
-	movl	wakeup_pcb - wakeup_start(%ebx), %esi
-	movl	wakeup_ret - wakeup_start(%ebx), %edi
+	movl	wakeup_pcb - wakeup_start(%ebx), %ecx
+	movl	wakeup_ret - wakeup_start(%ebx), %edx
 
 	/* Restore CR4 and CR3. */
 	movl	wakeup_cr4 - wakeup_start(%ebx), %eax
@@ -166,7 +166,7 @@ wakeup_32:
 	jmp	1f
 1:
 	/* Jump to return address. */
-	jmp	*%edi
+	jmp	*%edx
 
 	.data
 

Modified: head/sys/i386/i386/swtch.s
==============================================================================
--- head/sys/i386/i386/swtch.s	Wed Jun 13 20:43:59 2012	(r237026)
+++ head/sys/i386/i386/swtch.s	Wed Jun 13 21:03:01 2012	(r237027)
@@ -460,13 +460,10 @@ ENTRY(savectx)
 END(savectx)
 
 /*
- * resumectx(pcb in %esi)
+ * resumectx(pcb) __fastcall
  * Resuming processor state from pcb.
  */
 ENTRY(resumectx)
-	/* Fetch PCB. */
-	movl	%esi,%ecx
-
 	/* Restore GDT. */
 	lgdt	PCB_GDT(%ecx)
 

Modified: head/sys/i386/include/pcb.h
==============================================================================
--- head/sys/i386/include/pcb.h	Wed Jun 13 20:43:59 2012	(r237026)
+++ head/sys/i386/include/pcb.h	Wed Jun 13 21:03:01 2012	(r237027)
@@ -97,7 +97,7 @@ struct trapframe;
 
 void	makectx(struct trapframe *, struct pcb *);
 int	savectx(struct pcb *) __returns_twice;
-void	resumectx(struct pcb *);
+void	resumectx(struct pcb *) __fastcall;
 #endif
 
 #endif /* _I386_PCB_H_ */



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