From owner-freebsd-alpha Sun Jan 10 13:55:28 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA18858 for freebsd-alpha-outgoing; Sun, 10 Jan 1999 13:55:28 -0800 (PST) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA18847 for ; Sun, 10 Jan 1999 13:55:24 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.1/8.9.1) with ESMTP id QAA10549 for ; Sun, 10 Jan 1999 16:54:54 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.9.1/8.9.1) id QAA72227; Sun, 10 Jan 1999 16:54:51 -0500 (EST) (envelope-from gallatin@cs.duke.edu) Message-Id: <199901102154.QAA72227@grasshopper.cs.duke.edu> From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 10 Jan 1999 16:54:51 -0500 (EST) To: freebsd-alpha@FreeBSD.ORG Subject: printing vm_offset_t's X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org What's the proper way to print out vm_offset_t's in MI parts of the kernel? Certain things (like procfs's map file) are broken because i386 defines vm_offset_t as: /sys/i386/include/types.h:typedef unsigned int vm_offset_t; but alpha defines it as: /sys/alpha/include/types.h:typedef unsigned long vm_offset_t; And printf format strings for printing out vm_offset_t's are typically "0x%x" which results in warnings on alpha, as well as truncation of the data. My gut reaction is that the i386's definition should be changed to an unsigned long (since the size would be the same) & all format strings for printing out vm_offset_t's should be changed to "0x%lx" If that's too radical, I think that at the very least format strings should be changed to "0x%lx". This would result in proper behaviour on alphas, with the downside of also shifting warning to the i386 branch. Or maybe we should just cast vm_offset_t's to (void *) and use a %p format sting. Just wanted to raise the issue.. Drew ------------------------------------------------------------------------------ Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin Duke University Email: gallatin@cs.duke.edu Department of Computer Science Phone: (919) 660-6590 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message