From owner-freebsd-hackers@freebsd.org Mon Dec 16 17:33:49 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FE1B1C9DDD for ; Mon, 16 Dec 2019 17:33:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47c7fh5cG1z44x6 for ; Mon, 16 Dec 2019 17:33:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 63A8E26003E; Mon, 16 Dec 2019 18:33:13 +0100 (CET) Subject: Re: How to compile 'struct module' usage? To: "Kenneth M. Glassey" , "freebsd-hackers@FreeBSD.org" References: From: Hans Petter Selasky Message-ID: <573c2041-41f6-19e1-7b39-0cf078a83659@selasky.org> Date: Mon, 16 Dec 2019 18:30:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47c7fh5cG1z44x6 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.93 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-2.63)[ip: (-9.17), ipnet: 2a01:4f8::/29(-2.41), asn: 24940(-1.54), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 17:33:49 -0000 On 2019-12-16 18:26, Kenneth M. Glassey wrote: > Hello, I am doing some fiddling on a driver port and I am encountering > a compilation error "incomplete definition of type struct module" > concerning lines in the port source that access members of struct module, > such as module->name. Looking into the issue, it seems that struct module > is not defined in the headers, at least not in sys/module.h, but I did see > some definitions in *.c files elsewhere. > > To check whether this was a problem specifically due to this driver, I > made a simple module following one of the tutorials online and it compiled > fine. I then added a line that accessed module->name and I got the > compilation error. > > So how do we build a module to allow the use of the members of struct > module? Is the struct module definition supposed to be constructed at > compile time, and if so, how? Or is it verboten to access members of that > struct? Hi, "struct module" is not public: grep -r "struct module {" /sys/ /sys/kern/kern_module.c:struct module { --HPS