Date: Tue, 03 Jul 2001 13:51:18 -0700 From: Mike Smith <msmith@freebsd.org> To: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys bio.h Message-ID: <200107032051.f63KpIm01502@mass.dis.org> In-Reply-To: Your message of "Tue, 03 Jul 2001 19:32:14 %2B0200." <20010703193214.A3398@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
> As Mike Smith wrote:
>
> > > sys/sys bio.h
> > > Log:
> > > Define BIO_CMD{1,2}, available for local hacks, similar to the already
> > > existing BIO_FLAG{1,2}. To be used in the fdc(4) driver soon.
> >
> > Any reason you're not using the driver-private field instead?
>
> Because i need to fill in a cmd value anyway, and neither of the
> existing didn't fit well. Maybe a single CMD_PRIVATE value would have
> sufficed, but i rather followed the other examples (CMD_FLAG{1,2}
> etc).
Neither of these was at all necesssary.
> Also, using a void * would have complicated matters pretty much. It's
> invalid to abuse a void * as an int
Er, no it's not.
void *foo;
int bar;
bar = (int)(uintptr_t)foo;
foo = (void *)(uintptr_t)bar;
> , so i would have had to malloc a
> single 32-bit value somewhere since i can't use a variable located on
> the stack, and pass its address down in one of the void * field.
No. Instead you've added more magic to the bio struct, heading straight
back towards turning it into the bloated monstrosity that the old buf
struct was.
If you need a private 'command' structure to pass stuff around inside
your driver, perhaps you should just create one?
--
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also. But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view. [Dr. Fritz Todt]
V I C T O R Y N O T V E N G E A N C E
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107032051.f63KpIm01502>
