tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: General device properties API
> On Sep 12, 2021, at 9:14 AM, Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
>
>> Date: Sun, 12 Sep 2021 08:57:07 -0700
>> From: Jason Thorpe <thorpej%me.com@localhost>
>>
>>> On Sep 12, 2021, at 8:17 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
>>>
>>> Doing this with symbols is a mess.
>>
>> Here's a way to basically get most of what you want without
>> referencing symbols:
>
> Now the linker doesn't detect namespace collisions. So if two
> different subsystems in different modules take the same name you might
> silently get runtime memory corruption.
I think we’re at a point here where we disagree on whether or not this will be an actual problem. I don’t believe it will be an actual problem and is therefore not worth the extra module management complexity (which isn’t free from a “space” perspective because each module has to have code to handle loading and unloading). We’re in engineering trade-off land here, and I think you’re making the wrong one.
In any case, here is a diff that adds the argument structure type checking. I also added an awk program to generate the argument structures and all of the call binding stuff automatically from an interface description file. So, if someone wants to deal with the additional module management complexity, they can change gendevcalls.awk, re-gen the header files, and all of the call sites will be updated automatically.
https://www.netbsd.org/~thorpej/device-call-typing-diffs.txt
-- thorpej
Home |
Main Index |
Thread Index |
Old Index