本文整理汇总了C++中KOBJMETHOD函数的典型用法代码示例。如果您正苦于以下问题:C++ KOBJMETHOD函数的具体用法?C++ KOBJMETHOD怎么用?C++ KOBJMETHOD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KOBJMETHOD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
return (bus_space_read_1(bas->bst, bas->bsh, SSCOM_URXH));
}
static int exynos4210_bus_probe(struct uart_softc *sc);
static int exynos4210_bus_attach(struct uart_softc *sc);
static int exynos4210_bus_flush(struct uart_softc *, int);
static int exynos4210_bus_getsig(struct uart_softc *);
static int exynos4210_bus_ioctl(struct uart_softc *, int, intptr_t);
static int exynos4210_bus_ipend(struct uart_softc *);
static int exynos4210_bus_param(struct uart_softc *, int, int, int, int);
static int exynos4210_bus_receive(struct uart_softc *);
static int exynos4210_bus_setsig(struct uart_softc *, int);
static int exynos4210_bus_transmit(struct uart_softc *);
static kobj_method_t exynos4210_methods[] = {
KOBJMETHOD(uart_probe, exynos4210_bus_probe),
KOBJMETHOD(uart_attach, exynos4210_bus_attach),
KOBJMETHOD(uart_flush, exynos4210_bus_flush),
KOBJMETHOD(uart_getsig, exynos4210_bus_getsig),
KOBJMETHOD(uart_ioctl, exynos4210_bus_ioctl),
KOBJMETHOD(uart_ipend, exynos4210_bus_ipend),
KOBJMETHOD(uart_param, exynos4210_bus_param),
KOBJMETHOD(uart_receive, exynos4210_bus_receive),
KOBJMETHOD(uart_setsig, exynos4210_bus_setsig),
KOBJMETHOD(uart_transmit, exynos4210_bus_transmit),
{0, 0 }
};
int
exynos4210_bus_probe(struct uart_softc *sc)
示例2: cs4281_wr
regno &= 0xff;
cs4281_wr(sc, CS4281PCI_ACCAD, regno);
cs4281_wr(sc, CS4281PCI_ACCDA, data);
cs4281_wr(sc, CS4281PCI_ACCTL, CS4281PCI_ACCTL_ESYN |
CS4281PCI_ACCTL_VFRM | CS4281PCI_ACCTL_DCV);
if (cs4281_waitclr(sc, CS4281PCI_ACCTL, CS4281PCI_ACCTL_DCV, 250) == 0) {
device_printf(sc->dev,"cs4281_wrcd: DCV did not go\n");
}
return 0;
}
static kobj_method_t cs4281_ac97_methods[] = {
KOBJMETHOD(ac97_read, cs4281_rdcd),
KOBJMETHOD(ac97_write, cs4281_wrcd),
KOBJMETHOD_END
};
AC97_DECLARE(cs4281_ac97);
/* ------------------------------------------------------------------------- */
/* shared rec/play channel interface */
static void *
cs4281chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
{
struct sc_info *sc = devinfo;
struct sc_chinfo *ch = (dir == PCMDIR_PLAY) ? &sc->pch : &sc->rch;
ch->buffer = b;
示例3: ad1816_lock
case SOUND_MASK_MIC:
default:
dev = 0x50;
src = SOUND_MASK_MIC;
}
dev |= dev << 8;
ad1816_lock(ad1816);
ad1816_write(ad1816, 20, (ad1816_read(ad1816, 20) & ~0x7070) | dev);
ad1816_unlock(ad1816);
return src;
}
static kobj_method_t ad1816mixer_methods[] = {
KOBJMETHOD(mixer_init, ad1816mix_init),
KOBJMETHOD(mixer_set, ad1816mix_set),
KOBJMETHOD(mixer_setrecsrc, ad1816mix_setrecsrc),
KOBJMETHOD_END
};
MIXER_DECLARE(ad1816mixer);
/* -------------------------------------------------------------------- */
/* channel interface */
static void *
ad1816chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
{
struct ad1816_info *ad1816 = devinfo;
struct ad1816_chinfo *ch = (dir == PCMDIR_PLAY)? &ad1816->pch : &ad1816->rch;
ch->dir = dir;
示例4: while
src = *inbuf;
dst = *outbuf;
while(r--)
*dst++ = dp->d_table[(u_char)*src++];
*inbuf += n;
*outbuf += n;
*inbytesleft -= n;
*outbytesleft -= n;
return 0;
}
static const char *
iconv_xlat_name(struct iconv_converter_class *dcp)
{
return "xlat";
}
static kobj_method_t iconv_xlat_methods[] = {
KOBJMETHOD(iconv_converter_open, iconv_xlat_open),
KOBJMETHOD(iconv_converter_close, iconv_xlat_close),
KOBJMETHOD(iconv_converter_conv, iconv_xlat_conv),
#if 0
KOBJMETHOD(iconv_converter_init, iconv_xlat_init),
KOBJMETHOD(iconv_converter_done, iconv_xlat_done),
#endif
KOBJMETHOD(iconv_converter_name, iconv_xlat_name),
{0, 0}
};
KICONV_CONVERTER(xlat, sizeof(struct iconv_xlat));
示例5: msm_bus_probe
static int msm_bus_probe(struct uart_softc *sc);
static int msm_bus_attach(struct uart_softc *sc);
static int msm_bus_flush(struct uart_softc *, int);
static int msm_bus_getsig(struct uart_softc *);
static int msm_bus_ioctl(struct uart_softc *, int, intptr_t);
static int msm_bus_ipend(struct uart_softc *);
static int msm_bus_param(struct uart_softc *, int, int, int, int);
static int msm_bus_receive(struct uart_softc *);
static int msm_bus_setsig(struct uart_softc *, int);
static int msm_bus_transmit(struct uart_softc *);
static void msm_bus_grab(struct uart_softc *);
static void msm_bus_ungrab(struct uart_softc *);
static kobj_method_t msm_methods[] = {
KOBJMETHOD(uart_probe, msm_bus_probe),
KOBJMETHOD(uart_attach, msm_bus_attach),
KOBJMETHOD(uart_flush, msm_bus_flush),
KOBJMETHOD(uart_getsig, msm_bus_getsig),
KOBJMETHOD(uart_ioctl, msm_bus_ioctl),
KOBJMETHOD(uart_ipend, msm_bus_ipend),
KOBJMETHOD(uart_param, msm_bus_param),
KOBJMETHOD(uart_receive, msm_bus_receive),
KOBJMETHOD(uart_setsig, msm_bus_setsig),
KOBJMETHOD(uart_transmit, msm_bus_transmit),
KOBJMETHOD(uart_grab, msm_bus_grab),
KOBJMETHOD(uart_ungrab, msm_bus_ungrab),
{0, 0 }
};
int
示例6: return
out[j].device == out[i].device)
out[i].unit++;
}
}
return (0);
}
/* BHND_EROM_FREE_CORE_TABLE() */
static void
siba_erom_free_core_table(bhnd_erom_t *erom, struct bhnd_core_info *cores)
{
free(cores, M_BHND);
}
static kobj_method_t siba_erom_methods[] = {
KOBJMETHOD(bhnd_erom_probe, siba_erom_probe),
KOBJMETHOD(bhnd_erom_probe_static, siba_erom_probe_static),
KOBJMETHOD(bhnd_erom_init, siba_erom_init),
KOBJMETHOD(bhnd_erom_init_static, siba_erom_init_static),
KOBJMETHOD(bhnd_erom_fini, siba_erom_fini),
KOBJMETHOD(bhnd_erom_get_core_table, siba_erom_get_core_table),
KOBJMETHOD(bhnd_erom_free_core_table, siba_erom_free_core_table),
KOBJMETHOD(bhnd_erom_lookup_core, siba_erom_lookup_core),
KOBJMETHOD(bhnd_erom_lookup_core_addr, siba_erom_lookup_core_addr),
KOBJMETHOD_END
};
BHND_EROM_DEFINE_CLASS(siba_erom, siba_erom_parser, siba_erom_methods, sizeof(struct siba_erom));
示例7: z8530_bfe_attach
#include <sys/serial.h>
#include <dev/scc/scc_bfe.h>
#include <dev/scc/scc_bus.h>
#include <dev/ic/z8530.h>
#include "scc_if.h"
static int z8530_bfe_attach(struct scc_softc *, int);
static int z8530_bfe_iclear(struct scc_softc *, struct scc_chan *);
static int z8530_bfe_ipend(struct scc_softc *);
static int z8530_bfe_probe(struct scc_softc *);
static kobj_method_t z8530_methods[] = {
KOBJMETHOD(scc_attach, z8530_bfe_attach),
KOBJMETHOD(scc_iclear, z8530_bfe_iclear),
KOBJMETHOD(scc_ipend, z8530_bfe_ipend),
KOBJMETHOD(scc_probe, z8530_bfe_probe),
KOBJMETHOD_END
};
struct scc_class scc_z8530_class = {
"z8530 class",
z8530_methods,
sizeof(struct scc_softc),
.cl_channels = 2,
.cl_class = SCC_CLASS_Z8530,
.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
.cl_range = CHAN_B - CHAN_A,
};
示例8: DELAY
/* wait until codec is ready */
for (i = 0; i < TIMO && fm801_rd(fm801,FM_CODEC_CMD,2) & FM_CODEC_CMD_BUSY; i++) {
DELAY(10000);
DPRINT("fm801 wrcd: 2 - DELAY\n");
}
if (i >= TIMO) {
kprintf("fm801 wrcd: read codec busy\n");
return -1;
}
DPRINT("fm801 wrcd release reg 0x%x val 0x%x\n",regno, data);
return 0;
}
static kobj_method_t fm801_ac97_methods[] = {
KOBJMETHOD(ac97_read, fm801_rdcd),
KOBJMETHOD(ac97_write, fm801_wrcd),
DEVMETHOD_END
};
AC97_DECLARE(fm801_ac97);
/* -------------------------------------------------------------------- */
/*
* The interrupt handler
*/
static void
fm801_intr(void *p)
{
struct fm801_info *fm801 = (struct fm801_info *)p;
u_int32_t intsrc = fm801_rd(fm801, FM_INTSTATUS, 2);
示例9: via_wr
return -1;
via_wr(via, VIA_AC97_CONTROL, VIA_AC97_CODEC00_VALID |
VIA_AC97_READ | VIA_AC97_INDEX(reg), 4);
if (via_waitready_codec(via))
return -1;
if (via_waitvalid_codec(via))
return -1;
return via_rd(via, VIA_AC97_CONTROL, 2);
}
static kobj_method_t via_ac97_methods[] = {
KOBJMETHOD(ac97_read, via_read_codec),
KOBJMETHOD(ac97_write, via_write_codec),
KOBJMETHOD_END
};
AC97_DECLARE(via_ac97);
/* -------------------------------------------------------------------- */
static int
via_buildsgdt(struct via_chinfo *ch)
{
u_int32_t phys_addr, flag;
int i, seg_size;
seg_size = sndbuf_getsize(ch->buffer) / SEGS_PER_CHAN;
phys_addr = sndbuf_getbufaddr(ch->buffer);
示例10: mpu401_timeout
};
static void mpu401_timeout(void *m);
static mpu401_intr_t mpu401_intr;
static int mpu401_minit(struct snd_midi *, void *);
static int mpu401_muninit(struct snd_midi *, void *);
static int mpu401_minqsize(struct snd_midi *, void *);
static int mpu401_moutqsize(struct snd_midi *, void *);
static void mpu401_mcallback(struct snd_midi *, void *, int);
static void mpu401_mcallbackp(struct snd_midi *, void *, int);
static const char *mpu401_mdescr(struct snd_midi *, void *, int);
static const char *mpu401_mprovider(struct snd_midi *, void *);
static kobj_method_t mpu401_methods[] = {
KOBJMETHOD(mpu_init, mpu401_minit),
KOBJMETHOD(mpu_uninit, mpu401_muninit),
KOBJMETHOD(mpu_inqsize, mpu401_minqsize),
KOBJMETHOD(mpu_outqsize, mpu401_moutqsize),
KOBJMETHOD(mpu_callback, mpu401_mcallback),
KOBJMETHOD(mpu_callbackp, mpu401_mcallbackp),
KOBJMETHOD(mpu_descr, mpu401_mdescr),
KOBJMETHOD(mpu_provider, mpu401_mprovider),
KOBJMETHOD_END
};
DEFINE_CLASS(mpu401, mpu401_methods, 0);
void
mpu401_timeout(void *a)
{
示例11: spltty
{
struct au88x0_info *aui = arg;
int sl;
sl = spltty();
au88x0_codec_wait(aui);
au88x0_write(aui, AU88X0_CODEC_IO, AU88X0_CDIO_WRITE(reg, data), 4);
splx(sl);
return 0;
}
/*
* Codec interface glue
*/
static kobj_method_t au88x0_ac97_methods[] = {
KOBJMETHOD(ac97_read, au88x0_codec_read),
KOBJMETHOD(ac97_write, au88x0_codec_write),
KOBJMETHOD_END
};
AC97_DECLARE(au88x0_ac97);
#define au88x0_channel(aui, dir) \
&(aui)->aui_chan[((dir) == PCMDIR_PLAY) ? 0 : 1]
/***************************************************************************\
* *
* CHANNEL INTERFACE *
* *
\***************************************************************************/
示例12: device_printf
}
if (t == 20) {
/* Timed out. Abort writing. */
device_printf(ess->dev, "agg_wrcodec() PROGLESS timed out.\n");
return -1;
}
bus_space_write_2(ess->st, ess->sh, PORT_CODEC_REG, data);
bus_space_write_1(ess->st, ess->sh, PORT_CODEC_CMD,
CODEC_CMD_WRITE | regno);
return 0;
}
static kobj_method_t agg_ac97_methods[] = {
KOBJMETHOD(ac97_init, agg_ac97_init),
KOBJMETHOD(ac97_read, agg_rdcodec),
KOBJMETHOD(ac97_write, agg_wrcodec),
{ 0, 0 }
};
AC97_DECLARE(agg_ac97);
/* -------------------------------------------------------------------- */
static inline void
ringbus_setdest(struct agg_info *ess, int src, int dest)
{
u_int32_t data;
data = bus_space_read_4(ess->st, ess->sh, PORT_RINGBUS_CTRL);
data &= ~(0xfU << src);
示例13: quicc_read4
#define quicc_read4(bas, reg) \
bus_space_read_4((bas)->bst, (bas)->bsh, reg)
#define quicc_write2(bas, reg, val) \
bus_space_write_2((bas)->bst, (bas)->bsh, reg, val)
#define quicc_write4(bas, reg, val) \
bus_space_write_4((bas)->bst, (bas)->bsh, reg, val)
static int quicc_bfe_attach(struct scc_softc *, int);
static int quicc_bfe_enabled(struct scc_softc *, struct scc_chan *);
static int quicc_bfe_iclear(struct scc_softc *, struct scc_chan *);
static int quicc_bfe_ipend(struct scc_softc *);
static int quicc_bfe_probe(struct scc_softc *);
static kobj_method_t quicc_methods[] = {
KOBJMETHOD(scc_attach, quicc_bfe_attach),
KOBJMETHOD(scc_enabled, quicc_bfe_enabled),
KOBJMETHOD(scc_iclear, quicc_bfe_iclear),
KOBJMETHOD(scc_ipend, quicc_bfe_ipend),
KOBJMETHOD(scc_probe, quicc_bfe_probe),
KOBJMETHOD_END
};
struct scc_class scc_quicc_class = {
"QUICC class",
quicc_methods,
sizeof(struct scc_softc),
.cl_channels = 4,
.cl_class = SCC_CLASS_QUICC,
.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
.cl_range = 0,
示例14: ds_wr
sec = regno & 0x100;
regno &= 0xff;
cid = sec? (sc->cd2id << 8) : 0;
if (sec && cid == 0)
return ENXIO;
cmd = YDSXG_AC97WRITECMD | cid | regno;
cmd <<= 16;
cmd |= data;
ds_wr(sc, YDSXGR_AC97CMDDATA, cmd, 4);
return ds_cdbusy(sc, sec);
}
static kobj_method_t ds_ac97_methods[] = {
KOBJMETHOD(ac97_init, ds_initcd),
KOBJMETHOD(ac97_read, ds_rdcd),
KOBJMETHOD(ac97_write, ds_wrcd),
KOBJMETHOD_END
};
AC97_DECLARE(ds_ac97);
/* -------------------------------------------------------------------- */
static void
ds_enadsp(struct sc_info *sc, int on)
{
u_int32_t v, i;
v = on? 1 : 0;
if (on) {
示例15: while
j *= align;
dst += j;
count -= j;
} while (count != 0);
return (dst - b);
}
static struct pcm_feederdesc feeder_volume_desc[] = {
{ FEEDER_VOLUME, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 }
};
static kobj_method_t feeder_volume_methods[] = {
KOBJMETHOD(feeder_init, feed_volume_init),
KOBJMETHOD(feeder_free, feed_volume_free),
KOBJMETHOD(feeder_set, feed_volume_set),
KOBJMETHOD(feeder_feed, feed_volume_feed),
KOBJMETHOD_END
};
FEEDER_DECLARE(feeder_volume, NULL);
/* Extern */
/*
* feeder_volume_apply_matrix(): For given matrix map, apply its configuration
* to feeder_volume matrix structure. There are
* possibilites that feeder_volume be inserted
* before or after feeder_matrix, which in this