From owner-freebsd-alpha Wed May 15 17:21:15 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 93F7D37B403 for ; Wed, 15 May 2002 17:21:09 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id UAA21700; Wed, 15 May 2002 20:21:08 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g4G0KcP36038; Wed, 15 May 2002 20:20:38 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15586.64342.316609.71281@grasshopper.cs.duke.edu> Date: Wed, 15 May 2002 20:20:38 -0400 (EDT) To: Craig Cc: Rich Bud , freebsd-alpha@freebsd.org Subject: Re: natd sig 10 under stable In-Reply-To: <3CE2E558.9030707@cheetahusa.net> References: <20020515160407.T28044-100000@nemesis.fortean.com> <15586.55082.170680.378288@grasshopper.cs.duke.edu> <3CE2E558.9030707@cheetahusa.net> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Here's an MFC candidate of the unaligned fixup additions to support the bwx instructions (ldwu & stw). Please apply this to your system (cd /usr/src/sys; patch < thepatch), rebuild your kernel & reboot to see if your natd problem is fixed. Thanks, Drew Index: alpha/alpha/trap.c =================================================================== RCS file: /home/ncvs/src/sys/alpha/alpha/trap.c,v retrieving revision 1.26.2.4 diff -u -r1.26.2.4 trap.c --- alpha/alpha/trap.c 5 Mar 2001 21:24:15 -0000 1.26.2.4 +++ alpha/alpha/trap.c 16 May 2002 00:16:30 -0000 @@ -921,6 +921,11 @@ extern int alpha_unaligned_print, alpha_unaligned_fix; extern int alpha_unaligned_sigbus; +struct unaligned_fixup_data { + const char *type; /* opcode name */ + int size; /* size, 0 if fixup not supported */ +}; + int unaligned_fixup(va, opcode, reg, p) unsigned long va, opcode, reg; @@ -931,10 +936,11 @@ const char *type; unsigned long *regptr, longdata, uac; int intdata; /* signed to get extension when storing */ - struct { - const char *type; /* opcode name */ - int size; /* size, 0 if fixup not supported */ - } tab[0x10] = { + u_int16_t worddata; /* unsigned to _avoid_ extension */ + const struct unaligned_fixup_data tab_0c[0x2] = { + { "ldwu", 2 }, { "stw", 2 }, + }; + const struct unaligned_fixup_data tab_20[0x10] = { #ifdef FIX_UNALIGNED_VAX_FP { "ldf", 4 }, { "ldg", 8 }, #else @@ -971,9 +977,12 @@ * Find out which opcode it is. Arrange to have the opcode * printed if it's an unknown opcode. */ - if (opcode >= 0x20 && opcode <= 0x2f) { - type = tab[opcode - 0x20].type; - size = tab[opcode - 0x20].size; + if (opcode >= 0x0c && opcode <= 0x0d) { + type = tab_0c[opcode - 0x0c].type; + size = tab_0c[opcode - 0x0c].size; + } else if (opcode >= 0x20 && opcode <= 0x2f) { + type = tab_20[opcode - 0x20].type; + size = tab_20[opcode - 0x20].size; } else { type = "0x%lx"; size = 0; @@ -1016,6 +1025,15 @@ signal = SIGBUS; if (dofix && size != 0) { switch (opcode) { + case 0x0c: /* ldwu */ + /* XXX ONLY WORKS ON LITTLE-ENDIAN ALPHA */ + unaligned_load_integer(worddata); + break; + + case 0x0d: /* stw */ + /* XXX ONLY WORKS ON LITTLE-ENDIAN ALPHA */ + unaligned_store_integer(worddata); + break; #ifdef FIX_UNALIGNED_VAX_FP case 0x20: /* ldf */ unaligned_load_floating(intdata, Ffloat_to_reg); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message