Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2013 16:55:44 +0000 (UTC)
From:      Will Andrews <will@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r256983 - in projects/vps/sys: amd64/amd64 i386/i386 mips/mips vps
Message-ID:  <201310231655.r9NGtiUi057472@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: will
Date: Wed Oct 23 16:55:43 2013
New Revision: 256983
URL: http://svnweb.freebsd.org/changeset/base/256983

Log:
  Sync with svn.7he.at/vps/trunk r185.
  
  r185 | klaus | 2013-07-09 05:20:23 -0600 (Tue, 09 Jul 2013) | 3 lines
  Some code cleanup.
  
  Submitted by:	Klaus P. Ohrhallinger <k@7he.at>

Modified:
  projects/vps/sys/amd64/amd64/pmap.c
  projects/vps/sys/amd64/amd64/vps_machdep.c
  projects/vps/sys/i386/i386/pmap.c
  projects/vps/sys/i386/i386/vps_machdep.c
  projects/vps/sys/mips/mips/vps_machdep.c
  projects/vps/sys/vps/vps_libdump.h

Modified: projects/vps/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/vps/sys/amd64/amd64/pmap.c	Wed Oct 23 16:55:20 2013	(r256982)
+++ projects/vps/sys/amd64/amd64/pmap.c	Wed Oct 23 16:55:43 2013	(r256983)
@@ -122,8 +122,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/cpuset.h>
 #endif
 
-#include <vps/vps_account.h>
-
 #include <vm/vm.h>
 #include <vm/vm_param.h>
 #include <vm/vm_kern.h>
@@ -167,24 +165,6 @@ __FBSDID("$FreeBSD$");
 #define	pa_index(pa)	((pa) >> PDRSHIFT)
 #define	pa_to_pvh(pa)	(&pv_table[pa_index(pa)])
 
-#if 0
-
-#ifdef VPS
-#define VPS_ACCOUNT_PMAP(_pmap, action, charge)				\
-	do {								\
-		if (_pmap == kernel_map->pmap || 			\
-		    _pmap == kmem_map->pmap ||				\
-		    _pmap == buffer_map->pmap)				\
-			break;						\
-		vps_account(curthread->td_vps, VPS_ACC_PHYS,		\
-			action, charge << PAGE_SHIFT);				\
-	} while (0)
-#endif /* VPS */
-
-#else
-#define VPS_ACCOUNT_PMAP(a, b, c)
-#endif
-
 #define	NPV_LIST_LOCKS	MAXCPU
 
 #define	PHYS_TO_PV_LIST_LOCK(pa)	\
@@ -481,7 +461,6 @@ pmap_resident_count_inc(pmap_t pmap, int
 
 	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
 	pmap->pm_stats.resident_count += count;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, count);
 }
 
 static __inline void
@@ -490,7 +469,6 @@ pmap_resident_count_dec(pmap_t pmap, int
 
 	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
 	pmap->pm_stats.resident_count -= count;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, count);
 }
 
 PMAP_INLINE pt_entry_t *

Modified: projects/vps/sys/amd64/amd64/vps_machdep.c
==============================================================================
--- projects/vps/sys/amd64/amd64/vps_machdep.c	Wed Oct 23 16:55:20 2013	(r256982)
+++ projects/vps/sys/amd64/amd64/vps_machdep.c	Wed Oct 23 16:55:43 2013	(r256983)
@@ -63,7 +63,6 @@ static const char vpsid[] =
 
 #ifdef VPS
 
