From owner-freebsd-hackers@freebsd.org Mon Dec 16 18:01:21 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 6A52A1CA899 for ; Mon, 16 Dec 2019 18:01:21 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 47c8GS4rLrz4705 for ; Mon, 16 Dec 2019 18:01:20 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1576519278; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=arfpR1vIf6tNq9V2NykB/lEo2d27MdZdCQEI6m5gCuRdZksltCg/1LmHm063CW094XAsNuwo84Ez+ oRhNTE1oRQgpjrEd+xLUNOjyDqKyuSAK7oN0jRKhEBDvDRs4Qxkmv3oH9xwqIuhEM1A6NwNHpHUFIm u4nFet9bx3M1xlvEslHZ+rAqnIc9nDAbgzzScWmy/3QhGvGyc76kNCg8knU5iEJ+FlSGdmgn2dxENh OnPuwiMfyfgn0PpkzB0wLajDKOoKU3WE1O3lE2zis8h3SG5c8jKMdZ7P1ajhr0f2HDgAHtw8XonujA aOnM2auk9tgloZjQr/fh0ex5/0KpPJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=D45dUn05ybc370FKAb2YEHwlrFiLdBAi+yft2vQpNZg=; b=KDeqyK0ZWHwPMj5fSMVM+4w52Vr2X1bCE/H04LX8vKK2LiMPlwHmaaDtvrwXsAC9uiylOj40Uspi5 MfHreTsgOVCyVVKJoJFyrVY7ewonKOgpQhYC8Jw748esecvp5ugB0Rn6ARK6I6WCkvmSj/ectt2Mg1 Mly/r2qPygFBPBfoHykKxYYY6Dw2y4z4rblnk/+Cs81QWmA31XlCu1+yvbb5L7Gg6yKSerPvcQHQkF CPhyBl+k4OzmB48i2dlhu/k0I2heu3WbEOCJG2YFFY1xkrQnycIU1O2dQomjZW+KHh9jCYiKh3rLrS mryKk11GAzSvOljd3Nxdf2PWjkyDO7Q== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=D45dUn05ybc370FKAb2YEHwlrFiLdBAi+yft2vQpNZg=; b=dNWJoeq+QfDJYKXC0ARzT3gBVrAKiEo7H/0CAFlSLdfbZKkj/jE3/gSU535z+DCZkKlkM//tsqfhP HPNhFPWVPcMFw1uwA3fPeq1TpcHqi+YvckGORJzDKlw7XEc+S3/mG+0SKO3ctfwwwJ3aT0v4TGtnmw CMWeja759BmeLjsyPye9RRMNXuxxEvXs6piCm7LAL350baidMUvgWloSXxOH+sJ2lMtlG2vALNH/J5 1zpDdqXvWKWRt5cIv6KiH4a8kuOFiD/PpyshwB7KTipohRBv5xtNEYD/zZ6eFOm6C2QTzwKOHIW3PI 4UEx886fhcMQHCXdJ6ksvGroE+jfRIw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 0e06419f-202e-11ea-829e-79a40d15cccd X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 0e06419f-202e-11ea-829e-79a40d15cccd; Mon, 16 Dec 2019 18:01:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xBGI1GWJ050179; Mon, 16 Dec 2019 11:01:16 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <4073d95a738cb52eba5c3426e767b7ac701e42cd.camel@freebsd.org> Subject: Re: How to compile 'struct module' usage? From: Ian Lepore To: "Kenneth M. Glassey" , "freebsd-hackers@FreeBSD.org" Date: Mon, 16 Dec 2019 11:01:16 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47c8GS4rLrz4705 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_LONG(-0.96)[-0.961,0] 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 18:01:21 -0000 On Mon, 2019-12-16 at 17:26 +0000, 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? > > Thanks! > > Kenneth > The definition of struct module is private by design. You need to use the existing accessor functions such as module_getname(), module_file(), etc (which are likely not well-documented anywhere, but can be found in kern_module.c). -- Ian