From owner-svn-src-head@FreeBSD.ORG Sun Jan 29 02:58:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2F80106564A; Sun, 29 Jan 2012 02:58:30 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1918FC15; Sun, 29 Jan 2012 02:58:30 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q0T2cjt6091949 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 Jan 2012 18:38:48 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F24B17E.4050306@freebsd.org> Date: Sat, 28 Jan 2012 18:39:58 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.25) Gecko/20111213 Thunderbird/3.1.17 MIME-Version: 1.0 To: Bruce Evans References: <201201272204.q0RM4hRH062478@svn.freebsd.org> <20120128184815.L1114@besplex.bde.org> In-Reply-To: <20120128184815.L1114@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230628 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 02:58:31 -0000 On 1/28/12 12:23 AM, Bruce Evans wrote: > On Fri, 27 Jan 2012, Marius Strobl wrote: > >> Log: >> Mark cpu_{halt,reset}() as __dead2 as appropriate. >> >> Modified: >> head/sys/sparc64/include/cpu.h >> >> Modified: head/sys/sparc64/include/cpu.h >> ============================================================================== >> >> --- head/sys/sparc64/include/cpu.h Fri Jan 27 21:52:59 2012 >> (r230627) >> +++ head/sys/sparc64/include/cpu.h Fri Jan 27 22:04:43 2012 >> (r230628) >> @@ -53,8 +53,8 @@ extern char btext[]; >> extern char etext[]; >> >> void cheetah_init(u_int cpu_impl); >> -void cpu_halt(void); >> -void cpu_reset(void); >> +void cpu_halt(void) __dead2; >> +void cpu_reset(void) __dead2; >> void fork_trampoline(void); >> void swi_vm(void *v); >> void zeus_init(u_int cpu_impl); > > This reminds me that these functions and many others shouldn't be > in since they necessarily have a MI interface (so > that MI code can call them). A few interfaces in > need to be there so that the can be inlines or macros, but most > don't. Especially these 2. Since they are extremely non-time- > critical and not likely to be magical, they can be implemented as > a wrapper extern function even if the MD code prefers to use an > in inline or macro. Duplicating these 2 in ${N_ARCH} cpu.h files > mainly allows some of the files to forget to declare them as > __dead2. > > I put these in and didn't forget __dead2 for them. > systm.h already has prototypes for 11 functions named cpu_*. These > are unsorted of course. It also has prototypes for a few functions > that are misnamed (without a cpu_ as a prefix, or perhaps without > cpu_ or cpu at all) so that they are naturally unsorted and hard to > find. > > No MD declaration of these 2 in -current except the above has the > __dead2's. IIRC, I noticed that __dead2 was missing for them from > the style bug that code after calls to them has /* NOTREACHED */ > comments (shutdown_halt() still does, except in my version). > __dead2 should have made most of these comments go away 15-20 years > ago. > > A more important "cpu_" function whose comments annoy me is > cpu_throw(). This has always been declared in an MI file > (, which shows that we can't expect all these functions > to be declared in if they are MI). Calls to > cpu_throw() have the unnecessary comments /* doesn't return */ in > 2 places (lint won't understand these, so if you are going to > comment on the obvious then it should be /* NOTREACHED */), and a > bogus "teapot" panic and a /* NOTREACHED */ comment in another > place. The panic is so bogus that gcc removes it (as allowed by > cpu_throw() being declared __dead2). The first 2 places are > sched_throw() in 2 schedulers. This can't return, but isn't > declared as __dead2. The other place is thread_exit(). This is > one of very few extern functions that is declared as __dead2. > > Bruce > Bruce these comments are valid. please make use of your commit bit and make the appropriate changes!