Date: Sat, 9 Apr 2005 04:48:39 +1000 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: "M. Warner Losh" <imp@bsdimp.com> Cc: freebsd-current@freebsd.org Subject: Re: machdep.conspeed sysctl Message-ID: <20050408184838.GC89047@cirb503493.alcatel.com.au> In-Reply-To: <20050407.211210.100582852.imp@bsdimp.com> References: <200504061737.18204.michaelnottebrock@gmx.net> <20050407.211210.100582852.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2005-Apr-07 21:12:10 -0600, M. Warner Losh wrote: >In message: <200504061737.18204.michaelnottebrock@gmx.net> > Michael Nottebrock <michaelnottebrock@gmx.net> writes: >: However, a loader-tunable comconsole speed would *really* be useful IMHO, so >: perhaps someone could try and make it happen for real? :-) > >I backed it out because there was some problem that bde pointed out to >me. I can no longer recall what that was... The log says: "Until I can figure out how to live without the volatile qualifier on comdefaultrate, comment out the support for machdep.conspeed for now." Presumably gcc and/or bde complained that TUNABLE_INT() expected an "int *" but was passed "volatile int *". bde made it volatile in 1.162 though it's not clear to me why the volatile is needed here. I probably need to go and have a close study of exactly what a compiler is permitted to optimise away in the absence of 'volatile'. Rather than try and remove the 'volatile', an alternative approach would be to expand TUNABLE_INT() and use a an alternative to tunable_int_init() that could handle the volatile: Replace the current line with (untested): void tunable_comdefaultrate_init(void *data __unused) { int rate; TUNABLE_INT_FETCH("machdep.conspeed", &rate); comdefaultrate = rate; } SYSINIT(Tunable_init_comdefaultrate, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, \ tunable_comdefaultrate_init, NULL) -- Peter Jeremy
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050408184838.GC89047>