From owner-freebsd-alpha Tue Nov 10 15:50:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA06905 for freebsd-alpha-outgoing; Tue, 10 Nov 1998 15:50:22 -0800 (PST) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA06900 for ; Tue, 10 Nov 1998 15:50:19 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id PAA01499; Tue, 10 Nov 1998 15:48:50 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811102348.PAA01499@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Andrew Gallatin cc: freebsd-alpha@FreeBSD.ORG Subject: Re: another small observation In-reply-to: Your message of "Tue, 10 Nov 1998 18:36:05 EST." <13896.52405.267251.355470@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 10 Nov 1998 15:48:50 -0800 From: Mike Smith 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? Looks about right, although I wouldn't even bother with the 's' option - expected behaviour is that 'halt' will drop you back to SRM, and I have no problems with that. If you've tested this, then I'll commit a simplified version straight away. > 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 -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message