-/*__attribute__((inline))*/
 void
 vps_md_print_thread(struct thread *td)
 {
@@ -85,7 +84,6 @@ vps_md_print_thread(struct thread *td)
 		td->td_frame->tf_rip);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_thread(struct vps_dump_thread *vdtd, struct thread *td)
 {
@@ -93,7 +91,6 @@ vps_md_snapshot_thread(struct vps_dump_t
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_thread(struct vps_dump_thread *vdtd, struct thread *ntd,
     struct proc *p)
@@ -119,14 +116,13 @@ vps_md_restore_thread(struct vps_dump_th
 	ntd->td_retval[0] = vdtd->td_retval[0];
 	ntd->td_retval[1] = vdtd->td_retval[1];
 
-	//db_trace_thread(ntd, 10);
+	/* db_trace_thread(ntd, 10); */
 	DBGCORE("%s: td_pcb = %p; td_frame = %p; pcb_rsp = %016lx\n",
 	    __func__, ntd->td_pcb, ntd->td_frame, ntd->td_pcb->pcb_rsp);
 
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_sysentvec(struct sysentvec *sv, long *svtype)
 {
@@ -151,7 +147,6 @@ vps_md_snapshot_sysentvec(struct sysentv
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_sysentvec(long svtype, struct sysentvec **sv)
 {
@@ -174,7 +169,6 @@ vps_md_restore_sysentvec(long svtype, st
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_checkarch(uint8 ptrsize, uint8 byteorder)
 {
@@ -188,7 +182,6 @@ vps_md_restore_checkarch(uint8 ptrsize, 
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_thread_savefpu(struct vps_snapst_ctx *ctx, struct vps *vps,
     struct thread *td)
@@ -223,7 +216,6 @@ vps_md_snapshot_thread_savefpu(struct vp
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_thread_savefpu(struct vps_snapst_ctx *ctx, struct vps *vps,
     struct thread *td)
@@ -258,7 +250,6 @@ vps_md_restore_thread_savefpu(struct vps
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_reboot_copyout(struct thread *td, struct execve_args *args)
 {
@@ -329,7 +320,6 @@ vps_md_reboot_copyout(struct thread *td,
 	return (error);
 }
 
-/*__attribute__((noinline))*/
 int
 vps_md_syscall_fixup(struct vps *vps, struct thread *td,
     register_t *ret_code, register_t **ret_args, int *ret_narg)
@@ -489,7 +479,6 @@ vps_md_syscall_fixup_setup_inthread(stru
 	return (0);
 }
 
-__attribute__((noinline))
 void
 vps_md_print_pcb(struct thread *td)
 {
@@ -497,50 +486,21 @@ vps_md_print_pcb(struct thread *td)
 
         p = td->td_pcb;
 
-#if 0
-// XXX
         DBGCORE("%s: td=%p\n"
-                "pcb_cr3: 0x%08x\n"
-                "pcb_edi: 0x%08x\n"
-                "pcb_esi: 0x%08x\n"
-                "pcb_ebp: 0x%08x\n"
-                "pcb_esp: 0x%08x\n"
-                "pcb_ebx: 0x%08x\n"
-                "pcb_eip: 0x%08x\n"
-                "pcb_psl: 0x%08x\n"
-                "pcb_ext: 0x%08x\n"
+                "pcb_cr3: 0x%16lx\n"
+                "pcb_rbp: 0x%16lx\n"
+                "pcb_rsp: 0x%16lx\n"
+                "pcb_rbx: 0x%16lx\n"
+                "pcb_rip: 0x%16lx\n"
                 , __func__, td
                 , p->pcb_cr3
-                , p->pcb_edi
-                , p->pcb_esi
-                , p->pcb_ebp
-                , p->pcb_esp
-                , p->pcb_ebx
-                , p->pcb_eip
-                , p->pcb_psl
-                , (int)p->pcb_ext
+                , p->pcb_rbp
+                , p->pcb_rsp
+                , p->pcb_rbx
+                , p->pcb_rip
                 );
-#endif
 }
 
-#if 0
-/* --------------------------- 8< --------------------------- */
-
-// vps_suspend():
-#if defined(CPU_X86)
-              DBGCORE("td->td_frame=%p tf_rax=%p tf_rsp=%p\n", td->td_frame,
-                 (void*)td->td_frame->tf_rax, (void*)td->td_frame->tf_rsp);
-#elif defined(CPU_386)
-              DBGCORE("td->td_frame=%p tf_eax=%p tf_esp=%p\n", td->td_frame,
-                 (void*)td->td_frame->tf_eax, (void*)td->td_frame->tf_esp);
-#else
-#error "unsupported architecture"
-#endif
-
-// 
-/* --------------------------- 8< --------------------------- */
-#endif /* 0 */
-
 #endif /* VPS */
 
 /* EOF */

Modified: projects/vps/sys/i386/i386/pmap.c
==============================================================================
--- projects/vps/sys/i386/i386/pmap.c	Wed Oct 23 16:55:20 2013	(r256982)
+++ projects/vps/sys/i386/i386/pmap.c	Wed Oct 23 16:55:43 2013	(r256983)
@@ -155,9 +155,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/xbox.h>
 #endif
 
-#include <vps/vps.h>
-#include <vps/vps_account.h>
-
 #if !defined(CPU_DISABLE_SSE) && defined(I686_CPU)
 #define CPU_ENABLE_SSE
 #endif
@@ -201,24 +198,6 @@ __FBSDID("$FreeBSD$");
     atomic_clear_int((u_int *)(pte), PG_W))
 #define pmap_pte_set_prot(pte, v) ((*(int *)pte &= ~PG_PROT), (*(int *)pte |= (v)))
 
-#if 0
-
-#ifdef VPS
-#define VPS_ACCOUNT_PMAP(_pmap, action, charge)                         \
-        do {                                                            \
-                if (_pmap == kernel_map->pmap ||                        \
-                    _pmap == kmem_map->pmap ||                          \
-                    _pmap == buffer_map->pmap)                          \
-                        break;                                          \
-                vps_account(curthread->td_vps, VPS_ACC_PHYS,            \
-                        action, charge << PAGE_SHIFT);                  \
-        } while (0)
-#endif /* VPS */
-
-#else
-#define VPS_ACCOUNT_PMAP(a, b, c)
-#endif
-
 struct pmap kernel_pmap_store;
 LIST_HEAD(pmaplist, pmap);
 static struct pmaplist allpmaps;
@@ -1687,7 +1666,6 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t 
 	 */
 	pmap->pm_pdir[m->pindex] = 0;
 	--pmap->pm_stats.resident_count;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, 1);
 
 	/*
 	 * This is a release store so that the ordinary store unmapping
@@ -1871,7 +1849,6 @@ _pmap_allocpte(pmap_t pmap, u_int ptepin
 	 */
 
 	pmap->pm_stats.resident_count++;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, 1);
 
 	ptepa = VM_PAGE_TO_PHYS(m);
 	pmap->pm_pdir[ptepindex] =
@@ -2691,7 +2668,6 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t 
 		}
 		if (va < VM_MAXUSER_ADDRESS) {
 			pmap->pm_stats.resident_count++;
-			VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, 1);
 		}
 	}
 	mptepa = VM_PAGE_TO_PHYS(mpte);
@@ -2822,7 +2798,6 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t 
 	if (oldpde & PG_G)
 		pmap_invalidate_page(kernel_pmap, sva);
 	pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, NBPDR / PAGE_SIZE);
 	if (oldpde & PG_MANAGED) {
 		pvh = pa_to_pvh(oldpde & PG_PS_FRAME);
 		pmap_pvh_free(pvh, pmap, sva);
@@ -2846,7 +2821,6 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t 
 		if (mpte != NULL) {
 			pmap_remove_pt_page(pmap, mpte);
 			pmap->pm_stats.resident_count--;
-			VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, 1);
 			KASSERT(mpte->wire_count == NPTEPG,
 			    ("pmap_remove_pde: pte page wire count error"));
 			mpte->wire_count = 0;
@@ -2879,7 +2853,6 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t 
 	if (oldpte & PG_G)
 		pmap_invalidate_page(kernel_pmap, va);
 	pmap->pm_stats.resident_count -= 1;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, 1);
 	if (oldpte & PG_MANAGED) {
 		m = PHYS_TO_VM_PAGE(oldpte & PG_FRAME);
 		if ((oldpte & (PG_M | PG_RW)) == (PG_M | PG_RW))
@@ -3070,7 +3043,6 @@ small_mappings:
 		pmap = PV_PMAP(pv);
 		PMAP_LOCK(pmap);
 		pmap->pm_stats.resident_count--;
-		VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, 1);
 		pde = pmap_pde(pmap, pv->pv_va);
 		KASSERT((*pde & PG_PS) == 0, ("pmap_remove_all: found"
 		    " a 4mpage in page %p's pv list", m));
@@ -3535,7 +3507,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
 		}
 	} else {
 		pmap->pm_stats.resident_count++;
-		VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, 1);
 	}
 
 	/*
@@ -3676,7 +3647,6 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t 
 	 * Increment counters.
 	 */
 	pmap->pm_stats.resident_count += NBPDR / PAGE_SIZE;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, NBPDR / PAGE_SIZE);
 
 	/*
 	 * Map the superpage.
@@ -3842,7 +3812,6 @@ pmap_enter_quick_locked(pmap_t pmap, vm_
 	 * Increment counters
 	 */
 	pmap->pm_stats.resident_count++;
-	VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, 1);
 
 	pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0);
 #ifdef PAE
