Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2006 15:44:19 +0200
From:      Johannes Weiner <root@hnaz.ath.cx>
To:        freebsd-hackers@freebsd.org
Subject:   Kernelinternal function return value caching?
Message-ID:  <20060611134419.GA71676@leiferikson.flosken.lan>

next in thread | raw e-mail | index | archive | help
Hi folks,

when I found out, that playing sound with xmms does not always work out
100%, I started experimenting with the sound driver.

What I got first was, that when a sound channel is opened/initialized, the
optimal playback values for speed, format and blocksize of the channel are
guessed by iterating combinations until the best is found (at least that is
what I think it does).
When this is done, the playback is started.

Not all playback parameters are increased simultaneously, though.
The blocksize incrementation doesn't work out. Although the function for
setting it to a higher value is called, it just doesn't get executed.
I checked that with a simple printf() within the concerned function.

I read how objects are looked up and saw that KOBJOPLOOKUP() tries to cache
functions before looking them up again. This should not lead to the caching
of function return values instead of really executing them, should it?

I wrote a small frontend to avoid KOBJOPLOOKUP() and even after I got a straight
pointer on the function, and make a call on this, it still doesn't get executed.

How could that be? Is it possible that the return values are cached when a
function is inlined or marked static?

I don't get it...

Hannes

PS: code reference:

* hardware-specific setblocksize() that doesn't get executed when called:
	static int fm801ch_setblocksize() in sys/dev/sound/pci/fm801.c

* generic setblocksize() that should execute the specific one:
	int chn_setblocksize() in sys/dev/sound/pcm/channel.c
	calls specific setblocksize() with the macro CHANNEL_SETBLOCKSIZE()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060611134419.GA71676>