From owner-freebsd-alpha Tue Nov 10 15:36:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA05679 for freebsd-alpha-outgoing; Tue, 10 Nov 1998 15:36:33 -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 PAA05674 for ; Tue, 10 Nov 1998 15:36:32 -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.8.5/8.8.5) with ESMTP id SAA26000; Tue, 10 Nov 1998 18:36:12 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.9.1/8.9.1) id SAA12180; Tue, 10 Nov 1998 18:36:06 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 10 Nov 1998 18:36:05 -0500 (EST) To: Mike Smith Cc: freebsd-alpha@FreeBSD.ORG Subject: Re: another small observation In-Reply-To: <199811102223.OAA00993@dingo.cdrom.com> References: <13896.47289.309597.453451@grasshopper.cs.duke.edu> <199811102223.OAA00993@dingo.cdrom.com> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <13896.52405.267251.355470@grasshopper.cs.duke.edu> Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Mike Smith writes: > No. The Alpha should register an at_shutdown hook which checks for > RB_HALT and calls the appropriate halt routine. cpu_halt() should also > die. Sorry.. I didn't know at_shutdown() even existed. How's the following? Index: /sys/alpha/alpha/machdep.c =================================================================== RCS file: /scratch/freebsd-cvs/src/sys/alpha/alpha/machdep.c,v retrieving revision 1.20 diff -u -r1.20 machdep.c --- machdep.c 1998/11/02 00:14:50 1.20 +++ machdep.c 1998/11/10 23:29:28 @@ -132,6 +132,7 @@ #include #include #include +#include #include #include #include @@ -212,6 +213,32 @@ #define offsetof(type, member) ((size_t)(&((type *)0)->member)) static void +alpha_srm_shutdown(int howto, void* arg2) +{ + if(howto & RB_HALT) { + printf("\n"); + printf("The operating system has halted.\n"); + printf("Please press 's' to drop into the SRM console, " + "or any other key to reboot.\n\n"); + switch (cngetc()) { + case 's' : + case 'S' : + printf("returning to the SRM console...\n"); + case -1: /* No console, just die */ + alpha_pal_halt(); + /* NOTREACHED */ + default: + /* + * this doesn't actually do anything -- it + * would be nice if howto was passed by reference + */ + howto &= ~RB_HALT; + break; + } + } +} + +static void cpu_startup(dummy) void *dummy; { @@ -394,6 +421,7 @@ */ bufinit(); vm_pager_bufferinit(); + at_shutdown_pri(alpha_srm_shutdown, 0, SHUTDOWN_FINAL, SHUTDOWN_PRI_LAST); } BTW - it would be nice if howto was passed in by reference. The way it stands now, you'll see some silliness like this if you decide you really want to just reboot: syncing disks... 5 4 done The operating system has halted. Please press 's' to drop into the SRM console, or any other key to reboot The operating system has halted. Please press any key to reboot. Rebooting... 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