From owner-freebsd-current Sun Feb 28 16:25:31 1999 Delivered-To: freebsd-current@freebsd.org Received: from bubba.whistle.com (s205m7.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 0A7F715018; Sun, 28 Feb 1999 16:25:24 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id QAA17791; Sun, 28 Feb 1999 16:24:33 -0800 (PST) From: Archie Cobbs Message-Id: <199903010024.QAA17791@bubba.whistle.com> Subject: Re: panic: zone: entry not free In-Reply-To: <5lemnaxj6c.fsf@mg.trafford.dementia.org> from Assar Westerlund at "Feb 28, 99 11:22:35 pm" To: assar@sics.se (Assar Westerlund) Date: Sun, 28 Feb 1999 16:24:33 -0800 (PST) Cc: eivind@FreeBSD.ORG, freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Assar Westerlund writes: > I think that the goal should be to make KLDs work with all kinds of > kernels. I've been thinking about this too... Certainly, for each kernel config option FOO we could have a symbol in the kernel that a KLD could examine: static const u_char kernlel_option_FOO = 1; But what to do about KLD's that want to link against kernel symbols that may or may not exist? For example, some KLD's that present interfaces would like to know if BPF is in the kernel, and if so to support it .. but this means linking with bpfattach(), etc.. Would it be possible to permit 'partial' linking of a KLD, so that the following code would work no matter what kernel was used? int xyz_attach() { ... if (kernlel_option_BPF > 0) bpf_attach(..); /* "bpf_attach" only gets resolved if it exists * in the kernel; otherwise, it remains NULL but * that's OK because in that case we don't call it */ ... } Maybe this would require something like this in the KLD.. MODULE_BREAKABLE_LINKS(xyz) { "bpfattach", "bpf_mtap" }; A fair bit of hackery, but probably worth it... -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message