@@ -3939,7 +3908,6 @@ pmap_object_init_pt(pmap_t pmap, vm_offs
 				    PG_U | PG_RW | PG_V);
 				pmap->pm_stats.resident_count += NBPDR /
 				    PAGE_SIZE;
-				VPS_ACCOUNT_PMAP(pmap, VPS_ACC_ALLOC, NBPDR / PAGE_SIZE);
 				pmap_pde_mappings++;
 			}
 			/* Else continue on if the PDE is already valid. */
@@ -4062,7 +4030,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
 				    ~PG_W;
 				dst_pmap->pm_stats.resident_count +=
 				    NBPDR / PAGE_SIZE;
-				VPS_ACCOUNT_PMAP(dst_pmap, VPS_ACC_ALLOC, NBPDR / PAGE_SIZE);
 			}
 			continue;
 		}
@@ -4098,7 +4065,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
 					*dst_pte = ptetemp & ~(PG_W | PG_M |
 					    PG_A);
 					dst_pmap->pm_stats.resident_count++;
-					VPS_ACCOUNT_PMAP(dst_pmap, VPS_ACC_ALLOC, 1);
 	 			} else {
 					free = NULL;
 					if (pmap_unwire_ptp(dst_pmap, dstmpte,
@@ -4495,7 +4461,6 @@ pmap_remove_pages(pmap_t pmap)
 				pc->pc_map[field] |= bitmask;
 				if ((tpte & PG_PS) != 0) {
 					pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
-					VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, NBPDR / PAGE_SIZE);
 					pvh = pa_to_pvh(tpte & PG_PS_FRAME);
 					TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
 					if (TAILQ_EMPTY(&pvh->pv_list)) {
@@ -4507,7 +4472,6 @@ pmap_remove_pages(pmap_t pmap)
 					if (mpte != NULL) {
 						pmap_remove_pt_page(pmap, mpte);
 						pmap->pm_stats.resident_count--;
-						VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, 1);
 						KASSERT(mpte->wire_count == NPTEPG,
 						    ("pmap_remove_pages: pte page wire count error"));
 						mpte->wire_count = 0;
@@ -4516,7 +4480,6 @@ pmap_remove_pages(pmap_t pmap)
 					}
 				} else {
 					pmap->pm_stats.resident_count--;
-					VPS_ACCOUNT_PMAP(pmap, VPS_ACC_FREE, 1);
 					TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
 					if (TAILQ_EMPTY(&m->md.pv_list) &&
 					    (m->flags & PG_FICTITIOUS) == 0) {

Modified: projects/vps/sys/i386/i386/vps_machdep.c
==============================================================================
--- projects/vps/sys/i386/i386/vps_machdep.c	Wed Oct 23 16:55:20 2013	(r256982)
+++ projects/vps/sys/i386/i386/vps_machdep.c	Wed Oct 23 16:55:43 2013	(r256983)
@@ -63,7 +63,6 @@ static const char vpsid[] =
 
 #ifdef VPS
 
-/*__attribute__((inline))*/
 void
 vps_md_print_thread(struct thread *td)
 {
@@ -85,7 +84,6 @@ vps_md_print_thread(struct thread *td)
 		td->td_frame->tf_eip);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_thread(struct vps_dump_thread *vdtd, struct thread *td)
 {
@@ -93,7 +91,6 @@ vps_md_snapshot_thread(struct vps_dump_t
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_thread(struct vps_dump_thread *vdtd, struct thread *ntd,
     struct proc *p)
@@ -121,14 +118,13 @@ vps_md_restore_thread(struct vps_dump_th
 	ntd->td_retval[0] = vdtd->td_retval[0];
 	ntd->td_retval[1] = vdtd->td_retval[1];
 
-	//db_trace_thread(ntd, 10);
+	/* db_trace_thread(ntd, 10); */
 	DBGCORE("%s: td_pcb = %p; td_frame = %p; pcb_esp = %08x\n",
 		__func__, ntd->td_pcb, ntd->td_frame, ntd->td_pcb->pcb_esp);
 
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_sysentvec(struct sysentvec *sv, long *svtype)
 {
@@ -148,7 +144,6 @@ vps_md_snapshot_sysentvec(struct sysentv
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_sysentvec(long svtype, struct sysentvec **sv)
 {
@@ -167,7 +162,6 @@ vps_md_restore_sysentvec(long svtype, st
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_checkarch(uint8 ptrsize, uint8 byteorder)
 {
@@ -181,7 +175,6 @@ vps_md_restore_checkarch(uint8 ptrsize, 
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_thread_savefpu(struct vps_snapst_ctx *ctx, struct vps *vps,
     struct thread *td)
@@ -190,7 +183,6 @@ vps_md_snapshot_thread_savefpu(struct vp
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_thread_savefpu(struct vps_snapst_ctx *ctx, struct vps *vps,
     struct thread *td)
@@ -199,7 +191,6 @@ vps_md_restore_thread_savefpu(struct vps
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_reboot_copyout(struct thread *td, struct execve_args *args)
 {
@@ -264,7 +255,6 @@ vps_md_reboot_copyout(struct thread *td,
 	return (error);
 }
 
-/*__attribute__((noinline))*/
 int
 vps_md_syscall_fixup(struct vps *vps, struct thread *td,
     register_t *ret_code, register_t **ret_args, int *ret_narg)
@@ -380,7 +370,6 @@ vps_md_syscall_fixup_setup_inthread(stru
 	return (0);
 }
 
-__attribute__((noinline))
 void
 vps_md_print_pcb(struct thread *td)
 {
@@ -411,24 +400,6 @@ vps_md_print_pcb(struct thread *td)
                 );
 }
 
-#if 0
-/* --------------------------- 8< --------------------------- */
-
-// vps_suspend():
-#if defined(CPU_X86)
-              DBGCORE("td->td_frame=%p tf_rax=%p tf_rsp=%p\n", td->td_frame,
-                 (void*)td->td_frame->tf_rax, (void*)td->td_frame->tf_rsp);
-#elif defined(CPU_386)
-              DBGCORE("td->td_frame=%p tf_eax=%p tf_esp=%p\n", td->td_frame,
-                 (void*)td->td_frame->tf_eax, (void*)td->td_frame->tf_esp);
-#else
-#error "unsupported architecture"
-#endif
-
-// 
-/* --------------------------- 8< --------------------------- */
-#endif /* 0 */
-
 #endif /* VPS */
 
 /* EOF */

Modified: projects/vps/sys/mips/mips/vps_machdep.c
==============================================================================
--- projects/vps/sys/mips/mips/vps_machdep.c	Wed Oct 23 16:55:20 2013	(r256982)
+++ projects/vps/sys/mips/mips/vps_machdep.c	Wed Oct 23 16:55:43 2013	(r256983)
@@ -75,35 +75,25 @@ static const char vpsid[] =
 
 #ifdef VPS
 
-/*__attribute__((inline))*/
 void
 vps_md_print_thread(struct thread *td)
 {
 
 	DBGCORE("%s: thread %p/%d kernel stack:\n"
-		/*
-		"td->td_pcb->rsp=%016lx\n"
-		"td->td_frame->tf_rax=%016lx\n"
-		"td->td_frame->tf_rsp=%016lx\n"
-		"td->td_frame->tf_rbp=%016lx\n"
-		"td->td_frame->tf_rip=%016lx\n"
+		"td->td_pcb->pcb_context[PCB_REG_SP]=%016lx\n"
+		"td->td_frame->tf_sp=%016lx\n"
+		"td->td_frame->tf_pc=%016lx\n"
 		"trace:\n",
-		*/
 		,
 		__func__,
 		td,
 		td->td_tid
-		/*
-		td->td_pcb->pcb_rsp,
-		td->td_frame->tf_rax,
-		td->td_frame->tf_rsp,
-		td->td_frame->tf_rbp,
-		td->td_frame->tf_rip
-		*/
+		td->td_pcb->pcb_context[PCB_REG_SP],
+		td->td_frame->sp,
+		td->td_frame->pc
 		);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_thread(struct vps_dump_thread *vdtd, struct thread *td)
 {
@@ -113,7 +103,6 @@ vps_md_snapshot_thread(struct vps_dump_t
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_thread(struct vps_dump_thread *vdtd, struct thread *ntd,
     struct proc *p)
@@ -158,7 +147,6 @@ vps_md_restore_thread(struct vps_dump_th
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_sysentvec(struct sysentvec *sv, long *svtype)
 {
@@ -183,7 +171,6 @@ vps_md_snapshot_sysentvec(struct sysentv
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_sysentvec(long svtype, struct sysentvec **sv)
 {
@@ -192,6 +179,7 @@ vps_md_restore_sysentvec(long svtype, st
 	if (svtype == VPS_SYSENTVEC_ELF64)
 		*sv = &elf64_freebsd_sysvec;
 #ifdef COMPAT_FREEBSD32
+	/* XXX */
 	else if (svtype == VPS_SYSENTVEC_ELF32)
 		*sv = &ia32_freebsd_sysvec;
 #endif
@@ -206,7 +194,6 @@ vps_md_restore_sysentvec(long svtype, st
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_checkarch(uint8 ptrsize, uint8 byteorder)
 {
@@ -220,7 +207,6 @@ vps_md_restore_checkarch(uint8 ptrsize, 
 	return (error);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_snapshot_thread_savefpu(struct vps_snapst_ctx *ctx, struct vps *vps,
     struct thread *td)
@@ -258,7 +244,6 @@ XXX
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_restore_thread_savefpu(struct vps_snapst_ctx *ctx, struct vps *vps,
     struct thread *td)
@@ -296,7 +281,6 @@ XXX
 	return (0);
 }
 
-/*__attribute__((inline))*/
 int
 vps_md_reboot_copyout(struct thread *td, struct execve_args *args)
 {
@@ -320,6 +304,7 @@ vps_md_reboot_copyout(struct thread *td,
 		suword64((void *)(addr + 0x0), (addr + 0x40));
 		suword64((void *)(addr + 0x8), (vm_offset_t)NULL);
 #ifdef COMPAT_FREEBSD32
+	/* XXX */
 	} else if (p->p_sysent == &ia32_freebsd_sysvec) {
 		copyout("/sbin/init", (void *)(addr + 0x40), 11);
 		suword32((void *)(addr + 0x0), (addr + 0x40));
@@ -367,7 +352,6 @@ vps_md_reboot_copyout(struct thread *td,
 	return (error);
 }
 
-/*__attribute__((noinline))*/
 int
 vps_md_syscall_fixup(struct vps *vps, struct thread *td,
     register_t *ret_code, register_t **ret_args, int *ret_narg)
@@ -407,6 +391,7 @@ vps_md_syscall_fixup(struct vps *vps, st
 		DBGCORE("%s: proc=%p/%u elf64_freebsd_sysvec\n",
 		    __func__, p, p->p_pid);
 #ifdef COMPAT_FREEBSD32
+	/* XXX */
 	} else if (sv == &ia32_freebsd_sysvec) {
 		DBGCORE("%s: proc=%p/%u ia32_freebsd_sysvec\n",
 		    __func__, p, p->p_pid);
@@ -511,7 +496,6 @@ vps_md_syscall_fixup_setup_inthread(stru
 	return (0);
 }
 
-__attribute__((noinline))
 void
 vps_md_print_pcb(struct thread *td)
 {
@@ -519,50 +503,39 @@ vps_md_print_pcb(struct thread *td)
 
         p = td->td_pcb;
 
-#if 0
-// XXX
-        DBGCORE("%s: td=%p\n"
-                "pcb_cr3: 0x%08x\n"
-                "pcb_edi: 0x%08x\n"
-                "pcb_esi: 0x%08x\n"
-                "pcb_ebp: 0x%08x\n"
-                "pcb_esp: 0x%08x\n"
-                "pcb_ebx: 0x%08x\n"
-                "pcb_eip: 0x%08x\n"
-                "pcb_psl: 0x%08x\n"
-                "pcb_ext: 0x%08x\n"
+        DBGCORE("%s: td=%p PCB\n"
+                "s0: 0x%16lx\n"
+                "s1: 0x%16lx\n"
+                "s2: 0x%16lx\n"
+                "s3: 0x%16lx\n"
+                "s4: 0x%16lx\n"
+                "s5: 0x%16lx\n"
+                "s6: 0x%16lx\n"
+                "s7: 0x%16lx\n"
+                "sp: 0x%16lx\n"
+                "s8: 0x%16lx\n"
+                "ra: 0x%16lx\n"
+                "sr: 0x%16lx\n"
+                "gp: 0x%16lx\n"
+                "pc: 0x%16lx\n"
                 , __func__, td
-                , p->pcb_cr3
-                , p->pcb_edi
-                , p->pcb_esi
-                , p->pcb_ebp
-                , p->pcb_esp
-                , p->pcb_ebx
-                , p->pcb_eip
-                , p->pcb_psl
-                , (int)p->pcb_ext
+                , p->pcb_context[PCB_REG_S0]
+                , p->pcb_context[PCB_REG_S1]
+                , p->pcb_context[PCB_REG_S2]
+                , p->pcb_context[PCB_REG_S3]
+                , p->pcb_context[PCB_REG_S4]
+                , p->pcb_context[PCB_REG_S5]
+                , p->pcb_context[PCB_REG_S6]
+                , p->pcb_context[PCB_REG_S7]
+                , p->pcb_context[PCB_REG_SP]
+                , p->pcb_context[PCB_REG_S8]
+                , p->pcb_context[PCB_REG_RA]
+                , p->pcb_context[PCB_REG_SR]
+                , p->pcb_context[PCB_REG_GP]
+                , p->pcb_context[PCB_REG_PC]
                 );
-#endif
 }
 
-#if 0
-/* --------------------------- 8< --------------------------- */
-
-// vps_suspend():
-#if defined(CPU_X86)
-              DBGCORE("td->td_frame=%p tf_rax=%p tf_rsp=%p\n", td->td_frame,
-                 (void*)td->td_frame->tf_rax, (void*)td->td_frame->tf_rsp);
-#elif defined(CPU_386)
-              DBGCORE("td->td_frame=%p tf_eax=%p tf_esp=%p\n", td->td_frame,
-                 (void*)td->td_frame->tf_eax, (void*)td->td_frame->tf_esp);
-#else
-#error "unsupported architecture"
-#endif
-
-// 
-/* --------------------------- 8< --------------------------- */
-#endif /* 0 */
-
 #endif /* VPS */
 
 /* EOF */

Modified: projects/vps/sys/vps/vps_libdump.h
==============================================================================
--- projects/vps/sys/vps/vps_libdump.h	Wed Oct 23 16:55:20 2013	(r256982)
+++ projects/vps/sys/vps/vps_libdump.h	Wed Oct 23 16:55:43 2013	(r256983)
@@ -134,7 +134,6 @@ void vps_libdump_printheader(struct vps_
 #define VPS_DUMPH_32BIT			32
 #define VPS_DUMPH_64BIT			64
 
-//#if defined(CPU_X86)
 #if defined(VPS_ARCH_AMD64)
 /* AMD64 declarations */
 typedef unsigned char	uint8;
@@ -165,7 +164,6 @@ typedef unsigned long size_t;
 
 /* end amd64 declarations */
 
-//#elif defined(CPU_386)
 #elif defined(VPS_ARCH_I386)
 /* i386 declarations */
 typedef unsigned char	uint8;



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