--- old/./README.xbuild	2015-01-14 19:07:05.008868832 -0500
+++ new/./README.xbuild	2015-01-14 19:07:05.016334166 -0500
@@ -23,7 +23,12 @@
 
 Fun way:
 
-Clone this repository again and do a normal i386 on i386 build.
+Using a normal i386 on i386 build:
+cd usr/src
+dmake setup
+cd cmd/sgs
+dmake install
+
 mkdir -p /opt/armtc/lib/amd64 /opt/armtc/usr/bin/amd64
 cd /opt/armtc/lib/
 ln -s amd64 64
--- old/usr/src/lib/libdisasm/common/dis_arm.c	2015-01-14 19:07:05.231790738 -0500
+++ new/usr/src/lib/libdisasm/common/dis_arm.c	2015-01-14 19:07:05.239244606 -0500
@@ -808,11 +808,17 @@
 	 * Print the shifter as appropriate
 	 */
 	switch (dpi_inst.dpii_stype) {
-	case ARM_DPI_SHIFTER_IMM32:
-		len = snprintf(buf, buflen, ", #%d, %d",
-		    dpi_inst.dpii_un.dpii_im.dpisi_imm,
-		    dpi_inst.dpii_un.dpii_im.dpisi_rot);
+	case ARM_DPI_SHIFTER_IMM32: {
+		uint32_t imm = dpi_inst.dpii_un.dpii_im.dpisi_imm;
+		int rot = dpi_inst.dpii_un.dpii_im.dpisi_rot * 2;
+		if (rot != 0)
+			imm = (imm << (32 - rot)) | (imm >> rot);
+		if (imm < 10)
+			len = snprintf(buf, buflen, ", #%d", imm);
+		else
+			len = snprintf(buf, buflen, ", #%d  ; %#x", imm, imm);
 		break;
+	}
 	case ARM_DPI_SHIFTER_SIMM:
 		if (dpi_inst.dpii_un.dpii_si.dpiss_code == DPI_S_NONE) {
 			len = snprintf(buf, buflen, ", %s",
--- old/usr/src/uts/armv6/ml/glocore.s	2015-01-14 19:07:05.535905299 -0500
+++ new/usr/src/uts/armv6/ml/glocore.s	2015-01-14 19:07:05.543474787 -0500
@@ -123,13 +123,18 @@
 	mcr	p15, 0, r0, c1, c0, 0
 
 	/*
-	 * mlsetup() takes the struct regs as an argument. main doesn't take any
-	 * and should never return. After the push below, we should have a
-	 * 8-byte aligned stack pointer. This is why we subtracted four earlier
-	 * on if we were 8-byte aligned.
+	 * mlsetup() takes the struct regs as an argument. main doesn't take
+	 * any and should never return. Currently, we have an 8-byte aligned
+	 * stack.  We want to push a zero frame pointer to terminate any
+	 * stack walking, but that would cause us to end up with only a
+	 * 4-byte aligned stack.  So, to keep things nice and correct, we
+	 * push a zero value twice - it's similar to a typical function
+	 * entry:
+	 * 	push { r9, lr }
 	 */
 	mov	r9,#0
-	push	{ r9 }
+	push	{ r9 }		/* link register */
+	push	{ r9 }		/* frame pointer */
 	mov	r0, sp
 	bl	mlsetup
 	bl	main
--- old/usr/src/uts/armv6/os/fakebop.c	2015-01-14 19:07:05.741344437 -0500
+++ new/usr/src/uts/armv6/os/fakebop.c	2015-01-14 19:07:05.748623540 -0500
@@ -204,6 +204,14 @@
 	bop_alloc_plast = pmax;
 }
 
+#define DUMP_ATAG_VAL(name, val)					\
+	do {								\
+		DBG_MSG("\t" name ":");					\
+		bcons_puts("\t");					\
+		DBG_MSG(fakebop_hack_ultostr((val),			\
+		    &buffer[BUFFERSIZE-1]));				\
+	} while (0)
+
 static void
 fakebop_dump_tags(void *tagstart)
 {
@@ -212,6 +220,8 @@
 	atag_mem_t *amp;
 	atag_cmdline_t *alp;
 	atag_initrd_t *aip;
+	atag_illumos_status_t *aisp;
+	atag_illumos_mapping_t *aimp;
 	const char *tname;
 	int i;
 	char *c;
@@ -251,6 +261,12 @@
 		case ATAG_CMDLINE:
 			tname = "ATAG_CMDLINE";
 			break;
+		case ATAG_ILLUMOS_STATUS:
+			tname = "ATAG_ILLUMOS_STATUS";
+			break;
+		case ATAG_ILLUMOS_MAPPING:
+			tname = "ATAG_ILLUMOS_MAPPING";
+			break;
 		default:
 			tname = fakebop_hack_ultostr(h->ah_tag,
 			    &buffer[BUFFERSIZE-1]);
@@ -268,41 +284,20 @@
 				DBG_MSG("ATAG_CORE has no extra information");
 			} else {
 				acp = (atag_core_t *)h;
-				DBG_MSG("\tflags:");
-				bcons_puts("\t");
-				DBG_MSG(fakebop_hack_ultostr(acp->ac_flags,
-				    &buffer[BUFFERSIZE-1]));
-				DBG_MSG("\tpage:");
-				bcons_puts("\t");
-				DBG_MSG(fakebop_hack_ultostr(acp->ac_pagesize,
-				    &buffer[BUFFERSIZE-1]));
-				DBG_MSG("\troot:");
-				bcons_puts("\t");
-				DBG_MSG(fakebop_hack_ultostr(acp->ac_rootdev,
-				    &buffer[BUFFERSIZE-1]));
+				DUMP_ATAG_VAL("flags", acp->ac_flags);
+				DUMP_ATAG_VAL("pagesize", acp->ac_pagesize);
+				DUMP_ATAG_VAL("rootdev", acp->ac_rootdev);
 			}
 			break;
 		case ATAG_MEM:
 			amp = (atag_mem_t *)h;
-			DBG_MSG("\tsize:");
-			bcons_puts("\t");
-			DBG_MSG(fakebop_hack_ultostr(amp->am_size,
-			    &buffer[BUFFERSIZE-1]));
-			DBG_MSG("\tstart:");
-			bcons_puts("\t");
-			DBG_MSG(fakebop_hack_ultostr(amp->am_start,
-			    &buffer[BUFFERSIZE-1]));
+			DUMP_ATAG_VAL("size", amp->am_size);
+			DUMP_ATAG_VAL("start", amp->am_start);
 			break;
 		case ATAG_INITRD2:
 			aip = (atag_initrd_t *)h;
-			DBG_MSG("\tsize:");
-			bcons_puts("\t");
-			DBG_MSG(fakebop_hack_ultostr(aip->ai_size,
-			    &buffer[BUFFERSIZE-1]));
-			DBG_MSG("\tstart:");
-			bcons_puts("\t");
-			DBG_MSG(fakebop_hack_ultostr(aip->ai_start,
-			    &buffer[BUFFERSIZE-1]));
+			DUMP_ATAG_VAL("size", aip->ai_size);
+			DUMP_ATAG_VAL("start", aip->ai_start);
 			break;
 		case ATAG_CMDLINE:
 			alp = (atag_cmdline_t *)h;
@@ -322,6 +317,29 @@
 			}
 			bcons_puts("\n");
 			break;
+		case ATAG_ILLUMOS_STATUS:
+			aisp = (atag_illumos_status_t *)h;
+			DUMP_ATAG_VAL("version", aisp->ais_version);
+			DUMP_ATAG_VAL("ptbase", aisp->ais_ptbase);
+			DUMP_ATAG_VAL("freemem", aisp->ais_freemem);
+			DUMP_ATAG_VAL("freeused", aisp->ais_freeused);
+			DUMP_ATAG_VAL("archive", aisp->ais_archive);
+			DUMP_ATAG_VAL("archivelen", aisp->ais_archivelen);
+			DUMP_ATAG_VAL("pt_arena", aisp->ais_pt_arena);
+			DUMP_ATAG_VAL("pt_arena_max", aisp->ais_pt_arena_max);
+			DUMP_ATAG_VAL("stext", aisp->ais_stext);
+			DUMP_ATAG_VAL("etext", aisp->ais_etext);
+			DUMP_ATAG_VAL("sdata", aisp->ais_sdata);
+			DUMP_ATAG_VAL("edata", aisp->ais_edata);
+			break;
+		case ATAG_ILLUMOS_MAPPING:
+			aimp = (atag_illumos_mapping_t *)h;
+			DUMP_ATAG_VAL("paddr", aimp->aim_paddr);
+			DUMP_ATAG_VAL("plen", aimp->aim_plen);
+			DUMP_ATAG_VAL("vaddr", aimp->aim_vaddr);
+			DUMP_ATAG_VAL("vlen", aimp->aim_vlen);
+			DUMP_ATAG_VAL("mapflags", aimp->aim_mapflags);
+			break;
 		default:
 			break;
 		}
@@ -342,6 +360,10 @@
 	while (ahp != NULL) {
 		switch (ahp->ah_tag) {
 		case ATAG_MEM:
+			/*
+			 * XXX: we may actually get more than one ATAG_MEM
+			 * if the system has discontiguous physical memory
+			 */
 			amp = (atag_mem_t *)ahp;
 			bp->bi_memsize = amp->am_size;
 			bp->bi_memstart = amp->am_start;
--- old/usr/src/uts/armv6/sys/atag.h	2015-01-14 19:07:05.977911628 -0500
+++ new/usr/src/uts/armv6/sys/atag.h	2015-01-14 19:07:05.985309555 -0500
@@ -78,7 +78,7 @@
 
 typedef struct atag_cmdline {
 	atag_header_t	al_header;
-	char 		al_cmdline[1];
+	char		al_cmdline[1];
 } atag_cmdline_t;
 
 typedef struct atag_illumos_status {
