Forgot to check in 386/asm.h.
Rather than do that, fix build by
generating asm.h automatically.

R=r
DELTA=97  (48 added, 36 deleted, 13 changed)
OCL=30449
CL=30452
diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile
index 498bf0b..78e3cbf 100644
--- a/src/pkg/runtime/Makefile
+++ b/src/pkg/runtime/Makefile
@@ -93,7 +93,7 @@
 	rm -f *.[568] *.a $(GOROOT)/lib/$(LIB)
 
 clean:
-	rm -f *.[568] *.a runtime.acid cgo2c
+	rm -f *.[568] *.a runtime.acid cgo2c */asm.h
 
 %.$O:	%.go
 	$(GC) $<
@@ -129,3 +129,7 @@
 chan.acid: runtime.h chan.c
 	$(CC) -a chan.c >chan.acid
 
+$(GOARCH)/asm.h: runtime.acid mkasmh
+	mkasmh >$@.x
+	mv -f $@.x $@
+
diff --git a/src/pkg/runtime/amd64/asm.h b/src/pkg/runtime/amd64/asm.h
deleted file mode 100644
index c32da75..0000000
--- a/src/pkg/runtime/amd64/asm.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Assembly constants
-
-#define	g	R15
-#define	m	R14
-
-// offsets in m
-#define	m_g0		0
-#define	m_morepc	8
-#define	m_morebuf	16
-#define	m_morearg	40
-#define	m_cret		48
-#define	m_procid	56
-#define	m_gsignal	64
-#define	m_tls		72
-#define	m_sched		104
-
-// offsets in gobuf
-#define	gobuf_sp	0
-#define	gobuf_pc	8
-#define	gobuf_g		16
-
-// offsets in g
-#define	g_stackguard	0
-#define	g_stackbase	8
-#define	g_defer		16
-#define	g_sched		24
diff --git a/src/pkg/runtime/amd64/asm.s b/src/pkg/runtime/amd64/asm.s
index 825acc4..539b1ab 100644
--- a/src/pkg/runtime/amd64/asm.s
+++ b/src/pkg/runtime/amd64/asm.s
@@ -143,24 +143,24 @@
 // morestack trampolines
 TEXT	sys·morestack00+0(SB),7,$0
 	MOVQ	$0, AX
-	MOVQ	AX, m_morearg(m)
+	MOVQ	AX, m_moreframe(m)
 	MOVQ	$sys·morestack+0(SB), AX
 	JMP	AX
 
 TEXT	sys·morestack01+0(SB),7,$0
 	SHLQ	$32, AX
-	MOVQ	AX, m_morearg(m)
+	MOVQ	AX, m_moreframe(m)
 	MOVQ	$sys·morestack+0(SB), AX
 	JMP	AX
 
 TEXT	sys·morestack10+0(SB),7,$0
 	MOVLQZX	AX, AX
-	MOVQ	AX, m_morearg(m)
+	MOVQ	AX, m_moreframe(m)
 	MOVQ	$sys·morestack+0(SB), AX
 	JMP	AX
 
 TEXT	sys·morestack11+0(SB),7,$0
-	MOVQ	AX, m_morearg(m)
+	MOVQ	AX, m_moreframe(m)
 	MOVQ	$sys·morestack+0(SB), AX
 	JMP	AX
 
@@ -199,7 +199,7 @@
 TEXT	sys·morestackx(SB),7,$0
 	POPQ	AX
 	SHLQ	$35, AX
-	MOVQ	AX, m_morearg(m)
+	MOVQ	AX, m_moreframe(m)
 	MOVQ	$sys·morestack(SB), AX
 	JMP	AX
 
diff --git a/src/pkg/runtime/mkasmh b/src/pkg/runtime/mkasmh
new file mode 100755
index 0000000..02f73ca
--- /dev/null
+++ b/src/pkg/runtime/mkasmh
@@ -0,0 +1,47 @@
+#!/bin/sh
+# Copyright 2009 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+set -e
+
+cat <<'EOF'
+// Assembly constants.
+// AUTOMATICALLY GENERATED BY mkasmh DURING BUILD
+
+EOF
+
+case "$GOARCH" in
+386)
+	echo '#define	g	0(FS)'
+	echo '#define	m	4(FS)'
+	;;
+amd64)
+	echo '#define	g	R15'
+	echo '#define	m	R14'
+	;;
+*)
+	echo 'unknown $GOARCH: '$GOARCH 1>&2
+	exit 1
+	;;
+esac
+echo
+
+awk '
+/^aggr G$/ { aggr="g" }
+/^aggr M$/ { aggr = "m" }
+/^aggr Gobuf$/ { aggr = "gobuf" }
+/^}/ { aggr = "" }
+
+#	Gobuf 24 sched;
+#	'Y' 48 stack0;
+#	'Y' 56 entry;
+#	'A' G 64 alllink;
+aggr != "" && /^	/ {
+	name=$NF;
+	sub(/;/, "", name);
+	offset=$(NF-1);
+	printf("#define %s_%s %s\n", aggr, name, offset);
+}
+' runtime.acid
+
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 59dba49..662fde7 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -134,23 +134,17 @@
 };
 struct	Gobuf
 {
-	// Offsets of fields in this struct are known to assembly.
-	// Any changes made here must be reflected in */asm.h.
-	// The debuggers also know the layout of this struct.
+	// The offsets of these fields are known to (hard-coded in) libmach.
 	byte*	sp;
 	byte*	pc;
 	G*	g;
 };
 struct	G
 {
-	// Offsets of fields in this block are known to assembly.
-	// Any changes made here must be reflected in */asm.h.
-	byte*	stackguard;	// cannot move - also known to linker, debuggers
-	byte*	stackbase;	// cannot move - also known to debuggers
+	byte*	stackguard;	// cannot move - also known to linker, libmach
+	byte*	stackbase;	// cannot move - also known to libmach
 	Defer*	defer;
-	Gobuf	sched;		// cannot move - also known to debuggers
-
-	// Fields not known to assembly.
+	Gobuf	sched;		// cannot move - also known to libmach
 	byte*	stack0;		// first stack segment
 	byte*	entry;		// initial function
 	G*	alllink;	// on allg
@@ -171,14 +165,12 @@
 };
 struct	M
 {
-	// Offsets of fields in this block are known to assembly.
-	// Any changes made here must be reflected in */asm.h.
-	// These are known to debuggers.
+	// The offsets of these fields are known to (hard-coded in) libmach.
 	G*	g0;		// goroutine with scheduling stack
 	void	(*morepc)(void);
 	Gobuf	morebuf;	// gobuf arg to morestack
 
-	// Known to assembly, but not to debuggers.
+	// Fields not known to debuggers.
 	uint32	moreframe;	// size arguments to morestack
 	uint32	moreargs;
 	uintptr	cret;		// return value from C
@@ -187,8 +179,6 @@
 	uint32	tls[8];		// thread-local storage (for 386 extern register)
 	Gobuf	sched;	// scheduling stack
 	G*	curg;		// current running goroutine
-
-	// Fields not known to assembly.
 	int32	id;
 	int32	mallocing;
 	int32	gcing;
@@ -202,7 +192,7 @@
 };
 struct	Stktop
 {
-	// The debuggers know the layout of this struct.
+	// The offsets of these fields are known to (hard-coded in) libmach.
 	uint8*	stackguard;
 	uint8*	stackbase;
 	Gobuf	gobuf;